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

# Redeem at size

> Redeem more TSY than an instant redemption can pay, with one signed authorization.

Use a redemption at size when a depositor wants more USDC than an [instant redemption](https://docs.multiliquid.xyz/api-reference/treasury/redeem.md) can pay now. The depositor signs once, and Multiliquid sources the USDC and settles the redemption on Ethereum mainnet.

## Before you start

* **The depositor's wallet**, holding the \$TSY to redeem and enough Treasury credits.
* **An EIP-712 signer** that supports `eth_signTypedData_v4`.

## 1. Prepare

Name the depositor and one amount, in whole tokens with at most 6 decimal places: `amountOut` for the exact USDC to receive, or `amountIn` for the exact \$TSY to redeem. 1,000 USDC is `1000`. Prepare fills in the operator, the asset IDs, the depositor's current nonce, and a signed bound from `slippageBps`, which defaults to 50 (0.5%).

```bash theme={null}
curl -X POST "https://api.multiliquid.xyz/v1/redemptions/prepare" \
  -H "Content-Type: application/json" \
  -d '{
    "user": "0x1111111111111111111111111111111111111111",
    "amountOut": "1000",
    "slippageBps": 50
  }'
```

Preparation answers `200` even when a check fails. The example depositor, `0x1111…1111`, holds enough \$TSY and Treasury credits but has not approved the Treasury delegate yet, so only `checks.allowance` fails, and `approval` covers it. [Prepare and sign](https://docs.multiliquid.xyz/api-reference/treasury/prepare-and-sign.md#preparation) shows the full response, which has what you need for the next steps:

| Field | Use |
| - | - |
| `redemption` | What you send back, unchanged. It holds the signed amounts in base units. |
| `typedData` | What the depositor signs, as it is |
| `approval` | The \$TSY approval to land first, or `null` when the allowance already covers the redemption |
| `checks` | Whether intake would accept the redemption now, in whole tokens of each check's `token` |
| `quote` | The amounts the bound was set from, in whole tokens |
| `expiresAt` | The last moment to submit |

A failing check does not fail the preparation. Fix it before you submit:

| Check | What to do |
| - | - |
| `checks.credits` | Redeem less: the depositor's Treasury credits cover at most `available`. The `quote` still prices the whole amount, as [Too few credits](https://docs.multiliquid.xyz/api-reference/treasury/prepare-and-sign.md#too-few-credits) explains. |
| `checks.balance` | Redeem less \$TSY, or fund the wallet |
| `checks.allowance` | Land `approval` |
| `checks.liquidity` | `sufficient` says whether Multiliquid can pay this redemption now, and `available` is the most USDC it can pay out now. Redeem less, keeping `required` within `available`, or try again later. |

## 2. Approve

When `approval` is not `null`, land it and wait until it is confirmed: the redemption's signature does not grant the allowance. It is an ordinary on-chain \$TSY approval to the Treasury delegate, [complete](https://docs.multiliquid.xyz/api-reference/swap/quote-and-build.md#transactions-on-evm) with the depositor's nonce, gas, and fees: the wallet signs its `serialized` as returned and sets none of them itself. Sign within a few blocks, or prepare again for current fees. Either:

* the wallet signs its `transaction` without broadcasting it, and you submit it alone to [`POST /v1/submissions`](https://docs.multiliquid.xyz/api-reference/swap/submissions) and wait until it is `confirmed`; or
* the wallet sends it itself, as a wallet that can only broadcast, such as a browser wallet or a custody platform, does.

> [!WARNING]
>
> An instant \$TSY swap through the Treasury capital provider approves the same spender, the Treasury delegate. An `approve` replaces the allowance rather than adding to it, so a swap's approval that lands after this one, before the redemption settles, can leave the redemption short: intake rejects it, or it fails, with `INSUFFICIENT_ALLOWANCE`. Don't run an instant redemption and a redemption at size for one depositor at the same time.

## 3. Sign and submit

The depositor signs `typedData` as it is.

> [!WARNING]
>
> ethers rejects `EIP712Domain` in `types`. With ethers, delete `types.EIP712Domain` before signing; the signature is the same.

Send the `redemption` unchanged, with the `signature`, before `expiresAt`. Its amounts are the signed ones, in base units: `assetOutAmt` `1000000000` is the 1,000 USDC you asked for, and `assetInAmt` the most \$TSY the depositor signs to spend.

```bash theme={null}
curl -X POST "https://api.multiliquid.xyz/v1/redemptions" \
  -H "Content-Type: application/json" \
  -d '{
    "redemption": {
      "network": "evm-mainnet",
      "user": "0x1111111111111111111111111111111111111111",
      "operator": "0x13D923C6E01DE19CF2E134Da3300F09aC42221f2",
      "receiver": "0x1111111111111111111111111111111111111111",
      "inputs": [
        {
          "routeId": "7",
          "assetInId": "0x780a0ed07e618523cabd294ee648537f4d185a074f97ecd50188d7f394e1e927",
          "assetOutId": "0x58e27f2731863499e6a23a1662ebeed9041d6b40996ea9ca7f4ebc54201823b4",
          "stablecoinDelegateId": "0x780a0ed07e618523cabd294ee648537f4d185a074f97ecd50188d7f394e1e927",
          "assetInAmt": "1000186050000000000000",
          "assetOutAmt": "1000000000"
        }
      ],
      "nonce": "3",
      "deadline": "1796140800"
    },
    "signature": "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111b"
  }'
```

It answers `201` with the new redemption and its `redemptionId`. A `201` means the redemption could settle now, not that it will: the depositor can still move \$TSY or revoke the approval, and Multiliquid checks again before settling.

Posting the same signed body again is safe. It returns the same redemption with `replayed: true`.

## 4. Track until settled

Read `GET /v1/redemptions/{redemptionId}` until `state` is final:

| `state` | Meaning | Next |
| - | - | - |
| `processing` | Being settled. `statusDetail` notes a delay. | Poll every 5 seconds |
| `underReview` | The settlement's outcome is not yet known. Multiliquid resolves it. | Poll about once a minute, and don't sign a new redemption for the same nonce |
| `completed` | The USDC was paid to the receiver | Stop. `settlement` holds the amounts and the transaction. |
| `failed` | Stopped without settling | Read `failure`, as below |

A failed redemption whose `failure.resubmittable` is `true` can be restarted: fix the cause, such as approving more \$TSY, then post the same signed body again. It needs no new signature. When `resubmittable` is `false`, the depositor signs a new redemption, or, for `SETTLEMENT_UNVERIFIED`, you contact support with the `redemptionId`. [Lifecycle](https://docs.multiliquid.xyz/api-reference/treasury/lifecycle.md#failure-codes) lists every failure code.

## When submission is rejected

A rejected redemption is not stored. After fixing the cause, post the same body again before `expiresAt`, unless the fix below says to prepare again.

| Code | What happened | What to do |
| - | - | - |
| `OPERATOR_MISMATCH` | The signature names another operator | Prepare again, and sign what prepare returns |
| `DEADLINE_TOO_SOON` | The deadline is ten minutes away or less | Prepare and sign again. The default deadline is one hour. |
| `INVALID_SIGNATURE` | The signature does not match the depositor | Sign `typedData` exactly as returned |
| `NONCE_MISMATCH` | Another transaction used the nonce | Prepare and sign again |
| `NO_QUOTE` | The signed amounts cannot be quoted now, as when the depositor's credits fall short of an exact-USDC-out redemption | Prepare again and read `checks.credits`, then sign for an amount the credits cover |
| `NONCE_IN_USE` | A redemption with this nonce has started settling | Track `details.redemptionId` instead of signing again |
| `BOUND_NOT_MET` | The price moved outside the signed bound | Prepare and sign again |
| `INSUFFICIENT_CREDITS` | The depositor's Treasury credits do not cover the \$TSY | Prepare and sign again for less: credits cover at most `details.available` |
| `INSUFFICIENT_BALANCE`, `INSUFFICIENT_ALLOWANCE` | The depositor's \$TSY balance or allowance does not cover the redemption | Fund the wallet or land the approval, then post the same body again |
| `INSUFFICIENT_LIQUIDITY` | Not enough USDC is available now | `details.available` is the most USDC Multiliquid can pay out now. Prepare and sign again so that `details.required` is at most `details.available`, or try again later. |
| `RATE_LIMITED` (`429`) | Another redemption is being checked | Wait for `Retry-After`, then post again |

```json theme={null}
{
  "error": "not enough USDC is available to settle this redemption now; redeem a smaller amount or retry later",
  "status": 422,
  "code": "INSUFFICIENT_LIQUIDITY",
  "details": {
    "token": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
    "required": "1000.1",
    "available": "750"
  },
  "requestId": "req_019a5c1e8f3b7c2d9e4f6a1b2c3d4e5f"
}
```

[Errors](https://docs.multiliquid.xyz/api-reference/guides/errors.md) lists every code.


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