> ## Documentation Index
> Fetch the complete documentation index at: https://loopscale.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Withdraw from Earn Vault

Builds the transactions that withdraw shares from an Earn vault, either instantly from the vault's reserves or through the withdrawal queue.

* **`instant`** redeems shares straight from the vault's reserves in one step, paying the vault's fast-withdrawal cut. Payout is in the vault's underlying unless `mint` picks another token entry, and it only succeeds while that token's reserve holds enough.
* **`queued`** opens a withdrawal request for the shares. Once the request is filled, [claim it](https://loopscale.mintlify.site/api-reference/transactions/earn/claim-withdrawal.md) to receive the tokens, or [cancel it](https://loopscale.mintlify.site/api-reference/transactions/earn/cancel-withdrawal.md) before then to get the shares back. Passing `mint` records the token you want the request filled in; the vault manager honors it when filling.

Check the vault's `instantEnabled` and `queueEnabled` flags on [Get Earn Vault](https://loopscale.mintlify.site/api-reference/data/earn/get-earn-vault.md) before offering a mode.

Sign and send `txBase64s` in order as one Jito bundle, as described in [Sending Earn transactions](https://loopscale.mintlify.site/api-reference/transactions/earn/deposit.md#sending-earn-transactions). A queued request transaction comes partially signed by the new request account; keep that signature when you add the wallet's.

## Body

**address** `string` *required*

Earn vault address.

**wallet** `string` *required*

Wallet that owns the shares. It pays fees and signs the transactions.

**shares** `string | integer` *required*

Shares to withdraw, in LP base units.

**mode** `string` *required*

`instant` or `queued`.

**mint** `string`

Token to receive. Must be one of the vault's token entries, the tokens the vault holds; `acceptedAssetMints` on [Get Earn Vault](https://loopscale.mintlify.site/api-reference/data/earn/get-earn-vault.md) is the subset Loopscale offers in its app and is what integrators should stick to. Defaults to the vault's accepted asset (`acceptedAssetMint`). Instant mode pays it out in the same transaction. Queued mode writes it into the request transaction as a memo, and the fill later uses that token; the request then shows it as `payoutMint` on [Get Earn Position](https://loopscale.mintlify.site/api-reference/data/earn/get-earn-position.md).

**providerKind** `string` (default: exponent)

Vault provider. Only `exponent` is supported today.

## Response

Same shape as [Deposit to Earn Vault](https://loopscale.mintlify.site/api-reference/transactions/earn/deposit.md#response), plus:

**action** `string`

`withdrawRequestInstant` or `withdrawRequestQueued`.

**requestId** `string`

Queued mode only. Address of the new withdrawal request account. Pass it to Claim or Cancel. It is also returned later as `onChainRequestAddr` by [Get Earn Position](https://loopscale.mintlify.site/api-reference/data/earn/get-earn-position.md).

**signers** `string[]`

Queued mode only. Contains `requestId`, which has already signed the transaction.

**payoutMint** `string`

Token the withdrawal pays out in. Always set for instant mode; set for queued mode when `mint` was passed.

```bash Queued theme={null}
curl -X POST https://tars.loopscale.com/v1/pandora/earn/vaults/withdraw_request/tx \
  -H "Content-Type: application/json" \
  -d '{
    "address": "EsTx9ToYW2k1DsTw6ccpmP3RrXQriod114hcM7U5ZKaR",
    "wallet": "<WALLET>",
    "shares": "500000",
    "mode": "queued"
  }'
```

```json 200 theme={null}
{
  "providerKind": "exponent",
  "action": "withdrawRequestQueued",
  "vault": "EsTx9ToYW2k1DsTw6ccpmP3RrXQriod114hcM7U5ZKaR",
  "user": "<WALLET>",
  "requestId": "<REQUEST_ACCOUNT>",
  "signers": ["<REQUEST_ACCOUNT>"],
  "txBase64": "<WITHDRAW_REQUEST_TX>",
  "txBase64s": ["<AUM_REFRESH_TX>", "<WITHDRAW_REQUEST_TX>"]
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.