Skip to content

Commit

Permalink
Merge pull request #4 from galacticcouncil/fix-tvl
Browse files Browse the repository at this point in the history
fix tvl
  • Loading branch information
green-jay authored Aug 14, 2023
2 parents a8f9879 + 7de0826 commit 1986929
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions queries/defillama/v1/tvl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ SELECT
FROM
lrna_every_block leb
JOIN (
SELECT MAX(height) as max_height
FROM lrna_every_block
) max_leb ON leb.height = max_leb.max_height
SELECT
LEAST(max_leb.max_height, max_oa.max_block) AS joined_height
FROM
(SELECT MAX(height) as max_height FROM lrna_every_block) max_leb,
(SELECT MAX(block) as max_block FROM omnipool_asset) max_oa
) subq ON leb.height = subq.joined_height
JOIN omnipool_asset oa ON leb.height = oa.block
JOIN token_metadata tm ON oa.asset_id = tm.id
WHERE CASE
Expand Down

0 comments on commit 1986929

Please sign in to comment.