OpenAPI Reference
OpenAPI v1 — Public market data, account positions, trade history, token metadata, protocol statistics, liquidation records, and current funding rates. All financial fields are returned as decimal string values. Price and position-related fields use 6-decimal precision.
Returns a list of all available trading markets with real-time prices, 24h trading volume, current open interest, and position fee rates. WBTC and WETH names are displayed as BTC and ETH.
Filter by market status. 1=Delisted (no longer tradable), 2=Listed (actively trading), 3=Pending delist (will be removed soon)
Set to true to return only meme coins
Set to true to return only TradFi assets (stocks and metals)
List of trading markets
Response status code. 0 = success
Response message. 'success' on success
GET /openapi/v1/markets HTTP/1.1
Host: api.deriw.com
Accept: */*
List of trading markets
{
"code": 1,
"msg": "text",
"data": {
"markets": [
{
"address": "text",
"name": "text",
"decimals": 1,
"is_stable": true,
"is_shortable": true,
"is_wrapped": true,
"is_meme": true,
"is_tradfi": true,
"coin_type": 1,
"fee_rate": 1,
"price": "text",
"volume_24h": "text",
"long_interest": "text",
"short_interest": "text",
"status": 1
}
]
}
}Returns the current open positions for the specified wallet address. Supports pagination up to 100 records per page, with a maximum of 10,000 total accessible records. All size, collateral, and fee values use 6-decimal precision.
Wallet address to query positions for
Filter by index token contract address
Set to true for long positions, false for short positions
Page number, starting from 1
1Number of records per page (max 100)
20List of open positions
Response status code. 0 = success
Response message. 'success' on success
Request exceeds the maximum accessible page range
GET /openapi/v1/account/positions?account=text HTTP/1.1
Host: api.deriw.com
Accept: */*
{
"code": 1,
"msg": "text",
"data": {
"positions": [
{
"account": "text",
"index_token": "text",
"token_name": "text",
"is_long": true,
"size": "text",
"collateral": "text",
"leverage": "text",
"total_fees": "text",
"status": 1,
"created_at": 1,
"updated_at": 1
}
],
"total": 1
}
}Returns the trade history (both open and close positions) for the specified wallet address. Each record is either an 'increase' (opening) or 'decrease' (closing) trade. Supports filtering by time range and trade type. All financial fields use 6-decimal precision.
Wallet address to query trade history for
Filter by index token contract address
Filter by trade direction. 'increase' = opening positions, 'decrease' = closing positions. Omit to return both.
Start of time range filter (Unix timestamp in seconds)
End of time range filter (Unix timestamp in seconds)
Page number, starting from 1
1Number of records per page (max 100)
20List of trade records
Response status code. 0 = success
Response message. 'success' on success
Request exceeds the maximum accessible page range
GET /openapi/v1/trades?account=text HTTP/1.1
Host: api.deriw.com
Accept: */*
{
"code": 1,
"msg": "text",
"data": {
"total_volume": "text",
"history_volume": "text",
"total": 1,
"trades": [
{
"account": "text",
"trade_type": "text",
"index_token": "text",
"token_name": "text",
"is_long": true,
"size": "text",
"collateral": "text",
"price": "text",
"average_price": "text",
"pnl": "text",
"fee": "text",
"tx_hash": "text",
"block_number": 1,
"created_at": 1
}
]
}
}Returns the latest real-time price and 24-hour statistics (high, low, change) for all listed tokens. Prices use 6-decimal precision (multiplied by 1e6).
Filter by index token contract address
Filter by token display symbol (e.g., BTC, ETH, SOL)
List of token prices
Response status code. 0 = success
Response message. 'success' on success
GET /openapi/v1/prices HTTP/1.1
Host: api.deriw.com
Accept: */*
List of token prices
{
"code": 1,
"msg": "text",
"data": {
"prices": [
{
"index_token": "text",
"symbol": "text",
"price": "text",
"high_24h": "text",
"low_24h": "text",
"change_24h": "text"
}
]
}
}Returns metadata for all supported tokens including contract address, display name, decimals, trading attributes, coin type classification, and current fee rate. WBTC and WETH names are displayed as BTC and ETH.
Filter by token status. 1=Delisted, 2=Listed, 3=Pending delist
Set to true to return only meme coins
Set to true to return only TradFi assets (stocks and metals)
List of supported tokens
Response status code. 0 = success
Response message. 'success' on success
GET /openapi/v1/tokens HTTP/1.1
Host: api.deriw.com
Accept: */*
List of supported tokens
{
"code": 1,
"msg": "text",
"data": {
"tokens": [
{
"address": "text",
"name": "text",
"decimals": 1,
"is_stable": true,
"is_shortable": true,
"is_wrapped": true,
"is_meme": true,
"is_tradfi": true,
"coin_type": 1,
"fee_rate": "text",
"price": "text",
"status": 1
}
]
}
}Returns aggregated protocol-wide statistics including trading volume, fees, revenue, open interest, TVL, fund pool data, and unique trader count. All financial fields use 6-decimal precision. Unique traders is an integer count.
Start of time range filter (Unix timestamp in seconds)
End of time range filter (Unix timestamp in seconds)
Protocol statistics
Response status code. 0 = success
Response message. 'success' on success
GET /openapi/v1/stats HTTP/1.1
Host: api.deriw.com
Accept: */*
Protocol statistics
{
"code": 1,
"msg": "text",
"data": {
"total_volume": "text",
"trading_volume": "text",
"long_volume": "text",
"short_volume": "text",
"total_fees": "text",
"open_fee": "text",
"close_fee": "text",
"liquidation_fee": "text",
"manage_fee": "text",
"total_revenue": "text",
"long_revenue": "text",
"short_revenue": "text",
"open_interest": "text",
"long_open_interest": "text",
"short_open_interest": "text",
"long_weighting": "text",
"short_weighting": "text",
"tvl": "text",
"fund_pool_volume": "text",
"fund_pool_raised": "text",
"unique_traders": 1,
"updated_at": 1
}
}Returns liquidation records for the specified wallet address. Each record includes liquidation type: type 2 or 3 indicates normal liquidation events, type 4 indicates forced closure due to coin delisting, and type 5 indicates ADL (Auto-Deleveraging) events. All financial fields use 6-decimal precision.
Wallet address to query liquidation history for
Filter by index token contract address
Set to true for long positions, false for short positions
Start of time range filter (Unix timestamp in seconds)
End of time range filter (Unix timestamp in seconds)
Page number, starting from 1
1Number of records per page (max 100)
20List of liquidation records
Response status code. 0 = success
Response message. 'success' on success
Request exceeds the maximum accessible page range
GET /openapi/v1/liquidations?account=text HTTP/1.1
Host: api.deriw.com
Accept: */*
{
"code": 1,
"msg": "text",
"data": {
"liquidations": [
{
"account": "text",
"index_token": "text",
"is_long": true,
"size": "text",
"collateral": "text",
"average_price": "text",
"mark_price": "text",
"liquidation_price": "text",
"fee": "text",
"realised_pnl": "text",
"liquidation_type": 1,
"tx_hash": "text",
"block_number": 1,
"created_at": 1
}
],
"total": 1
}
}Returns the current position fee rate (in basis points) for each listed token. The fee rate represents the cost to open a position, expressed in bps where 1 bps = 0.01%. Returns all listed tokens when no filter is specified.
Filter by index token contract address. Omit to return fee rates for all listed tokens.
List of current fee rates
Response status code. 0 = success
Response message. 'success' on success
GET /openapi/v1/funding_rates HTTP/1.1
Host: api.deriw.com
Accept: */*
List of current fee rates
{
"code": 1,
"msg": "text",
"data": {
"funding_rates": [
{
"index_token": "text",
"name": "text",
"fee_rate": 1
}
]
}
}Returns the current open positions of traders in the specified host's room. Data is served from a background cache and is eventually consistent; an empty list is returned when the cache has not been warmed yet. PnL is from the room (LP) perspective. All amounts are USDT-denominated decimal strings.
Room host (creator) wallet address. Note: unlike other v1 endpoints, this is the room host address, not a trader address
Page number, starting from 1
1Number of records per page (max 100)
20List of room open positions. Business errors are also returned with HTTP 200 and a non-zero code: 100438 = invalid account address or page out of range
Response status code. 0 = success
Response message. 'success' on success
Malformed query parameters (e.g. missing account, page_size greater than 100)
GET /openapi/v1/rooms/open_positions?account=text HTTP/1.1
Host: api.deriw.com
Accept: */*
{
"code": 1,
"msg": "text",
"data": {
"items": [
{
"account": "text",
"market": "text",
"index_token": "text",
"direction": "text",
"leverage": "text",
"average_price": "text",
"now_price": "text",
"liquidation_price": "text",
"collateral_size": "text",
"size_delta": "text",
"unreleased_pnl": "text"
}
],
"total": 1,
"page_index": 1,
"page_size": 1
}
}Returns the closed position history of traders in the specified host's room, including force-close and liquidation flags and the room fee share. PnL is from the room (LP) perspective. All amounts are USDT-denominated decimal strings.
Room host (creator) wallet address
Page number, starting from 1
1Number of records per page (max 100)
20List of room closed positions. Business errors are also returned with HTTP 200 and a non-zero code: 100438 = invalid account address or page out of range
Response status code. 0 = success
Response message. 'success' on success
Malformed query parameters (e.g. missing account, page_size greater than 100)
GET /openapi/v1/rooms/close_position_history?account=text HTTP/1.1
Host: api.deriw.com
Accept: */*
{
"code": 1,
"msg": "text",
"data": {
"items": [
{
"account": "text",
"market": "text",
"direction": "text",
"leverage": "text",
"average_price": "text",
"close_price": "text",
"collateral_size": "text",
"size_delta": "text",
"released_pnl": "text",
"fee_share": "text",
"time": 1,
"is_force_close": true,
"is_liq": true,
"tx_hash": "text"
}
],
"total": 1,
"page_index": 1,
"page_size": 1
}
}Returns the host's liquidity deposit and withdrawal history for the room pool, sourced from on-chain liquidity events. All amounts are USDT-denominated decimal strings.
Room host (creator) wallet address
Page number, starting from 1
1Number of records per page (max 100)
20List of room liquidity changes. Business errors are also returned with HTTP 200 and a non-zero code: 100438 = invalid account address or page out of range
Response status code. 0 = success
Response message. 'success' on success
Malformed query parameters (e.g. missing account, page_size greater than 100)
GET /openapi/v1/rooms/lp_change?account=text HTTP/1.1
Host: api.deriw.com
Accept: */*
{
"code": 1,
"msg": "text",
"data": {
"items": [
{
"account": "text",
"amount": "text",
"type": "text",
"symbol": "text",
"contract_address": "text",
"status": "text",
"time": 1
}
],
"total": 1,
"page_index": 1,
"page_size": 1
}
}Returns the room pool's daily fee share trend in ascending date order. The window covers the last N calendar days including today; days before the room's reopen time are returned as 0. Amounts are USDT-denominated decimal strings.
Room host (creator) wallet address
Number of calendar days to return (default 10)
10Daily fee share trend. Business errors are also returned with HTTP 200 and a non-zero code: 100438 = invalid account address, 100009 = room pool not found for this account
Response status code. 0 = success
Response message. 'success' on success
Malformed query parameters (e.g. missing account)
GET /openapi/v1/rooms/fee?account=text HTTP/1.1
Host: api.deriw.com
Accept: */*
{
"code": 1,
"msg": "text",
"data": {
"items": [
{
"day": "text",
"volume": "text"
}
]
}
}Returns the room pool's daily TVL (total value locked) trend in ascending date order. Historical days are read from daily snapshots; today's value is read from the blockchain in real time. Days before the room's reopen time are returned as 0. Amounts are USDT-denominated decimal strings.
Room host (creator) wallet address
Number of calendar days to return (default 10)
10Daily TVL trend. Business errors are also returned with HTTP 200 and a non-zero code: 100438 = invalid account address, 100009 = room pool not found for this account
Response status code. 0 = success
Response message. 'success' on success
Malformed query parameters (e.g. missing account)
GET /openapi/v1/rooms/tvl?account=text HTTP/1.1
Host: api.deriw.com
Accept: */*
{
"code": 1,
"msg": "text",
"data": {
"items": [
{
"day": "text",
"volume": "text"
}
]
}
}Returns an aggregated overview of the specified host's room: deposits, pool equity, TVL, open interest capacity, active traders, 24h volume, realized PnL, net revenue, and room health. Amounts are USDT-denominated decimal strings; percentage fields are decimal ratio strings (e.g. '0.05' = 5%).
Room host (creator) wallet address
Room detail overview. Business errors are also returned with HTTP 200 and a non-zero code: 100438 = invalid account address, 100009 = room pool not found for this account
Response status code. 0 = success
Response message. 'success' on success
Malformed query parameters (e.g. missing account)
GET /openapi/v1/rooms/detail?account=text HTTP/1.1
Host: api.deriw.com
Accept: */*
{
"code": 1,
"msg": "text",
"data": {
"net_deposits": "text",
"net_deposits_change_percent": "text",
"total_deposits": "text",
"total_deposits_change_percent": "text",
"withdrawable_amount": "text",
"pool_equity": "text",
"pool_equity_change_percent": "text",
"total_tvl": "text",
"total_reversed_oi": "text",
"total_reversed_oi_percent": "text",
"max_oi": "text",
"total_available_oi": "text",
"active_trader": "text",
"total_volume": "text",
"realized_pnl": "text",
"net_revenue": "text",
"room_health": {
"utilization_rate": "text",
"risk_exposure": "text",
"risk_exposure_rate": "text"
}
}
}Returns aggregated per-trader statistics for the specified host's room: total volume, win rate, fees, and PnL from the room (LP) perspective. All amounts are USDT-denominated decimal strings.
Room host (creator) wallet address
Page number, starting from 1
1Number of records per page (max 100)
20List of room trader statistics. Business errors are also returned with HTTP 200 and a non-zero code: 100438 = invalid account address or page out of range
Response status code. 0 = success
Response message. 'success' on success
Malformed query parameters (e.g. missing account, page_size greater than 100)
GET /openapi/v1/rooms/traders?account=text HTTP/1.1
Host: api.deriw.com
Accept: */*
{
"code": 1,
"msg": "text",
"data": {
"items": [
{
"account": "text",
"total_volume": "text",
"win_rate": "text",
"total_fee": "text",
"unreleased_pnl": "text",
"released_pnl": "text",
"managed_fee": "text"
}
],
"total": 1,
"page_index": 1,
"page_size": 1
}
}Last updated