Skip to content

lukas/rm pyth pull push completely#2165

Closed
LukasDeco wants to merge 14 commits intomasterfrom
lukas/rm-pyth-pull-push-completely
Closed

lukas/rm pyth pull push completely#2165
LukasDeco wants to merge 14 commits intomasterfrom
lukas/rm-pyth-pull-push-completely

Conversation

@LukasDeco
Copy link
Copy Markdown
Collaborator

  • rm: pyth pull and other pyth stuff
  • refactor: pyth lazer defaults for tests
  • temp: working on cargo tests

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 25, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a9fabee9-0be6-46e6-a699-46964cc48d7e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands and usage tips.

…rp default)

When slots_before_stale_for_amm_immdiate_override is 0, oracle_validity()
unconditionally returns is_stale_for_amm_immediate=true (math/oracle.rs:344-348).
This was never a problem when spot markets used OracleSource::Pyth (push oracle
path), but with PythLazer the oracle delay computation (clock_slot - posted_slot)
can produce non-positive values that still get flagged as stale, causing
InvalidOracle failures during liquidation and margin calculations.

Perp markets already default to oracle_slot_delay_override=-1 (perp_market.rs:1407),
which makes the check evaluate oracle_delay > 0 instead of unconditionally true.
This commit applies the same -1 override to all spot oracle validity calls in
spot_balance.rs (exchange oracle) and margin.rs (margin calc) so that PythLazer
spot oracles are not incorrectly classified as stale.

Made-with: Cursor
@LukasDeco
Copy link
Copy Markdown
Collaborator Author

Closing to reopen from protocol-v2-shadow.

@LukasDeco
Copy link
Copy Markdown
Collaborator Author

Closing to reopen from protocol-v2-shadow (same commits; head repo moved per team workflow).

@LukasDeco
Copy link
Copy Markdown
Collaborator Author

move to shadow

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.

1 participant