Reya
  • Start Here
    • Why Reya?
  • REYA PRODUCTS
    • Reya DEX
      • Navigating Reya DEX
        • Dashboard: getting started
          • Creating your margin account
          • Moving funds
          • Checking your account
        • The Trading Screen
          • Trade form
          • Market Data Panel
        • LP Pool
      • Trading on Reya DEX
        • Perpetual Futures
        • Margin
        • Auto-exchange and Liquidations
        • Specifications
        • Conditional Orders
        • FlashSwap
        • Collateral liquidations
        • Settlement and cross-collateralization
      • Docs: Reya DEX REST API
      • Docs: Reya DEX WebSocket
    • Reya Network
      • The structure of Reya Network
      • The Liquidity Layer
        • Reya’s pool for perpetual futures
        • Offering liquidity in the passive pool
        • Deepdive into passive perps
        • Network Owned Liquidity
      • Derivatives Clearing
        • Automatic leveraging of PnL across instruments
        • Cross-collateralization
          • Haircuts
          • Auto-exchange conditions
          • Auto-exchange mechanism
        • Cross-margining
          • The margin system
        • The liquidation engine
          • Ranked liquidations
          • Dutch auction
          • Backstop LPs
          • Insurance Funds
          • Page 1
        • Spot markets
        • Reya Governance
      • What's the roadmap
      • Who's Behind Reya Network
    • rUSD / srUSD
      • rUSD
      • srUSD
      • srUSD How to and FAQs
  • COMMUNITY
    • Join the Reya Community
    • Incentives Overview
      • Experience (XP)
        • Technical details
      • Boosts
      • Ranks and Seasons
    • x.com
  • Technical Docs
    • Reya Python SDK
    • Contract Functions
      • Core
      • Passive Perp Instrument
      • Passive Pool
      • Oracle Adapter
    • Contract Addresses
    • Smart Contract Withdrawals
    • Audits
  • REYA RESOURCES
    • Blog
    • Beginner's Guide to Better Trading with Reya
    • Block Explorer
    • Glossary (coming soon)
    • FAQ (coming soon)
Powered by GitBook
On this page
  • Base URL
  • Table of Contents
  • Market Information
  • Get Markets
  • Get Market by ID
  • Get Markets Data
  • Get Market Data
  • Get Market Orders
  • Get Markets Configuration
  • Asset and Price Information
  • Get Assets
  • Get Prices
  • Get Price by Asset Pair ID
  • Get Pool Balance
  • Fee Configuration
  • Get Fee Tier Parameters
  • Get Global Fee Parameters
  • Account and Wallet Information
  • Get Wallet Positions
  • Get Wallet Conditional Orders
  • Get Wallet Account Balances
  • Get Wallet Configuration
  • Get Wallet Orders
  • Candle Data
  • Get Historical Candles
  1. REYA PRODUCTS
  2. Reya DEX

Docs: Reya DEX REST API

This document provides comprehensive information about the trading API endpoints in the Reya DEX.

Base URL

Mainnet: https://api.reya.xyz/
Testnet: https://api-cronos.reya.xyz/

Table of Contents

  • Market Information

    • Get Markets

    • Get Market by ID

    • Get Markets Data

    • Get Market Data

    • Get Market Orders

    • Get Markets Configuration

  • Asset and Price Information

    • Get Assets

    • Get Prices

    • Get Price by Asset Pair ID

    • Get Pool Balance

  • Account and Wallet Information

    • Get Wallet Positions

    • Get Wallet Conditional Orders

    • Get Wallet Accounts

    • Get Wallet Account Balances

    • Get Wallet Orders

    • Get Wallet Configuration

  • Fee Configuration

    • Get Fee Tier Parameters

    • Get Global Fee Parameters

  • Candle Data

    • Get Historical Candles

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:

Field
Type
Description

id

string

Unique 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

Example Response:

[
  {
    "id": "2",
    "ticker": "BTC-rUSD",
    "markPrice": 43000,
    "isActive": true,
    "maxLeverage": 40,
    "description": "Perpetual LP Pool",
    "name": "Market",
    "tickSizeDecimals": 2,
    "priority": 0
  },
  {
    "id": "1",
    "ticker": "ETH-rUSD",
    "markPrice": 2000,
    "isActive": true,
    "maxLeverage": 25,
    "description": "Perpetual LP Pool",
    "name": "Market",
    "tickSizeDecimals": 2,
    "priority": 0
  },
  ...
]

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/marketsData

Parameters: None

