# Fee history for one provision

`GET /dex/provisions/{boxId}/fees/history` · Lithos client API · Lithos Dex

Source: https://lithosprotocol.org/docs/api/get-ld-provision-fee-history

Earnings over time for one provision, from its current size and entry. Earnings from before a resize are not reconstructed.

## Parameters

| Name | In | Type | Required | Description |

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

| `boxId` | path | string | yes | UTXO id of the provision box |

| `from` | query | integer · int32 | no | First block height to include |

| `to` | query | integer · int32 | no | Last block height to include |

| `bucket` | query | integer · int32 | no | Bucket size in blocks |

## Responses

### 200: Bucketed fee history for the provision

`LDProvisionFeeHistory`

- `boxId` (string, required)
- `history` (LDFeeHistoryPoint[], required)
  - `height` (integer · int32, required): Block height at the end of this bucket
  - `timestamp` (integer · int64): Unix milliseconds at the end of this bucket. Absent if unresolved.
  - `periodX` (string, required): nanoERG fees taken during this bucket. Decimal string.
  - `periodY` (string, required)
  - `cumulativeX` (string, required): nanoERG fees taken from the start of the range to here. Decimal string.
  - `cumulativeY` (string, required)
- `partial` (boolean, required): True when the series does not reach back to the pool's start.

### 400: No pool history indexed, or an invalid range or bucket size.

`ApiError`

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

### 404: No live provision with that id.

`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 provision moved. Re-read to find its current box id.

`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

### 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/provisions/{boxId}/fees/history"
```

## Example response

```json
{
  "boxId": "ce00d6e0f4fd3390c0519bb0d24824e1e6b06978163f4845a7cf2c1c7d8f1b65",
  "history": [
    {
      "height": 1312460,
      "timestamp": 1765432100000,
      "periodX": "210000000",
      "periodY": "6350000",
      "cumulativeX": "8420000000",
      "cumulativeY": "254300000"
    }
  ],
  "partial": false
}
```
