Skip to content

Add pyth price overrides to margin check#19

Merged
0xahzam merged 5 commits intomasterfrom
ahzam/add-oracle-override
Dec 2, 2025
Merged

Add pyth price overrides to margin check#19
0xahzam merged 5 commits intomasterfrom
ahzam/add-oracle-override

Conversation

@0xahzam
Copy link
Contributor

@0xahzam 0xahzam commented Nov 29, 2025

No description provided.

src/margin.rs Outdated
let oracle = market_state.get_spot_oracle_price(spot_position.market_index);
let diff_bps = (pyth_price.price.abs_diff(oracle.price) * 10_000)
/ oracle.price.unsigned_abs();
if diff_bps > 5 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can set this param on MarketState so it's easily configurable

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

@0xahzam 0xahzam merged commit 6b6ac04 into master Dec 2, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants