0xHaM-dEris Protocol Staking Hub
    Updated 2023-10-11
    -- /*
    SELECT
    BLOCK_TIMESTAMP::date as date,
    TX_SENDER,
    split(a_fee.ATTRIBUTE_VALUE, 'uluna')[0]::float/1e6 fee,
    split(a_delegate.ATTRIBUTE_VALUE, 'uluna')[0]::float/1e6 as amount
    FROM terra.core.fact_msg_attributes_standard as a__contract_address
    JOIN terra.core.fact_msg_attributes_standard as a_delegate using(tx_id, BLOCK_TIMESTAMP)
    JOIN terra.core.fact_msg_attributes_standard as a_mint using(tx_id, BLOCK_TIMESTAMP)
    JOIN terra.core.fact_msg_attributes_standard as a_fee using(tx_id, BLOCK_TIMESTAMP)
    JOIN terra.core.fact_transactions as a_tx using(tx_id, BLOCK_TIMESTAMP)
    WHERE a__contract_address.ATTRIBUTE_VALUE in (
    'terra10788fkzah89xrdm27zkj5yvhj9x3494lxawzm5qq3vvxcqz2yzaqyd3enk',
    'terra1ecgazyd0waaj3g7l9cmy5gulhxkps2gmxu9ghducvuypjq68mq2s5lvsct'
    )
    AND a__contract_address.ATTRIBUTE_KEY = '_contract_address'
    AND a__contract_address.MSG_TYPE = 'wasm'
    AND a_delegate.MSG_TYPE = 'delegate'
    AND a_delegate.ATTRIBUTE_KEY = 'amount'
    AND a_mint.ATTRIBUTE_VALUE = 'mint'
    AND a_mint.ATTRIBUTE_KEY = 'action'
    AND a_mint.MSG_TYPE = 'wasm'
    AND a_fee.ATTRIBUTE_KEY = 'fee'
    AND a_fee.MSG_TYPE = 'tx'

    AND tx_id ='E5BD8437E558D8621B707616CDE7E9E16951A8E6B740BCA4A7ECF9E06FA6D2A9'
    GROUP by 1,2,3,4

    --*/

    -- SELECT
    -- BLOCK_TIMESTAMP,
    -- tx_id,
    -- TX_SENDER,
    -- split(ATTRIBUTE_VALUE, 'uluna')[0]::float/1e6 fee
    -- FROM terra.core.fact_msg_attributes_standard
    Run a query to Download Data