Deposits
Discover chains and tokens
Find which chains and tokens are available for deposits.- Frontend
- Server
depositTokens includes wallet balances when the user is signed in.Quoting a deposit
- Frontend
- Server
tokenAddress. It creates a session automatically.Frontend DepositQuote
The frontend quote is a display-ready handle that you pass to sdk.execute():
Server SessionResult
The server quote returns the complete session union:
Executing a deposit
- Frontend
- Server
client.sessions.execute() for server integrations. It locks before invoking your callback and submits the returned hashes. Submit moves a current session directly from LOCKED to SETTLED. The session service records the hashes but does not verify transaction receipts. Use balances and positions for indexer-backed money state.
Re-quoting the same session
CallquoteDeposit() again while the session is OPEN to update prices, amounts, tokens, or chains. The session stays the same. Don’t create a new session for these changes.
- Frontend
- Server
forceReset only discards an active session before starting a fresh one. Use it when you intentionally want to abandon that session, not to refresh a price or change an amount, token, or chain.
Withdrawals
Discover destinations
Find which chains accept withdrawals and which loan token the user will receive.Quoting a withdrawal
- Frontend
- Server
isMaxWithdraw: true, Blend redeems all shares on every source chain. For any source chain that differs from the destination, whether the withdrawal is partial or full, Vault embeds Relay bridge calldata inside the atomic withdrawal transaction. The returned step list may omit a separate bridge step, but execution still routes those funds to the requested destination.
The result shapes also differ for withdrawals.
Frontend WithdrawQuote
Server SessionResult
Executing a withdrawal
Withdrawals may span multiple chains. The SDK handles multi-chain signing automatically.- Frontend
- Server
deriveSigner is called once per source chain. Handle wallet chain-switching inside the callback, return clients for the requested chain, and attach the account that matches signerAddress.Flow plan conflicts
If a rebalance is in progress, withdrawal quoting returns a409 with error code FLOWPLAN_CONFLICT. Show a “try again shortly” message to your user. Don’t auto-retry - wait for the rebalance to finish.
Cross-chain
Blend routes deposits and withdrawals across chains using the Relay bridge. In any cross-chain withdrawal, partial or full, the bridge call can be embedded inside the atomicliquidityReset calldata instead of appearing as a separate step.
Bridge adapters
The SDK picks the best adapter based on the token and route. You don’t need to choose.
Safe address determinism
Safe addresses are deterministic. The same wallet address produces the same Safe address on every chain. This means cross-chain deposits route to the correct Safe automatically, even if the Safe hasn’t been deployed on the destination chain yet.liquidityReset as delegateCall
During withdrawals, theliquidityReset step flushes vault positions back to the loan token. This step runs as a delegateCall through the Safe (the only step that does). The isDelegateCall: true flag in the action plan’s transaction marks it.
Testing
Test these scenarios before going to production:What to watch out for
Don’t useforceReset: true to update prices or change an amount, token, or chain. Re-quote the existing OPEN session. Use forceReset only when you intend to discard the active session.
Don’t auto-retry on FLOWPLAN_CONFLICT. The rebalance needs to finish first. Show a message and let the user try again.
Don’t assume single-chain for withdrawals. Funds may be spread across chains. Your deriveSigner (frontend) or submitActionPlan (server) callback must handle multiple chains.
Don’t skip the amount field when using isMaxWithdraw: true. Pass "0" as the amount.
Don’t treat a SETTLED session as proof of on-chain confirmation. It records hash ingestion. Check indexer-backed balances or positions for the resulting money state.
Frontend SDK
Frontend configuration, auth, and execution details.
Server SDK
Server configuration, account management, and session lifecycle.
SDK Reference
Error codes, types, and utility functions.
Best Practices
Production patterns for session management and error recovery.