Migration required — September 16, 2026 deploymentNative SOL collateral support is being deployed on September 16. Update your integration for this deployment:
- Upgrade to the latest Rise SDK for TypeScript or Rust.
- Use the deposit helper below to deposit SOL into a trader account.
- Update your margin calculation using the example below. It includes the trader’s SOL balance, SOL’s index price, and the exchange’s collateral discount settings.
Available instructions
Deposit SOL
Send ReallocTrader → System transfer → SyncNative in one transaction. Native SOL consumes a position-map slot even though it is not a perp position. Reallocate first so additional rent is funded separately;SyncNative cannot resize the account.
These examples derive PDA index 0, subaccount 0 from the owner. Amounts are integer lamports: 0.01 SOL = 10,000,000 lamports. Keep wallet SOL for rent and fees.
PhoenixInstructionClient configured with your deployment’s addresses and account fetcher (optionally its exchange cache). Both examples return unsigned instructions; the owner signs and sends them.
Rust’s create_deposit_native_sol_ixs includes reallocation, transfer, and sync. TypeScript’s buildNativeSolDepositFlow also includes reallocation for ordinary wallet-paid deposits. Sponsored deposits require a separate wallet-paid ReallocTrader preparation transaction and traderCapacityPrepared: true; the sponsored transaction contains only transfer + sync.
Have the wallet sign and submit with matching blockhash/preflight commitments. Confirm before reading margin. Caps can leave part of a successful deposit as uncredited excess, so always reread the accounted balance.
Compute margin using API data
Effective collateral includes discounted SOL value; portfolio value includes undiscounted SOL value. SOL adds no perp margin requirement, but the BTC position does. SOL does not increase the quote-withdrawal payout cap: withdraw native SOL or explicitly swap it.
Fetch market prices and collateral metadata from the API, then compute margin with the SDK. In TypeScript, use
getCalculator() so collateral parameters are included. In Rust, use to_trader_portfolio_with_metadata(&metadata)? and pass &metadata to compute_margin; the quote-only to_trader_portfolio() path cannot value SOL. Supply current trader state from Accounts: TypeScript uses resource.marginInputs(); Rust uses the selected SubaccountState from the trader-state stream. Recompute after the confirmed deposit and order have appeared in that state.
1 quote lot = 0.000001 USD).
Use the normal order flow to buy BTC: read the current bid/ask, compute the mid, and cap the buy price at mid × (1 + slippagePercent / 100) with a default of 1%. SOL collateral does not change the order instruction. The deposit and order are separate transactions; a failed order leaves the deposit in place.
View trader margin with Hawkeye
Hawkeye simulates on-chain margin, including discounted SOL value. Call this after the deposit and again after the order. Margin and quote collateral use quote lots (1 quote lot = 0.000001 USD).