Response Fields:

Field
Type
Description

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

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,
    "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,
    "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 Orders

Returns orders for a specific market.

Endpoint: GET /api/trading/market/:marketId/orders

Parameters:

  • marketId (path): The ID of the market

  • before (query, optional): Pagination parameter, unique ID to fetch orders before

  • after (query, optional): Pagination parameter, unique ID to fetch orders after

  • direction (query, optional): Sorting direction, either 'asc' or 'desc'

  • limit (query, optional): Number of orders to return (default: 100, max: 100)

Response Fields:

Field
Type
Description

data

array

Array of order objects

» id

string

Unique identifier for the order

» market_id

string

ID of the market

» account_id

string

ID of the account

» executed_base

string

Executed base amount of the order

» fee

string

Fee paid for the order

» price

string

Execution price of the order

» is_match_order

boolean

Whether the order 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 order event

» created_at

string

Creation timestamp (ISO 8601 format)

meta

object

Metadata for the order list

» 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": "0x6aaad743ca503ce6d5af7d6697a4ae5048e56dc4759453f10a91a80c72c2a3e8-8",
    "market_id": "2",
    "account_id": "13535",
    "executed_base": "1000000000000000",
    "fee": "44608",
    "price": "1.11521027e+23",
    "is_match_order": true,
    "liquidation_type": "-1",
    "position_base": "2000000000000000",
    "position_realized_pnl": "-239872695506513495539",
    "position_last_price": "1.113128725e+23",
    "position_last_price_timestamp": "1747928714",
    "position_funding_value": "5.744415068930922194348e+21",
    "position_base_multiplier": "1000000000000000000",
    "position_adl_unwind_price": "0",
    "counterparty_account_id": "2",
    "counterparty_base": "38400000000000000",
    "counterparty_realized_pnl": "4.882961090171428331359e+22",
    "counterparty_last_price": "1.10931637573604060913705e+23",
    "counterparty_last_price_timestamp": "1747927885",
    "counterparty_funding_value": "5.744415068930922194348e+21",
    "counterparty_base_multiplier": "1000000000000000000",
    "counterparty_adl_unwind_price": "0",
    "transaction_hash": "0x6aaad743ca503ce6d5af7d6697a4ae5048e56dc4759453f10a91a80c72c2a3e8",
    "block_timestamp": "1747928714",
    "block_number": "67782452",
    "unique_id": 6778245200008,
    "created_at": "2025-05-22T15:45:15.306Z"
    },
    {
      "id": "0xee6b97870ce5007629f0deea6b4fcf0023d9c811d0c3434802ced04c6ee4ffd0-8",
      "market_id": "2",
      "account_id": "41116",
      "executed_base": "-7500000000000000",
      "fee": "233284",
      "price": "1.11087614e+23",
      "is_match_order": true,
      "liquidation_type": "-1",
      "position_base": "0",
      "position_realized_pnl": "39438568000892260456",
      "position_last_price": "1.11169147e+23",
      "position_last_price_timestamp": "1747927453",
      "position_funding_value": "5.743926019031790294165e+21",
      "position_base_multiplier": "1000000000000000000",
      "position_adl_unwind_price": "0",
      "counterparty_account_id": "2",
      "counterparty_base": "39400000000000000",
      "counterparty_realized_pnl": "4.8829040780853913171371e+22",
      "counterparty_last_price": "1.10931637573604060913705e+23",
      "counterparty_last_price_timestamp": "1747927885",
      "counterparty_funding_value": "5.743926019031790294165e+21",
      "counterparty_base_multiplier": "1000000000000000000",
      "counterparty_adl_unwind_price": "0",
      "transaction_hash": "0xee6b97870ce5007629f0deea6b4fcf0023d9c811d0c3434802ced04c6ee4ffd0",
      "block_timestamp": "1747927885",
      "block_number": "67781953",
      "unique_id": 6778195300008,
      "created_at": "2025-05-22T15:31:25.748Z"
    }
  ],
  "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:

Field
Type
Description

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:

Field
Type
Description

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:

Field
Type
Description

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:

Field
Type
Description

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:

Field
Type
Description

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:

Field
Type
Description

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:

Field
Type
Description

market_id

string

Identifier for the market

account_id

string

Identifier for the account

base

string

Base amount of the position

quote

string

Quote amount of the position

leverage_hi

number

High leverage value

leverage_lo

number

Low leverage value

is_long

boolean

Whether the position is long

updated_block_number

string

Block number of the last update

