Reya DEX REST API
Base URL
https://api.reya.xyz/
Table of Contents
Private Trading Endpoints
The following endpoints require authentication and are used for placing and managing orders.
Create Order
Creates a new order on the Reya DEX. Supports both limit orders and trigger orders (take profit/stop loss).
Endpoint: POST /api/trading/create-order
Request Body:
accountId
number
Yes
The account ID to place the order for
marketId
number
Yes
The market ID to place the order in
exchangeId
number
Yes
The exchange ID where the order will be placed
isBuy
boolean
Yes
Whether this is a buy order (true) or sell order (false)
price
string
Yes
The price for the order as a string
size
string
Yes
The size/amount for the order as a string
reduceOnly
boolean
Yes
Whether this order should only reduce existing position
type
OrderType
Yes
Order type configuration (limit or trigger)
signature
string
Yes
Cryptographic signature for the order
nonce
number
Yes
Unique nonce for the order
signerWallet
string
Yes
The wallet address of the signer
expiresAfter
number
Conditional
Timestamp deadline for order expiration. Required for IOC orders, forbidden for GTC and trigger orders
OrderType:
For limit orders:
{
"limit": {
"timeInForce": "IOC" | "GTC"
}
}
For trigger orders (take profit/stop loss):
{
"trigger": {
"triggerPx": "string",
"tpsl": "TP" | "SL"
}
}
Response Fields:
success
boolean
Whether the order creation was successful
orderId
string
The ID of the created order. Only populated for GTC limit orders and trigger orders (SL/TP)
transactionHash
string
The transaction hash of the executed order. Only populated for IOC orders
error
string
Error message (if unsuccessful)
Example Request:
{
"accountId": 12345,
"marketId": 2,
"exchangeId": 1,
"isBuy": true,
"price": "43000.00",
"size": "0.1",
"reduceOnly": false,
"type": {
"limit": {
"timeInForce": "GTC"
}
},
"signature": "0x...",
"nonce": 1234567890,
"signerWallet": "0x..."
}
Example IOC Order with expiresAfter:
{
"accountId": 12345,
"marketId": 2,
"exchangeId": 1,
"isBuy": true,
"price": "43000.00",
"size": "0.1",
"reduceOnly": false,
"type": {
"limit": {
"timeInForce": "IOC"
}
},
"expiresAfter": 1672531200,
"signature": "0x...",
"nonce": 1234567890,
"signerWallet": "0x..."
}
Example Response for GTC/Trigger Orders:
{
"success": true,
"orderId": "order_123456"
}
Example Response for IOC Orders:
{
"success": true,
"transactionHash": "0x1234567890abcdef..."
}
Cancel Order
Cancels an existing order on the Reya DEX.
Endpoint: POST /api/trading/cancel-order
Request Body:
orderId
string
Yes
The ID of the order to cancel
signature
string
Yes
Cryptographic signature for the cancellation
Response Fields:
success
boolean
Whether the order cancellation was successful
orderId
string
The ID of the cancelled order
error
string
Error message (if unsuccessful)
Example Request:
{
"orderId": "order_123456",
"signature": "0x..."
}
Example Response:
{
"success": true,
"orderId": "order_123456"
}
Market Information
Get Markets
Returns a list of all markets, with some additional information for each market. Endpoint: GET /api/trading/markets
Parameters: None
Response Fields:
id
string
Unique identifier for the market
assetPairId
string
Asset pair identifier for the market
ticker
string
Trading pair symbol (e.g., "BTC-rUSD")
markPrice
number
Current mark price of the asset
isActive
boolean
Whether the market is currently active
maxLeverage
number
Maximum leverage allowed for this market
description
string
Description of the market
name
string
Always set to market
tickSizeDecimals
number
Number of decimal places for the tick size, e.g. 'tickSizeDecimals' 2 means tick size is 0.01
priority
number
Display priority for the market // TODO what's this? Always set to 0 right now
Example Response:
[
{
"id": "2",
"ticker": "BTC-rUSD",
"markPrice": 43000,
"isActive": true,
"maxLeverage": 40,
"description": "Perpetual LP Pool",
"name": "Market",
"tickSizeDecimals": 2,
"priority": 0,
"assetPairId": "BTCUSDMARK"
},
{
"id": "1",
"ticker": "ETH-rUSD",
"markPrice": 2000,
"isActive": true,
"maxLeverage": 25,
"description": "Perpetual LP Pool",
"name": "Market",
"tickSizeDecimals": 2,
"priority": 0,
"assetPairId": "ETHUSDMARK"
},
...
]
Get Market by ID
Same as GetMarkets, but returns information about a specific market by its ID.
Endpoint: GET /api/trading/market/:marketId
Parameters:
marketId
: The ID of the market
Get Markets Data
Returns data for all markets.
Endpoint: GET /api/trading/markets/data
Parameters: None
Response Fields:
marketId
string
Unique identifier for the market
updatedAt
number
Timestamp of the last update, in milliseconds
longOI
number
Long open interest
shortOI
number
Short open interest
longSkewPercentage
number
Percentage of open interest that is long
shortSkewPercentage
number
Percentage of open interest that is short
openInterest
number
Total open interest
fundingRate
number
Current funding rate
fundingRateVelocity
number
Current funding rate velocity
last24hVolume
number
24-hour trading volume
maxAmountBaseLong
number
Maximum base amount for long positions
maxAmountBaseShort
number
Maximum base amount for short positions
maxAmountSizeLong
number
Maximum size for long positions
maxAmountSizeShort
number
Maximum size for short positions
priceChange24H
number
Absolute price change in the last 24 hours
priceChange24HPercentage
number
Percentage price change in the last 24 hours
poolPrice
number
Current pool price
oraclePrice
number
Current oracle price
pricesUpdatedAt
number
Timestamp when prices were last updated, in milliseconds
Example Response:
[
{
"marketId": "1",
"updatedAt": 1747927089946,
"longOI": 154.741,
"shortOI": 154.706,
"longSkewPercentage": 50,
"shortSkewPercentage": 50,
"openInterest": 154.741,
"fundingRate": -0.000509373441021089,
"fundingRateVelocity": -0.00000006243
"last24hVolume": 917833.49891,
"maxAmountBaseLong": 22358.141305674,
"maxAmountBaseShort": 22358.071305674,
"maxAmountSizeLong": 59601470.9708475,
"maxAmountSizeShort": 59601284.3675466,
"priceChange24H": 92.6272285500004,
"priceChange24HPercentage": 3.59952086471522,
"poolPrice": 2666.48166680625,
"oraclePrice": 2666.48162040777,
"pricesUpdatedAt": 1747927089597
},
{
"marketId": "2",
"updatedAt": 1747927288895,
"longOI": 3.7879,
"shortOI": 3.8273,
"longSkewPercentage": 50,
"shortSkewPercentage": 50,
"openInterest": 3.8273,
"fundingRate": 0.00193517321555959,
"fundingRateVelocity" : 0.000432,
"last24hVolume": 5618707.0551167,
"maxAmountBaseLong": 857.066577292338,
"maxAmountBaseShort": 857.145377292338,
"maxAmountSizeLong": 95349246.104485,
"maxAmountSizeShort": 95358012.6586736,
"priceChange24H": 2303.70822774999,
"priceChange24HPercentage": 2.11497590601892,
"poolPrice": 111250.63101239,
"oraclePrice": 111250.687672029,
"pricesUpdatedAt": 1747927287804
}
]
Get Market Data
Same as Get Markets Data, but returns data for a specific market by ID.
Endpoint: GET /api/trading/market/:marketId/data
Parameters:
marketId
(path): The ID of the market
Get Market Trades
Returns trades for a specific market.
Endpoint: GET /api/trading/market/:marketId/trades
Parameters:
marketId
(path): The ID of the marketbefore
(query, optional): Pagination parameter, unique ID to fetch trades beforeafter
(query, optional): Pagination parameter, unique ID to fetch trades afterdirection
(query, optional): Sorting direction, either 'asc' or 'desc'limit
(query, optional): Number of trades to return (default: 100, max: 100)
Response Fields:
data
array
Array of trade objects
» id
string
Unique identifier for the trade
» market_id
string
ID of the market
» account_id
string
ID of the account
» executed_base
string
Executed base amount of the trade
» fee
string
Fee paid for the trade
» price
string
Execution price of the trade
» is_match_order
boolean
Whether the trade was a match order
» liquidation_type
string
Type of liquidation, if applicable (e.g., "-1" if not a liquidation)
» position_base
string
Base amount of the resulting position
» position_realized_pnl
string
Realized PnL for the position
» position_last_price
string
Last price for the position
» position_last_price_timestamp
string
Timestamp of the last price for the position
» position_funding_value
string
Funding value for the position
» position_base_multiplier
string
Base multiplier for the position
» position_adl_unwind_price
string
ADL unwind price for the position
» counterparty_account_id
string
Account ID of the counterparty
» counterparty_base
string
Base amount for the counterparty
» counterparty_realized_pnl
string
Realized PnL for the counterparty
» counterparty_last_price
string
Last price for the counterparty
» counterparty_last_price_timestamp
string
Timestamp of the last price for the counterparty
» counterparty_funding_value
string
Funding value for the counterparty
» counterparty_base_multiplier
string
Base multiplier for the counterparty
» counterparty_adl_unwind_price
string
ADL unwind price for the counterparty
» transaction_hash
string
Hash of the transaction
» block_timestamp
string
Timestamp of the block
» block_number
string
Number of the block
» unique_id
number
Unique sequential ID for the trade event
» event_sequence_number
string
Event sequence number
» exchange_id
string
Exchange identifier
» referrer_account_id
string
Referrer account identifier
» referrer_fee_credit
string
Referrer fee credit
» created_at
string
Creation timestamp (ISO 8601 format)
meta
object
Metadata for the trade list
» limit
number
Number of trades requested per page
» count
number
Number of trades returned in the current response
» before
string
Cursor to fetch trades before this unique_id
» after
string
Cursor to fetch trades after this unique_id
Example Response:
{
"data": [
{
"id": "0x4c36366092ec0119c574f097ba244ab941f96fe9441a02c3b963cbfccfe02e99-10",
"market_id": "2",
"account_id": "32035",
"executed_base": "-1700000000000000",
"fee": "47776",
"price": "1.14708602e+23",
"is_match_order": true,
"liquidation_type": "0",
"position_base": "-24100000000000000",
"position_realized_pnl": "741855373551797679732",
"position_last_price": "1.15322483064469728187344e+23",
"position_last_price_timestamp": "1754057329",
"position_funding_value": "5.308723745886726903994e+21",
"position_base_multiplier": "1000000000000000000",
"position_adl_unwind_price": "0",
"counterparty_account_id": "2",
"counterparty_base": "-15400000000000000",
"counterparty_realized_pnl": "5.3535544280032128031079e+22",
"counterparty_last_price": "1.14317628543179938341105e+23",
"counterparty_last_price_timestamp": "1754057237",
"counterparty_funding_value": "5.308723745886726903994e+21",
"counterparty_base_multiplier": "1000000000000000000",
"counterparty_adl_unwind_price": "0",
"transaction_hash": "0x4c36366092ec0119c574f097ba244ab941f96fe9441a02c3b963cbfccfe02e99",
"block_timestamp": "1754057329",
"block_number": "72598870",
"unique_id": "7259887000010",
"event_sequence_number": "152954",
"exchange_id": "2",
"referrer_account_id": "0",
"referrer_fee_credit": "0",
"position_average_entry_funding_value": "5.304856705168897438091e+21",
"position_session": "0",
"counterparty_average_entry_funding_value": "5.308696545204477078173e+21",
"counterparty_session": "1234",
"created_at": "2025-08-01T14:08:50.000Z"
}
],
"meta": {
"limit": 10,
"count": 2,
"before": null,
"after": null
}
}
Get Markets Configuration
Returns configuration information for all markets.
Endpoint: GET /api/trading/markets/configuration
Parameters: None
Response Fields:
market_id
string
Unique identifier for the market configuration
risk_matrix_index
string
Index in the risk matrix
max_open_base
string
Maximum open base amount
velocity_multiplier
string
Velocity multiplier for the market
minimum_order_base
string
Minimum order base amount
base_spacing
string
Spacing for base amounts
price_spacing
string
Spacing for prices
oracle_node_id
string
Node ID for the oracle
mtm_window
string
Mark-to-Market (MTM) window in milliseconds
dutch_config_lambda
string
Lambda parameter for Dutch auction configuration
dutch_config_min_base
string
Minimum base for Dutch auction configuration
slippage_params_phi
string
Phi parameter for slippage
slippage_params_beta
string
Beta parameter for slippage
depth_factor
string
Depth factor for the market
max_exposure_factor
string
Maximum exposure factor
max_p_slippage
string
Maximum price slippage allowed
price_spread
string
Price spread for the market
volatility_index_multiplier
string
Multiplier for the volatility index
block_timestamp
string
Timestamp of the block when the configuration was recorded
block_number
string
Number of the block when the configuration was recorded
unique_id
number
Unique sequential ID for the configuration event
Example Response:
[
{
"market_id": "7",
"risk_matrix_index": "0",
"max_open_base": "4500000000000000000",
"velocity_multiplier": "1e+22",
"minimum_order_base": "10000000000000000",
"base_spacing": "1000000000000000",
"price_spacing": "1000000000000000",
"oracle_node_id": "0xeba87760f9cb5f50279ee91edc07a7cfeba3e95b3d7340414fd297f7992ba59b",
"mtm_window": "15768000000",
"dutch_config_lambda": "1000000000000000000",
"dutch_config_min_base": "110000000000000000",
"slippage_params_phi": "0",
"slippage_params_beta": "0",
"depth_factor": "100000000000000000",
"max_exposure_factor": "999000000000000000",
"max_p_slippage": "100000000000000000",
"price_spread": "0",
"volatility_index_multiplier": "0",
"block_timestamp": "1738689899",
"block_number": "58212334",
"unique_id": 5821233400007
},
{
"market_id": "30",
"risk_matrix_index": "0",
"max_open_base": "1.9e+22",
"velocity_multiplier": "0",
"minimum_order_base": "1000000000000000000",
"base_spacing": "100000000000000000",
"price_spacing": "10000000000000",
"oracle_node_id": "0x0021af309815a96ddf67eea50b8c13ac1698795eb578cd868552c7a841b28429",
"mtm_window": "15768000000",
"dutch_config_lambda": "1000000000000000000",
"dutch_config_min_base": "110000000000000000",
"slippage_params_phi": "0",
"slippage_params_beta": "0",
"depth_factor": "1e+21",
"max_exposure_factor": "999000000000000000",
"max_p_slippage": "100000000000000000",
"price_spread": "0",
"volatility_index_multiplier": "0",
"block_timestamp": "1738689899",
"block_number": "58212334",
"unique_id": 5821233400030
}
]
Asset and Price Information
Get Assets
Returns all assets supported by the platform.
Endpoint: GET /api/trading/assets
Response Fields:
address
string
Contract address of the asset
name
string
Full name of the asset
short
string
Short symbol for the asset
createdAt
string
Timestamp when the asset was created
updatedAt
string
Timestamp when the asset was last updated
asset_price_contract_id
string
Contract ID for asset price
asset_price_usdc_contract_id
string
Contract ID for asset price in USDC
decimals
number
Number of decimals for the asset
Example Response:
[
{
"address": "0xaab18b45467ece5e47f85ca6d3dc4df2a350fd42",
"name": "USDE",
"short": "USDE",
"createdAt": "2024-08-16T20:23:58.000Z",
"updatedAt": "2024-08-16T20:23:58.000Z",
"asset_price_contract_id": "0x0000000000000000000000000000000000000001",
"asset_price_usdc_contract_id": "0x73ac348c40403ff1156a2f53ba57bccba2c63915",
"decimals": 18
},
...
]
Get Prices
Returns current prices for all symbols.
Endpoint: GET /api/trading/prices
Response Fields:
marketId
number
ID of the market
oraclePrice
string
Price from oracle
poolPrice
string
Price from pool
price
string
Current price
updatedAt
number
Timestamp of the last update
Example Response:
[
{
"marketId": 1,
"oraclePrice": "2531144014809193496986",
"poolPrice": "2531142939673207966023",
"price": "2530789301549999000000",
"updatedAt": 1747834146575
},
...
]
Get Price by Asset Pair ID
Same as Get Prices, but returns price information for a specific asset pair.
Endpoint: GET /api/trading/prices/:assetPairId
Parameters:
assetPairId
(path): Identifier of the asset pair (e.g., ETHUSDMARK)
Get Pool Balance
Returns the balance information for a specific pool.
Endpoint: GET /api/trading/poolBalance/:poolId
Parameters:
poolId
(path): Identifier of the pool
Response Fields:
id
number
Unique identifier for the pool balance entry
pool_id
number
ID of the pool
timestamp
number
Timestamp of the balance record
value
string
Current value of the pool
apy
string
Annual percentage yield
share_price
string
Price per share
share_price_index
string
Share price index
Example Response:
{
"id": 547606,
"pool_id": 1,
"timestamp": 1747834105656,
"value": "17989265.69244052",
"apy": "0.03072078779167425",
"share_price": "1.041881093786799",
"share_price_index": "33729011020.257646868833137"
}
Fee Configuration
Get Fee Tier Parameters
Returns parameters for all fee tiers.
Endpoint: GET /api/trading/feeTierParameters
Response Fields:
tier_id
string
ID of the fee tier
taker_fee
string
Fee applied to takers
maker_fee
string
Fee applied to makers
volume
string
Volume threshold for the tier
Example Response:
[
{
"tier_id": "100",
"taker_fee": "100000000000000",
"maker_fee": "100000000000000",
"volume": "0"
},
{
"tier_id": "3",
"taker_fee": "270000000000000",
"maker_fee": "270000000000000",
"volume": "10000000"
}
]
Get Global Fee Parameters
Returns global fee parameters for the platform.
Endpoint: GET /api/trading/globalFeeParameters
Response Fields:
og_discount
string
Discount for OG users
referee_discount
string
Discount for referees
referrer_rebate
string
Rebate for referrers
affiliate_referrer_rebate
string
Rebate for affiliate referrers
Example Response:
{
"og_discount": "300000000000000000",
"referee_discount": "100000000000000000",
"referrer_rebate": "100000000000000000",
"affiliate_referrer_rebate": "150000000000000000"
}
Account and Wallet Information
Get Wallet Positions
Returns all positions for a wallet.
Endpoint: GET /api/trading/wallet/:address/positions
Parameters:
address
(path): Wallet address
Response Fields:
market_id
string
Identifier for the market
account_id
string
Identifier for the account
base
string
Base amount of the position
realized_pnl
string
Realized profit and loss
last_price
string
Last price of the position
last_price_timestamp
string
Timestamp of the last price update
funding_value
string
Current funding value
base_multiplier
string
Base multiplier for the position
adl_unwind_price
string
ADL unwind price
average_entry_funding_value
string
Average entry funding value
session
string
Session identifier
exchange_id
string
Exchange identifier
event_sequence_number
string
Event sequence number
referrer_account_id
string
Referrer account identifier
referrer_fee_credit
string
Referrer fee credit
transaction_hash
string
Transaction hash
block_timestamp
string
Block timestamp
block_number
string
Block number
unique_id
string
Unique identifier
Example Response:
[
{
"market_id": "24",
"account_id": "95681",
"base": "860000000000000000",
"realized_pnl": "0",
"last_price": "769260743000000000000",
"last_price_timestamp": "1754055149",
"funding_value": "36712181829755925857",
"base_multiplier": "1000000000000000000",
"adl_unwind_price": "0",
"transaction_hash": "0x9b72dab20c7295d30ff849b94ea6a792724bf4b7e78936e85612a816712b08b4",
"block_timestamp": "1754055149",
"block_number": "72594664",
"unique_id": "7259466400011",
"event_sequence_number": "151532",
"exchange_id": "2",
"referrer_account_id": "0",
"referrer_fee_credit": "0",
"average_entry_funding_value": "36712181829755925856",
"session": "1"
}
]
Get Wallet Open Orders
Returns all pending open orders for a wallet.
Endpoint: GET /api/trading/wallet/:address/openOrders
Parameters:
address
(path): Wallet address
Response Fields:
id
string
Unique identifier for the order
account_id
string
Identifier for the account
market_id
string
Identifier for the market
order_type
string
Type of order (e.g., "Limit Order")
is_long
boolean
Whether the position is long
trigger_price
number
Price at which the order is triggered
order_base
string
Base amount of the order
exchange_id
number
Exchange identifier
inputs
string
Order inputs in hex format
counterparty_account_id
number
Counterparty account ID
reya_chain_id
number
Reya chain identifier
deadline
number
Order deadline timestamp
signer_address
string
Address of the signer
nonce
string
Unique nonce for the order
signature
string
Cryptographic signature
status
string
Current status of the order (e.g., "pending")
creation_timestamp_ms
number
Creation timestamp (in milliseconds)
last_update_timestamp_ms
number
Last update timestamp (in milliseconds)
transaction_hash
string
Hash of the transaction, or null if not yet processed
Example Response:
[
{
"id": "a77d7040-c079-4d48-b78a-4e9d682fd85d",
"account_id": "95681",
"market_id": "2",
"order_type": "Stop Loss",
"is_long": false,
"trigger_price": 110000,
"order_base": "0",
"status": "pending",
"creation_timestamp_ms": 1747943630008,
"last_update_timestamp_ms": 1747943630008,
"transaction_hash": null
}
]
Get Wallet Accounts
Returns all accounts belonging to a wallet.
Endpoint: GET /api/trading/wallet/:address/accounts
Parameters:
address
(path): Wallet address
Response Fields:
account_id
string
Identifier for the account
name
string
Name of the account
status
string
Status of the account (OPEN, CLOSED)
updated_timestamp_ms
string
Timestamp of the last update in milliseconds
source
string
Source of the account (e.g., "reya")
Example Response:
[
{
"account_id": "95681",
"name": "Margin Account 1",
"status": "OPEN",
"updated_timestamp_ms": "1744824667000",
"source": "reya"
},
{
"account_id": "99118",
"name": "444",
"status": "CLOSED",
"updated_timestamp_ms": "1747819016470",
"source": "reya"
}
]
Get Wallet Account Balances
Return balances for a all accounts belonging to a wallet
Endpoint: GET /api/trading/wallet/:address/accounts/balances
Parameters:
address
(path): Wallet address
Response Fields:
account_id
string
Identifier for the account
collateral
string
Collateral address
balance
number
balance
Example Response:
[
{
"account_id": "95681",
"collateral": "0x124c0D60D2ED42e6EF7c6018363B3d669242F822",
"balance": "25100076000000000000"
}
]
Get Wallet Configuration
Returns configuration for a specific account owner.
Endpoint: GET /api/trading/wallet/:address/configuration
Parameters:
address
(path): Wallet address
Response Fields:
tier_id
string
ID of the fee tier
og_status
boolean
Status of OG users
referee_status
boolean
Status of referees
affiliate_status
boolean
Status of affiliates
main_account_id
string
ID of the main account
Example Response:
{
"tier_id": "0",
"og_status": true,
"referee_status": false,
"affiliate_status": false,
"main_account_id": "7973"
}
Get Wallet Trades
Returns all trades for a wallet, with pagination.
Endpoint: GET /api/trading/wallet/:address/trades
Parameters:
address
(path): Wallet addresslimit
(query, optional): Number of trades to return (default: 100)before
(query, optional): Return trades before this ID for paginationafter
(query, optional): Return trades after this ID for pagination
Response Fields:
data
array
Array of trade objects
» id
string
Unique identifier for the trade
» market_id
string
Identifier for the market
» account_id
string
Identifier for the account
» executed_base
string
Base amount executed
» fee
string
Fee paid for the trade
» price
string
Trade price
» is_match_order
boolean
Whether the trade is a match trade
» liquidation_type
string
Type of liquidation, if applicable (e.g., "-1" if not a liquidation)
» position_base
string
Position base amount after the trade
» position_realized_pnl
string
Realized PnL for the position after this trade
» position_last_price
string
Last price for the position after this trade
» position_last_price_timestamp
string
Timestamp of the last price for the position
» position_funding_value
string
Funding value for the position
» position_base_multiplier
string
Base multiplier for the position
» position_adl_unwind_price
string
ADL unwind price for the position
» position_average_entry_funding_value
string
Average entry funding value for the position
» position_session
string
Session identifier for the position
» counterparty_account_id
string
Account ID of the counterparty
» counterparty_base
string
Base amount for the counterparty
» counterparty_realized_pnl
string
Realized PnL for the counterparty
» counterparty_last_price
string
Last price for the counterparty
» counterparty_last_price_timestamp
string
Timestamp of the last price for the counterparty
» counterparty_funding_value
string
Funding value for the counterparty
» counterparty_base_multiplier
string
Base multiplier for the counterparty
» counterparty_adl_unwind_price
string
ADL unwind price for the counterparty
» counterparty_average_entry_funding_value
string
Average entry funding value for the counterparty
» counterparty_session
string
Session identifier for the counterparty
» transaction_hash
string
Hash of the transaction
» block_timestamp
string
Timestamp of the block
» block_number
string
Block number
» unique_id
string
Unique identifier for the event
» event_sequence_number
string
Event sequence number
» exchange_id
string
Exchange identifier
» referrer_account_id
string
Referrer account identifier
» referrer_fee_credit
string
Referrer fee credit
» created_at
string
Creation timestamp
meta
object
Metadata for pagination
» limit
number
Number of orders requested per page
» count
number
Number of orders returned in the current response
» before
string
Cursor to fetch orders before this unique_id
» after
string
Cursor to fetch orders after this unique_id
Example Response:
{
"data": [
{
"id": "0x9b72dab20c7295d30ff849b94ea6a792724bf4b7e78936e85612a816712b08b4-11",
"market_id": "24",
"account_id": "95681",
"executed_base": "860000000000000000",
"fee": "264625",
"price": "769260743000000000000",
"is_match_order": true,
"liquidation_type": "-1",
"position_base": "860000000000000000",
"position_realized_pnl": "0",
"position_last_price": "769260743000000000000",
"position_last_price_timestamp": "1754055149",
"position_funding_value": "36712181829755925857",
"position_base_multiplier": "1000000000000000000",
"position_adl_unwind_price": "0",
"counterparty_account_id": "2",
"counterparty_base": "-860000000000000000",
"counterparty_realized_pnl": "-446806252300027191221",
"counterparty_last_price": "769260743000000000000",
"counterparty_last_price_timestamp": "1754055149",
"counterparty_funding_value": "36712181829755925857",
"counterparty_base_multiplier": "1000000000000000000",
"counterparty_adl_unwind_price": "0",
"transaction_hash": "0x9b72dab20c7295d30ff849b94ea6a792724bf4b7e78936e85612a816712b08b4",
"block_timestamp": "1754055149",
"block_number": "72594664",
"unique_id": "7259466400011",
"event_sequence_number": "151532",
"exchange_id": "2",
"referrer_account_id": "0",
"referrer_fee_credit": "0",
"position_average_entry_funding_value": "36712181829755925856",
"position_session": "1",
"counterparty_average_entry_funding_value": "36712181829755925856",
"counterparty_session": "226",
"created_at": "2025-08-01T13:32:35.158Z"
}
],
"meta": {
"limit": 100,
"count": 1,
"before": "7259466400011",
"after": "7259466400011"
}
}
Candle Data
Get Historical Candles
Returns historical candle data for a specific asset pair and resolution.
Endpoint: GET /candles/:assetPairId/:resolution
Path Parameters:
assetPairId
string
The ID of the asset pair (e.g., "ETH-rUSD")
resolution
string
The candle resolution (e.g., "1", "5", "15", "60", "240", "1D")
Query Parameters:
from
number
Optional. Unix timestamp (in seconds) for the start of the historical data range. Defaults to 200 candles back from to
if to
is provided, or 200 candles back from now.
to
number
Optional. Unix timestamp (in seconds) for the end of the historical data range. Defaults to the current time.
Response Fields:
t
number[]
Array of timestamps for each candle (epoch seconds)
o
number[]
Array of opening prices for each candle
h
number[]
Array of highest prices for each candle
l
number[]
Array of lowest prices for each candle
c
number[]
Array of closing prices for each candle
Example Response:
{
"t": [1747804140, 1747804200, 1747804260, 1747804320, 1747804380],
"o": [2557.997733549999, 2555.386924449999, 2560.118390749999, 2560.438506749999, 2558.67797405],
"h": [2557.997733549999, 2560.698570549999, 2560.728578149999, 2560.438506749999, 2559.06808615],
"l": [2554.636691949999, 2553.436319949999, 2559.368198649999, 2558.908027049999, 2558.027788949999],
"c": [2555.386924449999, 2560.118390749999, 2560.438506749999, 2558.67797405, 2558.027788949999]
}