Skip to main content

withdrawFromYieldVault

Withdraws assets from an Earn vault, then signs and sends the transaction for you. As with depositToYieldVault, you pass a vaultId and a plain amount like '10.5' — Dynamic looks up the vault’s address and decimal places for you. Unlike a deposit, there’s no approval step first: the wallet already owns its position in the vault, so a withdrawal is always a single transaction.

Usage

Parameters

Returns

Promise<{ transactionHash: string }> - The hash of the withdraw transaction.
A resolved withdrawFromYieldVault call means the withdrawal was sent, not that it finished. See Waiting for confirmation before showing a success state to the user.

Waiting for confirmation

transactionHash is returned as soon as the withdrawal is broadcast to the network — it can still fail or revert after that. Wait for a receipt before telling the user their withdrawal succeeded:

Examples

Withdraw the full position

Supported Chains

withdrawFromYieldVault only supports EVM wallet accounts — vault actions are EVM-only today. Calling it with a non-EVM walletAccount throws a WalletProviderMethodUnavailableError, since only EVM wallet providers implement the underlying executeYieldTransaction method.

React

useWithdrawFromYieldVault invalidates useGetYieldPosition on success, so the position refetches automatically. That refetch can still briefly show the old balance, since the withdrawal transaction may not be mined yet — see Waiting for confirmation.
Last modified on September 1, 2026