Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pindexer: dex_ex: correct denom conversion in aggregate summary #4945

Merged
merged 1 commit into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading