# A verified pool's recent activity

`GET /dex/pools/{poolNft}/activity/recent` · Lithos client API · Lithos Dex

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

`GET /dex/activity/recent` for any verified pool. On a token/token pool `ergIn` means X was sold. Collected for verified pools only.

## Parameters

| Name | In | Type | Required | Description |

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

| `poolNft` | path | string | yes | The pool's NFT id, 64 hex characters |

| `limit` | query | integer · int32 | no | Most entries |

## Responses

### 200: Recent pool transitions, newest first

`LDRecentActivity`

- `activity` (LDActivityEntry[], required)
  - `txId` (string, required)
  - `type` (string, required, one of SWAP, DEPOSIT, REDEEM, RESIZE, FLUSH): SWAP trades against the reserves. DEPOSIT opens a provision and REDEEM closes one. RESIZE changes a provision's size and flushes. FLUSH moves pending fees to the vault. 
  - `via` (string, required, one of ORDER, DIRECT): ORDER when the transaction fills a LithosDex order, DIRECT otherwise. RESIZE and FLUSH are always DIRECT. 
  - `orderBoxId` (string): The order this transaction filled. Present when `via` is ORDER.
  - `status` (string, required, one of MEMPOOL, CONFIRMED): MEMPOOL entries are unconfirmed and can still be dropped or replaced. They are listed ahead of every confirmed entry. 
  - `height` (integer · int32): Block height. Present when CONFIRMED.
  - `timestamp` (integer · int64): Unix milliseconds. Present when CONFIRMED and resolved.
  - `ergIn` (boolean): SWAP only. True when ERG was sold for the token.
  - `amountIn` (string): SWAP only. Raw units handed to the pool, pool fees included. Decimal string.
  - `amountOut` (string): SWAP only. Raw units received. Decimal string.
  - `amountX` (string): Not present for SWAP. nanoERG added to the reserves by a DEPOSIT or a growing RESIZE, returned from them by a REDEEM or a shrinking RESIZE, or moved to the vault by a FLUSH. Decimal string. 
  - `amountY` (string): Not present for SWAP. Token side of `amountX`. Decimal string.
  - `shares` (string): DEPOSIT, REDEEM and RESIZE only. Shares issued or closed; for RESIZE, the signed change. Decimal string. 
- `stats` (DexStatsView)
  - `status` (string, required, one of disabled, loading, ready, stale, unavailable): Freshness only. Coverage is a separate question — read `historyComplete` and a graph's `partial`.
  - `updatedAt` (integer · int64): When the last successful refresh began, in Unix milliseconds, before it read the node.
  - `sourceHeight` (integer · int32)
  - `sourceBlockId` (string): The chain tip checked before and after the read. Current price and activity can also include the mempool.
  - `windowStartHeight` (integer · int32): Earliest height you can ask for, max(0, `sourceHeight` - 21600).
  - `coverageStartHeight` (integer · int32): Oldest retained pool snapshot, including a predecessor where one exists.
  - `historyComplete` (boolean): Whether the history read reached the start of the index, or a predecessor, before the requested window.
  - `refreshing` (boolean, required)
  - `restored` (boolean, required): Loaded from disk. Stale until a node read succeeds, and never overwrites newer live data.
  - `error` (string): Short refresh failure message. Details stay in the client log.
  - `collectedFrom` (integer · int32): The height a verified pool other than ERG:LIT joined the verified list. Nothing before it is collected, so a graph covering earlier heights shows that range as not collected. Absent for ERG:LIT, whose whole life is collected. 
- `partial` (boolean): Present and true for stale snapshots; inspect stats.historyComplete for history coverage.

### 404: Not a verified pool, so nothing is collected for 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: No snapshot yet, or the pool index is still building. Retry-After is 5 seconds.

`DexStatsUnavailable`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description
- `stats` (DexStatsView, required)
  - `status` (string, required, one of disabled, loading, ready, stale, unavailable): Freshness only. Coverage is a separate question — read `historyComplete` and a graph's `partial`.
  - `updatedAt` (integer · int64): When the last successful refresh began, in Unix milliseconds, before it read the node.
  - `sourceHeight` (integer · int32)
  - `sourceBlockId` (string): The chain tip checked before and after the read. Current price and activity can also include the mempool.
  - `windowStartHeight` (integer · int32): Earliest height you can ask for, max(0, `sourceHeight` - 21600).
  - `coverageStartHeight` (integer · int32): Oldest retained pool snapshot, including a predecessor where one exists.
  - `historyComplete` (boolean): Whether the history read reached the start of the index, or a predecessor, before the requested window.
  - `refreshing` (boolean, required)
  - `restored` (boolean, required): Loaded from disk. Stale until a node read succeeds, and never overwrites newer live data.
  - `error` (string): Short refresh failure message. Details stay in the client log.
  - `collectedFrom` (integer · int32): The height a verified pool other than ERG:LIT joined the verified list. Nothing before it is collected, so a graph covering earlier heights shows that range as not collected. Absent for ERG:LIT, whose whole life is collected. 

### 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/pools/{poolNft}/activity/recent"
```

## Example response

```json
{
  "activity": [
    {
      "txId": "9f3c1ab7d2e45806c91f7b3ad4e2091856cbf740e3a92d5178cc0b46e21f5d38",
      "type": "SWAP",
      "via": "ORDER",
      "orderBoxId": "5035b2e112b4f5b873dd3444c01df1e7e697807fd84fe96790eacb128e46428d",
      "status": "CONFIRMED",
      "height": 484719,
      "timestamp": 1765432100000,
      "ergIn": true,
      "amountIn": "12400000000",
      "amountOut": "441820000",
      "amountX": "5000000000",
      "amountY": "151058823",
      "shares": "1176470"
    }
  ],
  "stats": {
    "status": "disabled",
    "updatedAt": 0,
    "sourceHeight": 0,
    "sourceBlockId": "string",
    "windowStartHeight": 0,
    "coverageStartHeight": 0,
    "historyComplete": true,
    "refreshing": true,
    "restored": true,
    "error": "string",
    "collectedFrom": 0
  },
  "partial": true
}
```
