Skip to content

Commit

Permalink
pindexer: dex_ex: correct denom conversion in aggregate summary
Browse files Browse the repository at this point in the history
  • Loading branch information
cronokirby committed Nov 27, 2024
1 parent c129373 commit 460b36f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions crates/bin/pindexer/src/dex_ex/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,14 +530,15 @@ mod summary {
SELECT
asset_start, asset_end,
(dex_ex_pairs_summary.price - greatest(price_then, 0.000001)) / greatest(price_then, 0.000001) * 100 AS price_change,
liquidity * eligible_denoms.price AS liquidity,
direct_volume_over_window * eligible_denoms.price as dv,
swap_volume_over_window * eligible_denoms.price as sv,
liquidity * ed_end.price AS liquidity,
direct_volume_over_window * ed_start.price AS dv,
swap_volume_over_window * ed_start.price AS sv,
trades_over_window as trades
FROM dex_ex_pairs_summary
JOIN eligible_denoms
ON eligible_denoms.asset = asset_end
WHERE the_window = $3
JOIN eligible_denoms AS ed_end
ON ed_end.asset = asset_end
JOIN eligible_denoms AS ed_start
ON ed_start.asset = asset_start
),
sums AS (
SELECT
Expand Down
2 changes: 1 addition & 1 deletion crates/bin/pindexer/src/indexer_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl IndexerExt for cometindex::Indexer {
"passet1w6e7fvgxsy6ccy3m8q0eqcuyw6mh3yzqu3uq9h58nu8m8mku359spvulf6",
)
.expect("should be able to parse passet"),
100.0 * 1000_0000.0,
1000.0 * 1_000_000.0,
)))
.with_index(Box::new(crate::supply::Component::new()))
.with_index(Box::new(crate::ibc::Component::new()))
Expand Down

0 comments on commit 460b36f

Please sign in to comment.