Integration flow
A minimal end-to-end sequence for strategy data, balances, deposits, and withdrawals.
Before implementing this flow, create a strategy, then create an API key. Keep the key on your backend.
1. Load the strategy
Fetch the strategy when your application initializes, then refresh it on a schedule appropriate for your product:
GET /strategy-info/{strategy_id}Use the response to build the supported-asset selector and display current APY data. APY is variable; do not cache or present it as a guaranteed rate.
2. Load the user position
After a user connects a wallet, fetch their positions for your strategy:
GET /breeze-balances/{user_id}?strategy_id={strategy_id}Refresh balances after a confirmed deposit or withdrawal and whenever the product needs current position data.
3. Deposit
Request a serialized transaction from your backend:
POST /deposit/tx{
"params": {
"strategy_id": "43620ba3-354c-456b-aa3c-5bf7fa46a6d4",
"base_asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": 1000000,
"user_key": "GgBaCs3NCBuZN12kCJgAW63ydqohFkHEdfdEXBPzLHq",
"payer_key": "GgBaCs3NCBuZN12kCJgAW63ydqohFkHEdfdEXBPzLHq"
}
}The response is a JSON string containing a base64-encoded, unsigned Solana versioned transaction. Then:
- Base64-decode and deserialize the transaction.
- Present it to the user's wallet for review and signing.
- Submit the signed transaction.
- Wait for confirmation before refreshing balances.
4. Withdraw
Withdrawal uses the same transaction flow and required identity fields:
POST /withdraw/txFor a partial withdrawal, send amount in raw token units. To withdraw the
entire position, omit amount and set "all": true in params.
Use raw token units
Convert display amounts with the selected mint's decimals before creating a request.