from py_clob_client.clob_types import TradeParams

resp = client.get_trades(
    TradeParams(
        maker_address=client.get_address(),
        market="0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af",
    ),
)
print(resp)
print("Done!")
This endpoint requires a L2 Header.

Get trades for the authenticated user based on the provided filters.

HTTP REQUEST

GET /<clob-endpoint>/data/trades

Request Parameters

NameRequiredTypeDescription
idnostringid of trade to fetch
takernostringaddress to get trades for where it is included as a taker
makernostringaddress to get trades for where it is included as a maker
marketnostringmarket for which to get the trades (condition ID)
beforenostringunix timestamp representing the cutoff up to which trades that happened before then can be included
afternostringunix timestamp representing the cutoff for which trades that happened after can be included

Response Format

NameTypeDescription
nullTrade[]list of trades filtered by query parameters

A Trade object is of the form:

NameTypeDescription
idstringtrade id
taker_order_idstringhash of taker order (market order) that catalyzed the trade
marketstringmarket id (condition id)
asset_idstringasset id (token id) of taker order (market order)
sidestringbuy or sell
sizestringsize
fee_rate_bpsstringthe fees paid for the taker order expressed in basic points
pricestringlimit price of taker order
statusstringtrade status (see above)
match_timestringtime at which the trade was matched
last_updatestringtimestamp of last status update
outcomestringhuman readable outcome of the trade
maker_addressstringfunder address of the taker of the trade
ownerstringapi key of taker of the trade
transaction_hashstringhash of the transaction where the trade was executed
bucket_indexintegerindex of bucket for trade in case trade is executed in multiple transactions
maker_ordersMakerOrder[]list of the maker trades the taker trade was filled against
typestringside of the trade: TAKER or MAKER

A MakerOrder object is of the form:

NameTypeDescription
order_idstringid of maker order
maker_addressstringmaker address of the order
ownerstringapi key of the owner of the order
matched_amountstringsize of maker order consumed with this trade
fee_rate_bpsstringthe fees paid for the taker order expressed in basic points
pricestringprice of maker order
asset_idstringtoken/asset id
outcomestringhuman readable outcome of the maker order
from py_clob_client.clob_types import TradeParams

resp = client.get_trades(
    TradeParams(
        maker_address=client.get_address(),
        market="0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af",
    ),
)
print(resp)
print("Done!")