Skip to content

Get Trades

Returns the authenticated user’s trade history with pagination. Results can be narrowed by market, asset, time window, or maker address.

GET /data/trades

Base URL: https://api.openfish.fun

L2 authentication required. All five OPENFISH_* headers must be present.

ParameterTypeRequiredDescription
idstringNoTrade ID to filter by
maker_addressstringNoMaker address to filter by
marketstringNoCondition ID to filter trades by market
asset_idstringNoToken ID to filter trades by asset
beforeintegerNoUNIX timestamp — return trades before this time
afterintegerNoUNIX timestamp — return trades after this time
next_cursorstringNoCursor for pagination
{
"limit": 100,
"next_cursor": "LT100",
"count": 1,
"data": [
{
"id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"taker_order_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"market": "0x0000...0001",
"asset_id": "0xabc123...",
"side": "BUY",
"size": "50.00",
"price": "0.50",
"fee_rate_bps": "10",
"status": "MATCHED",
"match_time": "1700000000",
"last_update": "1700000000",
"outcome": "Yes",
"bucket_index": 0,
"owner": "api-key-uuid",
"maker_address": "0x1234...",
"maker_orders": [
{
"order_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"owner": "maker-api-key-uuid",
"maker_address": "0x5678...",
"matched_amount": "50.00"
}
],
"transaction_hash": "",
"trader_side": "TAKER",
"maker_fee": "0",
"taker_fee": "0.0625",
"error_msg": null
}
]
}
FieldTypeDescription
idstringTrade UUID
taker_order_idstringUUID of the taker’s triggering order
marketstringCondition ID
asset_idstringToken ID
sidestringBUY or SELL
sizestringFilled quantity
pricestringExecution price
fee_rate_bpsstringFee rate in basis points
statusstringTrade lifecycle status
match_timestringUNIX timestamp of the match event
outcomestringMarket outcome label (Yes/No)
trader_sidestringTAKER or MAKER
maker_feestringFee charged to the maker
taker_feestringFee charged to the taker
transaction_hashstringOn-chain transaction hash (populated after settlement)
error_msgstring|nullDiagnostic message when the trade encountered an error
Terminal window
# Get all trades
curl https://api.openfish.fun/data/trades \
-H "OPENFISH_ADDRESS: 0x..." \
-H "OPENFISH_SIGNATURE: ..." \
-H "OPENFISH_TIMESTAMP: 1700000000" \
-H "OPENFISH_API_KEY: ..." \
-H "OPENFISH_PASSPHRASE: ..."
# Filter by market and time range
curl "https://api.openfish.fun/data/trades?market=0x0000...0001&after=1700000000" \
-H "OPENFISH_ADDRESS: 0x..." \
-H "OPENFISH_SIGNATURE: ..." \
-H "OPENFISH_TIMESTAMP: 1700000000" \
-H "OPENFISH_API_KEY: ..." \
-H "OPENFISH_PASSPHRASE: ..."