Skip to main content
A withdrawal moves assets from your organization’s fee wrapper back to the user’s wallet. Amounts are specified in the underlying asset (vault shares are not exposed in the API), or pass "MAX" to exit the position entirely.
Earn is in private beta. Contact us to enable it for your organization.

Submit the withdrawal

enum<string>
required
ACTIVITY_TYPE_EARN_WITHDRAW
string
required
Timestamp (in milliseconds) of the request, used to verify liveness.
string
required
Unique identifier for your organization (or the sub-organization whose wallet is withdrawing).
string
required
Address of the deployed fee wrapper holding the position, from earn_positions.
string
required
The wallet account address to withdraw to and sign with.
string
required
Amount of the underlying asset to withdraw, in raw on-chain units (e.g. "500000" for 0.50 USDC), or the literal "MAX" to withdraw the entire position.
string
required
CAIP-2 chain identifier, e.g. eip155:8453.
boolean
Whether to sponsor the transaction’s gas via Gas Station. Defaults to false.
The result contains only a poll handle:

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 earn_positions start again from zero for that wrapper.
Positions in wrappers you have since replaced (after a fee change) remain withdrawable. Target the old wrapper’s address.

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)

As with deposits, a COMPLETED activity means the transaction was enqueued for broadcast, not that it confirmed. Poll earn_withdraw_status until it reports COMPLETED (included on-chain) or FAILED.
status is PENDING, COMPLETED, or FAILED. On FAILED, the response 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