hess2. Monthly Stake
    Updated 2025-04-09
    with base as ( select * from (
    SELECT
    livequery.live.udf_api (
    'https://api.dune.com/api/v1/query/4949984/results?api_key={dune_key}',
    'DuneAPI') as resp)
    ,
    table(FLATTEN(parse_json(resp:data:"result":"rows"))))
    , -- FOR THE REMAINING PERIOD UNTIL 2024-10-01
    staking_dune as (select TO_TIMESTAMP(REPLACE(value:"month", ' UTC', '')) AS date,
    value:"monthly_staked" as "Stake (AXS)",
    value:"monthly_unstaked" as "Unstake (AXS)",
    value:"cumulative_net_staked" as "Total Staked (AXS)",
    value:"stakers_count" as staker,
    value:"unstakers_count" as unstaker,
    value:"stake_txns" as stake_txns,
    value:"unstake_txns" as unstake_txns
    from base
    having date < '2024-10-01'
    )
    ,
    staking as ( select block_timestamp::Date as date,
    tx_hash,
    DECODED_LOG:_user::string as staker,
    DECODED_LOG:_amount/pow(10,18) as stake_amount
    from ronin.core.ez_decoded_event_logs
    where contract_address = lower('0x05b0bb3c1c320b280501b86706c3551995bc8571')
    and event_name = 'Staked')
    ,
    unstaking as ( select block_timestamp::Date as date,
    tx_hash,
    DECODED_LOG:_user::string as unstaker,
    DECODED_LOG:_amount/pow(10,18) as unstake_amount
    from ronin.core.ez_decoded_event_logs
    where contract_address = lower('0x05b0bb3c1c320b280501b86706c3551995bc8571')
    and event_name = 'Unstaked')
    ,
    Last run: 16 days ago
    MONTH
    Stake (AXS)
    Unstake (AXS)
    Total Staked (AXS)
    STAKER
    UNSTAKER
    STAKE_TXNS
    UNSTAKE_TXNS
    1
    2021-09-01 00:00:00.000
    4329127.342051819
    -39236.046605794
    4289891.295446025
    16675
    1103
    19602
    1256
    2
    2021-10-01 00:00:00.000
    26578072.29106821
    -12223716.8247033
    18644246.761810932
    60193
    28462
    645536
    80562
    3
    2021-11-01 00:00:00.000
    12192049.75963496
    -10239894.3725092
    20596402.14893672
    84704
    43055
    882217
    121852
    4
    2021-12-01 00:00:00.000
    8111321.732665519
    -7258911.45330802
    21448812.42829422
    126359
    48128
    1239289
    112831
    5
    2022-01-01 00:00:00.000
    7737448.127238865
    -8663334.62921191
    20522925.92632117
    177657
    83992
    1777284
    187049
    6
    2022-02-01 00:00:00.000
    11483028.031340776
    -7736338.98076818
    24269614.976893764
    149586
    78647
    982221
    134956
    7
    2022-03-01 00:00:00.000
    8900158.419820895
    -8505641.72389805
    24664131.672816604
    98006
    37849
    654219
    61463
    8
    2022-04-01 00:00:00.000
    15100357.107036708
    -14722621.6019294
    25041867.177923866
    86918
    25552
    553045
    41958
    9
    2022-05-01 00:00:00.000
    9105745.486970166
    -11676761.0402888
    22470851.624605224
    60202
    18248
    342929
    32769
    10
    2022-06-01 00:00:00.000
    5706160.163518483
    -4929716.88015937
    23247294.90796434
    48660
    9544
    268159
    18769
    11
    2022-07-01 00:00:00.000
    8610472.362162586
    -5064323.33566445
    26793443.934462473
    52460
    12601
    299117
    27758
    12
    2022-08-01 00:00:00.000
    7672851.248993438
    -4842480.42628337
    29623814.75717254
    48913
    10837
    280116
    26965
    13
    2022-09-01 00:00:00.000
    4226525.385321279
    -3369085.40774595
    30481254.734747868
    42873
    9336
    232332
    24278
    14
    2022-10-01 00:00:00.000
    15949839.170197107
    -6279519.64792782
    40151574.25701716
    38955
    9707
    199292
    23502
    15
    2022-11-01 00:00:00.000
    5970278.64674226
    -5778098.28583235
    40343754.61792707
    33465
    6447
    152133
    12035
    16
    2022-12-01 00:00:00.000
    4783135.351617293
    -3144013.32548401
    41982876.64406034
    30845
    5635
    141737
    10515
    17
    2023-01-01 00:00:00.000
    9291492.72329932
    -8773734.70240938
    42500634.66495028
    35764
    9416
    159529
    19344
    18
    2023-02-01 00:00:00.000
    5913463.54148662
    -5596958.45679374
    42817139.74964316
    31194
    7070
    137688
    15233
    19
    2023-03-01 00:00:00.000
    10331333.435558805
    -5943754.8349906
    47204718.35021137
    32088
    7611
    147322
    17495
    20
    2023-04-01 00:00:00.000
    10065823.046688166
    -7636227.11520266
    49634314.28169687
    29586
    6385
    124927
    12350
    44
    5KB
    14s