---
title: GET /v1/fills
---

# `GET /v1/fills`

List fills

Fill history, cursor-paginated.

Money, price, rate and count fields cross the wire as decimal strings; units are shown beside each field ([Wire encoding](/api/wire-encoding)). Group: [Account](/api/reference/account/).

**Auth:** API key (`x-api-key`)

**Scope:** `read`

**Rate limit:** the `read` budget ([Rate limits](/api/rate-limits))

**Effect:** `read`: reads only

## Parameters

- <span id="param-limit"></span>`limit` (query) · string · optional: Page size, 1..200 (default is the endpoint's historical window, not a cap).
- <span id="param-beforeSeq"></span>`beforeSeq` (query) · string · optional: Cursor: return rows strictly before this sequence (decimal). Omit for page one.

## Request

```bash [curl]
curl -fsS "$HB/v1/fills" \
  -H "x-api-key: $HB_KEY"
```

```python [Python]
import os

import requests

HB = os.environ.get("HB", "https://testnet.hardbasis.com")

resp = requests.get(
    f"{HB}/v1/fills",
    headers={
        "x-api-key": os.environ["HB_KEY"],
    },
)
resp.raise_for_status()
print(resp.json())
```

```ts [TypeScript]
const HB = process.env.HB ?? "https://testnet.hardbasis.com";

const res = await fetch(`${HB}/v1/fills`, {
  method: "GET",
  headers: {
    "x-api-key": process.env.HB_KEY!,
  },
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
console.log(await res.json());
```

## Responses

- **200**: OK
  - <span id="res-200-fills"></span>`fills` · object[] · required
    - <span id="res-200-fills-orderId"></span>`orderId` · string · required
    - <span id="res-200-fills-accountId"></span>`accountId` · string · required
    - <span id="res-200-fills-marketId"></span>`marketId` · string · required
    - <span id="res-200-fills-side"></span>`side` · enum(`buy`, `sell`) · required
    - <span id="res-200-fills-closedContracts"></span>`closedContracts` · string · unit `contracts` · required
    - <span id="res-200-fills-openedContracts"></span>`openedContracts` · string · unit `contracts` · required
    - <span id="res-200-fills-execPriceQ8"></span>`execPriceQ8` · string · unit `q8` · required: Execution price: oracle midQ8 moved by spreadQ9 against the taker (buys above, sells below), snapped to the market's tick grid. Price impact is NOT included in this price: it is charged separately as impactMsat. The taker fee is also charged separately (feeMsat).
    - <span id="res-200-fills-oracle"></span>`oracle` · object · required
    - <span id="res-200-fills-spreadQ9"></span>`spreadQ9` · string · unit `q9` · required
    - <span id="res-200-fills-tradeNotionalMsat"></span>`tradeNotionalMsat` · string · unit `msat` · required: Not an account movement: the notional of closedContracts + openedContracts at execPriceQ8, always >= 0. feeMsat and margin are computed from it.
    - <span id="res-200-fills-feeMsat"></span>`feeMsat` · string · unit `msat` · required: Taker fee actually charged, after any referral discount. Charged separately from the price (not included in execPriceQ8). Positive means debited from the account's free balance; never negative.
    - <span id="res-200-fills-impactMsat"></span>`impactMsat` · string · unit `msat` · required: Signed price-impact charge, charged separately: NOT included in execPriceQ8. Positive means debited from the account (an impact fee paid to the vault); negative means credited to the account (an impact rebate, capped at the impact the account paid over the trailing window; any excess is rebateDivertedMsat).
    - <span id="res-200-fills-rebateDivertedMsat"></span>`rebateDivertedMsat` · string · unit `msat` · required: Not an account movement: the part of an earned impact rebate withheld by the anti-cycling cap and routed to the insurance fund. Never credited to the account; >= 0.
    - <span id="res-200-fills-realizedPnlMsat"></span>`realizedPnlMsat` · string · unit `msat` · required: Realized PnL of closedContracts at execPriceQ8 against the entry price. Positive means credited to the account's free balance; negative means debited from the account (released margin first, then the position's remaining margin; any loss beyond that is deficitMsat). Fee, impact and funding are charged separately and not included.
    - <span id="res-200-fills-fundingSettledMsat"></span>`fundingSettledMsat` · string · unit `msat` · required: Funding accrued since the position's funding clock, settled into position margin at this fill before execution. Positive means credited to the account (received into position margin); negative means debited from the account (paid out of position margin, moved only up to that margin). Charged separately: not included in realizedPnlMsat, feeMsat or execPriceQ8. 0 when no position was open.
    - <span id="res-200-fills-releasedMarginMsat"></span>`releasedMarginMsat` · string · unit `msat` · required: Margin released for the closed portion. Positive means credited to the account's free balance, moved from its own reserved margin (an internal transfer, not new money); >= 0.
    - <span id="res-200-fills-reservedMarginMsat"></span>`reservedMarginMsat` · string · unit `msat` · required: Initial margin reserved for openedContracts. Positive means debited from the account's free balance into its reserved margin (an internal transfer); >= 0.
    - <span id="res-200-fills-deficitMsat"></span>`deficitMsat` · string · unit `msat` · required: Not an account movement: loss the account's margin could not cover on a bankrupt close, absorbed by the insurance fund. Never debited from the account; >= 0.
    - <span id="res-200-fills-referral"></span>`referral` · object \| null · optional
    - <span id="res-200-fills-positionAfter"></span>`positionAfter` · object \| null · required
    - <span id="res-200-fills-sizeShares"></span>`sizeShares` · string \| null · optional
    - <span id="res-200-fills-seq"></span>`seq` · string · unit `seq` · required
    - <span id="res-200-fills-tsMs"></span>`tsMs` · string · unit `ms` · required
  - <span id="res-200-nextBeforeSeq"></span>`nextBeforeSeq` · string \| null · unit `seq` · required

Example `200` response:

```json
{
  "fills": [
    {
      "orderId": "string",
      "accountId": "string",
      "marketId": "string",
      "side": "buy",
      "closedContracts": "100000",
      "openedContracts": "100000",
      "execPriceQ8": "100000",
      "oracle": {
        "midQ8": "100000",
        "confQ9": "100000",
        "tsMs": "100000"
      },
      "spreadQ9": "100000",
      "tradeNotionalMsat": "100000",
      "feeMsat": "100000",
      "impactMsat": "100000",
      "rebateDivertedMsat": "100000",
      "realizedPnlMsat": "100000",
      "fundingSettledMsat": "100000",
      "releasedMarginMsat": "100000",
      "reservedMarginMsat": "100000",
      "deficitMsat": "100000",
      "referral": {
        "code": "string",
        "grossFeeMsat": "100000",
        "discountMsat": "100000",
        "rewardMsat": "100000",
        "policyVersion": "100000"
      },
      "positionAfter": {
        "side": "long",
        "contracts": "100000",
        "entryPriceQ8": "100000",
        "marginMsat": "100000"
      },
      "sizeShares": "string",
      "seq": "100000",
      "tsMs": "100000"
    }
  ],
  "nextBeforeSeq": "100000"
}
```

## Errors

Every refusal carries a stable `code` from [`ErrorCode`](/api/reference/all#errorcode) beside human `error` prose; match on the code. See [Errors](/api/errors).

- **401**: A refusal carrying a stable machine `code` (ErrorCode) beside human `error` prose.
- **403**: A refusal carrying a stable machine `code` (ErrorCode) beside human `error` prose.
- **429**: A token bucket is exhausted.
