# Quote a liquidity redemption

`POST /dex/redeem/check` · Lithos client API · Lithos Dex

Source: https://lithosprotocol.org/docs/api/check-ld-redeem

Quote closing a provision. `amountX` / `amountY` are the liquidity only; `unclaimedX` / `unclaimedY` are fees that would be lost if the provision is spent without claiming.

## Request body

`LDRedeemRequest`, application/json.

- `provisionBoxId` (string, required)
- `minAmountX` (string): Least you will accept back on the ERG side. Decimal string.
- `minAmountY` (string): The same on the token side. Decimal string.
- `expectedPoolBoxId` (string): The pool box this was quoted against
- `acknowledgeUnclaimedFees` (boolean): Must be true to redeem a provision that still has unclaimed fees, which are lost when it is spent. Ignored when there are none. 

## Responses

### 200: Quote for the requested redemption

`LDRedeemQuote`

- `shares` (string, required): LP shares that would be closed. Decimal string.
- `amountX` (string, required): nanoERG returned. Liquidity only — fees settle separately. Decimal string.
- `amountY` (string, required): Raw token units returned. Decimal string.
- `withinMinSupply` (boolean, required): False when closing this provision would take supply under the contract's minimum, which the pool refuses. 
- `unclaimedX` (string, required): Unclaimed ERG fees. **Lost** if the provision is redeemed without claiming them first. Decimal string. 
- `unclaimedY` (string, required): Token side of the same. Decimal string.

### 400: Malformed body.

`ApiError`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description

### 404: No live provision with that id.

`ApiError`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description

### 409: The provision moved. Re-read to find its current box id.

`LDStateChangedResponse`

- `error` (integer, required)
- `reason` (string, required)
- `detail` (string, required): What moved, and what it moved to
- `poolBoxId` (string): Current pool box id
- `vaultBoxId` (string): Current vault box id
- `provisionBoxId` (string): Current provision box id

### 503: Node unavailable. Retry.

`ApiError`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description

### default: Error

`ApiError`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description

## Example request

```bash
curl -X POST "http://localhost:9000/dex/redeem/check" \
  -H "Content-Type: application/json" \
  -d '{ "provisionBoxId": "ce00d6e0f4fd3390c0519bb0d24824e1e6b06978163f4845a7cf2c1c7d8f1b65", "minAmountX": "53125000000", "minAmountY": "1605000000", "expectedPoolBoxId": "a1f4c2e8b7d93052416fbc8e07d21935a8c4f60b2e91d7385c06a4b1f2e83d97", "acknowledgeUnclaimedFees": false }'
```

## Example response

```json
{
  "shares": "12500000000",
  "amountX": "53125000000",
  "amountY": "1605000000",
  "withinMinSupply": true,
  "unclaimedX": "402000000",
  "unclaimedY": "12100000"
}
```
