Get Order History

API Description

Retrieves historical order data for a specific trader address. This endpoint provides comprehensive information about all past orders including filled and cancelled orders. Supports pagination and time range filtering.

HTTP Request

GET /v4/public/mm/order/history

Request Parameters

Parameter
Type
Required
Description

chainId

uint64

Yes

Chain ID (e.g., 143 for Monad mainnet)

address

string

Yes

Trader address (EVM address format)

symbol

string

No

Trading pair symbol (e.g., BTCUSDC)

startTime

int64

No

Start time in Unix timestamp (seconds). Default: 0

endTime

int64

No

End time in Unix timestamp (seconds). Default: current time

page

uint32

Yes

Page number (starts from 1)

size

uint32

Yes

Page size (max 200, default: 50)

Response Parameters

The response contains a data object with list (array of orders) and totalCount.

Parameter
Type
Description

data

object

Response data object

-> list

array

Array of order objects

-> totalCount

uint32

Total number of orders matching the query

-> list[].id

string

Order ID

-> list[].instrumentAddress

string

Instrument contract address

-> list[].expiry

uint32

Expiry timestamp (4294967295 for perpetual)

-> list[].placeTimestamp

uint64

Order placement timestamp (Unix timestamp in seconds)

-> list[].placeTxHash

string

Transaction hash of order placement

-> list[].size

string

Order size (absolute value)

-> list[].balance

string

Order balance (absolute value)

-> list[].takenSize

string

Filled size (absolute value)

-> list[].takenBalance

string

Filled balance (absolute value)

-> list[].orderPrice

string

Order price (in wei/smallest unit)

-> list[].feeRebate

string

Fee rebate amount

-> list[].type

uint32

Order type (0 = cancelled, 1 = filled)

-> list[].cancelTimestamp

uint64

Cancellation timestamp (0 if not cancelled)

-> list[].cancelTxHash

string

Cancellation transaction hash (empty if not cancelled)

-> list[].fillTimestamp

uint64

Fill timestamp (0 if not filled)

-> list[].fillTxHash

string

Fill transaction hash (empty if not filled)

-> list[].symbol

string

Trading pair symbol (e.g., BTC/USDC)

-> list[].baseToken

object

Base token information

-> list[].baseToken.address

string

Token contract address

-> list[].baseToken.symbol

string

Token symbol

-> list[].baseToken.decimals

number

Token decimals

-> list[].baseToken.image

string

Token image URL

-> list[].baseToken.price

number

Token price (USD)

-> list[].quoteToken

object

Quote token information

-> list[].quoteToken.address

string

Token contract address

-> list[].quoteToken.symbol

string

Token symbol

-> list[].quoteToken.decimals

number

Token decimals

-> list[].quoteToken.image

string

Token image URL

-> list[].quoteToken.price

number

Token price (USD)

-> list[].typeString

string

Order type string ("filled" or "cancelled")

-> list[].side

string

Order side ("long" or "short")

-> list[].tradeValue

string

Trade value (calculated from takenSize * orderPrice)

Request Example

Python (requests)

Note: This endpoint requires API authentication. See Quick Start Guide for signature generation details.

Example with optional parameters:

Response Example

Success Response

Error Response

Notes

  • This endpoint requires API authentication (see Quick Start Guide)

  • Required parameters: chainId, address, page, size

  • Optional parameters: symbol, startTime, endTime

  • Pagination: Uses page and size parameters (not cursor-based)

  • Page size: Maximum 200 records per page (default: 50)

  • Time format: startTime and endTime are Unix timestamps in seconds (not milliseconds)

  • Default time range: If not specified, startTime defaults to 0 and endTime defaults to current time

  • Order types:

    • type: 0 = Cancelled order

    • type: 1 = Filled order

  • Order side: "long" or "short" (string)

  • Size and balance: All size and balance values are absolute values (positive)

  • Taken fields: takenSize and takenBalance indicate how much of the order was filled

  • Timestamps: All timestamps are Unix timestamps in seconds

  • Transaction hashes: Empty string if the event hasn't occurred (e.g., cancelTxHash is empty for filled orders)

  • Token information: Includes base and quote token details with current prices

  • Trade value: Calculated as takenSize * orderPrice (0 for cancelled orders)

  • Symbol format: Returns as "BTC/USDC" format (with slash separator)

  • Expiry: 4294967295 indicates a perpetual contract

  • Response structure: Returns data object with list array and totalCount

  • Rate limit: 120 requests per minute

  • Success response has code: 0 (not 200)

Last updated