Repository navigation
fix(scenarios): follow Phoenix's deployed program - funding fields, error code and published IDL - #59
Open
92Infinitus92 wants to merge 2 commits 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.
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.
UpdateFundingParametersalso reads an optional clamp center, clamp band radius and divisor. Phoenix's IDL lists them since 2026-11-10, sophoenix-market-fundinghas three new fields:fundingClampCenter,fundingClampBandRadiusandfundingDivisor. A field left out is sent asNone, which keeps the current value. This fixesmarket_and_exchange_configuration_reaches_the_accounts_phoenix_reads.scenario_keeps_the_trader_usable_as_the_clock_moves_onchecks the error code 12289 instead of the text.a_move_past_more_resting_bids_than_one_crank_matches_uncrosses_the_bookrests 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.v1/idl.jsonis the Program Metadata IDL (H6r3zQwpMdsuSgoCFm39WjP6F9sMNyxwe3F3F9PhbqkQ) as written on 2026-11-10, sha256af1bac114fd2d9926a3e2253192941a3d28466f50b2521b3ff7d5e820b6055b0, with one change. The publishedTraderhasmaxPositions: u64, while the program keeps twou32values in those 8 bytes: the position limit, then the trader's preference bits. The bundledTraderhasmaxPositions: u32andtraderPreferenceBits: 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 -- --checkandcargo clippy -p surfpool-core --all-targetspass.cargo test -p surfpool-core --features ignore_tests_cigives 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 ofmaxPositionsleaves the preference bits, and a test against mainnet reads both values on a live trader.