ArioNet staking by wallets
    Updated 2025-02-17
    WITH staking AS (
    SELECT
    tx_id,
    signers[0] AS owner,
    utils.udf_hex_to_int(
    TO_CHAR(REVERSE(TO_BINARY(SUBSTR(utils.udf_base58_to_hex(instruction:data), 19, 16))))
    ) / POW(10, 6) AS amount,
    'stake' AS claim_program
    FROM
    solana.core.fact_events
    WHERE
    succeeded
    AND fact_events.program_id = 'veTbq5fF2HWYpgmkwjGKTYLVpY6miWYYmakML7R7LRf'
    AND SUBSTR(utils.udf_base58_to_hex(fact_events.instruction:data), 3, 16) = 'ceb0ca12c8d1b36c' -- staking
    AND block_timestamp >= '2024-12-10 14:05:13.000'
    and CONVERT_TIMEZONE('GMT', block_timestamp) <= '2025-02-01 23:00:00.000'
    UNION ALL

    SELECT
    tx_id,
    signers[0] AS owner,
    VALUE:parsed:info:tokenAmount:amount / POW(10, 6) AS amount,
    'unstake' AS claim_program
    FROM
    solana.core.fact_events,
    LATERAL FLATTEN(input => inner_instruction:instructions) t
    WHERE
    succeeded
    AND fact_events.program_id = 'veTbq5fF2HWYpgmkwjGKTYLVpY6miWYYmakML7R7LRf'
    AND SUBSTR(utils.udf_base58_to_hex(fact_events.instruction:data), 3, 16) = '5a5f6b2acd7c32e1' -- unstaking
    AND VALUE:parsed:info:tokenAmount:amount IS NOT NULL
    AND block_timestamp >= '2024-12-10 14:05:13.000'
    and CONVERT_TIMEZONE('GMT', block_timestamp) <= '2025-02-01 23:00:00.000'
    )

    -- Aggregate results
    Last run: about 2 months ago
    OWNER
    NET_LOCKED_TOKENS
    1
    2S5JDnseFzM3r5ZQ9LyGYZGuduQXQ4SkXXtvRbuD9qyC
    105320
    2
    EMuvhZGRW8L36wUkyoB36ymxqfUnQf6fMJiXmvamdPu2
    102695.068846
    3
    8CEPQh4wtKRBFgTiPjUpyWiTuCfUwXcNavRoJ5qLJrm
    100483.882644
    4
    GcXFgTPypQPqTBGTgZdZHHweZAaDJ3Suwugj52kyAcov
    93771.496951
    5
    4q4JP7HiBAboeCsaWiYpJACEU9Wznrroec2xANPg27GD
    89130.969616
    6
    C8aGVnj5aLBK9LDngUopLnLnxxPuJgHAheU2VhdkX4Ci
    64998.58
    7
    sage2WS4AdMTJRMuXAqW7jVCAovMqqiNRUZMWkMXsSr
    62000
    8
    HnjC5zVGyrBmP7bWoHWqgZQ5zngzokiEpzR6GtHFWcsa
    61511.828671
    9
    14RqBfPKo3EYqErssihKHk6boybE29BG7Pgwb9ScrguK
    61384.89
    10
    HVu66XJ7ienw7AiG7nVoo9HDEUsdj8YehyZYV52tt1bb
    60809.201993
    11
    CTaAwbT943ss4W2UmdUtozvZhvrRoBFt9DAFW8PuhRqt
    60101.78573
    12
    61h1PkewEknHc1VSFJMMiKcCERVRvQJUiuG6ZvY5uam3
    60009.192236
    13
    B1jdEJ7H8hoUbXa5wW3FJvCuoZeXDgkUGmyxZVWswDQL
    58581.128456
    14
    Azp2DN2ZLY9N6ZN8z3ncD2zQqsMFokCJiNvwMSxvYPWb
    53425.3586
    15
    HJ1xEKrDD89ekDMuAeoez9bDJMkQEUf4s7cynw3QyEmX
    52105
    16
    HMrrXZKVHXXPinZMLvYtginzsRCS1cDKjrt6o1jodXM5
    50003.13
    17
    9Aq3KWqyTnYDtUHj18ydsMbS4hvqwrLrTr8B7QLqdxm3
    49998.58
    18
    8dEnDThjLmVArAeJABdXK1gX5i6xEyBM6YRqcPVzSv72
    43716.617268
    19
    DCZPFdbaumPesuEbFJVp2wQzevoGNyqyiTQ4BnimQVte
    42000.524591
    20
    3j8hEZpGAgBfrsj3TiLWeNTfy7ELQyRrL6C6MpTTnNam
    40882.46
    ...
    51624
    3MB
    62s