Preview a withdrawal
Quotes what withdrawing these shares would pay right now, from the strategy's live accounting.
POST/
When the strategy's withdrawalSlippage is not null, set minAmountOut from this quote: take your tolerance off assetsOut, rounded down to assetDecimals. The preview is read-only, takes no Idempotency-Key, and still works after a strategy is deprecated or its provider stops taking deposits. It does not check the wallet's balance, so keep shares within the position's withdrawableShares. It returns 501 when the provider cannot quote withdrawals.
Requires an API key with the earn.read action.
Headers
-
x-project-id·string· min length 1 · exampleprj_exampleRequired for dashboard sessions. API keys use their assigned project.
Request body
application/json · required
Quote one withdrawal from a position against the strategy's live accounting. Read-only: nothing is built or saved.
-
positionId·string· required · min length 1 · max length 128 · exampleearn_position_2f8b6b04-7147-487e-b760-b1caa4fbcb8bThe position's ID, from the positions list or the deposit submit response.
-
shares·string· required · max length 128 · pattern^(?=.*[1-9])\d+(\.\d+)?$· example10Shares to withdraw, as a decimal string in share units. Keep it within the position's
withdrawableShares: the preview does not check the balance.
Responses
-
200Live withdrawal quote-
data·object· required-
positionId·string· required · min length 1 · max length 128 · exampleearn_position_2f8b6b04-7147-487e-b760-b1caa4fbcb8bThe position's ID, from the positions list or the deposit submit response.
-
assetsOut·string· required · max length 128 · pattern^(?=.*[1-9])\d+(\.\d+)?$· example25.02What redeeming the shares would pay at the live rate, decimal string in the deposit token's units. A truthful
minAmountOutfloor is derived from this figure. -
assetDecimals·integer· required · example6The deposit token's decimals, which define the scale used to quantize a floor.
-
blockingIssues·object[]· requiredConditions the provider reports would block this withdrawal; empty when none.
-
code·string· required · exampleSHARE_LOCKED -
message·string· required
-
-
-
meta·object· requiredResponse metadata.
-
requestId·string· required · min length 1 · examplereq_exampleRequest identifier for tracing.
-
timestamp·string· required · formatdate-time· example2025-01-01T00:00:00.000ZISO 8601 timestamp.
-
-
-
400Bad Request-
error·object· requiredStandard error payload.
-
code·string· requiredMachine-readable error code.
-
message·string· requiredHuman-readable error message.
-
details·objectOptional error details for debugging.
*·any
-
-
meta·object-
requestId·string· min length 1 · examplereq_exampleRequest identifier for tracing.
-
-
-
401UnauthorizedSame fields as
400. -
403Forbidden. Requires theearn.readaction: an API key must hold it (a module'smanageorexecutealso covers itsread), and a signed-in member's organization role must include it. Without it the error is INSUFFICIENT_PERMISSIONS anderror.details.actionnames the action. Any other 403 names its own reason.Same fields as
400. -
404Not FoundSame fields as
400. -
429Too Many RequestsSame fields as
400. -
500Internal Server ErrorSame fields as
400. -
501The provider does not support this operation.-
error·object· requiredStandard error payload.
-
code·string· required -
message·string· requiredHuman-readable error message.
-
details·objectOptional error details for debugging.
*·any
-
-
meta·object-
requestId·string· min length 1 · examplereq_exampleRequest identifier for tracing.
-
-
-
503Service UnavailableSame fields as
400.