> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sfcompute.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Orderbook

> Read the public orderbook: orders, windows, quotes, depth, and fills

> [!NOTE]
>
> This feature is in [public preview](https://docs.sfcompute.com/preview/roadmap.md#feature-states).

The orderbook is the public, anonymized record of buy and sell orders on the market. Each order
states its side, node count, SKU, delivery window, and limit price.

The diagram below shows 3 example open orders.

![Orderbook with three example open orders: a Buy for 8 H100s on Sep 1 9am to Sep 4 5pm at up to \$17.42/node-hour, a Sell for 4 B200s on the same window at \$17.38 minimum, and a Buy for 16 H200s on Oct 15 12am to Oct 22 12am at up to \$16.95.](https://mintcdn.com/sfcompute/FOad7tCEiZswvZiC/preview/images/orderbook-concept.svg?fit=max\&auto=format\&n=FOad7tCEiZswvZiC\&q=85\&s=d92445d0769bf2810566c07fedc69589)

The trading engine matches compatible buys and sells continuously. Open orders make up the live
book; filled orders and their executions provide market history. Orderbook responses never
expose participant, pool, or capacity identity.

Endpoints live under `/preview/v2/orderbook/` and require a Bearer token; see
[Using the API](https://docs.sfcompute.com/preview/using-the-api.md).

* [`/orders`](#orders) lists individual open and filled orders.
* [`/windows`](#windows) lists active SKU and delivery-window combinations in a time range.
* [`/quote`](#quote) returns the top of book (best bid and best ask) for one exact window.
* [`/depth`](#depth) returns the live book aggregated at every SKU and price level.
* [`/fills`](#fills) lists individual executions produced when orders match.

`/windows`, `/quote`, and `/depth` are derived views of open orders, while `/fills` is an
execution-level view. Use `/windows` when you don't yet know the exact window. The other endpoints
price or trace a window you've already picked. To create, cancel, or inspect your own workspace's
orders, see [Orders](https://docs.sfcompute.com/preview/orders.md).

The hardware filter is `?requirements=key:value`. Keys are SKU property names such as
`accelerator`, `region`, or `availability_zone`. Values are case-sensitive and match the property's
value spelling, as in `accelerator:h100`. Run `sf skus list` to see the properties a SKU
carries.

Each key takes exactly one value; combine keys with `;` to require all of them, as in
`accelerator:h100;availability_zone:a`. The reserved `instance_sku` key matches a single SKU by its
ID. The filter covers every SKU that satisfies these requirements.

All timestamps are Unix epoch seconds. Field names use the `_at` suffix. Delivery-window and range
boundaries (`start_at`, `end_at`, `range_start_at`, and `range_end_at`) must be aligned to whole
minutes.

## Orders

List individual open and filled orders whose delivery windows match a time range. Delivery must
start no earlier than 30 days before the request, regardless of when the order was created.
Results are anonymized and sorted newest first by `created_at`.

```http theme={null}
GET /preview/v2/orderbook/orders?requirements=accelerator:h100&range_start_at=1777507200&range_end_at=1780099200&window_relation=overlaps&status=open

{
  "object": "list",
  "requirements": { "accelerator": ["h100"] },
  "range_start_at": 1777507200,
  "range_end_at":   1780099200,
  "window_relation": "overlaps",
  "requested_at": 1777426010,
  "has_more": false,
  "data": [
    {
      "id": "ordr_JLBu4arl9nSLMfF2Ole",
      "allow_partial": false,
      "instance_sku": "sku_k3R-nX9vLm7Qp2Yw5Jd8F",
      "side": "buy",
      "status": "open",
      "allocation_schedule_delta": [
        { "start_at": 1777507200, "end_at": 1778112000, "node_count": 8 }
      ],
      "filled_allocation_schedule_delta": [
        { "start_at": 1777507200, "end_at": 1778112000, "node_count": 3 }
      ],
      "limit_price_dollars_per_node_hour": "17.420000",
      "filled_average_price_dollars_per_node_hour": "17.400000",
      "created_at": 1777426010
    }
  ]
}
```

`open` includes standing and partially filled orders; `filled` means the order filled completely.
Pending, cancelled, and rejected orders are not returned. Omit `status` to include both public
statuses, or repeat it to select more than one. Use `side=buy` for buys or `side=sell` for sells.
Use `allow_partial=false` to list only all-or-nothing orders, or `allow_partial=true` for orders
that may fill partially; omit it to include both.

Delivery windows are half-open ranges: `[start_at, end_at)`. `window_relation=overlaps` is the
default. `contained_within` requires the order's full window to be inside the requested range.
`exact` requires the windows to match.

The range is capped at 30 days. `limit` defaults to 50 and caps at 200; pass the returned `cursor`
as `starting_after` to fetch the next page. The cursor must not reference an order created in the
future; such cursors return a 422 response.

## Windows

Enumerate every SKU and delivery window that currently has open orders matching the
requirements filter, within a time range.

![Three example delivery windows displayed as horizontal bars on a Sep 1 to Sep 29 time axis, each showing its bid and ask counts.](https://mintcdn.com/sfcompute/ekPsBVIJC-6oCHIH/preview/images/orderbook-windows.svg?fit=max\&auto=format\&n=ekPsBVIJC-6oCHIH\&q=85\&s=65441019b963211550401583ea90a8cf)

```http theme={null}
GET /preview/v2/orderbook/windows?requirements=accelerator:h100&range_start_at=1777507200&range_end_at=1780099200

{
  "object": "list",
  "requirements": { "accelerator": ["h100"] },
  "range_start_at": 1777507200,
  "range_end_at":   1780099200,
  "has_more": false,
  "data": [
    {
      "instance_sku": "sku_k3R-nX9vLm7Qp2Yw5Jd8F",
      "start_at": 1777507200,
      "end_at":   1778112000,
      "duration_hours": 168,
      "total_bid_order_count": 3,
      "total_ask_order_count": 5,
      "best_bid": {
        "instance_sku": "sku_k3R-nX9vLm7Qp2Yw5Jd8F",
        "dollars_per_node_hour": "17.380000",
        "allocation_schedule_delta": [
          { "start_at": 1777507200, "end_at": 1778112000, "node_count": 4 }
        ]
      },
      "best_ask": {
        "instance_sku": "sku_k3R-nX9vLm7Qp2Yw5Jd8F",
        "dollars_per_node_hour": "17.420000",
        "allocation_schedule_delta": [
          { "start_at": 1777507200, "end_at": 1778112000, "node_count": 2 }
        ]
      }
    },
    {
      "instance_sku": "sku_q7T-mB4cV9xL2pR6wN8sJ",
      "start_at": 1777593600,
      "end_at":   1778198400,
      "duration_hours": 168,
      "total_bid_order_count": 0,
      "total_ask_order_count": 1,
      "best_ask": {
        "instance_sku": "sku_q7T-mB4cV9xL2pR6wN8sJ",
        "dollars_per_node_hour": "16.950000",
        "allocation_schedule_delta": [
          { "start_at": 1777593600, "end_at": 1778198400, "node_count": 8 }
        ]
      }
    }
  ]
}
```

A window appears when it holds at least one matching open order and sits entirely within the range.
`best_bid` / `best_ask` are omitted when that side is empty. Results are sorted ascending by
`(start_at, end_at, instance_sku)` and cursor-paginated. `limit` defaults to 50 and caps at 200; the
range is capped at 365 days.

## Quote

Get the top of book for one exact window: the highest bid and lowest ask.

![A vertical price ladder showing best ask of \$17.42 with 2 nodes above best bid of \$17.38 with 4 nodes, with a vertical bracket between them labeled spread \$0.04.](https://mintcdn.com/sfcompute/FOad7tCEiZswvZiC/preview/images/orderbook-quote.svg?fit=max\&auto=format\&n=FOad7tCEiZswvZiC\&q=85\&s=33afe12b0ec1829c50033e2e82a347dc)

```http theme={null}
GET /preview/v2/orderbook/quote?requirements=accelerator:h100&start_at=1777507200&end_at=1778112000

{
  "requirements": { "accelerator": ["h100"] },
  "start_at": 1777507200,
  "end_at":   1778112000,
  "requested_at": 1777426010,
  "best_bid": {
    "instance_sku": "sku_k3R-nX9vLm7Qp2Yw5Jd8F",
    "dollars_per_node_hour": "17.380000",
    "allocation_schedule_delta": [
      { "start_at": 1777507200, "end_at": 1778112000, "node_count": 4 }
    ]
  },
  "best_ask": {
    "instance_sku": "sku_k3R-nX9vLm7Qp2Yw5Jd8F",
    "dollars_per_node_hour": "17.420000",
    "allocation_schedule_delta": [
      { "start_at": 1777507200, "end_at": 1778112000, "node_count": 2 }
    ]
  }
}
```

Each side carries an `allocation_schedule_delta`: the unfilled nodes at that rate and SKU
over time. If multiple SKUs tie at the best price, the quote returns the SKU that sorts
first by ID. Use `/depth` to inspect every SKU at that price. The window's `end_at` must be in the
future; read past windows through [`/fills`](#fills).

## Depth

Get the depth of book aggregated by SKU and dollars-per-node-hour rate across the hardware
matching the requirements filter.

![Level II ladder showing two ask price levels above the spread and three bid price levels below, with horizontal bars whose lengths encode the node count at each price.](https://mintcdn.com/sfcompute/FOad7tCEiZswvZiC/preview/images/orderbook-depth.svg?fit=max\&auto=format\&n=FOad7tCEiZswvZiC\&q=85\&s=c6dc2019e4559fb16aa53f2025691aa9)

```http theme={null}
GET /preview/v2/orderbook/depth?requirements=accelerator:h100&start_at=1777507200&end_at=1778112000&depth=20

{
  "requirements": { "accelerator": ["h100"] },
  "start_at": 1777507200,
  "end_at":   1778112000,
  "requested_at": 1777426010,
  "bids": [
    {
      "instance_sku": "sku_k3R-nX9vLm7Qp2Yw5Jd8F",
      "dollars_per_node_hour": "17.380000",
      "allocation_schedule_delta": [
        { "start_at": 1777507200, "end_at": 1778112000, "node_count": 4 }
      ]
    },
    {
      "instance_sku": "sku_k3R-nX9vLm7Qp2Yw5Jd8F",
      "dollars_per_node_hour": "17.370000",
      "allocation_schedule_delta": [
        { "start_at": 1777507200, "end_at": 1778112000, "node_count": 6 }
      ]
    }
  ],
  "asks": [
    {
      "instance_sku": "sku_k3R-nX9vLm7Qp2Yw5Jd8F",
      "dollars_per_node_hour": "17.420000",
      "allocation_schedule_delta": [
        { "start_at": 1777507200, "end_at": 1778112000, "node_count": 2 }
      ]
    },
    {
      "instance_sku": "sku_k3R-nX9vLm7Qp2Yw5Jd8F",
      "dollars_per_node_hour": "17.430000",
      "allocation_schedule_delta": [
        { "start_at": 1777507200, "end_at": 1778112000, "node_count": 5 }
      ]
    }
  ]
}
```

Bids are sorted by descending rate (best bid first); asks are ascending. Orders at the same
rate and SKU collapse into one level. `depth` defaults to 20 and caps at 100 per side. The
window's `end_at` must be in the future; read past windows through [`/fills`](#fills).

## Fills

List individual executions for one exact delivery window. A single order can produce multiple
fills, and each fill records the nodes and price that actually traded.

```http theme={null}
GET /preview/v2/orderbook/fills?requirements=accelerator:h100&start_at=1777507200&end_at=1778112000&since_at=1777420800

{
  "object": "list",
  "requirements": { "accelerator": ["h100"] },
  "start_at": 1777507200,
  "end_at":   1778112000,
  "requested_at": 1777426010,
  "has_more": false,
  "data": [
    {
      "instance_sku": "sku_k3R-nX9vLm7Qp2Yw5Jd8F",
      "dollars_per_node_hour": "17.400000",
      "allocation_schedule_delta": [
        { "start_at": 1777507200, "end_at": 1778112000, "node_count": 3 }
      ],
      "filled_at": 1777424010
    }
  ]
}
```

`since_at` is a lower bound on when the fill was recorded. It defaults to 7 days before the request.
Values more than 30 days before the request return 422.

Results are sorted newest first and cursor-paginated. `limit` defaults to 50 and caps at 200.

## Allocation schedule deltas

`allocation_schedule_delta` describes how many nodes an order requests or offers during one or
more time intervals.

![An allocation\_schedule\_delta JSON entry mapped to eight nodes over a time interval. start\_at supplies the time for vertices A and B, end\_at supplies the time for C and D, and node\_count supplies the value for B and C.](https://mintcdn.com/sfcompute/FOad7tCEiZswvZiC/preview/images/orderbook-allocation-schedule.svg?fit=max\&auto=format\&n=FOad7tCEiZswvZiC\&q=85\&s=42d3e00c492dc61e4dd708772748e119)

Each object in the array is one schedule segment. `start_at` and `end_at` set the segment's time
bounds, while `node_count` specifies how many nodes apply during that interval. Multiple entries
can describe different node counts over adjacent intervals.

Schedule entries describe half-open intervals `[start_at, end_at)`: the node count applies at
`start_at`, but not at `end_at`. Adjacent entries therefore meet without overlapping. All segments
on an order refer to that order's single `instance_sku`.

In responses, a non-empty array always ends with a terminator entry whose `end_at` is `null` and
`node_count` is `0`, marking the schedule as open-ended and empty after the last segment. A schedule
with no capacity is returned as an empty array. Requests carry only the closed `[start_at, end_at)`
segments you submit and omit this terminator.

Orders are submitted with one node count over one delivery window, so
`allocation_schedule_delta` normally contains one segment. `filled_allocation_schedule_delta`
describes the portion that has executed so far and may contain multiple segments when different
parts of the order fill over different intervals. Subtract the filled node count from the
requested or offered node count at each instant to get the capacity that remains on the book.

For a buy, every filled segment adds to the destination pool's allocation schedule; for a sell, it
removes that segment. An orderbook fill reports the exact schedule segment that traded. To
calculate the compute represented by a schedule, sum `node_count × duration_hours` across its
entries.

## API reference

See the [Orderbook API reference](https://docs.sfcompute.com/api-reference/orderbook/list-market-windows.md) for full
request and response schemas.
