Skip to content

Commit

Permalink
Merge pull request #180 from Synthetixio/fix-notional-volume
Browse files Browse the repository at this point in the history
Bug: Update leaderboard to notional volume
  • Loading branch information
Tburm authored Jan 30, 2025
2 parents 2a1cdfb + a3e894a commit 651fe03
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ with actions as (
block_timestamp + INTERVAL '6 day'
) - INTERVAL '6 day' as epoch_start,
"caller" as account, -- noqa
{{ convert_wei('base_asset_amount') }} as volume,
{{ convert_wei('base_asset_amount') }} * CAST(
REGEXP_REPLACE(
token,
'.*_(long|short)',
''
) as INT
) as volume,
{{ convert_wei('leveraged_token_amount') }} * CAST(
REGEXP_REPLACE(
token,
Expand All @@ -30,7 +36,13 @@ with actions as (
block_timestamp + INTERVAL '6 day'
) - INTERVAL '6 day' as epoch_start,
recipient as account,
{{ convert_wei('base_asset_amount') }} as volume,
{{ convert_wei('base_asset_amount') }} * CAST(
REGEXP_REPLACE(
token,
'.*_(long|short)',
''
) as INT
) as volume,
0 as fees_paid
from
{{ ref('lt_minted_base_mainnet') }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ actions as (
block_timestamp + INTERVAL '6 day'
) - INTERVAL '6 day' as epoch_start,
COALESCE (z.account, r.account) as account,
{{ convert_wei('leveraged_token_amount') }} as volume,
{{ convert_wei('leveraged_token_amount') }} * CAST(
REGEXP_REPLACE(
token,
'.*_(long|short)',
''
) as INT
) as volume,
{{ convert_wei('leveraged_token_amount') }} * CAST(
REGEXP_REPLACE(
token,
Expand All @@ -36,7 +42,13 @@ actions as (
block_timestamp + INTERVAL '6 day'
) - INTERVAL '6 day' as epoch_start,
COALESCE (z.account, m.account) as account,
{{ convert_wei('leveraged_token_amount') }} as volume,
{{ convert_wei('leveraged_token_amount') }} * CAST(
REGEXP_REPLACE(
token,
'.*_(long|short)',
''
) as INT
) as volume,
0 as fees_paid
from
{{ ref('tlx_lt_minted_optimism_mainnet') }} as m
Expand Down

0 comments on commit 651fe03

Please sign in to comment.