# Quote a deposit order

`POST /dex/orders/deposit/check` · Lithos client API · Lithos Dex

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

Quote a deposit order offering `amountX` and `amountY` against the current pool. Shares are bought with the scarcer side, and the rest of the other side is returned when the order fills. `/dex/deposit/check` finds a balanced pair.

## Request body

`LDDepositOrderRequest`, application/json.

- `amountX` (string, required): Most nanoERG the order offers to the reserves, not counting the provision box. Decimal string. 
- `amountY` (string, required): Raw token units the order offers. Decimal string.
- `executorFee` (string): nanoERG paid to whoever fills the order. A fill broadcast to the mempool pays its miner fee out of this. Miners skip orders paying less than they accept. Omit for the client's default. Decimal string. 
- `maxMinerFee` (string): Most nanoERG a fill may pay as a miner fee, out of `executorFee`. Must be below `executorFee`. Omit for the client's default. Decimal string. 

## Responses

### 200: Quote for the requested deposit order

`LDDepositOrderQuote`

- `shares` (string, required): Shares the offer buys against the current pool. Decimal string.
- `amountX` (string, required): nanoERG the pool would take. Decimal string.
- `amountY` (string, required): Raw token units the pool would take. Decimal string.
- `excessX` (string, required): nanoERG offered beyond what the pool would take, returned with the fill. Decimal string.
- `excessY` (string, required): Token side of `excessX`. Decimal string.
- `shareOfSupply` (number · double, required): Fraction of the pool the provision would represent once it lands
- `provisionBoxValue` (string, required): nanoERG that funds the new provision box, on top of `amountX`. Decimal string.
- `executorFee` (string, required): The executor fee applied, the request's or the client's default. Decimal string.
- `maxMinerFee` (string, required): The miner fee cap applied. Decimal string.
- `totalErgRequired` (string, required): nanoERG locked in the order box: `amountX`, `excessX`, `provisionBoxValue`, `executorFee` and `ergReturned`. Decimal string. 
- `ergReturned` (string, required): nanoERG returned to the owner with the fill, beside the `ownerNFT`, not counting `excessX`. Decimal string. 
- `networkFee` (string, required): nanoERG paid to place the order. Decimal string.

### 400: Malformed body, a non-positive amount, or a `maxMinerFee` not below `executorFee`.

`ApiError`

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

### 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/orders/deposit/check" \
  -H "Content-Type: application/json" \
  -d '{ "amountX": "5000000000", "amountY": "152000000", "executorFee": "3000000", "maxMinerFee": "1000000" }'
```

## Example response

```json
{
  "shares": "1176470",
  "amountX": "5000000000",
  "amountY": "151058823",
  "excessX": "0",
  "excessY": "941177",
  "shareOfSupply": 0.00117,
  "provisionBoxValue": "600000000",
  "executorFee": "3000000",
  "maxMinerFee": "1000000",
  "totalErgRequired": "5604000000",
  "ergReturned": "1000000",
  "networkFee": "2000000"
}
```
