---
title: GET /v1/positions
---

# `GET /v1/positions`

List positions

The account's open positions.

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

## Request

```bash [curl]
curl -fsS "$HB/v1/positions" \
  -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/positions",
    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/positions`, {
  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
  - array of object, each:
    - <span id="res-200-item-marketId"></span>`marketId` · string · required
    - <span id="res-200-item-side"></span>`side` · enum(`long`, `short`) · required
    - <span id="res-200-item-contracts"></span>`contracts` · string · unit `contracts` · required
    - <span id="res-200-item-sizeShares"></span>`sizeShares` · string \| null · optional
    - <span id="res-200-item-entryPriceQ8"></span>`entryPriceQ8` · string · unit `q8` · required: Contract-weighted average execPriceQ8 of the opening fills. Fees and impact are not included in it (they are charged separately on each fill).
    - <span id="res-200-item-marginMsat"></span>`marginMsat` · string · unit `msat` · required: Not an account movement: a balance, the margin held on this position, including funding already settled into it. Funding accrued since fundingClockTsMs is NOT included yet.
    - <span id="res-200-item-fundingClockTsMs"></span>`fundingClockTsMs` · string · unit `ms` · required: Funding accrues from this time and is not yet in marginMsat. It settles into marginMsat (positive means credited to the account, negative debited) at the next hourly boundary, fill or liquidation.

Example `200` response:

```json
[
  {
    "marketId": "string",
    "side": "long",
    "contracts": "100000",
    "sizeShares": "string",
    "entryPriceQ8": "100000",
    "marginMsat": "100000",
    "fundingClockTsMs": "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.
