# Quote a new LithosDex pool

`POST /dex/pools/create/check` · Lithos client API · Lithos Dex

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

What creating a pool with reserves `amountX` and `amountY` would do. `tokenX` is ERG for an ERG/token pool. All of it goes into the pool at genesis, at the price the two amounts set, and genesis gives this wallet a provision for all of the supply but 1,000,000 shares. Those shares are locked for good, and with them a millionth of the pool. An ERG/token pool box must always keep over 0.01 ERG, so a warning says when a full exit by its only provider would leave more than the locked share behind. Lists any pool already trading the pair.

## Request body

`LDPoolCreateRequest`, application/json.

- `tokenX` (string, required): ERG for an ERG/token pool, or a token/token pool's first token id
- `tokenY` (string, required): The pool's other token id
- `amountX` (string, required): The pool's reserve of X at genesis; nanoERG for ERG, at least 0.01 ERG
- `amountY` (string, required)
- `feeParams` (LDFeeParams): Fee numerators over `feeDenom`. `dexFeeNum` stays in the pool; `ergFeeNum` / `tokenFeeNum` are set aside for liquidity providers. 
  - `dexFeeNum` (integer · int64, required)
  - `ergFeeNum` (integer · int64, required)
  - `tokenFeeNum` (integer · int64, required)
  - `feeDenom` (integer · int64, required): Denominator of every numerator above

## Responses

### 200: The quote

`LDPoolCreateQuote`

- `kind` (string, required, one of n2t, t2t)
- `tokenX` (string, required)
- `tokenY` (string, required)
- `feeParams` (LDFeeParams, required): Fee numerators over `feeDenom`. `dexFeeNum` stays in the pool; `ergFeeNum` / `tokenFeeNum` are set aside for liquidity providers. 
  - `dexFeeNum` (integer · int64, required)
  - `ergFeeNum` (integer · int64, required)
  - `tokenFeeNum` (integer · int64, required)
  - `feeDenom` (integer · int64, required): Denominator of every numerator above
- `reserveX` (string, required)
- `reserveY` (string, required)
- `shares` (string, required): The creator's provision: all of the genesis supply but lockedShares
- `lockedShares` (string, required): Supply no provision may represent, so its share of the reserves is locked for good
- `lockedShare` (number · double, required): That supply's fraction of the pool
- `lockedErg` (string, required): nanoERG nobody can take back: the vault box, and a token/token pool box
- `lockedTokens` (LDTokenAmount[], required): Tokens nobody can take back beyond the locked share: a token/token vault's one of each
  - `tokenId` (string, required)
  - `amount` (string, required): Raw token units. Decimal string.
- `poolBoxValue` (string, required)
- `vaultBoxValue` (string, required)
- `provisionBoxValue` (string, required): nanoERG the provision box holds, which a redeem returns
- `totalErgRequired` (string, required): nanoERG that leaves the wallet across the four transactions
- `tokensRequired` (LDTokenAmount[], required)
- `networkFee` (string, required): The four transactions' fees together
- `warnings` (string[], required): Pools already trading this pair or why none were looked for, and an ERG/token pool's exit floor

### 400: The request is malformed, names ERG as tokenY or one token twice, offers an ERG reserve under 0.01 ERG, or gives fees out of bounds.

`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/pools/create/check" \
  -H "Content-Type: application/json" \
  -d '{ "tokenX": "string", "tokenY": "string", "amountX": "string", "amountY": "string", "feeParams": { "dexFeeNum": 9985, "ergFeeNum": 15, "tokenFeeNum": 15, "feeDenom": 10000 } }'
```

## Example response

```json
{
  "kind": "n2t",
  "tokenX": "string",
  "tokenY": "string",
  "feeParams": {
    "dexFeeNum": 9985,
    "ergFeeNum": 15,
    "tokenFeeNum": 15,
    "feeDenom": 10000
  },
  "reserveX": "string",
  "reserveY": "string",
  "shares": "string",
  "lockedShares": "string",
  "lockedShare": 0,
  "lockedErg": "string",
  "lockedTokens": [
    {
      "tokenId": "86e272f770aa4ef48ad7e6d6dbe98b5069edd8383a403a8edb3ceed8a3d5cea3",
      "amount": "152000000"
    }
  ],
  "poolBoxValue": "string",
  "vaultBoxValue": "string",
  "provisionBoxValue": "string",
  "totalErgRequired": "string",
  "tokensRequired": [
    {
      "tokenId": "86e272f770aa4ef48ad7e6d6dbe98b5069edd8383a403a8edb3ceed8a3d5cea3",
      "amount": "152000000"
    }
  ],
  "networkFee": "string",
  "warnings": [
    "string"
  ]
}
```
