fix(oc): match the Coinbase stable swapper upgrade - #1439
Merged
Merged
Conversation
The stable swapper program dropped its address whitelist and moved to role-based authorities (coinbase/stable-swapper#20). The server side landed in code-payments/ocp-server#257; this brings the client's instruction and account parsing in line. Swap instruction: the `whitelist` account after `user` is gone, so the instruction now carries 15 accounts. The `address_whitelist` PDA derivation and its tests go with it. Every client-built swap (stateful, stateless sweep, USDC->USDF onramp, USDF deposit) used the same `CoinbaseStableSwapperProgram_Swap`, so all four pick this up. Pool account: `operations_authority` was replaced by `pause`, `unpause`, `treasury` and `configure` authorities, which pushes `fee_recipient` from byte 72 to byte 136. The onramp reads this field from chain to pick the fee recipient for USDC->USDF and USDF deposit transactions; at the old offset it would read `treasury_authority` instead. The parser now checks the account discriminator and is covered by the same mainnet fixture ocp-server uses (pool CrDL9SoCyW1tBgn8k7rgGSpWhnszneWDbvKvqPAU4PL9 after the 2026-09-08 MigrateAuthorities instruction). Compute unit limits are unchanged here: the server-driven swaps take the limit from server parameters, and the client-built transactions already set 200_000.
bmc08gt
added a commit
that referenced
this pull request
Sep 10, 2026
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.
Client side of code-payments/ocp-server#257. The stable swapper program dropped its address whitelist and moved to role-based authorities (coinbase/stable-swapper#20), which changes both the swap instruction and the pool account layout the app reads.
Swap instruction
The
whitelistaccount afteruseris gone, so the instruction now carries 15 accounts. Theaddress_whitelistPDA derivation and its tests go with it. All four client-built swaps shareCoinbaseStableSwapperProgram_Swap, so the stateful swap, stateless sweep, USDC to USDF onramp, and USDF deposit all pick this up.Pool account
operations_authoritywas replaced bypause,unpause,treasuryandconfigureauthorities. That pushesfee_recipientfrom byte 72 to byte 136. The onramp reads this field from chain to pick the fee recipient for USDC to USDF and USDF deposit transactions, and at the old offset it now readstreasury_authority. The parser reads the new layout, checks the account discriminator, and is covered by the same mainnet fixture ocp-server uses: poolCrDL9SoCyW1tBgn8k7rgGSpWhnszneWDbvKvqPAU4PL9after the 2026-09-08MigrateAuthoritiesinstruction.Compute unit limits
Unchanged here. The server-driven swaps take the limit from server parameters, and the client-built transactions already set
200_000.