Packages

Elixir client library for cryptocurrency exchanges — generated from CCXT specs via compile-time macros.

Current section

Files

Jump to
ccxt_client priv specs extracted dydx.exs
Raw

priv/specs/extracted/dydx.exs

# dYdX Exchange Specification
#
# Auto-generated by: mix ccxt.extract dydx
# CCXT version: 4.5.42
# Spec format version: 2
#
# Review before use:
# - signing: Detected from sign() method, verify with testnet
# - endpoints: Raw paths extracted, map to unified API as needed
# - exceptions: Extracted (exact, broad, HTTP status codes)
# - features/options: Extracted from describe()
# - classification: Set to :supported initially, promote after validation
#
%{
api_param_requirements: nil,
certified: false,
classification: :pro,
comment: nil,
countries: [
"US"
],
currencies: %{},
currency_aliases: %{
"BCHSV" => "BSV",
"XBT" => "BTC"
},
dex: true,
enable_rate_limit: true,
endpoint_extraction_stats: %{
"capturedMethods" => 8,
"coveragePercent" => 100,
"enabledMethods" => 27,
"excluded" => [
%{
"method" => "editOrder",
"reason" => "emulated (returns cached data, no HTTP call)"
}
],
"excludedMethods" => 1,
"extractableMethods" => 26,
"failures" => [
%{
"error" => "dydx cancelOrder() cancelling using id is not currently supported, please use provide the clientOrderId parameter.",
"method" => "cancelOrder"
},
%{
"error" => "dydx cancelOrders only support clientOrderIds.",
"method" => "cancelOrders"
},
%{
"error" => "dydx signOnboardingAction() requires a privateKey to be set.",
"method" => "createLimitOrder"
},
%{
"error" => "dydx signOnboardingAction() requires a privateKey to be set.",
"method" => "createOrder"
},
%{
"error" => "dydx fetchAccounts() requires a user parameter inside 'params' or the walletAddress set",
"method" => "fetchAccounts"
},
%{
"error" => "dydx fetchAccounts() requires a user parameter inside 'params' or the walletAddress set",
"method" => "fetchBalance"
},
%{
"error" => "dydx fetchOrders() requires a user parameter inside 'params' or the walletAddress set",
"method" => "fetchClosedOrders"
},
%{
"error" => "dydx fetchDeposits() requires a user parameter inside 'params' or the walletAddress set",
"method" => "fetchDeposits"
},
%{
"error" => "dydx fetchDepositsWithdrawals() requires a user parameter inside 'params' or the walletAddress set",
"method" => "fetchDepositsWithdrawals"
},
%{
"error" => "dydx fetchLedger() requires a user parameter inside 'params' or the walletAddress set",
"method" => "fetchLedger"
},
%{
"error" => "dydx fetchOrders() requires a user parameter inside 'params' or the walletAddress set",
"method" => "fetchOpenOrders"
},
%{
"error" => "dydx fetchOrders() requires a user parameter inside 'params' or the walletAddress set",
"method" => "fetchOrders"
},
%{
"error" => "dydx fetchPositions() requires a user parameter inside 'params' or the walletAddress set",
"method" => "fetchPosition"
},
%{
"error" => "dydx fetchPositions() requires a user parameter inside 'params' or the walletAddress set",
"method" => "fetchPositions"
},
%{
"error" => "dydx fetchTransfers() requires a user parameter inside 'params' or the walletAddress set",
"method" => "fetchTransfers"
},
%{
"error" => "dydx fetchWithdrawals() requires a user parameter inside 'params' or the walletAddress set",
"method" => "fetchWithdrawals"
},
%{
"error" => "dydx transfer() only support USDC",
"method" => "transfer"
},
%{
"error" => "dydx withdraw() only support USDC",
"method" => "withdraw"
}
]
},
endpoints: [
%{
api_section: "indexer",
auth: false,
base_url: "https://indexer.dydx.trade/v4",
cost: 1,
expects: :list,
market_type: :swap,
method: :get,
name: :fetch_funding_rate_history,
param_mappings: %{
"symbol" => "market"
},
params: [
:symbol,
:since,
:limit
],
path: "/historicalFunding/{market}",
response_transformer: {:extract_path, ["historicalFunding"]},
source: :intercepted
},
%{
api_section: "indexer",
auth: false,
base_url: "https://indexer.dydx.trade/v4",
cost: 1,
expects: :single,
market_type: :swap,
method: :get,
name: :fetch_l2_order_book,
param_mappings: %{
"symbol" => "market"
},
params: [
:symbol,
:limit
],
path: "/orderbooks/perpetualMarket/{market}",
source: :intercepted
},
%{
api_section: "indexer",
auth: false,
base_url: "https://indexer.dydx.trade/v4",
cost: 1,
expects: :list,
market_type: :swap,
method: :get,
name: :fetch_markets,
param_mappings: %{},
params: [],
path: "/perpetualMarkets",
response_transformer: {:extract_path, ["markets"]},
source: :intercepted
},
%{
api_section: "indexer",
auth: false,
base_url: "https://indexer.dydx.trade/v4",
cost: 1,
default_params: %{
"fromIso" => "2024-01-01T00:00:00.000Z",
"limit" => 1000,
"resolution" => "1HOUR"
},
expects: :list,
market_type: :swap,
method: :get,
name: :fetch_ohlcv,
param_mappings: %{
"symbol" => "market",
"timeframe" => "resolution"
},
params: [
:symbol,
:timeframe,
:since,
:limit
],
path: "/candles/perpetualMarkets/{market}",
response_transformer: {:extract_path, ["candles"]},
source: :intercepted
},
%{
api_section: "indexer",
auth: false,
base_url: "https://indexer.dydx.trade/v4",
cost: 1,
expects: :single,
market_type: :swap,
method: :get,
name: :fetch_order,
param_mappings: %{
"id" => "orderId"
},
params: [
:id,
:symbol
],
path: "/orders/{orderId}",
source: :intercepted
},
%{
api_section: "indexer",
auth: false,
base_url: "https://indexer.dydx.trade/v4",
cost: 1,
expects: :single,
market_type: :swap,
method: :get,
name: :fetch_order_book,
param_mappings: %{
"symbol" => "market"
},
params: [
:symbol,
:limit
],
path: "/orderbooks/perpetualMarket/{market}",
source: :intercepted
},
%{
api_section: "indexer",
auth: false,
base_url: "https://indexer.dydx.trade/v4",
cost: 1,
expects: :single,
market_type: :swap,
method: :get,
name: :fetch_time,
param_mappings: %{},
params: [],
path: "/time",
response_transformer: {:extract_path_unwrap, ["epoch"]},
source: :intercepted
},
%{
api_section: "indexer",
auth: false,
base_url: "https://indexer.dydx.trade/v4",
cost: 1,
expects: :list,
market_type: :swap,
method: :get,
name: :fetch_trades,
param_mappings: %{
"symbol" => "market"
},
params: [
:symbol,
:since,
:limit
],
path: "/trades/perpetualMarket/{market}",
response_transformer: {:extract_path, ["trades"]},
source: :intercepted
}
],
error_code_details: %{
10 => %{
description: "The next block height is greater than the GoodTilBlock of the message",
type: :invalid_order
},
1000 => %{
description: "Proposed LiquidationsConfig is invalid",
type: :invalid_parameters
},
10000 => %{
description: "Proposed EquityTierLimitConfig is invalid",
type: :invalid_order
},
10001 => %{
description: "Subaccount cannot open more orders due to equity tier limit.",
type: :invalid_order
},
1001 => %{
description: "Subaccount has no perpetual positions to liquidate",
type: :invalid_parameters
},
1002 => %{
description: "Subaccount is not liquidatable",
type: :invalid_parameters
},
1003 => %{
description: "Subaccount does not have an open position for perpetual",
type: :invalid_order
},
1004 => %{
description: "Liquidation order has invalid size",
type: :invalid_order
},
1005 => %{
description: "Liquidation order is on the wrong side",
type: :invalid_order
},
1006 => %{
description: "Total fills amount exceeds size of liquidation order",
type: :invalid_order
},
1007 => %{
description: "Liquidation order does not contain any fills",
type: :invalid_order
},
1008 => %{
description: "Subaccount has previously liquidated this perpetual in the current block",
type: :invalid_order
},
1009 => %{
description: "Liquidation order has size smaller than min position notional specified in the liquidation config",
type: :invalid_order
},
1010 => %{
description: "Liquidation order has size greater than max position notional specified in the liquidation config",
type: :invalid_order
},
1011 => %{
description: "Liquidation exceeds the maximum notional amount that a single subaccount can have liquidated per block",
type: :invalid_order
},
1012 => %{
description: "Liquidation exceeds the maximum insurance fund payout amount for a given subaccount per block",
type: :invalid_order
},
1013 => %{
description: "Insurance fund does not have sufficient funds to cover liquidation losses",
type: :invalid_order
},
1014 => %{
description: "Invalid perpetual position size delta",
type: :invalid_order
},
1015 => %{
description: "Invalid delta base and/or quote quantums for insurance fund delta calculation",
type: :invalid_order
},
1017 => %{
description: "Cannot deleverage subaccount against itself",
type: :invalid_order
},
1018 => %{
description: "Deleveraging match cannot have fills with same id",
type: :invalid_order
},
1019 => %{
description: "Deleveraging match cannot have fills with zero amount",
type: :invalid_order
},
1020 => %{
description: "Position cannot be fully offset",
type: :invalid_order
},
1021 => %{
description: "Deleveraging match has incorrect value for isFinalSettlement flag",
type: :invalid_order
},
1022 => %{
description: "Liquidation conflicts with ClobPair status",
type: :invalid_order
},
11 => %{
description: "The GoodTilBlock of the message is further than ShortBlockWindow blocks into the future",
type: :invalid_order
},
11000 => %{
description: "Invalid order router address",
type: :invalid_order
},
12 => %{
description: "MsgPlaceOrder is invalid",
type: :invalid_order
},
13 => %{
description: "MsgProposedMatchOrders is invalid",
type: :invalid_order
},
14 => %{
description: "State filled amount cannot be unchanged",
type: :invalid_order
},
15 => %{
description: "State filled amount cannot decrease",
type: :invalid_order
},
16 => %{
description: "Cannot prune state fill amount that does not exist",
type: :invalid_order
},
17 => %{
description: "Subaccount cannot open more than 20 orders on a given CLOB and side",
type: :invalid_order
},
18 => %{
description: "`FillAmount` is not divisible by `StepBaseQuantums` of the specified `ClobPairId`",
type: :invalid_order
},
19 => %{
description: "The provided perpetual ID does not have any associated CLOB pairs",
type: :invalid_order
},
20 => %{
description: "Replacing an existing order failed",
type: :invalid_order
},
2000 => %{
description: "FillOrKill order could not be fully filled",
type: :invalid_order
},
2001 => %{
description: "Reduce-only orders cannot increase the position size",
type: :invalid_order
},
2002 => %{
description: "Reduce-only orders cannot change the position side",
type: :invalid_order
},
2003 => %{
description: "Post-only order would cross one or more maker orders",
type: :invalid_order
},
2004 => %{
description: "IOC order is already filled, remaining size is cancelled.",
type: :invalid_order
},
2005 => %{
description: "Order would violate isolated subaccount constraints.",
type: :invalid_order
},
21 => %{
description: "Clob pair and perpetual ids do not match",
type: :invalid_order
},
22 => %{
description: "Matched order has negative fee",
type: :invalid_order
},
23 => %{
description: "Subaccounts updated for a matched order, but fee transfer to fee-collector failed",
type: :invalid_order
},
24 => %{
description: "Order is fully filled",
type: :invalid_order
},
25 => %{
description: "Attempting to get price premium with a non-perpetual CLOB pair",
type: :invalid_order
},
26 => %{
description: "Index price is zero when calculating price premium",
type: :invalid_order
},
27 => %{
description: "Invalid ClobPair parameter",
type: :invalid_order
},
28 => %{
description: "Oracle price must be > 0.",
type: :invalid_order
},
29 => %{
description: "Invalid stateful order cancellation",
type: :invalid_order
},
30 => %{
description: "An order with the same `OrderId` and `OrderHash` has already been processed for this CLOB",
type: :invalid_order
},
3000 => %{
description: "Invalid order flags",
type: :invalid_order
},
3001 => %{
description: "Invalid order goodTilBlockTime",
type: :invalid_order
},
3002 => %{
description: "Stateful orders cannot require immediate execution",
type: :invalid_order
},
3003 => %{
description: "The block time is greater than the GoodTilBlockTime of the message",
type: :invalid_order
},
3004 => %{
description: "The GoodTilBlockTime of the message is further than StatefulOrderTimeWindow into the future",
type: :invalid_order
},
3005 => %{
description: "Existing stateful order has higher-or-equal priority than the new one",
type: :invalid_order
},
3006 => %{
description: "Stateful order does not exist",
type: :invalid_order
},
3007 => %{
description: "Stateful order collateralization check failed",
type: :invalid_order
},
3008 => %{
description: "Stateful order was previously cancelled and therefore cannot be placed",
type: :invalid_order
},
3009 => %{
description: "Stateful order was previously removed and therefore cannot be placed",
type: :invalid_order
},
3010 => %{
description: "Stateful order cancellation failed because the order was already removed from state",
type: :invalid_order
},
31 => %{
description: "Missing mid price for ClobPair",
type: :invalid_order
},
32 => %{
description: "Existing stateful order cancellation has higher-or-equal priority than the new one",
type: :invalid_order
},
33 => %{
description: "ClobPair with id already exists",
type: :invalid_order
},
34 => %{
description: "Order conflicts with ClobPair status",
type: :invalid_order
},
35 => %{
description: "Invalid ClobPair status transition",
type: :invalid_order
},
36 => %{
description: "Operation conflicts with ClobPair status",
type: :invalid_order
},
37 => %{
description: "Perpetual does not exist in state",
type: :invalid_order
},
39 => %{
description: "ClobPair update is invalid",
type: :invalid_order
},
40 => %{
description: "Authority is invalid",
type: :invalid_order
},
4000 => %{
description: "MsgProposedOperations is invalid",
type: :invalid_order
},
4001 => %{
description: "Match Order is invalid",
type: :invalid_order
},
4002 => %{
description: "Order was not previously placed in operations queue",
type: :invalid_order
},
4003 => %{
description: "Fill amount cannot be zero",
type: :invalid_order
},
4004 => %{
description: "Deleveraging fill is invalid",
type: :invalid_order
},
4005 => %{
description: "Deleveraged subaccount in proposed deleveraged operation failed deleveraging validation",
type: :invalid_order
},
4006 => %{
description: "Order Removal is invalid",
type: :invalid_order
},
4007 => %{
description: "Order Removal reason is invalid",
type: :invalid_order
},
4008 => %{
description: "Zero-fill deleveraging operation included in block for non-negative TNC subaccount",
type: :invalid_order
},
41 => %{
description: "perpetual ID is already associated with an existing CLOB pair",
type: :invalid_order
},
42 => %{
description: "Unexpected time in force",
type: :invalid_order
},
43 => %{
description: "Order has remaining size",
type: :invalid_order
},
44 => %{
description: "invalid time in force",
type: :invalid_order
},
45 => %{
description: "Invalid batch cancel message",
type: :invalid_order
},
46 => %{
description: "Batch cancel has failed",
type: :invalid_order
},
47 => %{
description: "CLOB has not been initialized",
type: :invalid_order
},
48 => %{
description: "This field has been deprecated",
type: :invalid_order
},
49 => %{
description: "Invalid TWAP order placement",
type: :invalid_order
},
50 => %{
description: "Invalid builder code",
type: :invalid_order
},
5000 => %{
description: "Proposed BlockRateLimitConfig is invalid",
type: :invalid_order
},
5001 => %{
description: "Block rate limit exceeded",
type: :invalid_order
},
6000 => %{
description: "Conditional type is invalid",
type: :invalid_order
},
6001 => %{
description: "Conditional order trigger subticks is invalid",
type: :invalid_order
},
6002 => %{
description: "Conditional order is untriggered",
type: :invalid_order
},
9 => %{
description: "A cancel already exists in the memclob for this order with a greater than or equal GoodTilBlock",
type: :invalid_order
},
9000 => %{
description: "Asset orders are not implemented",
type: :invalid_order
},
9001 => %{
description: "Updates for assets other than USDC are not implemented",
type: :invalid_order
},
9002 => %{
description: "This function is not implemented",
type: :invalid_order
},
9003 => %{
description: "Reduce-only is currently disabled for non-IOC orders",
type: :invalid_order
},
"insufficient funds" => %{
description: nil,
type: :insufficient_balance
}
},
error_codes: %{
10 => :invalid_order,
1000 => :invalid_parameters,
10000 => :invalid_order,
10001 => :invalid_order,
1001 => :invalid_parameters,
1002 => :invalid_parameters,
1003 => :invalid_order,
1004 => :invalid_order,
1005 => :invalid_order,
1006 => :invalid_order,
1007 => :invalid_order,
1008 => :invalid_order,
1009 => :invalid_order,
1010 => :invalid_order,
1011 => :invalid_order,
1012 => :invalid_order,
1013 => :invalid_order,
1014 => :invalid_order,
1015 => :invalid_order,
1017 => :invalid_order,
1018 => :invalid_order,
1019 => :invalid_order,
1020 => :invalid_order,
1021 => :invalid_order,
1022 => :invalid_order,
11 => :invalid_order,
11000 => :invalid_order,
12 => :invalid_order,
13 => :invalid_order,
14 => :invalid_order,
15 => :invalid_order,
16 => :invalid_order,
17 => :invalid_order,
18 => :invalid_order,
19 => :invalid_order,
20 => :invalid_order,
2000 => :invalid_order,
2001 => :invalid_order,
2002 => :invalid_order,
2003 => :invalid_order,
2004 => :invalid_order,
2005 => :invalid_order,
21 => :invalid_order,
22 => :invalid_order,
23 => :invalid_order,
24 => :invalid_order,
25 => :invalid_order,
26 => :invalid_order,
27 => :invalid_order,
28 => :invalid_order,
29 => :invalid_order,
30 => :invalid_order,
3000 => :invalid_order,
3001 => :invalid_order,
3002 => :invalid_order,
3003 => :invalid_order,
3004 => :invalid_order,
3005 => :invalid_order,
3006 => :invalid_order,
3007 => :invalid_order,
3008 => :invalid_order,
3009 => :invalid_order,
3010 => :invalid_order,
31 => :invalid_order,
32 => :invalid_order,
33 => :invalid_order,
34 => :invalid_order,
35 => :invalid_order,
36 => :invalid_order,
37 => :invalid_order,
39 => :invalid_order,
40 => :invalid_order,
4000 => :invalid_order,
4001 => :invalid_order,
4002 => :invalid_order,
4003 => :invalid_order,
4004 => :invalid_order,
4005 => :invalid_order,
4006 => :invalid_order,
4007 => :invalid_order,
4008 => :invalid_order,
41 => :invalid_order,
42 => :invalid_order,
43 => :invalid_order,
44 => :invalid_order,
45 => :invalid_order,
46 => :invalid_order,
47 => :invalid_order,
48 => :invalid_order,
49 => :invalid_order,
50 => :invalid_order,
5000 => :invalid_order,
5001 => :invalid_order,
6000 => :invalid_order,
6001 => :invalid_order,
6002 => :invalid_order,
9 => :invalid_order,
9000 => :invalid_order,
9001 => :invalid_order,
9002 => :invalid_order,
9003 => :invalid_order,
"insufficient funds" => :insufficient_balance
},
exceptions: %{
broad: %{
"insufficient funds" => :insufficient_funds
},
exact: %{
"10" => :invalid_order,
"1000" => :bad_request,
"10000" => :invalid_order,
"10001" => :invalid_order,
"1001" => :bad_request,
"1002" => :bad_request,
"1003" => :invalid_order,
"1004" => :invalid_order,
"1005" => :invalid_order,
"1006" => :invalid_order,
"1007" => :invalid_order,
"1008" => :invalid_order,
"1009" => :invalid_order,
"1010" => :invalid_order,
"1011" => :invalid_order,
"1012" => :invalid_order,
"1013" => :invalid_order,
"1014" => :invalid_order,
"1015" => :invalid_order,
"1017" => :invalid_order,
"1018" => :invalid_order,
"1019" => :invalid_order,
"1020" => :invalid_order,
"1021" => :invalid_order,
"1022" => :invalid_order,
"11" => :invalid_order,
"11000" => :invalid_order,
"12" => :invalid_order,
"13" => :invalid_order,
"14" => :invalid_order,
"15" => :invalid_order,
"16" => :invalid_order,
"17" => :invalid_order,
"18" => :invalid_order,
"19" => :invalid_order,
"20" => :invalid_order,
"2000" => :invalid_order,
"2001" => :invalid_order,
"2002" => :invalid_order,
"2003" => :invalid_order,
"2004" => :invalid_order,
"2005" => :invalid_order,
"21" => :invalid_order,
"22" => :invalid_order,
"23" => :invalid_order,
"24" => :invalid_order,
"25" => :invalid_order,
"26" => :invalid_order,
"27" => :invalid_order,
"28" => :invalid_order,
"29" => :invalid_order,
"30" => :invalid_order,
"3000" => :invalid_order,
"3001" => :invalid_order,
"3002" => :invalid_order,
"3003" => :invalid_order,
"3004" => :invalid_order,
"3005" => :invalid_order,
"3006" => :invalid_order,
"3007" => :invalid_order,
"3008" => :invalid_order,
"3009" => :invalid_order,
"3010" => :invalid_order,
"31" => :invalid_order,
"32" => :invalid_order,
"33" => :invalid_order,
"34" => :invalid_order,
"35" => :invalid_order,
"36" => :invalid_order,
"37" => :invalid_order,
"39" => :invalid_order,
"40" => :invalid_order,
"4000" => :invalid_order,
"4001" => :invalid_order,
"4002" => :invalid_order,
"4003" => :invalid_order,
"4004" => :invalid_order,
"4005" => :invalid_order,
"4006" => :invalid_order,
"4007" => :invalid_order,
"4008" => :invalid_order,
"41" => :invalid_order,
"42" => :invalid_order,
"43" => :invalid_order,
"44" => :invalid_order,
"45" => :invalid_order,
"46" => :invalid_order,
"47" => :invalid_order,
"48" => :invalid_order,
"49" => :invalid_order,
"50" => :invalid_order,
"5000" => :invalid_order,
"5001" => :invalid_order,
"6000" => :invalid_order,
"6001" => :invalid_order,
"6002" => :invalid_order,
"9" => :invalid_order,
"9000" => :invalid_order,
"9001" => :invalid_order,
"9002" => :invalid_order,
"9003" => :invalid_order
}
},
exchange_options: %{
"chainId" => 1,
"chainName" => "dydx-mainnet-1",
"defaultFeeDenom" => "uusdc",
"defaultFeeMultiplier" => "1.6",
"defaultNetworkCodeReplacements" => %{
"BRC20" => %{
"BRC20" => "BTC"
},
"CRO" => %{
"CRC20" => "CRONOS"
},
"ETH" => %{
"ERC20" => "ETH"
},
"TRX" => %{
"TRC20" => "TRX"
}
},
"feeDenom" => %{
"CHAINTOKEN_DECIMALS" => 18,
"CHAINTOKEN_DENOM" => "adydx",
"CHAINTOKEN_GAS_PRICE" => "25000000000",
"USDC_DECIMALS" => 6,
"USDC_DENOM" => "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5",
"USDC_GAS_DENOM" => "uusdc",
"USDC_GAS_PRICE" => "0.025"
},
"mnemonic" => nil,
"networksById" => %{},
"sandboxMode" => false
},
extended_metadata: %{
limits: %{
"amount" => %{},
"cost" => %{},
"leverage" => %{},
"price" => %{}
},
logo_url: "https://github.com/user-attachments/assets/617ea0c1-f05a-4d26-9fcb-a0d1d4091ae1",
referral_url: "dydx.trade?ref=ccxt"
},
extracted_metadata: %{
ccxt_version: "4.5.42"
},
features: %{
default: %{
create_order: %{
hedged: false,
iceberg: false,
leverage: false,
margin_mode: false,
market_buy_by_cost: false,
market_buy_requires_price: false,
self_trade_prevention: false,
stop_loss_price: false,
take_profit_price: false,
time_in_force: %{
fok: true,
gtd: true,
ioc: true,
po: true
},
trailing: false,
trigger_direction: false,
trigger_price: true,
trigger_price_type: %{
index: false,
last: true,
mark: true
}
},
fetch_closed_orders: %{
limit: 500,
margin_mode: false,
symbol_required: false,
trailing: true,
trigger: true,
until_days: 100000
},
fetch_my_trades: %{
days_back: 90,
limit: 500,
margin_mode: false,
symbol_required: false,
until_days: 10000
},
fetch_ohlcv: %{
limit: 1000
},
fetch_open_orders: %{
limit: 500,
margin_mode: false,
symbol_required: false,
trailing: true,
trigger: true
},
fetch_order: %{
margin_mode: false,
symbol_required: false,
trailing: false,
trigger: true
},
fetch_orders: %{
limit: 500,
margin_mode: false,
symbol_required: false,
trailing: true,
trigger: true,
until_days: 100000
},
sandbox: true
},
for_swap: %{
create_order: %{
hedged: true
},
extends: "default"
},
future: %{},
swap: %{
linear: %{
extends: "forSwap"
}
}
},
fees: %{
trading: %{
maker: 0.0001,
percentage: true,
taker: 0.0005,
tier_based: true
}
},
forward_aliases: nil,
handle_content_type_application_zip: nil,
handle_errors_source: "handleErrors(httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody) {\n if (!response) {\n return undefined; // fallback to default error handler\n }\n //\n // abci response\n // { \"result\": { \"code\": 0 } }\n //\n // rest response\n // { \"code\": 123 }\n //\n const result = this.safeDict(response, 'result');\n let errorCode = this.safeString(result, 'code');\n if (!errorCode) {\n errorCode = this.safeString(response, 'code');\n }\n if (errorCode) {\n const errorCodeNum = this.parseToNumeric(errorCode);\n if (errorCodeNum > 0) {\n const feedback = this.id + ' ' + this.json(response);\n this.throwExactlyMatchedException(this.exceptions['exact'], errorCode, feedback);\n this.throwBroadlyMatchedException(this.exceptions['broad'], body, feedback);\n throw new errors.ExchangeError(feedback);\n }\n }\n return undefined;\n }",
has: %{
add_margin: false,
borrow_cross_margin: false,
borrow_isolated_margin: false,
borrow_margin: false,
c_o_r_s: false,
cancel_all_orders: false,
cancel_all_orders_after: false,
cancel_all_orders_ws: false,
cancel_order: true,
cancel_order_with_client_order_id: false,
cancel_order_ws: false,
cancel_orders: true,
cancel_orders_with_client_order_id: false,
cancel_orders_ws: false,
cancel_withdraw: false,
close_all_positions: false,
close_position: false,
create_convert_trade: false,
create_deposit_address: false,
create_limit_buy_order: false,
create_limit_buy_order_ws: false,
create_limit_order: true,
create_limit_order_ws: false,
create_limit_sell_order: false,
create_limit_sell_order_ws: false,
create_market_buy_order: false,
create_market_buy_order_with_cost: false,
create_market_buy_order_with_cost_ws: false,
create_market_buy_order_ws: false,
create_market_order: false,
create_market_order_with_cost: false,
create_market_order_with_cost_ws: false,
create_market_order_ws: true,
create_market_sell_order: false,
create_market_sell_order_with_cost: false,
create_market_sell_order_with_cost_ws: false,
create_market_sell_order_ws: false,
create_order: true,
create_order_with_take_profit_and_stop_loss: false,
create_order_with_take_profit_and_stop_loss_ws: false,
create_order_ws: false,
create_orders: false,
create_post_only_order: false,
create_post_only_order_ws: false,
create_reduce_only_order: false,
create_reduce_only_order_ws: false,
create_stop_limit_order: false,
create_stop_limit_order_ws: false,
create_stop_loss_order: false,
create_stop_loss_order_ws: false,
create_stop_market_order: false,
create_stop_market_order_ws: false,
create_stop_order: false,
create_stop_order_ws: false,
create_take_profit_order: false,
create_take_profit_order_ws: false,
create_trailing_amount_order: false,
create_trailing_amount_order_ws: false,
create_trailing_percent_order: false,
create_trailing_percent_order_ws: false,
create_trigger_order: false,
create_trigger_order_ws: false,
deposit: false,
edit_order: true,
edit_order_with_client_order_id: false,
edit_order_ws: false,
edit_orders: false,
fetch_a_d_l_rank: false,
fetch_accounts: true,
fetch_balance: true,
fetch_balance_ws: false,
fetch_bids_asks: false,
fetch_borrow_interest: false,
fetch_borrow_rate: false,
fetch_borrow_rate_histories: false,
fetch_borrow_rate_history: false,
fetch_borrow_rates: false,
fetch_borrow_rates_per_symbol: false,
fetch_canceled_and_closed_orders: false,
fetch_canceled_orders: false,
fetch_closed_order: false,
fetch_closed_orders: true,
fetch_closed_orders_ws: false,
fetch_convert_currencies: false,
fetch_convert_quote: false,
fetch_convert_trade: false,
fetch_convert_trade_history: false,
fetch_cross_borrow_rate: false,
fetch_cross_borrow_rates: false,
fetch_currencies: false,
fetch_currencies_ws: true,
fetch_deposit: false,
fetch_deposit_address: false,
fetch_deposit_addresses: false,
fetch_deposit_addresses_by_network: false,
fetch_deposit_withdraw_fee: false,
fetch_deposit_withdraw_fees: false,
fetch_deposits: true,
fetch_deposits_withdrawals: true,
fetch_deposits_ws: false,
fetch_funding_history: false,
fetch_funding_interval: false,
fetch_funding_intervals: false,
fetch_funding_rate: false,
fetch_funding_rate_history: true,
fetch_funding_rates: false,
fetch_greeks: false,
fetch_index_ohlcv: false,
fetch_isolated_borrow_rate: false,
fetch_isolated_borrow_rates: false,
fetch_isolated_positions: false,
fetch_l2_order_book: true,
fetch_l3_order_book: false,
fetch_last_prices: false,
fetch_ledger: true,
fetch_ledger_entry: false,
fetch_leverage: false,
fetch_leverage_tiers: false,
fetch_leverages: false,
fetch_liquidations: false,
fetch_long_short_ratio: false,
fetch_long_short_ratio_history: false,
fetch_margin_adjustment_history: false,
fetch_margin_mode: false,
fetch_margin_modes: false,
fetch_mark_ohlcv: false,
fetch_mark_prices: false,
fetch_market_leverage_tiers: false,
fetch_markets: true,
fetch_markets_ws: false,
fetch_my_liquidations: false,
fetch_my_settlement_history: false,
fetch_my_trades: false,
fetch_my_trades_ws: false,
fetch_ohlcv: true,
fetch_ohlcv_ws: false,
fetch_open_interest: false,
fetch_open_interest_history: false,
fetch_open_interests: false,
fetch_open_order: false,
fetch_open_orders: true,
fetch_open_orders_ws: false,
fetch_option: false,
fetch_option_chain: false,
fetch_order: true,
fetch_order_book: true,
fetch_order_book_ws: false,
fetch_order_books: false,
fetch_order_trades: false,
fetch_order_with_client_order_id: false,
fetch_order_ws: false,
fetch_orders: true,
fetch_orders_by_status: false,
fetch_orders_ws: false,
fetch_position: true,
fetch_position_a_d_l_rank: false,
fetch_position_history: false,
fetch_position_mode: false,
fetch_position_ws: false,
fetch_positions: true,
fetch_positions_a_d_l_rank: false,
fetch_positions_for_symbol: false,
fetch_positions_for_symbol_ws: false,
fetch_positions_history: false,
fetch_positions_risk: false,
fetch_positions_ws: false,
fetch_premium_index_ohlcv: false,
fetch_settlement_history: false,
fetch_status: false,
fetch_ticker: false,
fetch_ticker_ws: false,
fetch_tickers: false,
fetch_tickers_ws: false,
fetch_time: true,
fetch_trades: true,
fetch_trades_ws: false,
fetch_trading_fee: false,
fetch_trading_fees: false,
fetch_trading_fees_ws: false,
fetch_trading_limits: false,
fetch_transaction_fee: false,
fetch_transaction_fees: false,
fetch_transactions: false,
fetch_transfer: false,
fetch_transfers: true,
fetch_underlying_assets: false,
fetch_volatility_history: false,
fetch_withdraw_addresses: false,
fetch_withdrawal: false,
fetch_withdrawal_whitelist: false,
fetch_withdrawals: true,
fetch_withdrawals_ws: false,
future: false,
margin: false,
option: false,
private_api: true,
public_api: true,
reduce_margin: false,
repay_cross_margin: false,
repay_isolated_margin: false,
sandbox: false,
set_leverage: false,
set_margin: false,
set_margin_mode: false,
set_position_mode: false,
sign_in: false,
spot: false,
swap: true,
transfer: true,
un_watch_my_trades: false,
un_watch_ohlcv: false,
un_watch_ohlcv_for_symbols: false,
un_watch_order_book: false,
un_watch_order_book_for_symbols: false,
un_watch_orders: false,
un_watch_positions: false,
un_watch_ticker: false,
un_watch_tickers: false,
un_watch_trades: false,
un_watch_trades_for_symbols: false,
watch_balance: false,
watch_bids_asks: false,
watch_liquidations: false,
watch_liquidations_for_symbols: false,
watch_my_liquidations: false,
watch_my_liquidations_for_symbols: false,
watch_my_trades: false,
watch_ohlcv: true,
watch_ohlcv_for_symbols: false,
watch_order_book: true,
watch_order_book_for_symbols: false,
watch_orders: false,
watch_orders_for_symbols: false,
watch_position: false,
watch_positions: false,
watch_status: false,
watch_ticker: false,
watch_tickers: false,
watch_trades: true,
watch_trades_for_symbols: false,
withdraw: true,
ws: false
},
http_config: nil,
id: "dydx",
markets: nil,
name: "dYdX",
ohlcv_timestamp_resolution: :unknown,
options: %{
"chain_id" => 1,
"chain_name" => "dydx-mainnet-1",
"default_fee_denom" => "uusdc",
"default_fee_multiplier" => "1.6",
"fee_denom" => %{
"CHAINTOKEN_DECIMALS" => 18,
"CHAINTOKEN_DENOM" => "adydx",
"CHAINTOKEN_GAS_PRICE" => "25000000000",
"USDC_DECIMALS" => 6,
"USDC_DENOM" => "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5",
"USDC_GAS_DENOM" => "uusdc",
"USDC_GAS_PRICE" => "0.025"
},
"mnemonic" => nil,
:sandbox_mode => false
},
order_mappings: nil,
param_mappings: %{
"id" => "orderId",
"symbol" => "market",
"timeframe" => "resolution"
},
parse_methods: [
%{
"comment" => nil,
"examples" => [],
"line_end" => 2421,
"line_start" => 2413,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "response"
},
%{
"comment" => nil,
"key" => "USDC",
"value" => "account"
}
],
"name" => "parseBalance",
"signature" => "parseBalance (response): Balances",
"source" => "parseBalance (response): Balances {\n const account = this.account ();\n account['free'] = this.safeString (response, 'freeCollateral');\n const result: Dict = {\n 'info': response,\n 'USDC': account,\n };\n return this.safeBalance (result);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"id\": \"6a6075bc-7183-5fd9-bc9d-894e238aa527\",\n \"sender\": {\n \"address\": \"dydx14zzueazeh0hj67cghhf9jypslcf9sh2n5k6art\",\n \"subaccountNumber\": 0\n },\n \"recipient\": {\n \"address\": \"dydx1slanxj8x9ntk9knwa6cvfv2tzlsq5gk3dshml0\",\n \"subaccountNumber\": 1\n },\n \"size\": \"0.000001\",\n \"createdAt\": \"2025-07-29T09:43:02.105Z\",\n \"createdAtHeight\": \"45116125\",\n \"symbol\": \"USDC\",\n \"type\": \"TRANSFER_OUT\",\n \"transactionHash\": \"92B4744BA1B783CF37C79A50BEBC47FFD59C8D5197D62A8485D3DCCE9AF220AF\"\n }"
],
"line_end" => 1776,
"line_start" => 1723,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "item"
},
%{
"comment" => nil,
"key" => "id",
"value" => "this.safeString (item, 'id')"
},
%{
"comment" => nil,
"key" => "direction",
"value" => "direction"
},
%{
"comment" => nil,
"key" => "account",
"value" => "this.safeString (sender, 'address')"
},
%{
"comment" => nil,
"key" => "referenceAccount",
"value" => "this.safeString (recipient, 'address')"
},
%{
"comment" => nil,
"key" => "referenceId",
"value" => "this.safeString (item, 'transactionHash')"
},
%{
"comment" => nil,
"key" => "type",
"value" => "this.parseLedgerEntryType (type)"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "code"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "this.parseNumber (amount)"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "before",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "after",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "status",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "undefined"
}
],
"name" => "parseLedgerEntry",
"signature" => "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry",
"source" => "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n //\n // {\n // \"id\": \"6a6075bc-7183-5fd9-bc9d-894e238aa527\",\n // \"sender\": {\n // \"address\": \"dydx14zzueazeh0hj67cghhf9jypslcf9sh2n5k6art\",\n // \"subaccountNumber\": 0\n // },\n // \"recipient\": {\n // \"address\": \"dydx1slanxj8x9ntk9knwa6cvfv2tzlsq5gk3dshml0\",\n // \"subaccountNumber\": 1\n // },\n // \"size\": \"0.000001\",\n // \"createdAt\": \"2025-07-29T09:43:02.105Z\",\n // \"createdAtHeight\": \"45116125\",\n // \"symbol\": \"USDC\",\n // \"type\": \"TRANSFER_OUT\",\n // \"transactionHash\": \"92B4744BA1B783CF37C79A50BEBC47FFD59C8D5197D62A8485D3DCCE9AF220AF\"\n // }\n //\n const currencyId = this.safeString (item, 'symbol');\n const code = this.safeCurrencyCode (currencyId, currency);\n currency = this.safeCurrency (currencyId, currency);\n const type = this.safeStringUpper (item, 'type');\n let direction = undefined;\n if (type !== undefined) {\n if (type === 'TRANSFER_IN' || type === 'DEPOSIT') {\n direction = 'in';\n } else if (type === 'TRANSFER_OUT' || type === 'WITHDRAWAL') {\n direction = 'out';\n }\n }\n const amount = this.safeString (item, 'size');\n const timestamp = this.parse8601 (this.safeString (item, 'createdAt'));\n const sender = this.safeDict (item, 'sender');\n const recipient = this.safeDict (item, 'recipient');\n return this.safeLedgerEntry ({\n 'info': item,\n 'id': this.safeString (item, 'id'),\n 'direction': direction,\n 'account': this.safeString (sender, 'address'),\n 'referenceAccount': this.safeString (recipient, 'address'),\n 'referenceId': this.safeString (item, 'transactionHash'),\n 'type': this.parseLedgerEntryType (type),\n 'currency': code,\n 'amount': this.parseNumber (amount),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'before': undefined,\n 'after': undefined,\n 'status': undefined,\n 'fee': undefined,\n }, currency) as LedgerEntry;\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 1786,
"line_start" => 1778,
"mappings" => [],
"name" => "parseLedgerEntryType",
"signature" => "parseLedgerEntryType (type)",
"source" => "parseLedgerEntryType (type) {\n const ledgerType: Dict = {\n 'TRANSFER_IN': 'transfer',\n 'TRANSFER_OUT': 'transfer',\n 'DEPOSIT': 'deposit',\n 'WITHDRAWAL': 'withdrawal',\n };\n return this.safeString (ledgerType, type, type);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"clobPairId\": \"0\",\n \"ticker\": \"BTC-USD\",\n \"status\": \"ACTIVE\",\n \"oraclePrice\": \"118976.5376\",\n \"priceChange24H\": \"659.9736\",\n \"volume24H\": \"1292729.3605\",\n \"trades24H\": 9387,\n \"nextFundingRate\": \"0\",\n \"initialMarginFraction\": \"0.02\",\n \"maintenanceMarginFraction\": \"0.012\",\n \"openInterest\": \"52.0691\",\n \"atomicResolution\": -10,\n \"quantumConversionExponent\": -9,\n \"tickSize\": \"1\",\n \"stepSize\": \"0.0001\",\n \"stepBaseQuantums\": 1000000,\n \"subticksPerTick\": 100000,\n \"marketType\": \"CROSS\",\n \"openInterestLowerCap\": \"0\",\n \"openInterestUpperCap\": \"0\",\n \"baseOpenInterest\": \"50.3776\",\n \"defaultFundingRate1H\": \"0\"\n }"
],
"line_end" => 577,
"line_start" => 479,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "this.safeString (market, 'ticker')"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "base",
"value" => "base"
},
%{
"comment" => nil,
"key" => "quote",
"value" => "quote"
},
%{
"comment" => nil,
"key" => "settle",
"value" => "settle"
},
%{
"comment" => nil,
"key" => "baseId",
"value" => "baseId"
},
%{
"comment" => nil,
"key" => "baseName",
"value" => "baseName"
},
%{
"comment" => nil,
"key" => "quoteId",
"value" => "quoteId"
},
%{
"comment" => nil,
"key" => "settleId",
"value" => "settleId"
},
%{
"comment" => nil,
"key" => "type",
"value" => "'swap'"
},
%{
"comment" => nil,
"key" => "spot",
"value" => "false"
},
%{
"comment" => nil,
"key" => "margin",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "swap",
"value" => "swap"
},
%{
"comment" => nil,
"key" => "future",
"value" => "false"
},
%{
"comment" => nil,
"key" => "option",
"value" => "false"
},
%{
"comment" => nil,
"key" => "active",
"value" => "active"
},
%{
"comment" => nil,
"key" => "contract",
"value" => "contract"
},
%{
"comment" => nil,
"key" => "contractSize",
"value" => "this.parseNumber ('1')"
},
%{
"comment" => nil,
"key" => "inverse",
"value" => "false"
},
%{
"comment" => nil,
"key" => "taker",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "maker",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "expiry",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "expiryDatetime",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "strike",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "optionType",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "precision",
"value" => "{\n 'amount': this.parseNumber (amountPrecisionStr),\n 'price': this.parseNumber (pricePrecisionStr),\n }"
},
%{
"comment" => nil,
"key" => "limits",
"value" => "{\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n 'amount': {\n 'min': undefined,\n 'max': undefined,\n },\n 'price': {\n 'min': undefined,\n 'max': undefined,\n },\n 'cost': {\n 'min': undefined,\n 'max': undefined,\n },\n }"
},
%{
"comment" => nil,
"key" => "created",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "info",
"value" => "market"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "this.parseNumber (amountPrecisionStr)"
},
%{
"comment" => nil,
"key" => "price",
"value" => "this.parseNumber (pricePrecisionStr)"
}
],
"name" => "parseMarket",
"signature" => "parseMarket (market: Dict): Market",
"source" => "parseMarket (market: Dict): Market {\n //\n // {\n // \"clobPairId\": \"0\",\n // \"ticker\": \"BTC-USD\",\n // \"status\": \"ACTIVE\",\n // \"oraclePrice\": \"118976.5376\",\n // \"priceChange24H\": \"659.9736\",\n // \"volume24H\": \"1292729.3605\",\n // \"trades24H\": 9387,\n // \"nextFundingRate\": \"0\",\n // \"initialMarginFraction\": \"0.02\",\n // \"maintenanceMarginFraction\": \"0.012\",\n // \"openInterest\": \"52.0691\",\n // \"atomicResolution\": -10,\n // \"quantumConversionExponent\": -9,\n // \"tickSize\": \"1\",\n // \"stepSize\": \"0.0001\",\n // \"stepBaseQuantums\": 1000000,\n // \"subticksPerTick\": 100000,\n // \"marketType\": \"CROSS\",\n // \"openInterestLowerCap\": \"0\",\n // \"openInterestUpperCap\": \"0\",\n // \"baseOpenInterest\": \"50.3776\",\n // \"defaultFundingRate1H\": \"0\"\n // }\n //\n const quoteId = 'USDC';\n const marketId = this.safeString (market, 'ticker');\n const parts = marketId.split ('-');\n const baseName = this.safeString (parts, 0);\n const baseId = this.safeString (market, 'baseId', baseName); // idk where 'baseId' comes from, but leaving as is\n const base = this.safeCurrencyCode (baseId);\n const quote = this.safeCurrencyCode (quoteId);\n const settleId = 'USDC';\n const settle = this.safeCurrencyCode (settleId);\n const symbol = base + '/' + quote + ':' + settle;\n const contract = true;\n const swap = true;\n const amountPrecisionStr = this.safeString (market, 'stepSize');\n const pricePrecisionStr = this.safeString (market, 'tickSize');\n const status = this.safeString (market, 'status');\n let active = true;\n if (status !== 'ACTIVE') {\n active = false;\n }\n return this.safeMarketStructure ({\n 'id': this.safeString (market, 'ticker'),\n 'symbol': symbol,\n 'base': base,\n 'quote': quote,\n 'settle': settle,\n 'baseId': baseId,\n 'baseName': baseName,\n 'quoteId': quoteId,\n 'settleId': settleId,\n 'type': 'swap',\n 'spot': false,\n 'margin': undefined,\n 'swap': swap,\n 'future': false,\n 'option': false,\n 'active': active,\n 'contract': contract,\n 'contractSize': this.parseNumber ('1'), // trades seem in absolute size\n 'linear': true,\n 'inverse': false,\n 'taker': undefined,\n 'maker': undefined,\n 'expiry': undefined,\n 'expiryDatetime': undefined,\n 'strike': undefined,\n 'optionType': undefined,\n 'precision': {\n 'amount': this.parseNumber (amountPrecisionStr),\n 'price': this.parseNumber (pricePrecisionStr),\n },\n 'limits': {\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n 'amount': {\n 'min': undefined,\n 'max': undefined,\n },\n 'price': {\n 'min': undefined,\n 'max': undefined,\n },\n 'cost': {\n 'min': undefined,\n 'max': undefined,\n },\n },\n 'created': undefined,\n 'info': market,\n });\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"startedAt\": \"2025-07-25T09:47:00.000Z\",\n \"ticker\": \"BTC-USD\",\n \"resolution\": \"1MIN\",\n \"low\": \"116099\",\n \"high\": \"116099\",\n \"open\": \"116099\",\n \"close\": \"116099\",\n \"baseTokenVolume\": \"0\",\n \"usdVolume\": \"0\",\n \"trades\": 0,\n \"startingOpenInterest\": \"54.0594\",\n \"orderbookMidPriceOpen\": \"115845.5\",\n \"orderbookMidPriceClose\": \"115845.5\"\n }"
],
"line_end" => 728,
"line_start" => 702,
"mappings" => [],
"name" => "parseOHLCV",
"signature" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV",
"source" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n //\n // {\n // \"startedAt\": \"2025-07-25T09:47:00.000Z\",\n // \"ticker\": \"BTC-USD\",\n // \"resolution\": \"1MIN\",\n // \"low\": \"116099\",\n // \"high\": \"116099\",\n // \"open\": \"116099\",\n // \"close\": \"116099\",\n // \"baseTokenVolume\": \"0\",\n // \"usdVolume\": \"0\",\n // \"trades\": 0,\n // \"startingOpenInterest\": \"54.0594\",\n // \"orderbookMidPriceOpen\": \"115845.5\",\n // \"orderbookMidPriceClose\": \"115845.5\"\n // }\n //\n return [\n this.parse8601 (this.safeString (ohlcv, 'startedAt')),\n this.safeNumber (ohlcv, 'open'),\n this.safeNumber (ohlcv, 'high'),\n this.safeNumber (ohlcv, 'low'),\n this.safeNumber (ohlcv, 'close'),\n this.safeNumber (ohlcv, 'baseTokenVolume'),\n ];\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"id\": \"dad46410-3444-5566-a129-19a619300fb7\",\n \"subaccountId\": \"8586bcf6-1f58-5ec9-a0bc-e53db273e7b0\",\n \"clientId\": \"716238006\",\n \"clobPairId\": \"0\",\n \"side\": \"BUY\",\n \"size\": \"0.001\",\n \"totalFilled\": \"0.001\",\n \"price\": \"400000\",\n \"type\": \"LIMIT\",\n \"status\": \"FILLED\",\n \"timeInForce\": \"GTT\",\n \"reduceOnly\": false,\n \"orderFlags\": \"64\",\n \"goodTilBlockTime\": \"2025-07-28T12:07:33.000Z\",\n \"createdAtHeight\": \"45058325\",\n \"clientMetadata\": \"2\",\n \"updatedAt\": \"2025-07-28T12:06:35.330Z\",\n \"updatedAtHeight\": \"45058326\",\n \"postOnly\": false,\n \"ticker\": \"BTC-USD\",\n \"subaccountNumber\": 0\n }"
],
"line_end" => 922,
"line_start" => 861,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "order"
},
%{
"comment" => nil,
"key" => "id",
"value" => "this.safeString (order, 'id')"
},
%{
"comment" => nil,
"key" => "clientOrderId",
"value" => "this.safeString (order, 'clientId')"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "lastTradeTimestamp",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "lastUpdateTimestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "type",
"value" => "type"
},
%{
"comment" => nil,
"key" => "timeInForce",
"value" => "timeInForce"
},
%{
"comment" => nil,
"key" => "postOnly",
"value" => "this.safeBool (order, 'postOnly')"
},
%{
"comment" => nil,
"key" => "reduceOnly",
"value" => "this.safeBool (order, 'reduceOnly')"
},
%{
"comment" => nil,
"key" => "side",
"value" => "side"
},
%{
"comment" => nil,
"key" => "price",
"value" => "price"
},
%{
"comment" => nil,
"key" => "triggerPrice",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "amount"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "average",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "filled",
"value" => "filled"
},
%{
"comment" => nil,
"key" => "remaining",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "status",
"value" => "status"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "trades",
"value" => "undefined"
}
],
"name" => "parseOrder",
"signature" => "parseOrder (order: Dict, market: Market = undefined): Order",
"source" => "parseOrder (order: Dict, market: Market = undefined): Order {\n //\n // {\n // \"id\": \"dad46410-3444-5566-a129-19a619300fb7\",\n // \"subaccountId\": \"8586bcf6-1f58-5ec9-a0bc-e53db273e7b0\",\n // \"clientId\": \"716238006\",\n // \"clobPairId\": \"0\",\n // \"side\": \"BUY\",\n // \"size\": \"0.001\",\n // \"totalFilled\": \"0.001\",\n // \"price\": \"400000\",\n // \"type\": \"LIMIT\",\n // \"status\": \"FILLED\",\n // \"timeInForce\": \"GTT\",\n // \"reduceOnly\": false,\n // \"orderFlags\": \"64\",\n // \"goodTilBlockTime\": \"2025-07-28T12:07:33.000Z\",\n // \"createdAtHeight\": \"45058325\",\n // \"clientMetadata\": \"2\",\n // \"updatedAt\": \"2025-07-28T12:06:35.330Z\",\n // \"updatedAtHeight\": \"45058326\",\n // \"postOnly\": false,\n // \"ticker\": \"BTC-USD\",\n // \"subaccountNumber\": 0\n // }\n //\n const status = this.parseOrderStatus (this.safeStringUpper (order, 'status'));\n const marketId = this.safeString (order, 'ticker');\n const symbol = this.safeSymbol (marketId, market);\n const filled = this.safeString (order, 'totalFilled');\n const timestamp = this.parse8601 (this.safeString (order, 'updatedAt'));\n const price = this.safeString (order, 'price');\n const amount = this.safeString (order, 'size');\n const type = this.parseOrderType (this.safeStringUpper (order, 'type'));\n const side = this.safeStringLower (order, 'side');\n const timeInForce = this.safeStringUpper (order, 'timeInForce');\n return this.safeOrder ({\n 'info': order,\n 'id': this.safeString (order, 'id'),\n 'clientOrderId': this.safeString (order, 'clientId'),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'lastTradeTimestamp': undefined,\n 'lastUpdateTimestamp': timestamp,\n 'symbol': symbol,\n 'type': type,\n 'timeInForce': timeInForce,\n 'postOnly': this.safeBool (order, 'postOnly'),\n 'reduceOnly': this.safeBool (order, 'reduceOnly'),\n 'side': side,\n 'price': price,\n 'triggerPrice': undefined,\n 'amount': amount,\n 'cost': undefined,\n 'average': undefined,\n 'filled': filled,\n 'remaining': undefined,\n 'status': status,\n 'fee': undefined,\n 'trades': undefined,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 933,
"line_start" => 924,
"mappings" => [],
"name" => "parseOrderStatus",
"signature" => "parseOrderStatus (status: Str)",
"source" => "parseOrderStatus (status: Str) {\n const statuses: Dict = {\n 'UNTRIGGERED': 'open',\n 'OPEN': 'open',\n 'FILLED': 'closed',\n 'CANCELED': 'canceled',\n 'BEST_EFFORT_CANCELED': 'canceling',\n };\n return this.safeString (statuses, status, status);\n }"
},
%{
"comment" => nil,
"examples" => [],
"line_end" => 946,
"line_start" => 935,
"mappings" => [],
"name" => "parseOrderType",
"signature" => "parseOrderType (type: Str)",
"source" => "parseOrderType (type: Str) {\n const types: Dict = {\n 'LIMIT': 'LIMIT',\n 'STOP_LIMIT': 'LIMIT',\n 'TAKE_PROFIT_LIMIT': 'LIMIT',\n 'MARKET': 'MARKET',\n 'STOP_MARKET': 'MARKET',\n 'TAKE_PROFIT_MARKET': 'MARKET',\n 'TRAILING_STOP': 'MARKET',\n };\n return this.safeStringUpper (types, type, type);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"market\": \"BTC-USD\",\n \"status\": \"OPEN\",\n \"side\": \"SHORT\",\n \"size\": \"-0.407\",\n \"maxSize\": \"-0.009\",\n \"entryPrice\": \"118692.04840909090909090909\",\n \"exitPrice\": \"119526.565625\",\n \"realizedPnl\": \"476.42665909090909090909088\",\n \"unrealizedPnl\": \"-57.26681734000000000000037\",\n \"createdAt\": \"2025-07-14T07:53:55.631Z\",\n \"createdAtHeight\": \"44140908\",\n \"closedAt\": null,\n \"sumOpen\": \"0.44\",\n \"sumClose\": \"0.032\",\n \"netFunding\": \"503.13121\",\n \"subaccountNumber\": 0\n }"
],
"line_end" => 1124,
"line_start" => 1069,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "position"
},
%{
"comment" => nil,
"key" => "id",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "entryPrice",
"value" => "this.safeNumber (position, 'entryPrice')"
},
%{
"comment" => nil,
"key" => "markPrice",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "notional",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "collateral",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "unrealizedPnl",
"value" => "this.safeNumber (position, 'unrealizedPnl')"
},
%{
"comment" => nil,
"key" => "side",
"value" => "side"
},
%{
"comment" => nil,
"key" => "contracts",
"value" => "this.parseNumber (quantity)"
},
%{
"comment" => nil,
"key" => "contractSize",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "hedged",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "maintenanceMargin",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "maintenanceMarginPercentage",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "initialMargin",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "initialMarginPercentage",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "leverage",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "liquidationPrice",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "marginRatio",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "marginMode",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "percentage",
"value" => "undefined"
}
],
"name" => "parsePosition",
"signature" => "parsePosition (position: Dict, market: Market = undefined)",
"source" => "parsePosition (position: Dict, market: Market = undefined) {\n //\n // {\n // \"market\": \"BTC-USD\",\n // \"status\": \"OPEN\",\n // \"side\": \"SHORT\",\n // \"size\": \"-0.407\",\n // \"maxSize\": \"-0.009\",\n // \"entryPrice\": \"118692.04840909090909090909\",\n // \"exitPrice\": \"119526.565625\",\n // \"realizedPnl\": \"476.42665909090909090909088\",\n // \"unrealizedPnl\": \"-57.26681734000000000000037\",\n // \"createdAt\": \"2025-07-14T07:53:55.631Z\",\n // \"createdAtHeight\": \"44140908\",\n // \"closedAt\": null,\n // \"sumOpen\": \"0.44\",\n // \"sumClose\": \"0.032\",\n // \"netFunding\": \"503.13121\",\n // \"subaccountNumber\": 0\n // }\n //\n const marketId = this.safeString (position, 'market');\n market = this.safeMarket (marketId, market);\n const symbol = market['symbol'];\n const side = this.safeStringLower (position, 'side');\n let quantity = this.safeString (position, 'size');\n if (side !== 'long') {\n quantity = Precise.stringMul ('-1', quantity);\n }\n const timestamp = this.parse8601 (this.safeString (position, 'createdAt'));\n return this.safePosition ({\n 'info': position,\n 'id': undefined,\n 'symbol': symbol,\n 'entryPrice': this.safeNumber (position, 'entryPrice'),\n 'markPrice': undefined,\n 'notional': undefined,\n 'collateral': undefined,\n 'unrealizedPnl': this.safeNumber (position, 'unrealizedPnl'),\n 'side': side,\n 'contracts': this.parseNumber (quantity),\n 'contractSize': undefined,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'hedged': undefined,\n 'maintenanceMargin': undefined,\n 'maintenanceMarginPercentage': undefined,\n 'initialMargin': undefined,\n 'initialMarginPercentage': undefined,\n 'leverage': undefined,\n 'liquidationPrice': undefined,\n 'marginRatio': undefined,\n 'marginMode': undefined,\n 'percentage': undefined,\n });\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"id\": \"02ac5b1f0000000200000002\",\n \"side\": \"BUY\",\n \"size\": \"0.0501\",\n \"price\": \"115732\",\n \"type\": \"LIMIT\",\n \"createdAt\": \"2025-07-25T05:11:09.800Z\",\n \"createdAtHeight\": \"44849951\"\n }"
],
"line_end" => 660,
"line_start" => 627,
"mappings" => [
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "symbol",
"value" => "symbol"
},
%{
"comment" => nil,
"key" => "side",
"value" => "side"
},
%{
"comment" => nil,
"key" => "price",
"value" => "price"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "amount"
},
%{
"comment" => nil,
"key" => "cost",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "order",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "takerOrMaker",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "type",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "info",
"value" => "trade"
}
],
"name" => "parseTrade",
"signature" => "parseTrade (trade: Dict, market: Market = undefined): Trade",
"source" => "parseTrade (trade: Dict, market: Market = undefined): Trade {\n //\n // {\n // \"id\": \"02ac5b1f0000000200000002\",\n // \"side\": \"BUY\",\n // \"size\": \"0.0501\",\n // \"price\": \"115732\",\n // \"type\": \"LIMIT\",\n // \"createdAt\": \"2025-07-25T05:11:09.800Z\",\n // \"createdAtHeight\": \"44849951\"\n // }\n //\n const timestamp = this.parse8601 (this.safeString (trade, 'createdAt'));\n const symbol = market['symbol'];\n const price = this.safeString (trade, 'price');\n const amount = this.safeString (trade, 'size');\n const side = this.safeStringLower (trade, 'side');\n const id = this.safeString (trade, 'id');\n return this.safeTrade ({\n 'id': id,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'symbol': symbol,\n 'side': side,\n 'price': price,\n 'amount': amount,\n 'cost': undefined,\n 'order': undefined,\n 'takerOrMaker': undefined,\n 'type': undefined,\n 'fee': undefined,\n 'info': trade,\n }, market);\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"id\": \"6a6075bc-7183-5fd9-bc9d-894e238aa527\",\n \"sender\": {\n \"address\": \"dydx14zzueazeh0hj67cghhf9jypslcf9sh2n5k6art\",\n \"subaccountNumber\": 0\n },\n \"recipient\": {\n \"address\": \"dydx1slanxj8x9ntk9knwa6cvfv2tzlsq5gk3dshml0\",\n \"subaccountNumber\": 1\n },\n \"size\": \"0.000001\",\n \"createdAt\": \"2025-07-29T09:43:02.105Z\",\n \"createdAtHeight\": \"45116125\",\n \"symbol\": \"USDC\",\n \"type\": \"TRANSFER_OUT\",\n \"transactionHash\": \"92B4744BA1B783CF37C79A50BEBC47FFD59C8D5197D62A8485D3DCCE9AF220AF\"\n }"
],
"line_end" => 2076,
"line_start" => 2024,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "transaction"
},
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "txid",
"value" => "txid"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "network",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "address",
"value" => "addressTo"
},
%{
"comment" => nil,
"key" => "addressTo",
"value" => "addressTo"
},
%{
"comment" => nil,
"key" => "addressFrom",
"value" => "addressFrom"
},
%{
"comment" => nil,
"key" => "tag",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tagTo",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "tagFrom",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "type",
"value" => "this.safeStringLower (transaction, 'type')"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "code"
},
%{
"comment" => nil,
"key" => "status",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "updated",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "internal",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "comment",
"value" => "undefined"
},
%{
"comment" => nil,
"key" => "fee",
"value" => "undefined"
}
],
"name" => "parseTransaction",
"signature" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction",
"source" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n //\n // {\n // \"id\": \"6a6075bc-7183-5fd9-bc9d-894e238aa527\",\n // \"sender\": {\n // \"address\": \"dydx14zzueazeh0hj67cghhf9jypslcf9sh2n5k6art\",\n // \"subaccountNumber\": 0\n // },\n // \"recipient\": {\n // \"address\": \"dydx1slanxj8x9ntk9knwa6cvfv2tzlsq5gk3dshml0\",\n // \"subaccountNumber\": 1\n // },\n // \"size\": \"0.000001\",\n // \"createdAt\": \"2025-07-29T09:43:02.105Z\",\n // \"createdAtHeight\": \"45116125\",\n // \"symbol\": \"USDC\",\n // \"type\": \"TRANSFER_OUT\",\n // \"transactionHash\": \"92B4744BA1B783CF37C79A50BEBC47FFD59C8D5197D62A8485D3DCCE9AF220AF\"\n // }\n //\n const id = this.safeString (transaction, 'id');\n const sender = this.safeDict (transaction, 'sender');\n const recipient = this.safeDict (transaction, 'recipient');\n const addressTo = this.safeString (recipient, 'address');\n const addressFrom = this.safeString (sender, 'address');\n const txid = this.safeString (transaction, 'transactionHash');\n const currencyId = this.safeString (transaction, 'symbol');\n const code = this.safeCurrencyCode (currencyId, currency);\n const timestamp = this.parse8601 (this.safeString (transaction, 'createdAt'));\n const amount = this.safeNumber (transaction, 'size');\n return {\n 'info': transaction,\n 'id': id,\n 'txid': txid,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'network': undefined,\n 'address': addressTo,\n 'addressTo': addressTo,\n 'addressFrom': addressFrom,\n 'tag': undefined,\n 'tagTo': undefined,\n 'tagFrom': undefined,\n 'type': this.safeStringLower (transaction, 'type'), // 'deposit', 'withdrawal'\n 'amount': amount,\n 'currency': code,\n 'status': undefined,\n 'updated': undefined,\n 'internal': undefined,\n 'comment': undefined,\n 'fee': undefined,\n } as Transaction;\n }"
},
%{
"comment" => nil,
"examples" => [
"{\n \"id\": \"6a6075bc-7183-5fd9-bc9d-894e238aa527\",\n \"sender\": {\n \"address\": \"dydx14zzueazeh0hj67cghhf9jypslcf9sh2n5k6art\",\n \"subaccountNumber\": 0\n },\n \"recipient\": {\n \"address\": \"dydx1slanxj8x9ntk9knwa6cvfv2tzlsq5gk3dshml0\",\n \"subaccountNumber\": 1\n },\n \"size\": \"0.000001\",\n \"createdAt\": \"2025-07-29T09:43:02.105Z\",\n \"createdAtHeight\": \"45116125\",\n \"symbol\": \"USDC\",\n \"type\": \"TRANSFER_OUT\",\n \"transactionHash\": \"92B4744BA1B783CF37C79A50BEBC47FFD59C8D5197D62A8485D3DCCE9AF220AF\"\n }"
],
"line_end" => 1996,
"line_start" => 1956,
"mappings" => [
%{
"comment" => nil,
"key" => "info",
"value" => "transfer"
},
%{
"comment" => nil,
"key" => "id",
"value" => "id"
},
%{
"comment" => nil,
"key" => "timestamp",
"value" => "timestamp"
},
%{
"comment" => nil,
"key" => "datetime",
"value" => "this.iso8601 (timestamp)"
},
%{
"comment" => nil,
"key" => "currency",
"value" => "code"
},
%{
"comment" => nil,
"key" => "amount",
"value" => "amount"
},
%{
"comment" => nil,
"key" => "fromAccount",
"value" => "fromAccount"
},
%{
"comment" => nil,
"key" => "toAccount",
"value" => "toAccount"
},
%{
"comment" => nil,
"key" => "status",
"value" => "undefined"
}
],
"name" => "parseTransfer",
"signature" => "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry",
"source" => "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n //\n // {\n // \"id\": \"6a6075bc-7183-5fd9-bc9d-894e238aa527\",\n // \"sender\": {\n // \"address\": \"dydx14zzueazeh0hj67cghhf9jypslcf9sh2n5k6art\",\n // \"subaccountNumber\": 0\n // },\n // \"recipient\": {\n // \"address\": \"dydx1slanxj8x9ntk9knwa6cvfv2tzlsq5gk3dshml0\",\n // \"subaccountNumber\": 1\n // },\n // \"size\": \"0.000001\",\n // \"createdAt\": \"2025-07-29T09:43:02.105Z\",\n // \"createdAtHeight\": \"45116125\",\n // \"symbol\": \"USDC\",\n // \"type\": \"TRANSFER_OUT\",\n // \"transactionHash\": \"92B4744BA1B783CF37C79A50BEBC47FFD59C8D5197D62A8485D3DCCE9AF220AF\"\n // }\n //\n const id = this.safeString (transfer, 'id');\n const currencyId = this.safeString (transfer, 'symbol');\n const code = this.safeCurrencyCode (currencyId, currency);\n const amount = this.safeNumber (transfer, 'size');\n const sender = this.safeDict (transfer, 'sender');\n const recipient = this.safeDict (transfer, 'recipient');\n const fromAccount = this.safeString (sender, 'address');\n const toAccount = this.safeString (recipient, 'address');\n const timestamp = this.parse8601 (this.safeString (transfer, 'createdAt'));\n return {\n 'info': transfer,\n 'id': id,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'currency': code,\n 'amount': amount,\n 'fromAccount': fromAccount,\n 'toAccount': toAccount,\n 'status': undefined,\n };\n }"
}
],
path_prefix: "",
pro: true,
quote_json_numbers: nil,
rate_limits: %{
interval_ms: 100,
period: 1000,
requests: 10,
rolling_window_size: 60000
},
raw_endpoints: %{
private: [],
public: []
},
required_credentials: %{
api_key: false,
password: false,
secret: false,
uid: false
},
requires_eddsa: false,
response_error: nil,
signing: %{
confidence: :medium,
pattern: :hmac_sha256_headers
},
spec_format_version: 2,
status: %{
"eta" => nil,
"status" => "ok",
"updated" => nil,
"url" => nil
},
symbol_format: nil,
symbol_formats: %{
precision_mode: 4,
sample_limits: %{
"amount" => %{},
"cost" => %{},
"price" => %{}
},
sample_precision: %{
"amount" => 0.0001,
"price" => 1
},
swap: %{
base: "BTC",
base_id: "BTC",
case: :upper,
contract: true,
contract_size: 1,
id: "BTC-USD",
inverse: false,
limits: %{
"amount" => %{},
"cost" => %{},
"leverage" => %{},
"price" => %{}
},
linear: true,
precision: %{
"amount" => 0.0001,
"price" => 1
},
quote: "USDC",
quote_id: "USDC",
separator: "-",
settle: "USDC",
settle_id: "USDC",
symbol: "BTC/USDC:USDC"
}
},
symbol_patterns: %{
swap: %{
case: :upper,
component_order: nil,
date_format: nil,
pattern: :implicit,
prefix: nil,
separator: "-",
suffix: nil
}
},
timeframes: %{
"15m" => "15MINS",
"1d" => "1DAY",
"1h" => "1HOUR",
"1m" => "1MIN",
"30m" => "30MINS",
"4h" => "4HOURS",
"5m" => "5MINS"
},
url_strategy: %{
detected_from: "fallback",
pattern: :no_prefix,
prefix: nil
},
urls: %{
api: "https://indexer.dydx.trade/v4",
api_sections: %{
"indexer" => "https://indexer.dydx.trade/v4",
"nodeRest" => "https://dydx-rest.publicnode.com",
"nodeRpc" => "https://dydx-ops-rpc.kingnodes.com"
},
doc: [
"https://docs.dydx.xyz"
],
other: nil,
sandbox: %{
"indexer" => "https://indexer.v4testnet.dydx.exchange/v4",
"nodeRest" => "https://test-dydx-rest.kingnodes.com",
"nodeRpc" => "https://test-dydx-rpc.kingnodes.com"
},
www: "https://www.dydx.xyz"
},
version: "v4",
ws: %{
channel_templates: %{
watch_ohlcv: %{
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :type_topic,
separator: ":"
},
watch_order_book: %{
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :type_topic,
separator: ":"
},
watch_trades: %{
market_id_format: :native,
params: [
%{
"default" => nil,
"name" => "limit"
}
],
pattern: :type_topic,
separator: ":"
}
},
has: %{
watch_balance: false,
watch_bids_asks: nil,
watch_liquidations: nil,
watch_liquidations_for_symbols: nil,
watch_my_liquidations: nil,
watch_my_liquidations_for_symbols: nil,
watch_my_trades: nil,
watch_ohlcv: true,
watch_ohlcv_for_symbols: nil,
watch_order_book: true,
watch_order_book_for_symbols: nil,
watch_orders: nil,
watch_orders_for_symbols: nil,
watch_position: nil,
watch_positions: nil,
watch_status: nil,
watch_ticker: false,
watch_tickers: false,
watch_trades: true,
watch_trades_for_symbols: nil
},
message_patterns: [
%{
args_field: "channel",
format: :type,
id_field: "id",
keys: [
"channel",
"id",
"type"
],
kind_field: "type",
kind_value: "subscribe",
sources: [
:send,
:watch
]
}
],
subscription_config: %{
args_field: "topic",
args_format: :string,
market_id_format: :native,
op_field: "type",
separator: ":"
},
subscription_pattern: :type_subscribe,
test_urls: "wss://indexer.v4testnet.dydx.exchange/v4/ws",
urls: "wss://indexer.dydx.trade/v4/ws",
watch_methods: [
"watchOHLCV",
"watchOrderBook",
"watchTrades"
]
}
}