Skip to content

fix(scenarios): follow Phoenix's deployed program - funding fields, error code and published IDL - #59

Open
92Infinitus92 wants to merge 2 commits into
feat/scenarios/override/phoenix-idl-refresh-supportfrom
fix/scenarios/phoenix-idl-refresh
Open

92Infinitus92 wants to merge 2 commits into
feat/scenarios/override/phoenix-idl-refresh-supportfrom
fix/scenarios/phoenix-idl-refresh

Conversation

@92Infinitus92

Copy link
Copy Markdown
Collaborator

Phoenix changed its mainnet program and its published IDL, and three Phoenix tests against mainnet fail on main. This PR fixes them and brings the bundled IDL to the published one. It is the Phoenix half of #55, which is split in two, and it carries the Phoenix fixes from #54.

  • Funding. UpdateFundingParameters also reads an optional clamp center, clamp band radius and divisor. Phoenix's IDL lists them since 2026-11-10, so phoenix-market-funding has three new fields: fundingClampCenter, fundingClampBandRadius and fundingDivisor. A field left out is sent as None, which keeps the current value. This fixes market_and_exchange_configuration_reaches_the_accounts_phoenix_reads.
  • Stale readings. Hawkeye reworded its refusal to "OracleMarkPriceUnavailable". scenario_keeps_the_trader_usable_as_the_clock_moves_on checks the error code 12289 instead of the text.
  • Uncross. a_move_past_more_resting_bids_than_one_crank_matches_uncrosses_the_book rests its own 81 bids before the price move. It relied on the depth of the live book, which was 30 and 41 bids on 2026-11-16.
  • IDL. v1/idl.json is the Program Metadata IDL (H6r3zQwpMdsuSgoCFm39WjP6F9sMNyxwe3F3F9PhbqkQ) as written on 2026-11-10, sha256 af1bac114fd2d9926a3e2253192941a3d28466f50b2521b3ff7d5e820b6055b0, with one change. The published Trader has maxPositions: u64, while the program keeps two u32 values in those 8 bytes: the position limit, then the trader's preference bits. The bundled Trader has maxPositions: u32 and traderPreferenceBits: u32, so a write of one leaves the other. The monitoring run reports this one entry, types/Trader, until Phoenix publishes the split. The README records both hashes and says to redo the split after each refresh.

Tests: cargo +nightly fmt --all -- --check and cargo clippy -p surfpool-core --all-targets pass. cargo test -p surfpool-core --features ignore_tests_ci gives 898 passed, 0 failed. The Phoenix tests against mainnet (--features integration-tests phoenix) give 47 passed, 0 failed, the three above among them. A unit test checks that a write of maxPositions leaves the preference bits, and a test against mainnet reads both values on a live trader.

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