ShapeShiftCosmos Validator Delegation Charts
    Updated 2024-10-09
    WITH redelegateTb AS (
    SELECT
    tx_id,
    SPLIT(ATTRIBUTE_VALUE, 'uatom')[0]::numeric/1e6 AS amount_redelegated
    FROM cosmos.core.fact_msg_attributes
    WHERE msg_type = 'redelegate'
    AND attribute_key = 'amount'
    AND ATTRIBUTE_VALUE ILIKE '%uatom%'
    AND tx_succeeded = 'TRUE'
    ),
    spenderTb AS (
    SELECT
    block_timestamp,
    tx_id,
    attribute_value AS redelegater_wallet
    FROM cosmos.core.fact_msg_attributes
    WHERE msg_type = 'coin_spent'
    AND attribute_index = '0'
    AND attribute_key = 'spender'
    AND msg_index = '0'
    AND tx_id IN (SELECT tx_id FROM redelegateTb)
    AND tx_succeeded = 'TRUE'
    ),
    receiverTb AS (
    SELECT
    block_timestamp,
    tx_id,
    attribute_value AS receiver
    FROM cosmos.core.fact_msg_attributes
    WHERE msg_type = 'coin_received'
    AND attribute_key = 'receiver'
    AND tx_id IN (SELECT tx_id FROM redelegateTb)
    AND tx_succeeded = 'TRUE'
    ),
    sourceTB AS (
    SELECT
    QueryRunArchived: QueryRun has been archived