Integration Flow
Step-by-step guide for integrating Breeze API into your application
This represents one possible implementation approach. Your implementation may vary based on specific requirements.
Prerequisites
Create Strategy & Get API Key
Before starting, create a strategy in the Customer Portal and get your API key.
Integration Flow
Fetch Supported Assets (Once)
Call /strategy-info/{strategy_id}/ once on app initialization to get all supported assets for your strategy.
GET /strategy-info/{strategy_id}/Use this to:
- Build your asset selector/dropdown
- Store the list of supported token mints
- Know which assets users can deposit
{
"strategy_id": "43620ba3-...",
"strategy_name": "my-strategy",
"assets": [
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
"So11111111111111111111111111111111111111112"
],
"apy": 4.29,
"apy_per_asset": { ... }
}Fetch APY Data (Periodically)
Use the same /strategy-info/{strategy_id}/ endpoint to display current APY rates.
GET /strategy-info/{strategy_id}/Use this to:
- Display overall strategy APY
- Show per-asset APY rates
- Update APY display periodically (e.g., every few minutes)
{
"apy": 4.29,
"apy_per_asset": {
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v": 5.66,
"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB": 2.46,
"So11111111111111111111111111111111111111112": 2.78
}
}Fetch User Balances
When a user connects their wallet, fetch their Breeze balances using /breeze-balances/{user_pubkey}.
GET /breeze-balances/{user_pubkey}?strategy_id={strategy_id}Use this to:
- Show user's deposited amounts per asset
- Display total position value
- Show earned yield per asset
Deposit Funds
When a user wants to deposit, generate a transaction using /deposit/tx.
POST /deposit/tx{
"params": {
"strategy_id": "your-strategy-id",
"base_asset": "token-mint-address",
"amount": 1000000,
"user_key": "user-wallet-pubkey",
"payer_key": "user-wallet-pubkey"
}
}Flow:
- Generate transaction with
/deposit/tx - Deserialize the base64 response
- User signs with their wallet
- Submit to Solana network
- Refresh balances after confirmation
Withdraw Funds
When a user wants to withdraw, generate a transaction using /withdraw/tx.
POST /withdraw/tx{
"params": {
"strategy_id": "your-strategy-id",
"base_asset": "token-mint-address",
"amount": 1000000,
"user_key": "user-wallet-pubkey",
"payer_key": "user-wallet-pubkey"
}
}"all": true in params to withdraw the entire balance for an asset.
