"MAX" to exit the position entirely.
Earn is in early access. Contact us to enable it for your organization.
Submit the withdrawal
Submit anACTIVITY_TYPE_EARN_WITHDRAW activity with:
- the
wrapperAddressholding the position, fromlist_earn_positions - the
signWithwallet account to withdraw to and sign with - the
amountValuein raw on-chain units of the underlying asset (e.g."500000"for 0.50 USDC), or the literal"MAX"to withdraw the entire position - the CAIP-2 chain in
chainCaip2, and optionallysponsorfor gas sponsorship
withdrawRequestId.
Withdrawals always work, even when deposits to the wrapper are paused.
Full exit with MAX
"amountValue": "MAX" redeems the wallet’s exact live share balance in the wrapper, so the position closes completely without leaving dust.
A
MAX withdrawal resets the position’s lifetime accounting: after it
confirms, totalDeposited and totalWithdrawn in
list_earn_positions start again from zero
for that wrapper.Claiming yield only
To pay out yield without touching principal, withdraw exactly the yield amount. Compute it from the position’s raw fields:JavaScript
Poll withdrawal status (required)
Poll with thewithdrawRequestId from the activity result. status is PENDING, COMPLETED, or FAILED; on COMPLETED the response carries the withdrawTxHash, and on FAILED it includes an error field with the reason.
Gas
Identical to deposits:sponsor: true uses Gas Station (Pro plan or higher); otherwise the signWith wallet pays gas natively. See Gas: sponsored vs self-funded.
Next steps
- Track positions to verify the position after withdrawing