Function Signature
Description
Builds the unsigned transaction that withdraws amount from an Earn vault. Withdrawals redeem shares the wallet already holds, so they never carry an approval. The underlying asset is sent to receiverAddress when given, otherwise to ownerAddress.
The method only builds the payload. Execute it with executeEarnTransaction, or use withdrawFromEarnVault to prepare and execute in one call.
Available as client.earn on DynamicEvmWalletClient and DynamicSvmWalletClient.
Parameters
Required Parameters
vaultId (string): The vault identifier from listVaults.
ownerAddress (string): The wallet address that owns the position.
amount (string): How much of the vault’s underlying asset to withdraw, in the asset’s human-readable units ('12.5' USDC, not '12500000'). Needs a leading zero ('0.01', not '.01').
Optional Parameters
receiverAddress (string): The address that receives the withdrawn asset. Defaults to ownerAddress. For a Solana vault, omit it or set it to ownerAddress: Solana vaults always return tokens to the owner’s own accounts.
traceContext (TraceContext): Trace context forwarded to the Dynamic API.
Returns
Promise<EarnSigningPayload>: The unsigned signing payload to execute.
Example
Error Handling
Fails with an HTTP 403 error when Earn is not enabled for your environment, or an HTTP 400 error when the amount exceeds the position or is otherwise invalid.
See Also
Last modified on October 29, 2026