All programsStaging
Phoenix Integration Staging
Integration adapter for Phoenix. Lets a GLAM vault register trader accounts under GLAM authorization and, after separate delegated activation, deposit or withdraw funds, place or cancel Phoenix orders, move collateral between trader accounts, and sync trader state. This staging deployment exposes additional or pre-release functionality for review.
Accounts owned or controlled
| Account | Owner / authority | Purpose |
|---|---|---|
| Integration authority PDA | Phoenix Integration Staging | Program-derived authority used for integration-level signing during Phoenix CPI calls. |
| Phoenix trader accounts | Phoenix | Trader accounts registered to, refreshed for, and priced as GLAM vault-controlled positions. |
Integration notes
- For now, use
glam-cli phoenix onboardorclient.phoenix.onboardTrader(...)to idempotently run the complete two-phase delegated-onboarding flow for the active vault's default Phoenix 0/0 trader. - When the Eternal trader is missing, these helpers first execute the GLAM-wrapped
register_traderinstruction so GLAM's onchain permission check remains enforceable. register_traderis phase one only; registration does not activate the delegated capabilities required for deposit, withdraw, order, or cancel operations.- When needed, delegated activation then uses Phoenix's no-referral
build-register-ixs/send-register-ixsflow, including EternalOnboardTraderDelegated. - A fully onboarded trader is an idempotent no-op; no onboarding transaction is required.
- Deprecated sponsored invite/referral activation routes are not part of the supported flow.
Instructions
16 total
| Instruction | Description |
|---|---|
| cancel_all | Cancels all of the trader's resting orders on the market identified by the orderbook account. |
| cancel_orders_by_id | Cancels specific resting orders by their order IDs. |
| cancel_up_to | Cancels orders on one side of the book up to an optional count and/or tick limit. |
| deposit | Ember deposit: converts the vault's input mint into the Phoenix-side output mint. |
| deposit_funds | Deposits base or quote mint tokens from the vault's token account into the Phoenix trader account. |
| place_limit_order | Places a limit order; the unfilled portion rests on the orderbook. |
| place_market_order | Places an immediate-or-cancel market order; unfilled size is dropped rather than rested. |
| place_multi_limit_order | Places multiple limit orders (bids and/or asks) on a single market in one CPI. |
| register_trader | Creates an Eternal/Phoenix trader account with the GLAM vault PDA as its authority; registration alone does not activate delegated capabilities. |
| set_phoenix_policy | Sets the GLAM Phoenix policy (market allowlist, order types, and price-deviation limits) on the vault state. |
| sync_parent_to_child | Syncs collateral and state from a parent trader account down to a child subaccount. |
| transfer_collateral | Transfers collateral from a source trader subaccount to a destination trader subaccount. |
| transfer_collateral_child_to_parent | Transfers collateral from a child subaccount back to its parent trader account. |
| update_trader_state | Refreshes the trader account's cached state (PnL, funding, margin) against current market data. |
| withdraw | Ember withdraw: converts the Phoenix-side output mint back to the input mint; `None` = full balance. |
| withdraw_funds | Withdraws base or quote mint tokens from the Phoenix trader account back to the vault's token account. |