# LithosDex pool state

`GET /dex/pool` · Lithos client API · Lithos Dex

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

Current state of the LithosDex pool. `reservesX` / `reservesY` are tradable; `pendingX` / `pendingY` are fees awaiting a flush.

## Responses

### 200: Current pool state

`LDPoolInfo`

- `poolNFT` (string, required): Token id of the pool NFT
- `utxoId` (string, required): Pool box id. Send back as `expectedPoolBoxId` when executing.
- `tokenY` (string, required): Token id of the pool's token side
- `tokenName` (string): Display name of the pool's token, when known
- `tokenDecimals` (integer · int32): Decimal places implied by raw token amounts
- `reservesX` (string, required): nanoERG the AMM trades with — box value less pendingX. Decimal string.
- `reservesY` (string, required): Raw token units the AMM trades with — token balance less pendingY. Decimal string.
- `pendingX` (string, required): nanoERG fees accrued but not yet flushed to the vault. Decimal string.
- `pendingY` (string, required): Token-side fees accrued but not yet flushed. Decimal string.
- `supply` (string, required): LP shares outstanding. Decimal string.
- `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
- `accX` (string, required): Cumulative ERG fee per share, scaled by 1e27. Decimal string — this value exceeds the exact range of a double and must not be parsed as a JSON number. 
- `accY` (string, required): Cumulative token fee per share, same 1e27 scale. Decimal string.
- `provTokensLeft` (string, required): Provision tokens left in the pool; one is used per deposit. Decimal string. 
- `canFlush` (boolean, required): Whether any fees are pending. A flush needs something to move.
- `canDeposit` (boolean, required): Whether a provision token remains to hand out
- `syncHeight` (integer · int32, required): Block height this snapshot was taken at

### 404: No pool box found on this network.

`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 GET "http://localhost:9000/dex/pool"
```

## Example response

```json
{
  "poolNFT": "720933ab10ef28eafd96a4e41f783c12b444ed81d6a08879f583266031c04dbd",
  "utxoId": "a1f4c2e8b7d93052416fbc8e07d21935a8c4f60b2e91d7385c06a4b1f2e83d97",
  "tokenY": "86e272f770aa4ef48ad7e6d6dbe98b5069edd8383a403a8edb3ceed8a3d5cea3",
  "tokenName": "LIT",
  "tokenDecimals": 4,
  "reservesX": "4250000000000",
  "reservesY": "128400000000",
  "pendingX": "3180000000",
  "pendingY": "96400000",
  "supply": "1000000000000",
  "feeParams": {
    "dexFeeNum": 9985,
    "ergFeeNum": 15,
    "tokenFeeNum": 15,
    "feeDenom": 10000
  },
  "accX": "41820000000000000000000000",
  "accY": "1264000000000000000000000",
  "provTokensLeft": "999999999999997",
  "canFlush": true,
  "canDeposit": true,
  "syncHeight": 1312460
}
```
