Skip to main content
Native SOL stays in the trader account as lamports. No wrapping or USDC conversion is required.
Migration required — September 16, 2026 deploymentNative SOL collateral support is being deployed on September 16. Update your integration for this deployment:
  1. Upgrade to the latest Rise SDK for TypeScript or Rust.
  2. Use the deposit helper below to deposit SOL into a trader account.
  3. 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.
If your app only counts USDC collateral, traders who deposit SOL will see less collateral and a worse account health score than they should. Updating the SDK is not enough if your app still leaves SOL out of its margin calculation.
Depositing SOL adds collateral without changing the size, entry price, or direction of existing positions. The exchange counts a discounted portion of SOL’s value toward margin, so account health can change as SOL’s price changes. Use an existing trader and its owner’s signing wallet, with API/RPC endpoints for the same deployment.

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.
Call ReallocTrader once to extend the position map by one entry and reserve space for the SOL collateral balance. It is safe to include it in later deposits: when sufficient capacity already exists, it is a no-op.
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.
The TypeScript helper takes a 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.
These are local calculations using API prices, with index freshness assumed. Keep the SOL pricing market even without a SOL perp position, and never add SOL’s USD value to quote collateral yourself. Use Hawkeye below for an on-chain simulation. Margin and quote collateral use quote lots (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).