updated_timestamp_ms

string

Timestamp of the last update (in milliseconds)

is_auto_exchange

boolean

Whether auto exchange is enabled

liquid_price

number

Liquidation price

mark_price

number

Current mark price

pnl

number

Profit and loss

pnl_perc

number

Profit and loss percentage

entry_price

number

Entry price of the position

leverage

number

Current leverage

unrealized_funding

number

Unrealized funding amount

Example Response:

[
  {
    "market_id": "1",
    "account_id": "7973",
    "base": "0",
    "realized_pnl": "-252947911897913931194",
    "last_price": "3.282153e+21",
    "last_price_timestamp": "1722773294",
    "funding_value": "236370407620718552816",
    "base_multiplier": "1000000000000000000",
    "adl_unwind_price": "0",
    "transaction_hash": "0x68901182d42077be9d1c6a4cdf3ebece582812b30159e52efae5855e0ba09787",
    "block_timestamp": "1722820382",
    "block_number": "17179690",
    "unique_id": 1717969000012
  }
]

Get Wallet Conditional Orders

Returns all pending conditional orders for a wallet.

Endpoint: GET /api/trading/wallet/:address/conditionalOrders

Parameters:

  • address (path): Wallet address

Response Fields:

Field
Type
Description

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 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:

Field
Type
Description

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:

Field
Type
Description

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 Orders

Returns all orders for a wallet, with pagination.

Endpoint: GET /api/trading/wallet/:address/orders

Parameters:

  • address (path): Wallet address

  • limit (query, optional): Number of orders to return (default: 100)

  • before (query, optional): Return orders before this ID for pagination

  • after (query, optional): Return orders after this ID for pagination

Response Fields:

Field
Type
Description

data

array

Array of order objects

» id

string

Unique identifier for the order

» 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 order

» price

string

Order price

» is_match_order

boolean

Whether the order is a match order

» liquidation_type

string

Type of liquidation, if applicable (e.g., "-1" if not a liquidation)

» position_base

string

Position base amount after the order

» position_realized_pnl

string

Realized PnL for the position after this order

» position_last_price

string

Last price for the position after this order

» 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

Block number

» unique_id

number

Unique identifier for the event

» created_at

string

Creation timestamp

meta

object

Metadata for pagination

» limit

number

Number of results returned

» count

number

Total count of results in this batch

» before

number

ID to use for fetching previous page

» after

number

ID to use for fetching next page

Example Response:

{
  "data": [
    {
      "id": "0xe7a2415f615c32fdb309738f7786e40cb5c2ff31bd5229d527cbb87a9953e1bf-8",
      "market_id": "2",
      "account_id": "95681",
      "executed_base": "20600000000000000",
      "fee": "801813",
      "price": "1.11208696e+23",
      "is_match_order": true,
      "liquidation_type": "-1",
      "position_base": "20600000000000000",
      "position_realized_pnl": "-18749657582419440095",
      "position_last_price": "1.11208696e+23",
      "position_last_price_timestamp": "1747943611",
      "position_funding_value": "5.753090050869636920185e+21",
      "position_base_multiplier": "1000000000000000000",
      "position_adl_unwind_price": "0",
      "counterparty_account_id": "2",
      "counterparty_base": "-77900000000000000",
      "counterparty_realized_pnl": "4.8843950429623853993507e+22",
      "counterparty_last_price": "1.11564219456087119420629e+23",
      "counterparty_last_price_timestamp": "1747943611",
      "counterparty_funding_value": "5.753090050869636920185e+21",
      "counterparty_base_multiplier": "1000000000000000000",
      "counterparty_adl_unwind_price": "0",
      "transaction_hash": "0xe7a2415f615c32fdb309738f7786e40cb5c2ff31bd5229d527cbb87a9953e1bf",
      "block_timestamp": "1747943611",
      "block_number": "67791450",
      "unique_id": 6779145000008,
      "created_at": "2025-05-22T19:53:31.545Z"
    }
  ],
  "meta": {
    "limit": 100,
    "count": 100,
    "before": 6779145000008,
    "after": 6717460200009
  }
}

Candle Data

Get Historical Candles

Returns historical candle data for a specific asset pair and resolution.

Endpoint: GET /candles/:assetPairId/:resolution

Path Parameters:

Parameter
Type
Description

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:

Parameter
Type
Description

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:

Field
Type
Description

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]
}
PreviousSettlement and cross-collateralizationNextDocs: Reya DEX WebSocket

Last updated 8 days ago