Deposits
Discover chains and tokens
Find which chains and tokens are available for deposits.Quoting a deposit
inputAssetAddress. quoteDeposit returns a SessionResult. Narrow on type and check the extracted action plan before using deposit-specific fields.
Deposit SessionResult
The quote returns the complete session union:
Executing a deposit
client.sessions.execute(). 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.
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
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.
Withdrawal SessionResult
Executing a withdrawal
Withdrawals may span multiple chains. They produce multiple action plans (one per source chain). Execute each plan and collect all hashes.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 bridge adapter is selected for the transfer’s token and destination chain and included in the action plan.
Safe address determinism
Safe addresses are deterministic. For a given Account Type, the same wallet address produces the same Safe address on every chain. Cross-chain deposits use that address 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 submitActionPlan 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.
Using the SDK
Configuration, account management, and session lifecycle.
SDK Reference
Error codes, types, and utility functions.
Best Practices
Production patterns for session management and error recovery.