# Backpack Exchange Specification # # Auto-generated by: mix ccxt.extract backpack # CCXT version: 4.5.34 # Spec format version: 1 # # 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: [ "JP" ], currencies: %{}, currency_aliases: %{ "BCHSV" => "BSV", "XBT" => "BTC" }, dex: false, enable_rate_limit: true, endpoint_extraction_stats: %{ "capturedMethods" => 41, "coveragePercent" => 100, "enabledMethods" => 45, "excluded" => [ %{ "method" => "fetchOpenInterestHistory", "reason" => "backpack fetchOpenInterestHistory() is not supported yet" }, %{ "method" => "editOrder", "reason" => "emulated (returns cached data, no HTTP call)" } ], "excludedMethods" => 2, "extractableMethods" => 43, "failures" => [ %{ "error" => "backpack fetchDepositAddress() requires a network parameter, see https://docs.ccxt.com/?id=network-codes", "method" => "fetchDepositAddress" }, %{ "error" => "backpack withdraw() requires a network parameter", "method" => "withdraw" } ] }, endpoints: [ %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :delete, name: :cancel_all_orders, param_mappings: %{}, params: [ :symbol ], path: "/api/v1/orders", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :delete, name: :cancel_order, param_mappings: %{ "id" => "orderId" }, params: [ :id, :symbol ], path: "/api/v1/order", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "orderType" => "Limit", "side" => "Bid" }, market_type: :spot, method: :post, name: :create_limit_buy_order, param_mappings: %{ "amount" => "quantity" }, params: [ :symbol, :amount, :price ], path: "/api/v1/order", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "orderType" => "Limit", "side" => "Bid" }, market_type: :spot, method: :post, name: :create_limit_order, param_mappings: %{ "amount" => "quantity" }, params: [ :symbol, :side, :amount, :price ], path: "/api/v1/order", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "orderType" => "Limit", "side" => "Ask" }, market_type: :spot, method: :post, name: :create_limit_sell_order, param_mappings: %{ "amount" => "quantity" }, params: [ :symbol, :amount, :price ], path: "/api/v1/order", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "orderType" => "Market", "side" => "Bid" }, market_type: :spot, method: :post, name: :create_market_buy_order, param_mappings: %{ "amount" => "quantity" }, params: [ :symbol, :amount ], path: "/api/v1/order", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "orderType" => "Market", "side" => "Bid" }, market_type: :spot, method: :post, name: :create_market_buy_order_with_cost, param_mappings: %{ "cost" => "quantity" }, params: [ :symbol, :cost ], path: "/api/v1/order", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "orderType" => "Market", "side" => "Bid" }, market_type: :spot, method: :post, name: :create_market_order, param_mappings: %{ "amount" => "quantity" }, params: [ :symbol, :side, :amount, :price ], path: "/api/v1/order", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "orderType" => "Market", "side" => "Bid" }, market_type: :spot, method: :post, name: :create_market_order_with_cost, param_mappings: %{ "cost" => "quantity" }, params: [ :symbol, :side, :cost ], path: "/api/v1/order", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "orderType" => "Market", "side" => "Ask" }, market_type: :spot, method: :post, name: :create_market_sell_order, param_mappings: %{ "amount" => "quantity" }, params: [ :symbol, :amount ], path: "/api/v1/order", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "orderType" => "Market", "side" => "Ask" }, market_type: :spot, method: :post, name: :create_market_sell_order_with_cost, param_mappings: %{ "cost" => "quantity" }, params: [ :symbol, :cost ], path: "/api/v1/order", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "side" => "Bid" }, market_type: :spot, method: :post, name: :create_order, param_mappings: %{ "amount" => "quantity", "type" => "orderType" }, params: [ :symbol, :type, :side, :amount, :price ], path: "/api/v1/order", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "side" => "Bid" }, market_type: :swap, method: :post, name: :create_order_with_take_profit_and_stop_loss, param_mappings: %{ "amount" => "quantity", "stopLoss" => "stopLossTriggerPrice", "takeProfit" => "takeProfitTriggerPrice", "type" => "orderType" }, params: [ :symbol, :type, :side, :amount, :price, :takeProfit, :stopLoss ], path: "/api/v1/order", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :post, name: :create_orders, param_mappings: %{}, params: [ :orders ], path: "/api/v1/orders", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "postOnly" => true, "side" => "Bid" }, market_type: :spot, method: :post, name: :create_post_only_order, param_mappings: %{ "amount" => "quantity", "type" => "orderType" }, params: [ :symbol, :type, :side, :amount, :price ], path: "/api/v1/order", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "reduceOnly" => true, "side" => "Bid" }, market_type: :swap, method: :post, name: :create_reduce_only_order, param_mappings: %{ "amount" => "quantity", "type" => "orderType" }, params: [ :symbol, :type, :side, :amount, :price ], path: "/api/v1/order", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "side" => "Bid", "triggerDirection" => "below" }, market_type: :swap, method: :post, name: :create_trigger_order, param_mappings: %{ "amount" => "triggerQuantity", "type" => "orderType" }, params: [ :symbol, :type, :side, :amount, :price, :triggerPrice ], path: "/api/v1/order", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_balance, param_mappings: %{}, params: [], path: "/api/v1/capital", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_currencies, param_mappings: %{}, params: [], path: "/api/v1/assets", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_deposits, param_mappings: %{}, params: [ :code, :since, :limit ], path: "/wapi/v1/capital/deposits", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :swap, method: :get, name: :fetch_funding_history, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/wapi/v1/history/funding", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :swap, method: :get, name: :fetch_funding_rate, param_mappings: %{}, params: [ :symbol ], path: "/api/v1/markPrices", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :swap, method: :get, name: :fetch_funding_rate_history, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/api/v1/fundingRates", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, default_params: %{ "interval" => "1m", "priceType" => "Index" }, market_type: :swap, method: :get, name: :fetch_index_ohlcv, param_mappings: %{ "since" => "startTime", "timeframe" => "interval" }, params: [ :symbol, :timeframe, :since, :limit ], path: "/api/v1/klines", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_l2_order_book, param_mappings: %{}, params: [ :symbol, :limit ], path: "/api/v1/depth", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, default_params: %{ "interval" => "1m", "priceType" => "Mark" }, market_type: :swap, method: :get, name: :fetch_mark_ohlcv, param_mappings: %{ "since" => "startTime", "timeframe" => "interval" }, params: [ :symbol, :timeframe, :since, :limit ], path: "/api/v1/klines", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_markets, param_mappings: %{}, params: [], path: "/api/v1/markets", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "fillType" => "User" }, market_type: :spot, method: :get, name: :fetch_my_trades, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/wapi/v1/history/fills", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_ohlcv, param_mappings: %{ "since" => "startTime", "timeframe" => "interval" }, params: [ :symbol, :timeframe, :since, :limit ], path: "/api/v1/klines", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :swap, method: :get, name: :fetch_open_interest, param_mappings: %{}, params: [ :symbol ], path: "/api/v1/openInterest", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_open_order, param_mappings: %{ "arg0" => "orderId", "arg1" => "symbol" }, params: [], path: "/api/v1/order", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_open_orders, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/api/v1/orders", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_order_book, param_mappings: %{}, params: [ :symbol, :limit ], path: "/api/v1/depth", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_orders, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/wapi/v1/history/orders", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :swap, method: :get, name: :fetch_positions, param_mappings: %{}, params: [ :symbols ], path: "/api/v1/position", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_status, param_mappings: %{}, params: [], path: "/api/v1/status", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_ticker, param_mappings: %{}, params: [ :symbol ], path: "/api/v1/ticker", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_tickers, param_mappings: %{}, params: [ :symbols ], path: "/api/v1/tickers", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_time, param_mappings: %{}, params: [], path: "/api/v1/time", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_trades, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/api/v1/trades", source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_withdrawals, param_mappings: %{}, params: [ :code, :since, :limit ], path: "/wapi/v1/capital/withdrawals", source: :intercepted } ], error_code_details: %{ "ACCOUNT_LIQUIDATING" => %{ description: nil, type: :invalid_parameters }, "BORROW_LIMIT" => %{ description: nil, type: :invalid_parameters }, "BORROW_REQUIRES_LEND_REDEEM" => %{ description: nil, type: :invalid_parameters }, "FORBIDDEN" => %{ description: nil, type: :exchange_error }, "INSUFFICIENT_FUNDS" => %{ description: nil, type: :insufficient_balance }, "INSUFFICIENT_MARGIN" => %{ description: nil, type: :insufficient_balance }, "INSUFFICIENT_SUPPLY" => %{ description: nil, type: :insufficient_balance }, "INVALID_ASSET" => %{ description: nil, type: :invalid_parameters }, "INVALID_CLIENT_REQUEST" => %{ description: nil, type: :invalid_parameters }, "INVALID_MARKET" => %{ description: nil, type: :invalid_order }, "INVALID_ORDER" => %{ description: nil, type: :invalid_order }, "INVALID_POSITION_ID" => %{ description: nil, type: :invalid_parameters }, "INVALID_PRICE" => %{ description: nil, type: :invalid_parameters }, "INVALID_QUANTITY" => %{ description: nil, type: :invalid_parameters }, "INVALID_RANGE" => %{ description: nil, type: :invalid_parameters }, "INVALID_SIGNATURE" => %{ description: nil, type: :invalid_credentials }, "INVALID_SOURCE" => %{ description: nil, type: :invalid_parameters }, "INVALID_SYMBOL" => %{ description: nil, type: :invalid_order }, "INVALID_TWO_FACTOR_CODE" => %{ description: nil, type: :invalid_parameters }, "LEND_LIMIT" => %{ description: nil, type: :invalid_parameters }, "LEND_REQUIRES_BORROW_REPAY" => %{ description: nil, type: :invalid_parameters }, "MAINTENANCE" => %{ description: nil, type: :exchange_error }, "MAX_LEVERAGE_REACHED" => %{ description: nil, type: :insufficient_balance }, "NOT_IMPLEMENTED" => %{ description: nil, type: :exchange_error }, "ORDER_LIMIT" => %{ description: nil, type: :exchange_error }, "POSITION_LIMIT" => %{ description: nil, type: :exchange_error }, "PRECONDITION_FAILED" => %{ description: nil, type: :exchange_error }, "RESOURCE_NOT_FOUND" => %{ description: nil, type: :network_error }, "SERVER_ERROR" => %{ description: nil, type: :network_error }, "TIMEOUT" => %{ description: nil, type: :network_error }, "TOO_MANY_REQUESTS" => %{ description: nil, type: :rate_limited }, "TRADING_PAUSED" => %{ description: nil, type: :network_error }, "UNAUTHORIZED" => %{ description: nil, type: :invalid_credentials } }, error_codes: %{ "ACCOUNT_LIQUIDATING" => :invalid_parameters, "BORROW_LIMIT" => :invalid_parameters, "BORROW_REQUIRES_LEND_REDEEM" => :invalid_parameters, "FORBIDDEN" => :exchange_error, "INSUFFICIENT_FUNDS" => :insufficient_balance, "INSUFFICIENT_MARGIN" => :insufficient_balance, "INSUFFICIENT_SUPPLY" => :insufficient_balance, "INVALID_ASSET" => :invalid_parameters, "INVALID_CLIENT_REQUEST" => :invalid_parameters, "INVALID_MARKET" => :invalid_order, "INVALID_ORDER" => :invalid_order, "INVALID_POSITION_ID" => :invalid_parameters, "INVALID_PRICE" => :invalid_parameters, "INVALID_QUANTITY" => :invalid_parameters, "INVALID_RANGE" => :invalid_parameters, "INVALID_SIGNATURE" => :invalid_credentials, "INVALID_SOURCE" => :invalid_parameters, "INVALID_SYMBOL" => :invalid_order, "INVALID_TWO_FACTOR_CODE" => :invalid_parameters, "LEND_LIMIT" => :invalid_parameters, "LEND_REQUIRES_BORROW_REPAY" => :invalid_parameters, "MAINTENANCE" => :exchange_error, "MAX_LEVERAGE_REACHED" => :insufficient_balance, "NOT_IMPLEMENTED" => :exchange_error, "ORDER_LIMIT" => :exchange_error, "POSITION_LIMIT" => :exchange_error, "PRECONDITION_FAILED" => :exchange_error, "RESOURCE_NOT_FOUND" => :network_error, "SERVER_ERROR" => :network_error, "TIMEOUT" => :network_error, "TOO_MANY_REQUESTS" => :rate_limited, "TRADING_PAUSED" => :network_error, "UNAUTHORIZED" => :invalid_credentials }, exceptions: %{ exact: %{ "ACCOUNT_LIQUIDATING" => :bad_request, "BORROW_LIMIT" => :bad_request, "BORROW_REQUIRES_LEND_REDEEM" => :bad_request, "FORBIDDEN" => :operation_rejected, "INSUFFICIENT_FUNDS" => :insufficient_funds, "INSUFFICIENT_MARGIN" => :insufficient_funds, "INSUFFICIENT_SUPPLY" => :insufficient_funds, "INVALID_ASSET" => :bad_request, "INVALID_CLIENT_REQUEST" => :bad_request, "INVALID_MARKET" => :bad_symbol, "INVALID_ORDER" => :invalid_order, "INVALID_POSITION_ID" => :bad_request, "INVALID_PRICE" => :bad_request, "INVALID_QUANTITY" => :bad_request, "INVALID_RANGE" => :bad_request, "INVALID_SIGNATURE" => :authentication_error, "INVALID_SOURCE" => :bad_request, "INVALID_SYMBOL" => :bad_symbol, "INVALID_TWO_FACTOR_CODE" => :bad_request, "LEND_LIMIT" => :bad_request, "LEND_REQUIRES_BORROW_REPAY" => :bad_request, "MAINTENANCE" => :exchange_error, "MAX_LEVERAGE_REACHED" => :insufficient_funds, "NOT_IMPLEMENTED" => :operation_failed, "ORDER_LIMIT" => :operation_rejected, "POSITION_LIMIT" => :operation_rejected, "PRECONDITION_FAILED" => :operation_failed, "RESOURCE_NOT_FOUND" => :exchange_not_available, "SERVER_ERROR" => :network_error, "TIMEOUT" => :request_timeout, "TOO_MANY_REQUESTS" => :rate_limit_exceeded, "TRADING_PAUSED" => :exchange_not_available, "UNAUTHORIZED" => :authentication_error } }, exchange_options: %{ "adjustForTimeDifference" => false, "broker" => "", "brokerId" => "", "currencyIdsListForParseMarket" => nil, "defaultNetworkCodeReplacements" => %{ "BRC20" => %{ "BRC20" => "BTC" }, "CRO" => %{ "CRC20" => "CRONOS" }, "ETH" => %{ "ERC20" => "ETH" }, "TRX" => %{ "TRC20" => "TRX" } }, "instructions" => %{ "api/v1/account" => %{ "GET" => "accountQuery", "PATCH" => "accountUpdate" }, "api/v1/account/limits/borrow" => %{ "GET" => "maxBorrowQuantity" }, "api/v1/account/limits/order" => %{ "GET" => "maxOrderQuantity" }, "api/v1/account/limits/withdrawal" => %{ "GET" => "maxWithdrawalQuantity" }, "api/v1/borrowLend" => %{ "POST" => "borrowLendExecute" }, "api/v1/borrowLend/positions" => %{ "GET" => "borrowLendPositionQuery" }, "api/v1/capital" => %{ "GET" => "balanceQuery" }, "api/v1/capital/collateral" => %{ "GET" => "collateralQuery" }, "api/v1/order" => %{ "DELETE" => "orderCancel", "GET" => "orderQuery", "POST" => "orderExecute" }, "api/v1/orders" => %{ "DELETE" => "orderCancelAll", "GET" => "orderQueryAll", "POST" => "orderExecute" }, "api/v1/position" => %{ "GET" => "positionQuery" }, "api/v1/rfq/quote" => %{ "POST" => "quoteSubmit" }, "wapi/v1/capital/deposit/address" => %{ "GET" => "depositAddressQuery" }, "wapi/v1/capital/deposits" => %{ "GET" => "depositQueryAll" }, "wapi/v1/capital/withdrawals" => %{ "GET" => "withdrawalQueryAll", "POST" => "withdraw" }, "wapi/v1/history/borrowLend" => %{ "GET" => "borrowHistoryQueryAll" }, "wapi/v1/history/borrowLend/positions" => %{ "GET" => "borrowPositionHistoryQueryAll" }, "wapi/v1/history/dust" => %{ "GET" => "dustHistoryQueryAll" }, "wapi/v1/history/fills" => %{ "GET" => "fillHistoryQueryAll" }, "wapi/v1/history/funding" => %{ "GET" => "fundingHistoryQueryAll" }, "wapi/v1/history/interest" => %{ "GET" => "interestHistoryQueryAll" }, "wapi/v1/history/orders" => %{ "GET" => "orderHistoryQueryAll" }, "wapi/v1/history/pnl" => %{ "GET" => "pnlHistoryQueryAll" }, "wapi/v1/history/quote" => %{ "GET" => "quoteHistoryQueryAll" }, "wapi/v1/history/rfq" => %{ "GET" => "rfqHistoryQueryAll" }, "wapi/v1/history/settlement" => %{ "GET" => "settlementHistoryQueryAll" }, "wapi/v1/history/strategies" => %{ "GET" => "strategyHistoryQueryAll" } }, "networks" => %{ "ADA" => "Cardano", "APT" => "Aptos", "ARB" => "Arbitrum", "AVAX" => "Avalanche", "BASE" => "Base", "BCH" => "BitcoinCash", "BERA" => "Berachain", "BSC" => "Bsc", "BTC" => "Bitcoin", "DOGE" => "Dogecoin", "ECLIPSE" => "Eclipse", "EQUALSMONEY" => "EqualsMoney", "ERC20" => "Ethereum", "HYP" => "Hyperliquid", "LTC" => "Litecoin", "MATIC" => "Polygon", "OPTIMISM" => "Optimism", "SEI" => "Sei", "SOL" => "Solana", "STORY" => "Story", "SUI" => "Sui", "TRC20" => "Tron", "XRP" => "XRP" }, "networksById" => %{ "Aptos" => "APT", "Arbitrum" => "ARB", "Avalanche" => "AVAX", "Base" => "BASE", "Berachain" => "BERA", "Bitcoin" => "BTC", "BitcoinCash" => "BCH", "Bsc" => "BSC", "Cardano" => "ADA", "Dogecoin" => "DOGE", "Eclipse" => "ECLIPSE", "EqualsMoney" => "EQUALSMONEY", "Ethereum" => "ERC20", "Hyperliquid" => "HYP", "Litecoin" => "LTC", "Optimism" => "OPTIMISM", "Polygon" => "MATIC", "Sei" => "SEI", "Solana" => "SOL", "Story" => "STORY", "Sui" => "SUI", "Tron" => "TRC20", "XRP" => "XRP", "aptos" => "APT", "arbitrum" => "ARB", "avalanche" => "AVAX", "base" => "BASE", "berachain" => "BERA", "bitcoin" => "BTC", "bitcoincash" => "BCH", "bsc" => "BSC", "cardano" => "ADA", "dogecoin" => "DOGE", "eclipse" => "ECLIPSE", "equalsmoney" => "EQUALSMONEY", "ethereum" => "ERC20", "hyperliquid" => "HYP", "litecoin" => "LTC", "optimism" => "OPTIMISM", "polygon" => "MATIC", "sei" => "SEI", "solana" => "SOL", "story" => "STORY", "sui" => "SUI", "tron" => "TRC20", "xrp" => "XRP" }, "recvWindow" => 5000, "timeDifference" => 0 }, extended_metadata: %{ limits: %{ "amount" => %{}, "cost" => %{}, "leverage" => %{}, "price" => %{} }, logo_url: "https://github.com/user-attachments/assets/cc04c278-679f-4554-9f72-930dd632b80f", referral_url: "https://backpack.exchange/join/ccxt" }, extracted_metadata: %{ ccxt_version: "4.5.34" }, features: %{ default: %{ create_order: %{ hedged: false, iceberg: false, leverage: false, margin_mode: false, market_buy_by_cost: true, market_buy_requires_price: true, self_trade_prevention: %{ e_x_p_i_r_e__b_o_t_h: true, e_x_p_i_r_e__m_a_k_e_r: true, e_x_p_i_r_e__t_a_k_e_r: true, n_o_n_e: false }, stop_loss_price: true, take_profit_price: true, time_in_force: %{ fok: true, gtc: true, gtd: false, ioc: true, po: true }, trailing: false, trigger_direction: false, trigger_price: true }, create_orders: %{ max: 20 }, fetch_my_trades: %{ limit: 1000, margin_mode: false, symbol_required: false }, fetch_ohlcv: %{ limit: 1000, paginate: false }, fetch_open_orders: %{ limit: 1000, margin_mode: false, symbol_required: false, trailing: false, trigger: true }, fetch_orders: %{ limit: 1000, margin_mode: false, symbol_required: true, trailing: false, trigger: true }, sandbox: false }, future: %{}, spot: %{ extends: "default" }, swap: %{} }, fees: nil, handle_content_type_application_zip: nil, handle_errors_source: "handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {\n if (response === undefined) {\n return undefined; // fallback to default error handler\n }\n //\n // {\"code\":\"INVALID_ORDER\",\"message\":\"Invalid order\"}\n // {\"code\":\"INVALID_CLIENT_REQUEST\",\"message\":\"Must specify both `triggerPrice` and `triggerQuantity` or neither\"}\n //\n const errorCode = this.safeString(response, 'code');\n const message = this.safeString(response, 'message');\n if (errorCode !== undefined) {\n const feedback = this.id + ' ' + body;\n this.throwExactlyMatchedException(this.exceptions['exact'], errorCode, feedback);\n this.throwExactlyMatchedException(this.exceptions['exact'], message, feedback);\n this.throwBroadlyMatchedException(this.exceptions['broad'], message, feedback);\n throw new errors.ExchangeError(feedback); // unknown message\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: true, 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: false, 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: true, create_limit_buy_order_ws: false, create_limit_order: true, create_limit_order_ws: false, create_limit_sell_order: true, create_limit_sell_order_ws: false, create_market_buy_order: true, create_market_buy_order_with_cost: true, create_market_buy_order_with_cost_ws: false, create_market_buy_order_ws: false, create_market_order: true, create_market_order_with_cost: true, create_market_order_with_cost_ws: false, create_market_order_ws: true, create_market_sell_order: true, create_market_sell_order_with_cost: true, 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: true, create_order_with_take_profit_and_stop_loss_ws: false, create_order_ws: false, create_orders: true, create_post_only_order: true, create_post_only_order_ws: false, create_reduce_only_order: true, 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: true, 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_accounts: false, fetch_all_greeks: false, 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: false, 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: true, fetch_currencies_ws: true, fetch_deposit: false, fetch_deposit_address: true, 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: false, fetch_deposits_ws: false, fetch_funding_history: true, fetch_funding_interval: false, fetch_funding_intervals: false, fetch_funding_rate: true, fetch_funding_rate_history: true, fetch_funding_rates: false, fetch_greeks: false, fetch_index_ohlcv: true, 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: false, 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: true, 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: true, fetch_my_trades_ws: false, fetch_ohlcv: true, fetch_ohlcv_ws: false, fetch_open_interest: true, fetch_open_interest_history: true, fetch_open_interests: false, fetch_open_order: true, fetch_open_orders: true, fetch_open_orders_ws: false, fetch_option: false, fetch_option_chain: false, fetch_order: false, 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: false, fetch_position_history: false, fetch_position_mode: false, fetch_position_ws: false, fetch_positions: true, 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: true, fetch_ticker: true, fetch_ticker_ws: false, fetch_tickers: true, 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: false, 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: true, 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: true, swap: true, transfer: false, 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: true, 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: true, watch_order_book: true, watch_order_book_for_symbols: true, watch_orders: true, watch_orders_for_symbols: false, watch_position: false, watch_positions: true, watch_status: false, watch_ticker: true, watch_tickers: true, watch_trades: true, watch_trades_for_symbols: true, withdraw: true, ws: false }, http_config: nil, id: "backpack", markets: nil, name: "Backpack", ohlcv_timestamp_resolution: :seconds, options: %{ :adjust_for_time_difference => false, :broker => "", :broker_id => "", "currency_ids_list_for_parse_market" => nil, "instructions" => %{ "api/v1/account" => %{ "GET" => "accountQuery", "PATCH" => "accountUpdate" }, "api/v1/account/limits/borrow" => %{ "GET" => "maxBorrowQuantity" }, "api/v1/account/limits/order" => %{ "GET" => "maxOrderQuantity" }, "api/v1/account/limits/withdrawal" => %{ "GET" => "maxWithdrawalQuantity" }, "api/v1/borrowLend" => %{ "POST" => "borrowLendExecute" }, "api/v1/borrowLend/positions" => %{ "GET" => "borrowLendPositionQuery" }, "api/v1/capital" => %{ "GET" => "balanceQuery" }, "api/v1/capital/collateral" => %{ "GET" => "collateralQuery" }, "api/v1/order" => %{ "DELETE" => "orderCancel", "GET" => "orderQuery", "POST" => "orderExecute" }, "api/v1/orders" => %{ "DELETE" => "orderCancelAll", "GET" => "orderQueryAll", "POST" => "orderExecute" }, "api/v1/position" => %{ "GET" => "positionQuery" }, "api/v1/rfq/quote" => %{ "POST" => "quoteSubmit" }, "wapi/v1/capital/deposit/address" => %{ "GET" => "depositAddressQuery" }, "wapi/v1/capital/deposits" => %{ "GET" => "depositQueryAll" }, "wapi/v1/capital/withdrawals" => %{ "GET" => "withdrawalQueryAll", "POST" => "withdraw" }, "wapi/v1/history/borrowLend" => %{ "GET" => "borrowHistoryQueryAll" }, "wapi/v1/history/borrowLend/positions" => %{ "GET" => "borrowPositionHistoryQueryAll" }, "wapi/v1/history/dust" => %{ "GET" => "dustHistoryQueryAll" }, "wapi/v1/history/fills" => %{ "GET" => "fillHistoryQueryAll" }, "wapi/v1/history/funding" => %{ "GET" => "fundingHistoryQueryAll" }, "wapi/v1/history/interest" => %{ "GET" => "interestHistoryQueryAll" }, "wapi/v1/history/orders" => %{ "GET" => "orderHistoryQueryAll" }, "wapi/v1/history/pnl" => %{ "GET" => "pnlHistoryQueryAll" }, "wapi/v1/history/quote" => %{ "GET" => "quoteHistoryQueryAll" }, "wapi/v1/history/rfq" => %{ "GET" => "rfqHistoryQueryAll" }, "wapi/v1/history/settlement" => %{ "GET" => "settlementHistoryQueryAll" }, "wapi/v1/history/strategies" => %{ "GET" => "strategyHistoryQueryAll" } }, :networks => %{ "ADA" => "Cardano", "APT" => "Aptos", "ARB" => "Arbitrum", "AVAX" => "Avalanche", "BASE" => "Base", "BCH" => "BitcoinCash", "BERA" => "Berachain", "BSC" => "Bsc", "BTC" => "Bitcoin", "DOGE" => "Dogecoin", "ECLIPSE" => "Eclipse", "EQUALSMONEY" => "EqualsMoney", "ERC20" => "Ethereum", "HYP" => "Hyperliquid", "LTC" => "Litecoin", "MATIC" => "Polygon", "OPTIMISM" => "Optimism", "SEI" => "Sei", "SOL" => "Solana", "STORY" => "Story", "SUI" => "Sui", "TRC20" => "Tron", "XRP" => "XRP" }, :networks_by_id => %{ "aptos" => "APT", "arbitrum" => "ARB", "avalanche" => "AVAX", "base" => "BASE", "berachain" => "BERA", "bitcoin" => "BTC", "bitcoincash" => "BCH", "bsc" => "BSC", "cardano" => "ADA", "dogecoin" => "DOGE", "eclipse" => "ECLIPSE", "equalsmoney" => "EQUALSMONEY", "ethereum" => "ERC20", "hyperliquid" => "HYP", "litecoin" => "LTC", "optimism" => "OPTIMISM", "polygon" => "MATIC", "sei" => "SEI", "solana" => "SOL", "story" => "STORY", "sui" => "SUI", "tron" => "TRC20", "xrp" => "XRP" }, :recv_window => 5000, :time_difference => 0 }, order_mappings: %{ side_format: nil, side_key: "side", type_format: :capitalize, type_key: "orderType" }, param_mappings: %{ "amount" => "triggerQuantity", "arg0" => "orderId", "arg1" => "symbol", "cost" => "quantity", "id" => "orderId", "since" => "startTime", "stopLoss" => "stopLossTriggerPrice", "takeProfit" => "takeProfitTriggerPrice", "timeframe" => "interval", "type" => "orderType" }, parse_methods: [ %{ "comment" => nil, "examples" => [ "{\n \"USDC\": {\n \"available\": \"120\",\n \"locked\": \"0\",\n \"staked\": \"0\"\n }\n }" ], "line_end" => 1386, "line_start" => 1361, "mappings" => [], "name" => "parseBalance", "signature" => "parseBalance (response): Balances", "source" => "parseBalance (response): Balances {\n //\n // {\n // \"USDC\": {\n // \"available\": \"120\",\n // \"locked\": \"0\",\n // \"staked\": \"0\"\n // }\n // }\n //\n const balanceKeys = Object.keys (response);\n const result: Dict = {};\n for (let i = 0; i < balanceKeys.length; i++) {\n const id = balanceKeys[i];\n const code = this.safeCurrencyCode (id);\n const balance = response[id];\n const account = this.account ();\n const locked = this.safeString (balance, 'locked');\n const staked = this.safeString (balance, 'staked');\n const used = Precise.stringAdd (locked, staked);\n account['free'] = this.safeString (balance, 'available');\n account['used'] = used;\n result[code] = account;\n }\n return this.safeBalance (result);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"address\": \"0xfBe7CbfCde93c8a4204a4be6B56732Eb32690170\"\n }" ], "line_end" => 1664, "line_start" => 1648, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "depositAddress" }, %{ "comment" => nil, "key" => "currency", "value" => "currency['code']" }, %{ "comment" => nil, "key" => "network", "value" => "undefined" }, %{ "comment" => nil, "key" => "tag", "value" => "undefined" } ], "name" => "parseDepositAddress", "signature" => "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress", "source" => "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n //\n // {\n // \"address\": \"0xfBe7CbfCde93c8a4204a4be6B56732Eb32690170\"\n // }\n //\n const address = this.safeString (depositAddress, 'address');\n const currencyId = this.safeString (depositAddress, 'currency');\n currency = this.safeCurrency (currencyId, currency);\n return {\n 'info': depositAddress,\n 'currency': currency['code'],\n 'network': undefined, // network is not returned by the API\n 'address': address,\n 'tag': undefined,\n } as DepositAddress;\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"fundingRate\": \"0.0001\",\n \"indexPrice\": \"118333.18643195\",\n \"markPrice\": \"118343.51853741\",\n \"nextFundingTimestamp\": 1753113600000,\n \"symbol\": \"BTC_USDC_PERP\"\n }" ], "line_end" => 1066, "line_start" => 1032, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "contract" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "markPrice", "value" => "this.safeNumber (contract, 'markPrice')" }, %{ "comment" => nil, "key" => "indexPrice", "value" => "this.safeNumber (contract, 'indexPrice')" }, %{ "comment" => nil, "key" => "interestRate", "value" => "undefined" }, %{ "comment" => nil, "key" => "estimatedSettlePrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "timestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "datetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "fundingRate", "value" => "this.safeNumber (contract, 'fundingRate')" }, %{ "comment" => nil, "key" => "fundingTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "fundingDatetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "nextFundingRate", "value" => "undefined" }, %{ "comment" => nil, "key" => "nextFundingTimestamp", "value" => "nextFundingTimestamp" }, %{ "comment" => nil, "key" => "nextFundingDatetime", "value" => "this.iso8601 (nextFundingTimestamp)" }, %{ "comment" => nil, "key" => "previousFundingRate", "value" => "undefined" }, %{ "comment" => nil, "key" => "previousFundingTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "previousFundingDatetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "interval", "value" => "'1h'" } ], "name" => "parseFundingRate", "signature" => "parseFundingRate (contract, market: Market = undefined): FundingRate", "source" => "parseFundingRate (contract, market: Market = undefined): FundingRate {\n //\n // {\n // \"fundingRate\": \"0.0001\",\n // \"indexPrice\": \"118333.18643195\",\n // \"markPrice\": \"118343.51853741\",\n // \"nextFundingTimestamp\": 1753113600000,\n // \"symbol\": \"BTC_USDC_PERP\"\n // }\n //\n const marketId = this.safeString (contract, 'symbol');\n market = this.safeMarket (marketId, market);\n const symbol = this.safeSymbol (marketId, market);\n const nextFundingTimestamp = this.safeInteger (contract, 'nextFundingTimestamp');\n return {\n 'info': contract,\n 'symbol': symbol,\n 'markPrice': this.safeNumber (contract, 'markPrice'),\n 'indexPrice': this.safeNumber (contract, 'indexPrice'),\n 'interestRate': undefined,\n 'estimatedSettlePrice': undefined,\n 'timestamp': undefined,\n 'datetime': undefined,\n 'fundingRate': this.safeNumber (contract, 'fundingRate'),\n 'fundingTimestamp': undefined,\n 'fundingDatetime': undefined,\n 'nextFundingRate': undefined,\n 'nextFundingTimestamp': nextFundingTimestamp,\n 'nextFundingDatetime': this.iso8601 (nextFundingTimestamp),\n 'previousFundingRate': undefined,\n 'previousFundingTimestamp': undefined,\n 'previousFundingDatetime': undefined,\n 'interval': '1h',\n } as FundingRate;\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"fundingRate\": \"0.0001\",\n \"intervalEndTimestamp\": \"2025-08-01T16:00:00\",\n \"quantity\": \"-0.001301\",\n \"subaccountId\": 0,\n \"symbol\": \"ETH_USDC_PERP\",\n \"userId\": 1813870\n }" ], "line_end" => 2258, "line_start" => 2231, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "income" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "code", "value" => "undefined" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "id", "value" => "id" }, %{ "comment" => nil, "key" => "amount", "value" => "amount" }, %{ "comment" => nil, "key" => "rate", "value" => "rate" } ], "name" => "parseIncome", "signature" => "parseIncome (income, market: Market = undefined)", "source" => "parseIncome (income, market: Market = undefined) {\n //\n // {\n // \"fundingRate\": \"0.0001\",\n // \"intervalEndTimestamp\": \"2025-08-01T16:00:00\",\n // \"quantity\": \"-0.001301\",\n // \"subaccountId\": 0,\n // \"symbol\": \"ETH_USDC_PERP\",\n // \"userId\": 1813870\n // }\n //\n const marketId = this.safeString (income, 'symbol');\n const symbol = this.safeSymbol (marketId, market);\n const amount = this.safeNumber (income, 'quantity');\n const id = this.safeString (income, 'userId');\n const timestamp = this.parse8601 (this.safeString (income, 'intervalEndTimestamp'));\n const rate = this.safeNumber (income, 'fundingRate');\n return {\n 'info': income,\n 'symbol': symbol,\n 'code': undefined,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'id': id,\n 'amount': amount,\n 'rate': rate,\n };\n }" }, %{ "comment" => nil, "examples" => [ "[\n {\n \"baseSymbol\": \"SOL\",\n \"createdAt\": \"2025-01-21T06:34:54.691858\",\n \"filters\": {\n \"price\": {\n \"borrowmarketFeeMaxMultiplier\": null,\n \"borrowmarketFeeMinMultiplier\": null,\n \"maxImpactMultiplier\": \"1.03\",\n \"maxMultiplier\": \"1.25\",\n \"maxPrice\": null,\n \"meanMarkPriceBand\": {\n \"maxMultiplier\": \"1.15\",\n \"minMultiplier\": \"0.9\"\n },\n \"meanPremiumBand\": null,\n \"minImpactMultiplier\": \"0.97\",\n \"minMultiplier\": \"0.75\",\n \"minPrice\": \"0.01\",\n \"tickSize\": \"0.01\"\n },\n \"quantity\": {\n \"maxQuantity\": null,\n \"minQuantity\": \"0.01\",\n \"stepSize\": \"0.01\"\n }\n },\n \"fundingInterval\": 28800000,\n \"fundingRateLowerBound\": null,\n \"fundingRateUpperBound\": null,\n \"imfFunction\": null,\n \"marketType\": \"SPOT\",\n \"mmfFunction\": null,\n \"openInterestLimit\": \"0\",\n \"orderBookState\": \"Open\",\n \"quoteSymbol\": \"USDC\",\n \"symbol\": \"SOL_USDC\"\n },\n {\n \"baseSymbol\": \"SOL\",\n \"createdAt\": \"2025-01-21T06:34:54.691858\",\n \"filters\": {\n \"price\": {\n \"borrowEntryFeeMaxMultiplier\": null,\n \"borrowEntryFeeMinMultiplier\": null,\n \"maxImpactMultiplier\": \"1.03\",\n \"maxMultiplier\": \"1.25\",\n \"maxPrice\": \"1000\",\n \"meanMarkPriceBand\": {\n \"maxMultiplier\": \"1.1\",\n \"minMultiplier\": \"0.9\"\n },\n \"meanPremiumBand\": {\n \"tolerancePct\": \"0.05\"\n },\n \"minImpactMultiplier\": \"0.97\",\n \"minMultiplier\": \"0.75\",\n \"minPrice\": \"0.01\",\n \"tickSize\": \"0.01\"\n },\n \"quantity\": {\n \"maxQuantity\": null,\n \"minQuantity\": \"0.01\",\n \"stepSize\": \"0.01\"\n }\n },\n \"fundingInterval\": \"28800000\",\n \"fundingRateLowerBound\": \"-100\",\n \"fundingRateUpperBound\": \"100\",\n \"imfFunction\": {\n \"base\": \"0.02\",\n \"factor\": \"0.0001275\",\n \"type\": \"sqrt\"\n },\n \"marketType\": \"PERP\",\n \"mmfFunction\": {\n \"base\": \"0.0125\",\n \"factor\": \"0.0000765\",\n \"type\": \"sqrt\"\n },\n \"openInterestLimit\": \"4000000\",\n \"orderBookState\": \"Open\",\n \"quoteSymbol\": \"USDC\",\n \"symbol\": \"SOL_USDC_PERP\"\n }\n ]" ], "line_end" => 793, "line_start" => 619, "mappings" => [ %{ "comment" => nil, "key" => "id", "value" => "id" }, %{ "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" => "quoteId", "value" => "quoteId" }, %{ "comment" => nil, "key" => "settleId", "value" => "settleId" }, %{ "comment" => nil, "key" => "type", "value" => "type" }, %{ "comment" => nil, "key" => "spot", "value" => "type === 'spot'" }, %{ "comment" => nil, "key" => "margin", "value" => "type === 'spot'" }, %{ "comment" => nil, "key" => "future", "value" => "false" }, %{ "comment" => nil, "key" => "option", "value" => "false" }, %{ "comment" => nil, "key" => "active", "value" => "orderBookState === 'Open'" }, %{ "comment" => nil, "key" => "contract", "value" => "type !== 'spot'" }, %{ "comment" => nil, "key" => "linear", "value" => "linear" }, %{ "comment" => nil, "key" => "inverse", "value" => "inverse" }, %{ "comment" => nil, "key" => "taker", "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': amountPrecision,\n 'price': pricePrecision,\n }" }, %{ "comment" => nil, "key" => "limits", "value" => "{\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n 'amount': {\n 'min': minQuantity,\n 'max': maxQuantity,\n },\n 'price': {\n 'min': minPrice,\n 'max': maxPrice,\n },\n 'cost': {\n 'min': undefined,\n 'max': undefined,\n },\n }" }, %{ "comment" => nil, "key" => "created", "value" => "this.parse8601 (this.safeString (market, 'createdAt'))" }, %{ "comment" => nil, "key" => "info", "value" => "market" } ], "name" => "parseMarket", "signature" => "parseMarket (market: Dict): Market", "source" => "parseMarket (market: Dict): Market {\n //\n // [\n // {\n // \"baseSymbol\": \"SOL\",\n // \"createdAt\": \"2025-01-21T06:34:54.691858\",\n // \"filters\": {\n // \"price\": {\n // \"borrowmarketFeeMaxMultiplier\": null,\n // \"borrowmarketFeeMinMultiplier\": null,\n // \"maxImpactMultiplier\": \"1.03\",\n // \"maxMultiplier\": \"1.25\",\n // \"maxPrice\": null,\n // \"meanMarkPriceBand\": {\n // \"maxMultiplier\": \"1.15\",\n // \"minMultiplier\": \"0.9\"\n // },\n // \"meanPremiumBand\": null,\n // \"minImpactMultiplier\": \"0.97\",\n // \"minMultiplier\": \"0.75\",\n // \"minPrice\": \"0.01\",\n // \"tickSize\": \"0.01\"\n // },\n // \"quantity\": {\n // \"maxQuantity\": null,\n // \"minQuantity\": \"0.01\",\n // \"stepSize\": \"0.01\"\n // }\n // },\n // \"fundingInterval\": 28800000,\n // \"fundingRateLowerBound\": null,\n // \"fundingRateUpperBound\": null,\n // \"imfFunction\": null,\n // \"marketType\": \"SPOT\",\n // \"mmfFunction\": null,\n // \"openInterestLimit\": \"0\",\n // \"orderBookState\": \"Open\",\n // \"quoteSymbol\": \"USDC\",\n // \"symbol\": \"SOL_USDC\"\n // },\n // {\n // \"baseSymbol\": \"SOL\",\n // \"createdAt\": \"2025-01-21T06:34:54.691858\",\n // \"filters\": {\n // \"price\": {\n // \"borrowEntryFeeMaxMultiplier\": null,\n // \"borrowEntryFeeMinMultiplier\": null,\n // \"maxImpactMultiplier\": \"1.03\",\n // \"maxMultiplier\": \"1.25\",\n // \"maxPrice\": \"1000\",\n // \"meanMarkPriceBand\": {\n // \"maxMultiplier\": \"1.1\",\n // \"minMultiplier\": \"0.9\"\n // },\n // \"meanPremiumBand\": {\n // \"tolerancePct\": \"0.05\"\n // },\n // \"minImpactMultiplier\": \"0.97\",\n // \"minMultiplier\": \"0.75\",\n // \"minPrice\": \"0.01\",\n // \"tickSize\": \"0.01\"\n // },\n // \"quantity\": {\n // \"maxQuantity\": null,\n // \"minQuantity\": \"0.01\",\n // \"stepSize\": \"0.01\"\n // }\n // },\n // \"fundingInterval\": \"28800000\",\n // \"fundingRateLowerBound\": \"-100\",\n // \"fundingRateUpperBound\": \"100\",\n // \"imfFunction\": {\n // \"base\": \"0.02\",\n // \"factor\": \"0.0001275\",\n // \"type\": \"sqrt\"\n // },\n // \"marketType\": \"PERP\",\n // \"mmfFunction\": {\n // \"base\": \"0.0125\",\n // \"factor\": \"0.0000765\",\n // \"type\": \"sqrt\"\n // },\n // \"openInterestLimit\": \"4000000\",\n // \"orderBookState\": \"Open\",\n // \"quoteSymbol\": \"USDC\",\n // \"symbol\": \"SOL_USDC_PERP\"\n // }\n // ]\n //\n const id = this.safeString (market, 'symbol');\n const baseId = this.safeString (market, 'baseSymbol');\n const quoteId = this.safeString (market, 'quoteSymbol');\n const base = this.safeCurrencyCode (baseId);\n const quote = this.safeCurrencyCode (quoteId);\n let symbol = base + '/' + quote;\n const filters = this.safeDict (market, 'filters', {});\n const priceFilter = this.safeDict (filters, 'price', {});\n const maxPrice = this.safeNumber (priceFilter, 'maxPrice');\n const minPrice = this.safeNumber (priceFilter, 'minPrice');\n const pricePrecision = this.safeNumber (priceFilter, 'tickSize');\n const quantityFilter = this.safeDict (filters, 'quantity', {});\n const maxQuantity = this.safeNumber (quantityFilter, 'maxQuantity');\n const minQuantity = this.safeNumber (quantityFilter, 'minQuantity');\n const amountPrecision = this.safeNumber (quantityFilter, 'stepSize');\n let type: MarketType;\n const typeOfMarket = this.parseMarketType (this.safeString (market, 'marketType'));\n let linear: Bool = undefined;\n let inverse: Bool = undefined;\n let settle: Str = undefined;\n let settleId: Str = undefined;\n let contractSize: Num = undefined;\n if (typeOfMarket === 'spot') {\n type = 'spot';\n } else if (typeOfMarket === 'swap') {\n type = 'swap';\n linear = true;\n inverse = false;\n settleId = this.safeString (market, 'quoteSymbol');\n settle = this.safeCurrencyCode (settleId);\n symbol += ':' + settle;\n contractSize = 1;\n }\n const orderBookState = this.safeString (market, 'orderBookState');\n return this.safeMarketStructure ({\n 'id': id,\n 'symbol': symbol,\n 'base': base,\n 'quote': quote,\n 'settle': settle,\n 'baseId': baseId,\n 'quoteId': quoteId,\n 'settleId': settleId,\n 'type': type,\n 'spot': type === 'spot',\n 'margin': type === 'spot', // todo check if margin is supported for all markets\n 'swap': type === 'swap',\n 'future': false,\n 'option': false,\n 'active': orderBookState === 'Open',\n 'contract': type !== 'spot',\n 'linear': linear,\n 'inverse': inverse,\n 'taker': undefined, // todo check commission\n 'maker': undefined, // todo check commission\n 'contractSize': contractSize,\n 'expiry': undefined,\n 'expiryDatetime': undefined,\n 'strike': undefined,\n 'optionType': undefined,\n 'precision': {\n 'amount': amountPrecision,\n 'price': pricePrecision,\n },\n 'limits': {\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n 'amount': {\n 'min': minQuantity,\n 'max': maxQuantity,\n },\n 'price': {\n 'min': minPrice,\n 'max': maxPrice,\n },\n 'cost': {\n 'min': undefined,\n 'max': undefined,\n },\n },\n 'created': this.parse8601 (this.safeString (market, 'createdAt')),\n 'info': market,\n });\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 806, "line_start" => 795, "mappings" => [ %{ "comment" => nil, "key" => "SPOT", "value" => "'spot'" }, %{ "comment" => nil, "key" => "PERP", "value" => "'swap'" } ], "name" => "parseMarketType", "signature" => "parseMarketType (type)", "source" => "parseMarketType (type) {\n const types = {\n 'SPOT': 'spot',\n 'PERP': 'swap',\n // current types are described in the docs, but the exchange returns only 'SPOT' and 'PERP'\n // 'IPERP': 'swap',\n // 'DATED': 'swap',\n // 'PREDICTION': 'swap',\n // 'RFQ': 'swap',\n };\n return this.safeString (types, type, type);\n }" }, %{ "comment" => nil, "examples" => [ "[\n {\n \"close\": \"118294.6\",\n \"end\": \"2025-07-19 13:12:00\",\n \"high\": \"118297.6\",\n \"low\": \"118237.5\",\n \"open\": \"118238\",\n \"quoteVolume\": \"4106.558156\",\n \"start\": \"2025-07-19 13:09:00\",\n \"trades\": \"12\",\n \"volume\": \"0.03473\"\n },\n ...\n ]" ], "line_end" => 1007, "line_start" => 982, "mappings" => [], "name" => "parseOHLCV", "signature" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV", "source" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n //\n // [\n // {\n // \"close\": \"118294.6\",\n // \"end\": \"2025-07-19 13:12:00\",\n // \"high\": \"118297.6\",\n // \"low\": \"118237.5\",\n // \"open\": \"118238\",\n // \"quoteVolume\": \"4106.558156\",\n // \"start\": \"2025-07-19 13:09:00\",\n // \"trades\": \"12\",\n // \"volume\": \"0.03473\"\n // },\n // ...\n // ]\n //\n return [\n this.parse8601 (this.safeString (ohlcv, 'start')),\n this.safeNumber (ohlcv, 'open'),\n this.safeNumber (ohlcv, 'high'),\n this.safeNumber (ohlcv, 'low'),\n this.safeNumber (ohlcv, 'close'),\n this.safeNumber (ohlcv, 'volume'),\n ];\n }" }, %{ "comment" => nil, "examples" => [ "[\n {\n \"openInterest\": \"1273.85214\",\n \"symbol\": \"BTC_USDC_PERP\",\n \"timestamp\":1753105735301\n }\n ]" ], "line_end" => 1111, "line_start" => 1091, "mappings" => [ %{ "comment" => nil, "key" => "symbol", "value" => "market['symbol']" }, %{ "comment" => nil, "key" => "openInterestAmount", "value" => "undefined" }, %{ "comment" => nil, "key" => "openInterestValue", "value" => "openInterest" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "info", "value" => "interest" } ], "name" => "parseOpenInterest", "signature" => "parseOpenInterest (interest, market: Market = undefined)", "source" => "parseOpenInterest (interest, market: Market = undefined) {\n //\n // [\n // {\n // \"openInterest\": \"1273.85214\",\n // \"symbol\": \"BTC_USDC_PERP\",\n // \"timestamp\":1753105735301\n // }\n // ]\n //\n const timestamp = this.safeInteger (interest, 'timestamp');\n const openInterest = this.safeNumber (interest, 'openInterest');\n return this.safeOpenInterest ({\n 'symbol': market['symbol'],\n 'openInterestAmount': undefined,\n 'openInterestValue': openInterest,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'info': interest,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"clientId\": null,\n \"createdAt\": 1753624283415,\n \"executedQuantity\": \"0.001\",\n \"executedQuoteQuantity\": \"3.81428\",\n \"id\": \"4227701917\",\n \"orderType\": \"Market\",\n \"quantity\": \"0.001\",\n \"quoteQuantity\": \"3.82\",\n \"reduceOnly\": null,\n \"relatedOrderId\": null,\n \"selfTradePrevention\": \"RejectTaker\",\n \"side\": \"Bid\",\n \"status\": \"Filled\",\n \"stopLossLimitPrice\": null,\n \"stopLossTriggerBy\": null,\n \"stopLossTriggerPrice\": null,\n \"strategyId\": null,\n \"symbol\": \"ETH_USDC\",\n \"takeProfitLimitPrice\": null,\n \"takeProfitTriggerBy\": null,\n \"takeProfitTriggerPrice\": null,\n \"timeInForce\": \"GTC\",\n \"triggerBy\": null,\n \"triggerPrice\": null,\n \"triggerQuantity\": null,\n \"triggeredAt\": null\n }", "{\n \"clientId\": 123456789,\n \"createdAt\": 1753626206762,\n \"executedQuantity\": \"0\",\n \"executedQuoteQuantity\": \"0\",\n \"id\": \"4228978331\",\n \"orderType\": \"Limit\",\n \"postOnly\": true,\n \"price\": \"3000\",\n \"quantity\": \"0.001\",\n \"reduceOnly\": null,\n \"relatedOrderId\": null,\n \"selfTradePrevention\": \"RejectTaker\",\n \"side\": \"Bid\",\n \"status\": \"New\",\n \"stopLossLimitPrice\": null,\n \"stopLossTriggerBy\": null,\n \"stopLossTriggerPrice\": null,\n \"strategyId\": null,\n \"symbol\": \"ETH_USDC\",\n \"takeProfitLimitPrice\": null,\n \"takeProfitTriggerBy\": null,\n \"takeProfitTriggerPrice\": null,\n \"timeInForce\": \"GTC\",\n \"triggerBy\": null,\n \"triggerPrice\": null,\n \"triggerQuantity\": null,\n \"triggeredAt\": null\n }", "{\n \"clientId\": null,\n \"createdAt\": \"2025-07-27T18:05:40.897\",\n \"executedQuantity\": \"0\",\n \"executedQuoteQuantity\": \"0\",\n \"expiryReason\": null,\n \"id\": \"4239996998\",\n \"orderType\": \"Limit\",\n \"postOnly\": false,\n \"price\": \"4500\",\n \"quantity\": null,\n \"quoteQuantity\": null,\n \"selfTradePrevention\": \"RejectTaker\",\n \"side\": \"Ask\",\n \"status\": \"Cancelled\",\n \"stopLossLimitPrice\": null,\n \"stopLossTriggerBy\": null,\n \"stopLossTriggerPrice\": null,\n \"strategyId\": null,\n \"symbol\": \"ETH_USDC\",\n \"systemOrderType\": null,\n \"takeProfitLimitPrice\": null,\n \"takeProfitTriggerBy\": null,\n \"takeProfitTriggerPrice\": null,\n \"timeInForce\": \"GTC\",\n \"triggerBy\": null,\n \"triggerPrice\": \"4300\",\n \"triggerQuantity\": \"0.001\"\n }" ], "line_end" => 2075, "line_start" => 1935, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "order" }, %{ "comment" => nil, "key" => "id", "value" => "id" }, %{ "comment" => nil, "key" => "clientOrderId", "value" => "clientOrderId" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "lastTradeTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "type", "value" => "type" }, %{ "comment" => nil, "key" => "timeInForce", "value" => "timeInForce" }, %{ "comment" => nil, "key" => "postOnly", "value" => "postOnly" }, %{ "comment" => nil, "key" => "reduceOnly", "value" => "reduceOnly" }, %{ "comment" => nil, "key" => "side", "value" => "side" }, %{ "comment" => nil, "key" => "price", "value" => "price" }, %{ "comment" => nil, "key" => "triggerPrice", "value" => "triggerPrice" }, %{ "comment" => nil, "key" => "stopLossPrice", "value" => "stopLossPrice" }, %{ "comment" => nil, "key" => "takeProfitPrice", "value" => "takeProfitPrice" }, %{ "comment" => nil, "key" => "amount", "value" => "amount" }, %{ "comment" => nil, "key" => "cost", "value" => "cost" }, %{ "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 // \"clientId\": null,\n // \"createdAt\": 1753624283415,\n // \"executedQuantity\": \"0.001\",\n // \"executedQuoteQuantity\": \"3.81428\",\n // \"id\": \"4227701917\",\n // \"orderType\": \"Market\",\n // \"quantity\": \"0.001\",\n // \"quoteQuantity\": \"3.82\",\n // \"reduceOnly\": null,\n // \"relatedOrderId\": null,\n // \"selfTradePrevention\": \"RejectTaker\",\n // \"side\": \"Bid\",\n // \"status\": \"Filled\",\n // \"stopLossLimitPrice\": null,\n // \"stopLossTriggerBy\": null,\n // \"stopLossTriggerPrice\": null,\n // \"strategyId\": null,\n // \"symbol\": \"ETH_USDC\",\n // \"takeProfitLimitPrice\": null,\n // \"takeProfitTriggerBy\": null,\n // \"takeProfitTriggerPrice\": null,\n // \"timeInForce\": \"GTC\",\n // \"triggerBy\": null,\n // \"triggerPrice\": null,\n // \"triggerQuantity\": null,\n // \"triggeredAt\": null\n // }\n //\n // fetchOpenOrders\n // {\n // \"clientId\": 123456789,\n // \"createdAt\": 1753626206762,\n // \"executedQuantity\": \"0\",\n // \"executedQuoteQuantity\": \"0\",\n // \"id\": \"4228978331\",\n // \"orderType\": \"Limit\",\n // \"postOnly\": true,\n // \"price\": \"3000\",\n // \"quantity\": \"0.001\",\n // \"reduceOnly\": null,\n // \"relatedOrderId\": null,\n // \"selfTradePrevention\": \"RejectTaker\",\n // \"side\": \"Bid\",\n // \"status\": \"New\",\n // \"stopLossLimitPrice\": null,\n // \"stopLossTriggerBy\": null,\n // \"stopLossTriggerPrice\": null,\n // \"strategyId\": null,\n // \"symbol\": \"ETH_USDC\",\n // \"takeProfitLimitPrice\": null,\n // \"takeProfitTriggerBy\": null,\n // \"takeProfitTriggerPrice\": null,\n // \"timeInForce\": \"GTC\",\n // \"triggerBy\": null,\n // \"triggerPrice\": null,\n // \"triggerQuantity\": null,\n // \"triggeredAt\": null\n // }\n //\n // fetchOrders\n // {\n // \"clientId\": null,\n // \"createdAt\": \"2025-07-27T18:05:40.897\",\n // \"executedQuantity\": \"0\",\n // \"executedQuoteQuantity\": \"0\",\n // \"expiryReason\": null,\n // \"id\": \"4239996998\",\n // \"orderType\": \"Limit\",\n // \"postOnly\": false,\n // \"price\": \"4500\",\n // \"quantity\": null,\n // \"quoteQuantity\": null,\n // \"selfTradePrevention\": \"RejectTaker\",\n // \"side\": \"Ask\",\n // \"status\": \"Cancelled\",\n // \"stopLossLimitPrice\": null,\n // \"stopLossTriggerBy\": null,\n // \"stopLossTriggerPrice\": null,\n // \"strategyId\": null,\n // \"symbol\": \"ETH_USDC\",\n // \"systemOrderType\": null,\n // \"takeProfitLimitPrice\": null,\n // \"takeProfitTriggerBy\": null,\n // \"takeProfitTriggerPrice\": null,\n // \"timeInForce\": \"GTC\",\n // \"triggerBy\": null,\n // \"triggerPrice\": \"4300\",\n // \"triggerQuantity\": \"0.001\"\n // }\n //\n let timestamp = this.safeInteger (order, 'createdAt');\n const timestamp2 = this.parse8601 (this.safeString (order, 'createdAt'));\n if (timestamp2 !== undefined) {\n timestamp = timestamp2;\n }\n const id = this.safeString (order, 'id');\n const clientOrderId = this.safeString (order, 'clientId');\n const symbol = this.safeSymbol (this.safeString (order, 'symbol'), market);\n const type = this.safeStringLower (order, 'orderType');\n const timeInForce = this.safeString (order, 'timeInForce');\n const side = this.parseOrderSide (this.safeString (order, 'side'));\n const amount = this.safeString2 (order, 'quantity', 'triggerQuantity');\n const price = this.safeString (order, 'price');\n const cost = this.safeString (order, 'executedQuoteQuantity');\n const status = this.parseOrderStatus (this.safeString (order, 'status'));\n const triggerPrice = this.safeString (order, 'triggerPrice');\n const filled = this.safeString (order, 'executedQuantity');\n const reduceOnly = this.safeBool (order, 'reduceOnly');\n const postOnly = this.safeBool (order, 'postOnly');\n const stopLossPrice = this.safeString2 (order, 'stopLossLimitPrice', 'stopLossTriggerPrice');\n const takeProfitPrice = this.safeString2 (order, 'takeProfitLimitPrice', 'takeProfitTriggerPrice');\n return this.safeOrder ({\n 'info': order,\n 'id': id,\n 'clientOrderId': clientOrderId,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'lastTradeTimestamp': undefined,\n 'symbol': symbol,\n 'type': type,\n 'timeInForce': timeInForce,\n 'postOnly': postOnly,\n 'reduceOnly': reduceOnly,\n 'side': side,\n 'price': price,\n 'triggerPrice': triggerPrice,\n 'stopLossPrice': stopLossPrice,\n 'takeProfitPrice': takeProfitPrice,\n 'amount': amount,\n 'cost': cost,\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" => 2096, "line_start" => 2090, "mappings" => [], "name" => "parseOrderSide", "signature" => "parseOrderSide (side: Str)", "source" => "parseOrderSide (side: Str) {\n const sides: Dict = {\n 'Bid': 'buy',\n 'Ask': 'sell',\n };\n return this.safeString (sides, side, side);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2088, "line_start" => 2077, "mappings" => [], "name" => "parseOrderStatus", "signature" => "parseOrderStatus (status: Str)", "source" => "parseOrderStatus (status: Str) {\n const statuses: Dict = {\n 'New': 'open',\n 'Filled': 'closed',\n 'Cancelled': 'canceled',\n 'Expired': 'canceled',\n 'PartiallyFilled': 'open',\n 'TriggerPending': 'open',\n 'TriggerFailed': 'rejected',\n };\n return this.safeString (statuses, status, status);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"breakEvenPrice\": \"3831.3630555555555555555555556\",\n \"cumulativeFundingPayment\": \"-0.009218\",\n \"cumulativeInterest\": \"0\",\n \"entryPrice\": \"3826.8888888888888888888888889\",\n \"estLiquidationPrice\": \"0\",\n \"imf\": \"0.02\",\n \"imfFunction\": {\n \"base\": \"0.02\",\n \"factor\": \"0.0000935\",\n \"type\": \"sqrt\"\n },\n \"markPrice\": \"3787.46813304\",\n \"mmf\": \"0.0125\",\n \"mmfFunction\": {\n \"base\": \"0.0125\",\n \"factor\": \"0.0000561\",\n \"type\": \"sqrt\"\n },\n \"netCost\": \"13.7768\",\n \"netExposureNotional\": \"13.634885278944\",\n \"netExposureQuantity\": \"0.0036\",\n \"netQuantity\": \"0.0036\",\n \"pnlRealized\": \"0\",\n \"pnlUnrealized\": \"-0.141914\",\n \"positionId\": \"4238420454\",\n \"subaccountId\": null,\n \"symbol\": \"ETH_USDC_PERP\",\n \"userId\":1813870\n }" ], "line_end" => 2202, "line_start" => 2118, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "position" }, %{ "comment" => nil, "key" => "id", "value" => "id" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "timestamp", "value" => "this.parse8601 (this.safeString (position, 'timestamp'))" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (this.parse8601 (this.safeString (position, 'timestamp')))" }, %{ "comment" => nil, "key" => "lastUpdateTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "hedged", "value" => "hedged" }, %{ "comment" => nil, "key" => "side", "value" => "side" }, %{ "comment" => nil, "key" => "contracts", "value" => "this.safeString (position, 'netExposureQuantity')" }, %{ "comment" => nil, "key" => "contractSize", "value" => "undefined" }, %{ "comment" => nil, "key" => "entryPrice", "value" => "entryPrice" }, %{ "comment" => nil, "key" => "markPrice", "value" => "markPrice" }, %{ "comment" => nil, "key" => "lastPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "notional", "value" => "Precise.stringAbs (netCost)" }, %{ "comment" => nil, "key" => "leverage", "value" => "undefined" }, %{ "comment" => nil, "key" => "collateral", "value" => "undefined" }, %{ "comment" => nil, "key" => "initialMargin", "value" => "undefined" }, %{ "comment" => nil, "key" => "initialMarginPercentage", "value" => "this.safeString (position, 'imf')" }, %{ "comment" => nil, "key" => "maintenanceMargin", "value" => "undefined" }, %{ "comment" => nil, "key" => "maintenanceMarginPercentage", "value" => "this.safeString (position, 'mmf')" }, %{ "comment" => nil, "key" => "realizedPnl", "value" => "realizedPnl" }, %{ "comment" => nil, "key" => "unrealizedPnl", "value" => "unrealizedPnl" }, %{ "comment" => nil, "key" => "liquidationPrice", "value" => "liquidationPrice" }, %{ "comment" => nil, "key" => "marginMode", "value" => "undefined" }, %{ "comment" => nil, "key" => "marginRatio", "value" => "undefined" }, %{ "comment" => nil, "key" => "percentage", "value" => "undefined" }, %{ "comment" => nil, "key" => "stopLossPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "takeProfitPrice", "value" => "undefined" } ], "name" => "parsePosition", "signature" => "parsePosition (position: Dict, market: Market = undefined)", "source" => "parsePosition (position: Dict, market: Market = undefined) {\n //\n // fetchPositions\n // {\n // \"breakEvenPrice\": \"3831.3630555555555555555555556\",\n // \"cumulativeFundingPayment\": \"-0.009218\",\n // \"cumulativeInterest\": \"0\",\n // \"entryPrice\": \"3826.8888888888888888888888889\",\n // \"estLiquidationPrice\": \"0\",\n // \"imf\": \"0.02\",\n // \"imfFunction\": {\n // \"base\": \"0.02\",\n // \"factor\": \"0.0000935\",\n // \"type\": \"sqrt\"\n // },\n // \"markPrice\": \"3787.46813304\",\n // \"mmf\": \"0.0125\",\n // \"mmfFunction\": {\n // \"base\": \"0.0125\",\n // \"factor\": \"0.0000561\",\n // \"type\": \"sqrt\"\n // },\n // \"netCost\": \"13.7768\",\n // \"netExposureNotional\": \"13.634885278944\",\n // \"netExposureQuantity\": \"0.0036\",\n // \"netQuantity\": \"0.0036\",\n // \"pnlRealized\": \"0\",\n // \"pnlUnrealized\": \"-0.141914\",\n // \"positionId\": \"4238420454\",\n // \"subaccountId\": null,\n // \"symbol\": \"ETH_USDC_PERP\",\n // \"userId\":1813870\n // }\n //\n //\n const id = this.safeString (position, 'positionId');\n const marketId = this.safeString (position, 'symbol');\n market = this.safeMarket (marketId, market);\n const symbol = market['symbol'];\n const entryPrice = this.safeString (position, 'entryPrice');\n const markPrice = this.safeString (position, 'markPrice');\n const netCost = this.safeString (position, 'netCost');\n let hedged = false;\n let side = 'long';\n if (Precise.stringLt (netCost, '0')) {\n side = 'short';\n }\n if (netCost === undefined) {\n hedged = undefined;\n side = undefined;\n }\n const unrealizedPnl = this.safeString (position, 'pnlUnrealized');\n const realizedPnl = this.safeString (position, 'pnlRealized');\n const liquidationPrice = this.safeString (position, 'estLiquidationPrice');\n return this.safePosition ({\n 'info': position,\n 'id': id,\n 'symbol': symbol,\n 'timestamp': this.parse8601 (this.safeString (position, 'timestamp')),\n 'datetime': this.iso8601 (this.parse8601 (this.safeString (position, 'timestamp'))),\n 'lastUpdateTimestamp': undefined,\n 'hedged': hedged,\n 'side': side,\n 'contracts': this.safeString (position, 'netExposureQuantity'),\n 'contractSize': undefined,\n 'entryPrice': entryPrice,\n 'markPrice': markPrice,\n 'lastPrice': undefined,\n 'notional': Precise.stringAbs (netCost),\n 'leverage': undefined,\n 'collateral': undefined,\n 'initialMargin': undefined,\n 'initialMarginPercentage': this.safeString (position, 'imf'),\n 'maintenanceMargin': undefined,\n 'maintenanceMarginPercentage': this.safeString (position, 'mmf'),\n 'realizedPnl': realizedPnl,\n 'unrealizedPnl': unrealizedPnl,\n 'liquidationPrice': liquidationPrice,\n 'marginMode': undefined,\n 'marginRatio': undefined,\n 'percentage': undefined,\n 'stopLossPrice': undefined,\n 'takeProfitPrice': undefined,\n });\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"firstPrice\": \"327.38\",\n \"high\": \"337.99\",\n \"lastPrice\": \"317.14\",\n \"low\": \"300.01\",\n \"priceChange\": \"-10.24\",\n \"priceChangePercent\": \"-0.031279\",\n \"quoteVolume\": \"21584.32278\",\n \"symbol\": \"AAVE_USDC\",\n \"trades\": \"245\",\n \"volume\": \"65.823\"\n }, ..." ], "line_end" => 896, "line_start" => 844, "mappings" => [ %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "timestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "datetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "high", "value" => "high" }, %{ "comment" => nil, "key" => "low", "value" => "low" }, %{ "comment" => nil, "key" => "bid", "value" => "undefined" }, %{ "comment" => nil, "key" => "bidVolume", "value" => "undefined" }, %{ "comment" => nil, "key" => "ask", "value" => "undefined" }, %{ "comment" => nil, "key" => "askVolume", "value" => "undefined" }, %{ "comment" => nil, "key" => "vwap", "value" => "undefined" }, %{ "comment" => nil, "key" => "open", "value" => "open" }, %{ "comment" => nil, "key" => "close", "value" => "last" }, %{ "comment" => nil, "key" => "last", "value" => "last" }, %{ "comment" => nil, "key" => "previousClose", "value" => "undefined" }, %{ "comment" => nil, "key" => "change", "value" => "change" }, %{ "comment" => nil, "key" => "percentage", "value" => "percentage" }, %{ "comment" => nil, "key" => "average", "value" => "undefined" }, %{ "comment" => nil, "key" => "baseVolume", "value" => "baseVolume" }, %{ "comment" => nil, "key" => "quoteVolume", "value" => "quoteVolume" }, %{ "comment" => nil, "key" => "markPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "indexPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "info", "value" => "ticker" } ], "name" => "parseTicker", "signature" => "parseTicker (ticker: Dict, market: Market = undefined): Ticker", "source" => "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n //\n // fetchTicker/fetchTickers\n //\n // {\n // \"firstPrice\": \"327.38\",\n // \"high\": \"337.99\",\n // \"lastPrice\": \"317.14\",\n // \"low\": \"300.01\",\n // \"priceChange\": \"-10.24\",\n // \"priceChangePercent\": \"-0.031279\",\n // \"quoteVolume\": \"21584.32278\",\n // \"symbol\": \"AAVE_USDC\",\n // \"trades\": \"245\",\n // \"volume\": \"65.823\"\n // }, ...\n //\n const marketId = this.safeString (ticker, 'symbol');\n market = this.safeMarket (marketId, market);\n const symbol = this.safeSymbol (marketId, market);\n const open = this.safeString (ticker, 'firstPrice');\n const last = this.safeString (ticker, 'lastPrice');\n const high = this.safeString (ticker, 'high');\n const low = this.safeString (ticker, 'low');\n const baseVolume = this.safeString (ticker, 'volume');\n const quoteVolume = this.safeString (ticker, 'quoteVolume');\n const percentage = this.safeString (ticker, 'priceChangePercent');\n const change = this.safeString (ticker, 'priceChange');\n return this.safeTicker ({\n 'symbol': symbol,\n 'timestamp': undefined,\n 'datetime': undefined,\n 'high': high,\n 'low': low,\n 'bid': undefined,\n 'bidVolume': undefined,\n 'ask': undefined,\n 'askVolume': undefined,\n 'vwap': undefined,\n 'open': open,\n 'close': last,\n 'last': last,\n 'previousClose': undefined,\n 'change': change,\n 'percentage': percentage,\n 'average': undefined,\n 'baseVolume': baseVolume,\n 'quoteVolume': quoteVolume,\n 'markPrice': undefined,\n 'indexPrice': undefined,\n 'info': ticker,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"id\": 8721563,\n \"isBuyerMaker\": false,\n \"price\": \"117427.6\",\n \"quantity\": \"0.00016\",\n \"quoteQuantity\": \"18.788416\",\n \"timestamp\": 1753123916819\n }", "{\n \"clientId\": null,\n \"fee\": \"0.004974\",\n \"feeSymbol\": \"USDC\",\n \"isMaker\": false,\n \"orderId\": \"4238907375\",\n \"price\": \"3826.15\",\n \"quantity\": \"0.0026\",\n \"side\": \"Bid\",\n \"symbol\": \"ETH_USDC_PERP\",\n \"systemOrderType\": null,\n \"timestamp\": \"2025-07-27T17:39:00.092\",\n \"tradeId\": 9748827\n }" ], "line_end" => 1303, "line_start" => 1235, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "trade" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "symbol", "value" => "market['symbol']" }, %{ "comment" => nil, "key" => "id", "value" => "id" }, %{ "comment" => nil, "key" => "order", "value" => "orderId" }, %{ "comment" => nil, "key" => "type", "value" => "undefined" }, %{ "comment" => nil, "key" => "side", "value" => "side" }, %{ "comment" => nil, "key" => "takerOrMaker", "value" => "takerOrMaker" }, %{ "comment" => nil, "key" => "price", "value" => "price" }, %{ "comment" => nil, "key" => "amount", "value" => "amount" }, %{ "comment" => nil, "key" => "cost", "value" => "undefined" }, %{ "comment" => nil, "key" => "fee", "value" => "fee" } ], "name" => "parseTrade", "signature" => "parseTrade (trade: Dict, market: Market = undefined): Trade", "source" => "parseTrade (trade: Dict, market: Market = undefined): Trade {\n //\n // fetchTrades\n // {\n // \"id\": 8721563,\n // \"isBuyerMaker\": false,\n // \"price\": \"117427.6\",\n // \"quantity\": \"0.00016\",\n // \"quoteQuantity\": \"18.788416\",\n // \"timestamp\": 1753123916819\n // }\n //\n // fetchMyTrades\n // {\n // \"clientId\": null,\n // \"fee\": \"0.004974\",\n // \"feeSymbol\": \"USDC\",\n // \"isMaker\": false,\n // \"orderId\": \"4238907375\",\n // \"price\": \"3826.15\",\n // \"quantity\": \"0.0026\",\n // \"side\": \"Bid\",\n // \"symbol\": \"ETH_USDC_PERP\",\n // \"systemOrderType\": null,\n // \"timestamp\": \"2025-07-27T17:39:00.092\",\n // \"tradeId\": 9748827\n // }\n //\n const id = this.safeString2 (trade, 'id', 'tradeId');\n const marketId = this.safeString (trade, 'symbol');\n market = this.safeMarket (marketId, market);\n const price = this.safeString (trade, 'price');\n const amount = this.safeString (trade, 'quantity');\n const isMaker = this.safeBool (trade, 'isMaker');\n const takerOrMaker = isMaker ? 'maker' : 'taker';\n const orderId = this.safeString (trade, 'orderId');\n const side = this.parseOrderSide (this.safeString (trade, 'side'));\n let fee = undefined;\n const feeAmount = this.safeString (trade, 'fee');\n let timestamp = this.safeInteger (trade, 'timestamp');\n if (feeAmount !== undefined) {\n // if fetchMyTrades\n const datetime = this.safeString (trade, 'timestamp');\n timestamp = this.parse8601 (datetime);\n }\n const feeSymbol = this.safeCurrencyCode (this.safeString (trade, 'feeSymbol'));\n if (feeAmount !== undefined) {\n fee = {\n 'cost': feeAmount,\n 'currency': feeSymbol,\n 'rate': undefined,\n };\n }\n return this.safeTrade ({\n 'info': trade,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'symbol': market['symbol'],\n 'id': id,\n 'order': orderId,\n 'type': undefined,\n 'side': side,\n 'takerOrMaker': takerOrMaker,\n 'price': price,\n 'amount': amount,\n 'cost': undefined,\n 'fee': fee,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [ "[\n {\n \"createdAt\": \"2025-07-23T13:55:54.267\",\n \"fiatAmount\": null,\n \"fiatCurrency\": null,\n \"fromAddress\": \"0x2e3ab3e88a7dbdc763aadf5b28c18fb085af420a\",\n \"id\": 6695353,\n \"institutionBic\": null,\n \"platformMemo\": null,\n \"quantity\": \"120\",\n \"source\": \"ethereum\",\n \"status\": \"confirmed\",\n \"symbol\": \"USDC\",\n \"toAddress\": \"0xfBe7CbfCde93c8a4204a4be6B56732Eb32690170\",\n \"transactionHash\": \"0x58edaac415398d617b34c6673fffcaf0024990d5700565030119db5cbf3765d1\"\n }\n ]", "{\n \"accountIdentifier\": null,\n \"bankIdentifier\": null,\n \"bankName\": null,\n \"blockchain\": \"Ethereum\",\n \"clientId\": null,\n \"createdAt\": \"2025-08-13T19:27:13.817\",\n \"fee\": \"3\",\n \"fiatFee\": null,\n \"fiatState\": null,\n \"fiatSymbol\": null,\n \"id\": 5479929,\n \"identifier\": null,\n \"isInternal\": false,\n \"providerId\": null,\n \"quantity\": \"10\",\n \"status\": \"pending\",\n \"subaccountId\": null,\n \"symbol\": \"USDC\",\n \"toAddress\": \"0x0ad42b8e602c2d3d475ae52d678cf63d84ab2749\",\n \"transactionHash\": null,\n \"triggerAt\": null\n }", "[\n {\n \"accountIdentifier\": null,\n \"bankIdentifier\": null,\n \"bankName\": null,\n \"blockchain\": \"Ethereum\",\n \"clientId\": null,\n \"createdAt\": \"2025-08-13T19:27:13.817\",\n \"fee\": \"3\",\n \"fiatFee\": null,\n \"fiatState\": null,\n \"fiatSymbol\": null,\n \"id\": 5479929,\n \"identifier\": null,\n \"isInternal\": false,\n \"providerId\": null,\n \"quantity\": \"10\",\n \"status\": \"confirmed\",\n \"subaccountId\": null,\n \"symbol\": \"USDC\",\n \"toAddress\": \"0x0ad42b8e602c2d3d475ae52d678cf63d84ab2749\",\n \"transactionHash\": \"0x658b6d082af4afa0d3cf85caf344ff7c19d980117726bf193b00d8850f8746a1\",\n \"triggerAt\": null\n }\n ]" ], "line_end" => 1607, "line_start" => 1491, "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" => "network" }, %{ "comment" => nil, "key" => "address", "value" => "undefined" }, %{ "comment" => nil, "key" => "addressTo", "value" => "addressTo" }, %{ "comment" => nil, "key" => "addressFrom", "value" => "addressFrom" }, %{ "comment" => nil, "key" => "tag", "value" => "tag" }, %{ "comment" => nil, "key" => "tagTo", "value" => "undefined" }, %{ "comment" => nil, "key" => "tagFrom", "value" => "undefined" }, %{ "comment" => nil, "key" => "type", "value" => "undefined" }, %{ "comment" => nil, "key" => "amount", "value" => "amount" }, %{ "comment" => nil, "key" => "currency", "value" => "code" }, %{ "comment" => nil, "key" => "status", "value" => "status" }, %{ "comment" => nil, "key" => "updated", "value" => "undefined" }, %{ "comment" => nil, "key" => "internal", "value" => "internal" }, %{ "comment" => nil, "key" => "comment", "value" => "undefined" }, %{ "comment" => nil, "key" => "fee", "value" => "fee" } ], "name" => "parseTransaction", "signature" => "parseTransaction (transaction, currency: Currency = undefined): Transaction", "source" => "parseTransaction (transaction, currency: Currency = undefined): Transaction {\n //\n // fetchDeposits\n // [\n // {\n // \"createdAt\": \"2025-07-23T13:55:54.267\",\n // \"fiatAmount\": null,\n // \"fiatCurrency\": null,\n // \"fromAddress\": \"0x2e3ab3e88a7dbdc763aadf5b28c18fb085af420a\",\n // \"id\": 6695353,\n // \"institutionBic\": null,\n // \"platformMemo\": null,\n // \"quantity\": \"120\",\n // \"source\": \"ethereum\",\n // \"status\": \"confirmed\",\n // \"symbol\": \"USDC\",\n // \"toAddress\": \"0xfBe7CbfCde93c8a4204a4be6B56732Eb32690170\",\n // \"transactionHash\": \"0x58edaac415398d617b34c6673fffcaf0024990d5700565030119db5cbf3765d1\"\n // }\n // ]\n //\n // withdraw\n // {\n // \"accountIdentifier\": null,\n // \"bankIdentifier\": null,\n // \"bankName\": null,\n // \"blockchain\": \"Ethereum\",\n // \"clientId\": null,\n // \"createdAt\": \"2025-08-13T19:27:13.817\",\n // \"fee\": \"3\",\n // \"fiatFee\": null,\n // \"fiatState\": null,\n // \"fiatSymbol\": null,\n // \"id\": 5479929,\n // \"identifier\": null,\n // \"isInternal\": false,\n // \"providerId\": null,\n // \"quantity\": \"10\",\n // \"status\": \"pending\",\n // \"subaccountId\": null,\n // \"symbol\": \"USDC\",\n // \"toAddress\": \"0x0ad42b8e602c2d3d475ae52d678cf63d84ab2749\",\n // \"transactionHash\": null,\n // \"triggerAt\": null\n // }\n //\n // fetchWithdrawals\n // [\n // {\n // \"accountIdentifier\": null,\n // \"bankIdentifier\": null,\n // \"bankName\": null,\n // \"blockchain\": \"Ethereum\",\n // \"clientId\": null,\n // \"createdAt\": \"2025-08-13T19:27:13.817\",\n // \"fee\": \"3\",\n // \"fiatFee\": null,\n // \"fiatState\": null,\n // \"fiatSymbol\": null,\n // \"id\": 5479929,\n // \"identifier\": null,\n // \"isInternal\": false,\n // \"providerId\": null,\n // \"quantity\": \"10\",\n // \"status\": \"confirmed\",\n // \"subaccountId\": null,\n // \"symbol\": \"USDC\",\n // \"toAddress\": \"0x0ad42b8e602c2d3d475ae52d678cf63d84ab2749\",\n // \"transactionHash\": \"0x658b6d082af4afa0d3cf85caf344ff7c19d980117726bf193b00d8850f8746a1\",\n // \"triggerAt\": null\n // }\n // ]\n //\n const status = this.parseTransactionStatus (this.safeString (transaction, 'status'));\n const id = this.safeString (transaction, 'id');\n const txid = this.safeString (transaction, 'transactionHash');\n const coin = this.safeString (transaction, 'symbol');\n const code = this.safeCurrencyCode (coin, currency);\n const timestamp = this.parse8601 (this.safeString (transaction, 'createdAt'));\n const amount = this.safeNumber (transaction, 'quantity');\n const networkId = this.safeStringLower2 (transaction, 'source', 'blockchain');\n const network = this.networkIdToCode (networkId);\n const addressTo = this.safeString (transaction, 'toAddress');\n const addressFrom = this.safeString (transaction, 'fromAddress');\n const tag = this.safeString (transaction, 'platformMemo');\n const feeCost = this.safeNumber (transaction, 'fee');\n const internal = this.safeBool (transaction, 'isInternal', false);\n let fee = undefined;\n if (feeCost !== undefined) {\n fee = {\n 'cost': feeCost,\n 'currency': code,\n };\n }\n return {\n 'info': transaction,\n 'id': id,\n 'txid': txid,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'network': network,\n 'address': undefined,\n 'addressTo': addressTo,\n 'addressFrom': addressFrom,\n 'tag': tag,\n 'tagTo': undefined,\n 'tagFrom': undefined,\n 'type': undefined,\n 'amount': amount,\n 'currency': code,\n 'status': status,\n 'updated': undefined,\n 'internal': internal,\n 'comment': undefined,\n 'fee': fee,\n } as Transaction;\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 1621, "line_start" => 1609, "mappings" => [], "name" => "parseTransactionStatus", "signature" => "parseTransactionStatus (status: Str)", "source" => "parseTransactionStatus (status: Str) {\n const statuses: Dict = {\n 'cancelled': 'cancelled',\n 'confirmed': 'ok',\n 'declined': 'declined',\n 'expired': 'expired',\n 'initiated': 'initiated',\n 'pending': 'pending',\n 'refunded': 'refunded',\n 'information required': 'pending',\n };\n return this.safeString (statuses, status, status);\n }" } ], path_prefix: "", pro: true, quote_json_numbers: nil, rate_limits: %{ interval_ms: 50, period: 1000, requests: 20, rolling_window_size: 60000 }, raw_endpoints: %{ private: [ %{ auth: false, cost: 1, method: :get, path: "/api/v1/account" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/account/limits/borrow" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/account/limits/order" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/account/limits/withdrawal" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/borrowLend/positions" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/capital" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/capital/collateral" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/order" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/orders" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/position" }, %{ auth: false, cost: 1, method: :get, path: "/wapi/v1/capital/deposit/address" }, %{ auth: false, cost: 1, method: :get, path: "/wapi/v1/capital/deposits" }, %{ auth: false, cost: 1, method: :get, path: "/wapi/v1/capital/withdrawals" }, %{ auth: false, cost: 1, method: :get, path: "/wapi/v1/history/borrowLend" }, %{ auth: false, cost: 1, method: :get, path: "/wapi/v1/history/borrowLend/positions" }, %{ auth: false, cost: 1, method: :get, path: "/wapi/v1/history/dust" }, %{ auth: false, cost: 1, method: :get, path: "/wapi/v1/history/fills" }, %{ auth: false, cost: 1, method: :get, path: "/wapi/v1/history/funding" }, %{ auth: false, cost: 1, method: :get, path: "/wapi/v1/history/interest" }, %{ auth: false, cost: 1, method: :get, path: "/wapi/v1/history/orders" }, %{ auth: false, cost: 1, method: :get, path: "/wapi/v1/history/quote" }, %{ auth: false, cost: 1, method: :get, path: "/wapi/v1/history/rfq" }, %{ auth: false, cost: 1, method: :get, path: "/wapi/v1/history/settlement" }, %{ auth: false, cost: 1, method: :get, path: "/wapi/v1/history/strategies" }, %{ auth: false, cost: 1, method: :post, path: "/api/v1/account/convertDust" }, %{ auth: false, cost: 1, method: :post, path: "/api/v1/borrowLend" }, %{ auth: false, cost: 1, method: :post, path: "/api/v1/order" }, %{ auth: false, cost: 1, method: :post, path: "/api/v1/orders" }, %{ auth: false, cost: 1, method: :post, path: "/api/v1/rfq" }, %{ auth: false, cost: 1, method: :post, path: "/api/v1/rfq/accept" }, %{ auth: false, cost: 1, method: :post, path: "/api/v1/rfq/cancel" }, %{ auth: false, cost: 1, method: :post, path: "/api/v1/rfq/quote" }, %{ auth: false, cost: 1, method: :post, path: "/api/v1/rfq/refresh" }, %{ auth: false, cost: 1, method: :post, path: "/wapi/v1/capital/withdrawals" }, %{ auth: false, cost: 1, method: :delete, path: "/api/v1/order" }, %{ auth: false, cost: 1, method: :delete, path: "/api/v1/orders" }, %{ auth: false, cost: 1, method: :patch, path: "/api/v1/account" } ], public: [ %{ auth: false, cost: 1, method: :get, path: "/api/v1/assets" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/borrowLend/markets" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/borrowLend/markets/history" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/collateral" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/depth" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/fundingRates" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/klines" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/markPrices" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/market" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/markets" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/openInterest" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/ping" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/status" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/ticker" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/tickers" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/time" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/trades" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/trades/history" }, %{ auth: false, cost: 1, method: :get, path: "/api/v1/wallets" } ] }, required_credentials: %{ api_key: true, password: false, secret: true, uid: false }, requires_eddsa: false, response_error: nil, signing: %{ api_key_header: "X-API-Key", confidence: :medium, pattern: :hmac_sha256_headers, recv_window: 5000, signature_header: "X-Signature", uses_recv_window: true }, spec_format_version: 1, status: %{ "eta" => nil, "status" => "ok", "updated" => nil, "url" => nil }, symbol_format: nil, symbol_formats: %{ precision_mode: 4, sample_limits: %{ "amount" => %{ "min" => 0.01 }, "cost" => %{}, "price" => %{ "min" => 0.01 } }, sample_precision: %{ "amount" => 0.01, "price" => 0.01 }, spot: %{ base: "SOL", base_id: "SOL", case: :upper, contract: false, id: "SOL_USDC", limits: %{ "amount" => %{ "min" => 0.01 }, "cost" => %{}, "leverage" => %{}, "price" => %{ "min" => 0.01 } }, precision: %{ "amount" => 0.01, "price" => 0.01 }, quote: "USDC", quote_id: "USDC", separator: "_", symbol: "SOL/USDC" }, swap: %{ base: "SOL", base_id: "SOL", case: :upper, contract: true, contract_size: 1, id: "SOL_USDC_PERP", inverse: false, limits: %{ "amount" => %{ "min" => 0.01 }, "cost" => %{}, "leverage" => %{}, "price" => %{ "max" => 1000, "min" => 0.01 } }, linear: true, precision: %{ "amount" => 0.01, "price" => 0.01 }, quote: "USDC", quote_id: "USDC", separator: "_", settle: "USDC", settle_id: "USDC", symbol: "SOL/USDC:USDC" } }, symbol_patterns: %{ spot: %{ case: :upper, component_order: nil, date_format: nil, pattern: :underscore_upper, separator: "_", suffix: nil }, swap: %{ case: :upper, component_order: nil, date_format: nil, pattern: :suffix_perp, separator: "_", suffix: "_PERP" } }, timeframes: %{ "12h" => "12h", "15" => "15m", "1M" => "1month", "1d" => "1d", "1h" => "1h", "1m" => "1m", "1w" => "1w", "2h" => "2h", "30" => "30m", "3d" => "3d", "3m" => "3m", "4h" => "4h", "5m" => "5m", "6h" => "6h", "8h" => "8h" }, url_strategy: %{ detected_from: "fallback", pattern: :no_prefix, prefix: nil }, urls: %{ api: "https://api.backpack.exchange", api_sections: %{ "private" => "https://api.backpack.exchange", "public" => "https://api.backpack.exchange" }, doc: "https://docs.backpack.exchange/", other: nil, sandbox: nil, www: "https://backpack.exchange/" }, version: "v1", ws: %{ channel_templates: %{ watch_bids_asks: %{ market_id_format: :native, params: [], pattern: :method_as_topic }, watch_ohlcv: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :method_as_topic }, watch_ohlcv_for_symbols: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "interval" }, %{ "default" => nil, "name" => "limit" } ], pattern: :method_as_topic }, watch_order_book: %{ channel_name: "depth", market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :method_as_topic, separator: "." }, watch_order_book_for_symbols: %{ channel_name: "depth", market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :method_as_topic, separator: "." }, watch_orders: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :method_as_topic }, watch_positions: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :method_as_topic }, watch_private: %{ market_id_format: :native, params: [], pattern: :method_as_topic }, watch_public: %{ market_id_format: :native, params: [], pattern: :method_as_topic }, watch_ticker: %{ channel_name: "ticker", market_id_format: :native, params: [], pattern: :method_as_topic }, watch_tickers: %{ market_id_format: :native, params: [], pattern: :method_as_topic }, watch_trades: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :method_as_topic }, watch_trades_for_symbols: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :method_as_topic } }, has: %{ watch_balance: false, watch_bids_asks: true, watch_liquidations: nil, watch_liquidations_for_symbols: nil, watch_my_liquidations: nil, watch_my_liquidations_for_symbols: nil, watch_my_trades: false, watch_ohlcv: true, watch_ohlcv_for_symbols: true, watch_order_book: true, watch_order_book_for_symbols: true, watch_orders: true, watch_orders_for_symbols: nil, watch_position: nil, watch_positions: true, watch_status: nil, watch_ticker: true, watch_tickers: true, watch_trades: true, watch_trades_for_symbols: true }, message_patterns: [ %{ args_field: "params", format: :method, keys: [ "method", "params" ], kind_field: "method", kind_value: "SUBSCRIBE", sources: [ :send, :watch_multiple ] }, %{ args_field: "params", format: :method, keys: [ "method", "params" ], kind_field: "method", kind_value: "UNSUBSCRIBE", sources: [ :send, :watch_multiple ] } ], streaming: %{ keep_alive: 119000 }, subscription_config: %{ args_field: "params", args_format: :string_list, market_id_format: :native, op_field: "method" }, subscription_pattern: :method_as_topic, urls: %{ "private" => "wss://ws.backpack.exchange", "public" => "wss://ws.backpack.exchange" }, watch_methods: [ "watchBidsAsks", "watchOHLCV", "watchOHLCVForSymbols", "watchOrderBook", "watchOrderBookForSymbols", "watchOrders", "watchPositions", "watchPrivate", "watchPublic", "watchTicker", "watchTickers", "watchTrades", "watchTradesForSymbols" ] } }