API Reference

REST API methods for listing markets, fetching market details, and querying wallet positions.

Overview

All REST API methods read data from the Delphi API and require DELPHI_API_ACCESS_KEY to be set (except health()).

health()

Check service availability. Does not require authentication.

const { status } = await client.health();

Markets

listMarkets(params)

Retrieve markets with optional filtering and pagination using listMarkets.

const { markets } = await client.listMarkets({
  status: "open",
  category: "crypto",
  orderBy: "liquidity",    // "liquidity" | "created" | "settles_at"
  verifiable: true,
  skip: 0,
  limit: 50,
});

Parameters

Field
Type
Default
Description

skip

number

0

Pagination offset

limit

number

50

Max records returned

status

string

"open" | "closed" | "settled"

category

string

Filter by metadata category field

getMarket(params)

Retrieve a single market by ID.

This returns the same Market type. The id comes from listMarkets.

Market Type

Metadata Shape

The key address fields here are:

Field
Purpose

market.id

Pass to getMarket({ id })

market.implementation

Pass as marketAddress to all SDK trading, quote, and approval calls

Market Status Values

Status
Meaning

open

Trading active

awaiting_settlement

Trading deadline passed, awaiting settlement

settled

Winner submitted, positions redeemable

expired

Market expired without settlement (positions not redeemable)

The API returns these as strings.

The underlying contract exposes them as an int enum: 0 -> open, 1 -> awaiting_settlement, 2 -> settled, 3 -> expired.

Usage Patterns

You can paginate through all markets like this:

Or, find a market using a question keyword:

Positions

listPositions(params)

Retrieve positions for a wallet address.

Position Type

Be careful when parsing, because shares and tokensRedeemed are string representations of bigints.

Redemption

Markets must be settled (winner submitted) before redeeming. Only holders of the winning outcome receive tokens.

1. Single (Market) Redemption

2. Batch (Market) Redemption

3. Batch-Redeeming all Unredeemed, Settled Positions

Estimating Portfolio Value

Estimate the current liquidation value of all active positions:

Last updated