# Deposit liquidity

`POST /dex/deposit` · Lithos client API · Lithos Dex · requires the `api_key` header

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

Deposit a balanced pair directly and mint a provision. Send `maxAmountX` / `maxAmountY` from the quote to cap what it costs if the pool moves. Keep the returned `ownerNFT` — it is what owns the provision. `POST /dex/orders/deposit` places a deposit as an order.

## Request body

`LDDepositExecuteRequest`, application/json.

- `shares` (string, required): LP shares to unlock, as returned by the quote. Decimal string.
- `maxAmountX` (string): Most you will pay on the ERG side. Decimal string.
- `maxAmountY` (string): Most you will pay on the token side. Decimal string.
- `expectedPoolBoxId` (string): The pool box this was quoted against

## Responses

### 200: Result of the deposit transaction

`LDDepositResult`

- `outcome` (string, required, one of accepted, rejected, uncertain): Node submission outcome; uncertain retains the known transaction ID and input ownership.
- `provisionBoxId` (string, required): UTXO id of the newly minted provision box
- `ownerNFT` (string, required): Token that owns the provision. Whoever holds it controls the provision, and it does not change when the box id does. 
- `shares` (string, required)
- `amountX` (string, required)
- `amountY` (string, required)
- `txId` (string, required)

### 400: Malformed body, or a non-positive `shares`.

`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 pool moved. Re-read and quote again.

`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

### 422: Costs more than the given bounds, or the wallet cannot cover it.

`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 or wallet 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/deposit" \
  -H "api_key: $LITHOS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "shares": "1176470", "maxAmountX": "5000000000", "maxAmountY": "151058823", "expectedPoolBoxId": "a1f4c2e8b7d93052416fbc8e07d21935a8c4f60b2e91d7385c06a4b1f2e83d97" }'
```

## Example response

```json
{
  "outcome": "accepted",
  "provisionBoxId": "ce00d6e0f4fd3390c0519bb0d24824e1e6b06978163f4845a7cf2c1c7d8f1b65",
  "ownerNFT": "a1f4c2e8b7d93052416fbc8e07d21935a8c4f60b2e91d7385c06a4b1f2e83d97",
  "shares": "1176470",
  "amountX": "5000000000",
  "amountY": "151058823",
  "txId": "40b7d045a858d537cdbf072e46ffbb86c0c9f6b0e93c369c1ffcba76797636d7"
}
```
