tradesByTime
Market trades of the last 24 hours, in the WebSocket trades shape, by time, optionally filtered by coin.
Market trades of the last 24 hours. Each trade is exactly what the trades WebSocket channel sent for it, so a client can backfill a gap in its stream and get identical objects.
POST Request
type
string
Required. "tradesByTime"
startTime
number
Required unless cursor is given. Inclusive, milliseconds. A value older than 24 hours is moved forward to 24 hours ago.
endTime
number
Optional. Inclusive, milliseconds. Default: now.
cursor
string
Optional. The cursor from the previous response. Pass it back unchanged. A cursor older than 24 hours resumes at 24 hours ago.
coin
string
Optional. Only trades on this coin, e.g. "BTC", "xyz:GOLD", "@107", "#40080".
dex
string
Optional. "main_dex" or a HIP-3 dex such as "xyz".
limit
number
Optional. Default and maximum 2000.
Trades are returned oldest-first, in the order the WebSocket sent them. A range that lies entirely before the last 24 hours returns no trades.
curl -X POST https://api.hydromancer.xyz/info \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"type": "tradesByTime",
"coin": "BTC",
"startTime": 1786000000000,
"limit": 100
}'import requests
resp = requests.post(
"https://api.hydromancer.xyz/info",
headers={"X-API-Key": "YOUR_API_KEY"},
json={
"type": "tradesByTime",
"coin": "BTC",
"startTime": 1786000000000,
"limit": 100,
},
)
page = resp.json()Pagination
While hasMore is true, repeat the request with the response's cursor instead of startTime. On the last page hasMore is false and cursor is absent.
The cursor is opaque. Trades carry no field it could be built from, because a mirrored outcome trade and the trade it mirrors share every field the WebSocket sends.
Response Fields
trades
array
Trades, each in the WebSocket trades shape
hasMore
boolean
true when another page follows
cursor
string
Pass to the next request. Absent on the last page
Each trade:
coin
string
Coin
side
string
The taker's side: "B" bought, "A" sold
px
string
Price
sz
string
Size
hash
string
Transaction hash
time
number
Block time, milliseconds
tid
number
Trade id
users
array
[buyer, seller]
On outcome markets a trade on one side also appears on the other side's coin, at 1 − px with the side and the users swapped, as on the WebSocket.
Last updated