Get Trades
Returns the authenticated user’s trade history with pagination. Results can be narrowed by market, asset, time window, or maker address.
Endpoint
Section titled “Endpoint”GET /data/trades
Base URL: https://api.openfish.fun
Authentication
Section titled “Authentication”L2 authentication required. All five OPENFISH_* headers must be present.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | No | Trade ID to filter by |
maker_address | string | No | Maker address to filter by |
market | string | No | Condition ID to filter trades by market |
asset_id | string | No | Token ID to filter trades by asset |
before | integer | No | UNIX timestamp — return trades before this time |
after | integer | No | UNIX timestamp — return trades after this time |
next_cursor | string | No | Cursor for pagination |
Response
Section titled “Response”{ "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 } ]}Trade Schema
Section titled “Trade Schema”| Field | Type | Description |
|---|---|---|
id | string | Trade UUID |
taker_order_id | string | UUID of the taker’s triggering order |
market | string | Condition ID |
asset_id | string | Token ID |
side | string | BUY or SELL |
size | string | Filled quantity |
price | string | Execution price |
fee_rate_bps | string | Fee rate in basis points |
status | string | Trade lifecycle status |
match_time | string | UNIX timestamp of the match event |
outcome | string | Market outcome label (Yes/No) |
trader_side | string | TAKER or MAKER |
maker_fee | string | Fee charged to the maker |
taker_fee | string | Fee charged to the taker |
transaction_hash | string | On-chain transaction hash (populated after settlement) |
error_msg | string|null | Diagnostic message when the trade encountered an error |
Example
Section titled “Example”# Get all tradescurl 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 rangecurl "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: ..."