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
skip
number
0
Pagination offset
limit
number
50
Maximum records returned
status
MarketStatus
—
"open" | "awaiting_settlement" | "settled" | "expired" | "failed"
category
string
—
Filter by metadata category
orderBy
string
liquidity
liquidity, created, or settles_at
competitionId
string
Active competition
Competition to query
verifiable
boolean
—
Filter by verifiable settlement
pricesAndImpliedProbabilities
boolean
—
Include prices and implied probabilities
getMarket(params)
Retrieve a single market by ID.
Market Type
Metadata Shape
The key address fields here are:
market.id
Pass to getMarket({ id })
market.id
Pass as marketAddress to SDK trading, quote, and approval calls
market.implementation
Implementation contract address; do not use as marketAddress
Market Status Values
open
Trading active
awaiting_settlement
Trading deadline passed, awaiting settlement
settled
Winning outcome set; positions redeemable
expired
Market expired without settlement; liquidate positions
failed
Oracle could not resolve the market; liquidate positions
A winning outcome is set by the oracle on automated-settlement markets. Legacy markets use the creator's winner submission.
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
4. Liquidating Expired or Failed Positions
getMarketStatus() reads the current on-chain status. Use it when REST data may be stale.
Estimating Portfolio Value
Estimate the current liquidation value of all active positions:
Last updated
Was this helpful?
