# Your settled positions and closed offers

`GET /forwards/history` · Lithos client API · Difficulty Forwards · requires the `api_key` header

Source: https://lithosprotocol.org/docs/api/get-df-history

Every position this wallet held a side of that has been settled or refunded, with what it received and its net after margins and rewards, and every offer it made that was filled or cancelled. Newest first, at most 200 of each. A settlement still unconfirmed appears once it confirms.

## Responses

### 200: This wallet's history

`DFHistory`

- `height` (integer · int32, required)
- `settled` (DFSettledView[], required)
  - `boxId` (string, required)
  - `side` (string, required, one of long, short, both)
  - `strike` (string, required)
  - `notional` (string, required)
  - `margin` (string, required)
  - `windowStart` (integer · int32, required)
  - `windowLength` (integer · int32, required)
  - `windowEnd` (integer · int32, required)
  - `txId` (string, required): The settlement transaction.
  - `settledHeight` (integer · int32, required)
  - `settledAt` (integer · int64, required): Unix milliseconds of the block that confirmed the settlement.
  - `refund` (boolean, required): Whether each side got its margin back because the window had left the accumulator.
  - `windowMean` (string): The window's mean difficulty as the settlement read it. Absent for a refund.
  - `payout` (string, required): LIT base units the long side received on top of its margin, negative when the short side was paid.
  - `received` (string, required): LIT base units this wallet's side or sides received, margins included.
  - `net` (string, required): `received` less what this wallet put in: each side's margin and its 7.5 LIT of rewards.
- `offers` (DFPastOffer[], required)
  - `boxId` (string, required)
  - `makerSide` (string, required, one of long, short)
  - `strike` (string, required)
  - `notional` (string, required)
  - `windowStart` (integer · int32, required)
  - `windowLength` (integer · int32, required)
  - `expiry` (integer · int32, required)
  - `outcome` (string, required, one of filled, cancelled)
  - `txId` (string, required): The transaction that filled or cancelled it.
  - `height` (integer · int32, required)
  - `timestamp` (integer · int64, required)
  - `positionBoxId` (string): The position a fill created.
- `realizedNet` (string, required): The sum of every settled position's `net`, in LIT base units.
- `wins` (integer, required): Settled positions with a positive `net`.
- `losses` (integer, required): Settled positions with a negative `net`.
- `truncated` (boolean, required): Whether a scan stopped at its cap, so older history may be missing.

### 403: Missing or wrong api_key

`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 index unavailable. Never returns a partial list.

`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/forwards/history" \
  -H "api_key: $LITHOS_API_KEY"
```

## Example response

```json
{
  "height": 0,
  "settled": [
    {
      "boxId": "string",
      "side": "long",
      "strike": "string",
      "notional": "string",
      "margin": "string",
      "windowStart": 0,
      "windowLength": 0,
      "windowEnd": 0,
      "txId": "string",
      "settledHeight": 0,
      "settledAt": 0,
      "refund": true,
      "windowMean": "string",
      "payout": "string",
      "received": "string",
      "net": "string"
    }
  ],
  "offers": [
    {
      "boxId": "string",
      "makerSide": "long",
      "strike": "string",
      "notional": "string",
      "windowStart": 0,
      "windowLength": 0,
      "expiry": 0,
      "outcome": "filled",
      "txId": "string",
      "height": 0,
      "timestamp": 0,
      "positionBoxId": "string"
    }
  ],
  "realizedNet": "string",
  "wins": 0,
  "losses": 0,
  "truncated": true
}
```
