# Quote a provision resize

`POST /dex/provisions/{boxId}/resize/check` · Lithos client API · Lithos Dex

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

Quote changing a provision's size without closing it. A resize also flushes pending fees.

## Parameters

| Name | In | Type | Required | Description |

|---|---|---|---|---|

| `boxId` | path | string | yes | UTXO id of the provision box |

## Request body

`LDResizeRequest`, application/json.

- `newShares` (string, required): Size the provision should become. Must be positive — a resize to zero is a redemption. Decimal string. 
- `maxAmountX` (string): Most you will contribute on the ERG side, when increasing. Decimal string.
- `maxAmountY` (string): Most you will contribute on the token side, when increasing. Decimal string.
- `minAmountX` (string): Least you will take back on the ERG side, when decreasing. Decimal string.
- `minAmountY` (string): Least you will take back on the token side, when decreasing. Decimal string.
- `expectedPoolBoxId` (string): The pool box this was quoted against
- `expectedVaultBoxId` (string): Vault box the quote was made against. A resize also flushes.
- `expectedProvisionBoxId` (string): The provision box this was quoted against

## Responses

### 200: Quote for the requested resize

`LDResizeQuote`

- `oldShares` (string, required)
- `newShares` (string, required)
- `delta` (string, required): Change in shares; positive adds liquidity, negative removes it. Decimal string.
- `increasing` (boolean, required): True when adding liquidity. Decides which bounds apply on execute.
- `amountX` (string, required): nanoERG the pool takes when increasing, or returns when decreasing. Decimal string.
- `amountY` (string, required): Token side of the same. Decimal string.
- `nextEntryX` (string, required): Entry the resized provision must carry, chosen so nothing already earned is lost. Decimal string. 
- `nextEntryY` (string, required)
- `withinMinSupply` (boolean, required)

### 400: Malformed body, or `newShares` is not a different positive size.

`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/provisions/{boxId}/resize/check" \
  -H "Content-Type: application/json" \
  -d '{ "newShares": "20000000000", "maxAmountX": "31875000000", "maxAmountY": "963000000", "minAmountX": "21250000000", "minAmountY": "642000000", "expectedPoolBoxId": "a1f4c2e8b7d93052416fbc8e07d21935a8c4f60b2e91d7385c06a4b1f2e83d97", "expectedVaultBoxId": "88c297f99da7172f6aa20efbead69aa40e2b7734a1873d66ca1db6b19d214db6", "expectedProvisionBoxId": "ce00d6e0f4fd3390c0519bb0d24824e1e6b06978163f4845a7cf2c1c7d8f1b65" }'
```

## Example response

```json
{
  "oldShares": "12500000000",
  "newShares": "20000000000",
  "delta": "7500000000",
  "increasing": true,
  "amountX": "31875000000",
  "amountY": "963000000",
  "nextEntryX": "29632000000000000000000000",
  "nextEntryY": "892400000000000000000000",
  "withinMinSupply": true
}
```
