Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,8 @@ let routed_ixs = builder
)
.await?
.into_iter()
.map(|ix| flight.try_wrap_order_instruction(ix, trader_authority))
// false = owner-signed (no position authority)
.map(|ix| flight.try_wrap_order_instruction(ix, trader_authority, false))
.collect::<Result<Vec<_>, _>>()?;
```

Expand Down
2 changes: 2 additions & 0 deletions instructions.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"FlightPlaceLimitOrderWithConditionals": "189a38686a0823075f2d44a8e8dad25c0100e80300000000000064000000000000000000000000000000000000000000000000000000000000000000000000010001004c040000000000004b040000000000000101010084030000000000008303000000000000",
"FlightPlacePositionConditionalOrder": "189a38686a082307416c53814cc15c8f0000000001000100e803000000000000e7030000000000000001640000000000000000",
"FlightPlaceStopLoss": "189a38686a082307ec2ea442eb5ca289e803000000000000e7030000000000000000000000000000010100",
"FlightProxyPlaceMarketOrderDelegated": "189a38686a082307a02315eb6eb6f54102010064000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"FlightProxyPlaceMarketOrderPositionAuthority": "189a38686a0823075a76c0fcc063279102010064000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"OnboardTraderDelegated": "cfaa11153523589706000000000101010301020104010501",
"PlaceAttachedConditionalOrder": "2b7588804896657ae803000000000000000000000000000000000000000101010084030000000000008303000000000000",
"PlaceLimitOrder": "6cb021ba92e501c50100e8030000000000006400000000000000000000000000000000000000000000000000000000",
Expand Down
16 changes: 8 additions & 8 deletions programs/close-position-and-withdraw/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions programs/close-position-and-withdraw/cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions programs/example-program/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions programs/trader-onboarder/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions test-fixtures/sdk-instruction-fixtures.json
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,16 @@
"discriminatorHex": "9da33f1bf248fb61",
"discriminatorBase64": "naM/G/JI+2E="
},
{
"program": "phoenix-eternal",
"enumName": "PhoenixInstruction",
"instructionName": "AuthorizedTransferCollateral",
"snakeCaseName": "authorized_transfer_collateral",
"preimage": "global:authorized_transfer_collateral",
"tag": "2700316393894958814",
"discriminatorHex": "ded6450f74737925",
"discriminatorBase64": "3tZFD3RzeSU="
},
{
"program": "phoenix-eternal",
"enumName": "PhoenixInstruction",
Expand Down
25 changes: 25 additions & 0 deletions ts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,31 @@
Entries are drafted by Phoenix Rise sync PRs. Review and edit each
entry in this repo before merging.

## v0.4.76 - 2026-07-31

Source Phoenix commit: `116538d2560135ebd0d7d11fbb8804d32db043d8`

### Summary

- Flight order wrapping gains position-authority (delegate-signed) support: `tryWrapFlightInstruction` is renamed to `tryWrapOrderInstruction` and now takes a `usePositionAuthority` flag so Flight can append the collateral-transfer tail and collect its builder fee when a delegate, not the trader owner, signs — including for `PlaceMarketOrderDelegated`.
- Added `buildFlameAtomicDepositFlow` (plus `buildFlameDepositToPhoenixIx`, `deriveFlameDepositToPhoenixAddresses`, `deriveFlameGlobalStateAddress`) for atomic, sponsor-cranked Flame deposits so wallets holding no SOL can deposit in one bundled transaction.
- Added spot collateral support: new `spotCollaterals` fields on `SubaccountMarginInputs`, `TraderView`, and trader-state snapshot/delta types, plus new margin totals (`spotCollateralNotionalQuoteLots`, `spotCollateralDiscountedQuoteLots`).
- Added draft-order margin helpers (`computeDraftOrderMarginRequirementFromInputs`/`FromSnapshot`, `computeMaxDraftOrderSizeForAvailableMarginFromInputs`/`FromSnapshot`) for pre-trade margin estimation.
- Added `resolvePhoenixBuilderAddresses`, `BETA_USDC_MINT_ADDRESS`, `EMBER_STATE_ADDRESS`, and `DEPOSIT_PERMISSION` exports, and a `minBaseLotsToFill` field on isolated market order requests.

### Breaking Changes

- `tryWrapFlightInstruction(instruction, authority)` is renamed to `tryWrapOrderInstruction(instruction, signer, usePositionAuthority?)` on the Flight client; update call sites, and pass `usePositionAuthority: true` when the signer is a delegate rather than the trader owner.
- `wrapInstructionWithFlight`'s `authority` param is renamed to `signer`; it now also accepts `usePositionAuthority`/`resolveRootAuthority`, and calling it with `usePositionAuthority: true` but no `resolveRootAuthority` now throws.
- `PhoenixIxOperationContext.maybeWrapOrderIx` gained an optional third `usePositionAuthority` parameter, and the interface now requires a new `maybeWrapConditionalOrderIx` method — custom implementations of this interface need updating.
- Position-authority Flight proxy instructions (`ProxyInstructionParams`/`buildProxyInstructionIx`) now append two extra trailing accounts (collateral-transfer authority + permission account) when `rootAuthority` is set; code that indexes into the proxy instruction's account list positionally must account for this.

### Consumer Notes

- `ClientPlaceMarketOrderDelegatedInput.traderWallet` is deprecated in favor of `positionAuthority`, now the shared way to declare a delegate signer across all order builders — the effective signer is `positionAuthority ?? authority`, and high-level `client.ixs` methods pick the position-authority Flight path automatically when they differ.
- `buildFlameAtomicDepositFlow` currently only supports `traderSubaccountIndex` 0 and throws for any other value.
- The new `spotCollaterals` fields on `SubaccountMarginInputs`, `TraderView`, and trader-state types are optional and default to empty, so existing integrations keep compiling without changes.

## v0.4.67 - 2026-07-09

Source Phoenix commit: `39520ccb1d19d0f7610909dd2718dc7918d0ec22`
Expand Down
6 changes: 6 additions & 0 deletions ts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,12 @@ USDC from the user's wallet ATA into that proxy ATA. They do not perform the
Phoenix collateral deposit directly; the Flame crank/indexer completes that
asynchronously after the proxy account is funded.

For an atomic sponsored deposit, use `buildFlameAtomicDepositFlow`. It adds
permission setup plus the Flame `DepositToPhoenix` instruction. The user signs
the deposit permission; the sponsor fee payer cranks the deposit so wallets
holding no SOL can deposit (the crank fronts rent for the transient proxy
Phoenix ATA and the same instruction refunds it on close).

`buildDepositFlow` remains the direct Ember + Phoenix deposit path.

## Sync Order Packet Builders
Expand Down
10 changes: 5 additions & 5 deletions ts/bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading