Restore liquidity-aware weighting for centralized exchange prices - #73
Closed
micahkendall wants to merge 1 commit into
Closed
Restore liquidity-aware weighting for centralized exchange prices#73micahkendall wants to merge 1 commit into
micahkendall wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
reliability: Decimal::ONEfor multiple CEX feeds, which removed liquidity/volume weighting used by the aggregator and allowed thin or compromised exchanges to skew the aggregated price.reliability, so feeds must report a liquidity-derived weight rather than a constant to preserve robustness.Description
v(volume_base) and settingPriceInfo.reliabilityto that value insrc/sources/binance.rs.volume_24h(with a cached last-volume fallback) asreliabilityinsrc/sources/bybit.rs.reliabilityinsrc/sources/coinbase.rs,src/sources/crypto_com.rs,src/sources/kucoin.rs, andsrc/sources/maestro.rsrespectively.cargo fmt.Testing
cargo fmt --allwhich completed successfully.cargo test --all --quietand all automated tests passed (94tests passed,0failed).Codex Task