# OXFUN Exchange Specification # # Auto-generated by: mix ccxt.extract oxfun # 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: [ "PA" ], currencies: %{}, currency_aliases: %{ "BCHSV" => "BSV", "XBT" => "BTC" }, dex: false, enable_rate_limit: true, endpoint_extraction_stats: %{ "capturedMethods" => 36, "coveragePercent" => 100, "enabledMethods" => 38, "excluded" => [ %{ "method" => "fetchMarketLeverageTiers", "reason" => "emulated (returns cached data, no HTTP call)" } ], "excludedMethods" => 1, "extractableMethods" => 37, "failures" => [ %{ "error" => "oxfun fetchDepositAddress() require network parameter", "method" => "fetchDepositAddress" } ] }, endpoints: [ %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :delete, name: :cancel_all_orders, param_mappings: %{ "symbol" => "marketCode" }, params: [ :symbol ], path: "/v3/orders/cancel-all", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "orders" => [ %{ "marketCode" => "BTCUSDT", "orderId" => "test-order-id" } ], "responseType" => "FULL", "timestamp" => "" }, market_type: :spot, method: :delete, name: :cancel_order, param_mappings: %{}, params: [ :id, :symbol ], path: "/v3/orders/cancel", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "orders" => [ %{ "marketCode" => "BTCUSDT", "orderId" => "test-order-id" } ], "responseType" => "FULL", "timestamp" => "" }, market_type: :spot, method: :delete, name: :cancel_orders, param_mappings: %{}, params: [ :ids, :symbol ], path: "/v3/orders/cancel", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "orders" => [ %{ "marketCode" => "BTCUSDT", "orderType" => "LIMIT", "price" => 50000, "quantity" => 0.001, "side" => "BUY", "source" => 1000 } ], "responseType" => "FULL", "timestamp" => "" }, market_type: :spot, method: :post, name: :create_limit_order, param_mappings: %{}, params: [ :symbol, :side, :amount, :price ], path: "/v3/orders/place", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "orders" => [ %{ "amount" => "100", "marketCode" => "BTCUSDT", "orderType" => "MARKET", "side" => "BUY", "source" => 1000 } ], "responseType" => "FULL", "timestamp" => "" }, market_type: :spot, method: :post, name: :create_market_buy_order_with_cost, param_mappings: %{}, params: [ :symbol, :cost ], path: "/v3/orders/place", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "orders" => [ %{ "marketCode" => "BTCUSDT", "orderType" => "MARKET", "quantity" => 0.001, "side" => "BUY", "source" => 1000 } ], "responseType" => "FULL", "timestamp" => "" }, market_type: :spot, method: :post, name: :create_market_order, param_mappings: %{}, params: [ :symbol, :side, :amount, :price ], path: "/v3/orders/place", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "orders" => [ %{ "marketCode" => "BTCUSDT", "orderType" => "LIMIT", "price" => 50000, "quantity" => 0.001, "side" => "BUY", "source" => 1000 } ], "responseType" => "FULL", "timestamp" => "" }, market_type: :spot, method: :post, name: :create_order, param_mappings: %{}, params: [ :symbol, :type, :side, :amount, :price ], path: "/v3/orders/place", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "orders" => [ %{ "marketCode" => "BTCUSDT", "orderType" => "LIMIT", "price" => 50000, "quantity" => 0.001, "side" => "BUY", "source" => 1000 } ], "responseType" => "FULL", "timestamp" => "" }, market_type: :spot, method: :post, name: :create_orders, param_mappings: %{}, params: [ :orders ], path: "/v3/orders/place", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "orders" => [ %{ "marketCode" => "BTCUSDT", "orderType" => "LIMIT", "price" => 50000, "quantity" => 0.001, "side" => "BUY", "source" => 1000, "timeInForce" => "MAKER_ONLY" } ], "responseType" => "FULL", "timestamp" => "" }, market_type: :spot, method: :post, name: :create_post_only_order, param_mappings: %{}, params: [ :symbol, :type, :side, :amount, :price ], path: "/v3/orders/place", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "orders" => [ %{ "limitPrice" => 50000, "marketCode" => "BTCUSDT", "orderType" => "STOP_LIMIT", "quantity" => 0.001, "side" => "BUY", "source" => 1000, "stopPrice" => "48000", "triggerDirection" => "below" } ], "responseType" => "FULL", "timestamp" => "" }, market_type: :swap, method: :post, name: :create_stop_limit_order, param_mappings: %{}, params: [ :symbol, :side, :amount, :price, :triggerPrice ], path: "/v3/orders/place", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "orders" => [ %{ "marketCode" => "BTCUSDT", "orderType" => "STOP_MARKET", "quantity" => 0.001, "side" => "BUY", "source" => 1000, "stopPrice" => "48000", "triggerDirection" => "below" } ], "responseType" => "FULL", "timestamp" => "" }, market_type: :swap, method: :post, name: :create_stop_market_order, param_mappings: %{}, params: [ :symbol, :side, :amount, :triggerPrice ], path: "/v3/orders/place", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "orders" => [ %{ "limitPrice" => 50000, "marketCode" => "BTCUSDT", "orderType" => "STOP_LIMIT", "quantity" => 0.001, "side" => "BUY", "source" => 1000, "stopPrice" => "48000", "triggerDirection" => "below" } ], "responseType" => "FULL", "timestamp" => "" }, market_type: :swap, method: :post, name: :create_stop_order, param_mappings: %{}, params: [ :symbol, :type, :side, :amount, :price, :triggerPrice ], path: "/v3/orders/place", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_accounts, param_mappings: %{}, params: [], path: "/v3/account/names", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_balance, param_mappings: %{}, params: [], path: "/v3/balances", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_currencies, param_mappings: %{}, params: [], path: "/v3/assets", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_deposits, param_mappings: %{ "code" => "asset" }, params: [ :code, :since, :limit ], path: "/v3/deposit", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "marketCode" => "BTCUSDT" }, market_type: :swap, method: :get, name: :fetch_funding_history, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/v3/funding", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, default_params: %{ "marketCode" => "BTCUSDT" }, market_type: :swap, method: :get, name: :fetch_funding_rate, param_mappings: %{}, params: [ :symbol ], path: "/v3/funding/estimates", response_transformer: {:extract_path_unwrap, ["data"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, default_params: %{ "marketCode" => "BTCUSDT" }, market_type: :swap, method: :get, name: :fetch_funding_rate_history, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/v3/funding/rates", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :swap, method: :get, name: :fetch_funding_rates, param_mappings: %{}, params: [ :symbols ], path: "/v3/funding/estimates", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_l2_order_book, param_mappings: %{ "symbol" => "marketCode" }, params: [ :symbol, :limit ], path: "/v3/depth", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :swap, method: :get, name: :fetch_leverage_tiers, param_mappings: %{}, params: [ :symbols ], path: "/v3/leverage/tiers", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_markets, param_mappings: %{}, params: [], path: "/v3/markets", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_my_trades, param_mappings: %{ "symbol" => "marketCode" }, params: [ :symbol, :since, :limit ], path: "/v3/trades", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, default_params: %{ "endTime" => "", "timeframe" => "3600s" }, market_type: :spot, method: :get, name: :fetch_ohlcv, param_mappings: %{ "since" => "startTime", "symbol" => "marketCode" }, params: [ :symbol, :timeframe, :since, :limit ], path: "/v3/candles", response_transformer: {:extract_path, ["data"]}, 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: "/v3/orders/working", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_order, param_mappings: %{ "id" => "orderId" }, params: [ :id, :symbol ], path: "/v3/orders/status", response_transformer: {:extract_path_unwrap, ["data"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_order_book, param_mappings: %{ "limit" => "level", "symbol" => "marketCode" }, params: [ :symbol, :limit ], path: "/v3/depth", response_transformer: {:extract_path_unwrap, ["data"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :swap, method: :get, name: :fetch_positions, param_mappings: %{}, params: [ :symbols ], path: "/v3/positions", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_ticker, param_mappings: %{ "symbol" => "marketCode" }, params: [ :symbol ], path: "/v3/tickers", response_transformer: {:extract_path_unwrap, ["data"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :spot, method: :get, name: :fetch_tickers, param_mappings: %{}, params: [ :symbols ], path: "/v3/tickers", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, default_params: %{ "endTime" => "" }, market_type: :spot, method: :get, name: :fetch_trades, param_mappings: %{ "since" => "startTime", "symbol" => "marketCode" }, params: [ :symbol, :since, :limit ], path: "/v3/exchange-trades", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_transfers, param_mappings: %{ "code" => "asset" }, params: [ :code, :since, :limit ], path: "/v3/transfer", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :get, name: :fetch_withdrawals, param_mappings: %{ "code" => "asset" }, params: [ :code, :since, :limit ], path: "/v3/withdrawal", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :spot, method: :post, name: :transfer, param_mappings: %{ "amount" => "quantity", "code" => "asset" }, params: [ :code, :amount, :fromAccount, :toAccount ], path: "/v3/transfer", response_transformer: {:extract_path, ["data"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "externalFee" => false }, market_type: :spot, method: :post, name: :withdraw, param_mappings: %{ "amount" => "quantity", "code" => "asset" }, params: [ :code, :amount, :address, :tag ], path: "/v3/withdrawal", response_transformer: {:extract_path, ["data"]}, source: :intercepted } ], error_code_details: %{ -10 => %{ description: "{\"event\":null,\"success\":false,\"message\":\"Validation failed\",\"code\":\"0010\",\"data\":null} - failed transfer", type: :exchange_error }, -100005 => %{ description: "Open order not found", type: :order_not_found }, -100006 => %{ description: "Open order is not owned by the user", type: :invalid_order }, -100008 => %{ description: "Quantity cannot be less than the quantity increment xxx", type: :invalid_parameters }, -10001 => %{ description: "General networking failure", type: :exchange_error }, -100015 => %{ description: "recvWindow xxx has expired", type: :network_error }, -101 => %{ description: "Internal server is unavailable temporary, try again later", type: :network_error }, -20000 => %{ description: "Signature is invalid", type: :invalid_parameters }, -20001 => %{ description: "\"success\":false,\"code\":\"20001\",\"message\":\"marketCode is invalid\"", type: :invalid_parameters }, -20002 => %{ description: "Unexpected error, please check if your request data complies with the specification.", type: :invalid_parameters }, -20003 => %{ description: "Unrecognized operation", type: :exchange_error }, -20005 => %{ description: "Already logged in", type: :invalid_credentials }, -200050 => %{ description: "The market is not active", type: :network_error }, -20006 => %{ description: "Quantity must be greater than zero", type: :invalid_parameters }, -20007 => %{ description: "You are accessing server too rapidly", type: :invalid_credentials }, -20008 => %{ description: "clientOrderId must be greater than zero if provided", type: :invalid_parameters }, -20009 => %{ description: "JSON data format is invalid", type: :invalid_parameters }, -20010 => %{ description: "Either clientOrderId or orderId is required", type: :invalid_parameters }, -20011 => %{ description: "marketCode is required", type: :invalid_parameters }, -20012 => %{ description: "side is required", type: :invalid_parameters }, -20013 => %{ description: "orderType is required", type: :invalid_parameters }, -20014 => %{ description: "clientOrderId is not long type", type: :invalid_parameters }, -20015 => %{ description: "marketCode is invalid", type: :invalid_order }, -20016 => %{ description: "side is invalid", type: :invalid_parameters }, -20017 => %{ description: "orderType is invalid", type: :invalid_parameters }, -20018 => %{ description: "timeInForce is invalid", type: :invalid_parameters }, -20019 => %{ description: "orderId is invalid", type: :invalid_parameters }, -20020 => %{ description: "stopPrice or limitPrice is invalid", type: :invalid_parameters }, -20021 => %{ description: "price is invalid", type: :invalid_parameters }, -20022 => %{ description: "price is required for LIMIT order", type: :invalid_parameters }, -20023 => %{ description: "timestamp is required", type: :invalid_parameters }, -20024 => %{ description: "timestamp exceeds the threshold", type: :exchange_error }, -20025 => %{ description: "API key is invalid", type: :invalid_credentials }, -20026 => %{ description: "Token is invalid or expired", type: :invalid_parameters }, -20027 => %{ description: "The length of the message exceeds the maximum length", type: :invalid_parameters }, -20028 => %{ description: "price or stopPrice or limitPrice must be greater than zero", type: :invalid_parameters }, -20029 => %{ description: "stopPrice must be less than limitPrice for Buy Stop Order", type: :invalid_parameters }, -20030 => %{ description: "limitPrice must be less than stopPrice for Sell Stop Order", type: :invalid_parameters }, -20031 => %{ description: "The marketCode is closed for trading temporarily", type: :market_closed }, -20032 => %{ description: "Failed to submit due to timeout in server side", type: :network_error }, -20033 => %{ description: "triggerType is invalid", type: :invalid_parameters }, -20034 => %{ description: "The size of tag must be less than 32", type: :invalid_parameters }, -20050 => %{ description: "selfTradePreventionMode is invalid", type: :exchange_error }, -201 => %{ description: "Trade service is busy, try again later", type: :network_error }, -300001 => %{ description: "Invalid account status xxx, please contact administration if any questions", type: :access_restricted }, -30001 => %{ description: "Required parameter 'marketCode' is missing", type: :invalid_parameters }, -300011 => %{ description: "Repo market orders are not allowed during the auction window", type: :invalid_order }, -300012 => %{ description: "Repo bids above 0 and offers below 0 are not allowed during the auction window", type: :invalid_order }, -35034 => %{ description: "Wallet API is not functioning properly, please try again or contact support.", type: :invalid_credentials }, -35046 => %{ description: "Error. Please refresh the page.", type: :invalid_credentials }, -40001 => %{ description: "Alert from the server", type: :exchange_error }, -429 => %{ description: "Rate limit reached", type: :rate_limited }, -50001 => %{ description: "Unknown server error", type: :exchange_error }, -5001 => %{ description: "Your operation authority is invalid", type: :invalid_credentials }, -710001 => %{ description: "System failure, exception thrown -> xxx", type: :exchange_error }, -710002 => %{ description: "The price is lower than the minimum", type: :invalid_parameters }, -710003 => %{ description: "The price is higher than the maximum", type: :invalid_parameters }, -710004 => %{ description: "Position quantity exceeds the limit", type: :invalid_parameters }, -710005 => %{ description: "Insufficient margin", type: :insufficient_balance }, -710006 => %{ description: "Insufficient balance", type: :insufficient_balance }, -710007 => %{ description: "Insufficient position", type: :insufficient_balance } }, error_codes: %{ -10 => :exchange_error, -100005 => :order_not_found, -100006 => :invalid_order, -100008 => :invalid_parameters, -10001 => :exchange_error, -100015 => :network_error, -101 => :network_error, -20000 => :invalid_parameters, -20001 => :invalid_parameters, -20002 => :invalid_parameters, -20003 => :exchange_error, -20005 => :invalid_credentials, -200050 => :network_error, -20006 => :invalid_parameters, -20007 => :invalid_credentials, -20008 => :invalid_parameters, -20009 => :invalid_parameters, -20010 => :invalid_parameters, -20011 => :invalid_parameters, -20012 => :invalid_parameters, -20013 => :invalid_parameters, -20014 => :invalid_parameters, -20015 => :invalid_order, -20016 => :invalid_parameters, -20017 => :invalid_parameters, -20018 => :invalid_parameters, -20019 => :invalid_parameters, -20020 => :invalid_parameters, -20021 => :invalid_parameters, -20022 => :invalid_parameters, -20023 => :invalid_parameters, -20024 => :exchange_error, -20025 => :invalid_credentials, -20026 => :invalid_parameters, -20027 => :invalid_parameters, -20028 => :invalid_parameters, -20029 => :invalid_parameters, -20030 => :invalid_parameters, -20031 => :market_closed, -20032 => :network_error, -20033 => :invalid_parameters, -20034 => :invalid_parameters, -20050 => :exchange_error, -201 => :network_error, -300001 => :access_restricted, -30001 => :invalid_parameters, -300011 => :invalid_order, -300012 => :invalid_order, -35034 => :invalid_credentials, -35046 => :invalid_credentials, -40001 => :exchange_error, -429 => :rate_limited, -50001 => :exchange_error, -5001 => :invalid_credentials, -710001 => :exchange_error, -710002 => :invalid_parameters, -710003 => :invalid_parameters, -710004 => :invalid_parameters, -710005 => :insufficient_balance, -710006 => :insufficient_balance, -710007 => :insufficient_balance }, exceptions: %{ broad: %{ "-20001" => :operation_failed, "-200050" => :request_timeout }, exact: %{ "-000101" => :network_error, "-000201" => :network_error, "-0010" => :operation_failed, "-05001" => :authentication_error, "-100005" => :order_not_found, "-100006" => :invalid_order, "-100008" => :bad_request, "-10001" => :exchange_error, "-100015" => :network_error, "-20000" => :bad_request, "-20001" => :bad_request, "-20002" => :bad_request, "-20003" => :not_supported, "-20005" => :authentication_error, "-20006" => :bad_request, "-20007" => :authentication_error, "-20008" => :bad_request, "-20009" => :bad_request, "-20010" => :arguments_required, "-20011" => :arguments_required, "-20012" => :arguments_required, "-20013" => :arguments_required, "-20014" => :bad_request, "-20015" => :bad_symbol, "-20016" => :bad_request, "-20017" => :bad_request, "-20018" => :bad_request, "-20019" => :bad_request, "-20020" => :bad_request, "-20021" => :bad_request, "-20022" => :arguments_required, "-20023" => :arguments_required, "-20024" => :exchange_error, "-20025" => :authentication_error, "-20026" => :bad_request, "-20027" => :bad_request, "-20028" => :bad_request, "-20029" => :bad_request, "-20030" => :bad_request, "-20031" => :market_closed, "-20032" => :network_error, "-20033" => :bad_request, "-20034" => :bad_request, "-20050" => :exchange_error, "-300001" => :account_not_enabled, "-30001" => :bad_request, "-300011" => :invalid_order, "-300012" => :invalid_order, "-35034" => :authentication_error, "-35046" => :authentication_error, "-40001" => :exchange_error, "-429" => :rate_limit_exceeded, "-50001" => :exchange_error, "-710001" => :exchange_error, "-710002" => :bad_request, "-710003" => :bad_request, "-710004" => :bad_request, "-710005" => :insufficient_funds, "-710006" => :insufficient_funds, "-710007" => :insufficient_funds } }, exchange_options: %{ "defaultNetworkCodeReplacements" => %{ "BRC20" => %{ "BRC20" => "BTC" }, "CRO" => %{ "CRC20" => "CRONOS" }, "ETH" => %{ "ERC20" => "ETH" }, "TRX" => %{ "TRC20" => "TRX" } }, "networks" => %{ "ARB" => "Arbitrum", "AVAX" => "Avalanche", "BNB" => "BNBSmartChain", "BTC" => "Bitcoin", "ERC20" => "Ethereum", "FTM" => "Fantom", "MATIC" => "Polygon", "OPTIMISM" => "Optimism", "SOL" => "Solana" }, "networksById" => %{ "Arbitrum" => "ARB", "Avalanche" => "AVAX", "BNBSmartChain" => "BNB", "Base" => "BASE", "Bitcoin" => "BTC", "Ethereum" => "ERC20", "Fantom" => "FTM", "Optimism" => "OPTIMISM", "Polygon" => "MATIC", "Solana" => "SOL" }, "sandboxMode" => false }, extended_metadata: %{ fees_url: "https://support.ox.fun/en/articles/8819866-trading-fees", limits: %{ "amount" => %{}, "cost" => %{}, "leverage" => %{}, "price" => %{} }, logo_url: "https://github.com/ccxt/ccxt/assets/43336371/6a196124-c1ee-4fae-8573-962071b61a85", referral_url: "https://ox.fun/register?shareAccountId=5ZUD4a7G" }, extracted_metadata: %{ ccxt_version: "4.5.34" }, features: %{ default: %{ create_order: %{ hedged: false, iceberg: true, leverage: false, margin_mode: false, market_buy_by_cost: true, market_buy_requires_price: false, 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: true }, stop_loss_price: false, take_profit_price: false, time_in_force: %{ fok: true, gtd: false, ioc: true, po: true }, trailing: false, trigger_direction: false, trigger_price: true }, create_orders: %{ max: 10 }, fetch_my_trades: %{ days_back: 100000, limit: 500, margin_mode: false, symbol_required: false, until_days: 7 }, fetch_ohlcv: %{ limit: 500 }, fetch_open_orders: %{ margin_mode: false, symbol_required: false, trailing: false, trigger: false }, fetch_order: %{ margin_mode: false, symbol_required: false, trailing: false, trigger: false }, sandbox: true }, future: %{}, spot: %{ extends: "default" }, swap: %{ linear: %{ extends: "default" } } }, fees: %{ trading: %{ maker: 0.0002, percentage: true, taker: 0.0007, tier_based: true, tiers: %{ maker: [ %{ fee: 0.0002, volume: 0 }, %{ fee: 0.0001, volume: 2500000 }, %{ fee: 0, volume: 25000000 } ], taker: [ %{ fee: 0.0007, volume: 0 }, %{ fee: 0.0005, volume: 2500000 }, %{ fee: 0.0004, volume: 25000000 } ] } } }, 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;\n }\n if (code !== 200) {\n const responseCode = this.safeString(response, 'code', undefined);\n const feedback = this.id + ' ' + body;\n this.throwBroadlyMatchedException(this.exceptions['broad'], body, feedback);\n this.throwExactlyMatchedException(this.exceptions['exact'], responseCode, feedback);\n throw new errors.ExchangeError(feedback);\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_ws: false, cancel_order: true, cancel_order_with_client_order_id: false, cancel_order_ws: false, cancel_orders: true, cancel_orders_with_client_order_id: false, cancel_orders_ws: false, close_all_positions: false, close_position: false, create_deposit_address: false, create_limit_buy_order: false, create_limit_buy_order_ws: false, create_limit_order: true, create_limit_order_ws: false, create_limit_sell_order: false, create_limit_sell_order_ws: false, create_market_buy_order: false, create_market_buy_order_with_cost: true, create_market_buy_order_with_cost_ws: false, create_market_buy_order_ws: false, create_market_order: true, create_market_order_with_cost: false, create_market_order_with_cost_ws: false, create_market_order_ws: true, create_market_sell_order: false, create_market_sell_order_with_cost: false, create_market_sell_order_with_cost_ws: false, create_market_sell_order_ws: false, create_order: true, create_order_with_take_profit_and_stop_loss: false, create_order_with_take_profit_and_stop_loss_ws: false, create_order_ws: false, create_orders: true, create_post_only_order: true, create_post_only_order_ws: false, create_reduce_only_order: false, create_reduce_only_order_ws: false, create_stop_limit_order: true, create_stop_limit_order_ws: false, create_stop_loss_order: false, create_stop_loss_order_ws: false, create_stop_market_order: true, create_stop_market_order_ws: false, create_stop_order: true, create_stop_order_ws: false, create_take_profit_order: false, create_take_profit_order_ws: false, create_trailing_amount_order: false, create_trailing_amount_order_ws: false, create_trailing_percent_order: false, create_trailing_percent_order_ws: false, create_trigger_order: false, create_trigger_order_ws: false, deposit: false, edit_order: false, edit_order_with_client_order_id: false, edit_order_ws: false, edit_orders: false, fetch_accounts: true, fetch_balance: true, fetch_balance_ws: false, fetch_bids_asks: false, fetch_borrow_interest: false, fetch_borrow_rate: false, fetch_borrow_rate_histories: false, fetch_borrow_rate_history: false, fetch_borrow_rates: false, fetch_borrow_rates_per_symbol: false, fetch_canceled_and_closed_orders: false, fetch_canceled_orders: false, fetch_closed_order: false, fetch_closed_orders: 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: true, fetch_greeks: false, fetch_index_ohlcv: false, fetch_isolated_borrow_rate: false, fetch_isolated_borrow_rates: false, fetch_isolated_positions: false, fetch_l2_order_book: true, fetch_l3_order_book: false, fetch_last_prices: false, fetch_ledger: false, fetch_ledger_entry: false, fetch_leverage: false, fetch_leverage_tiers: true, fetch_leverages: false, fetch_liquidations: false, fetch_long_short_ratio: false, fetch_long_short_ratio_history: false, fetch_margin_adjustment_history: false, fetch_margin_mode: false, fetch_margin_modes: false, fetch_mark_ohlcv: false, fetch_mark_prices: false, fetch_market_leverage_tiers: true, 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: false, fetch_open_interest_history: false, fetch_open_interests: false, fetch_open_order: false, fetch_open_orders: true, fetch_open_orders_ws: false, fetch_option: false, fetch_option_chain: false, fetch_order: true, fetch_order_book: true, fetch_order_book_ws: false, fetch_order_books: false, fetch_order_trades: false, fetch_order_with_client_order_id: false, fetch_order_ws: false, fetch_orders: false, 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: false, fetch_ticker: true, fetch_ticker_ws: false, fetch_tickers: true, fetch_tickers_ws: false, fetch_time: false, fetch_trades: true, fetch_trades_ws: false, fetch_trading_fee: false, fetch_trading_fees: false, fetch_trading_fees_ws: false, fetch_trading_limits: false, fetch_transaction_fee: false, fetch_transaction_fees: false, fetch_transactions: false, fetch_transfer: false, fetch_transfers: true, fetch_underlying_assets: false, fetch_volatility_history: false, fetch_withdraw_addresses: false, fetch_withdrawal: false, fetch_withdrawal_whitelist: false, fetch_withdrawals: true, fetch_withdrawals_ws: false, future: false, margin: false, option: false, private_api: true, public_api: true, reduce_margin: false, repay_cross_margin: false, repay_isolated_margin: false, sandbox: true, set_leverage: false, set_margin: false, set_margin_mode: false, set_position_mode: false, sign_in: false, spot: true, swap: true, transfer: true, un_watch_my_trades: false, un_watch_ohlcv: false, un_watch_ohlcv_for_symbols: false, un_watch_order_book: false, un_watch_order_book_for_symbols: false, un_watch_orders: false, un_watch_positions: false, un_watch_ticker: false, un_watch_tickers: false, un_watch_trades: false, un_watch_trades_for_symbols: false, watch_balance: true, 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: false, watch_status: false, watch_ticker: true, watch_tickers: true, watch_trades: true, watch_trades_for_symbols: true, withdraw: true, ws: true }, http_config: nil, id: "oxfun", markets: nil, name: "OXFUN", ohlcv_timestamp_resolution: :milliseconds, options: %{ networks: %{ "ARB" => "Arbitrum", "AVAX" => "Avalanche", "BNB" => "BNBSmartChain", "BTC" => "Bitcoin", "ERC20" => "Ethereum", "FTM" => "Fantom", "MATIC" => "Polygon", "OPTIMISM" => "Optimism", "SOL" => "Solana" }, networks_by_id: %{ "Arbitrum" => "ARB", "Avalanche" => "AVAX", "BNBSmartChain" => "BNB", "Base" => "BASE", "Bitcoin" => "BTC", "Ethereum" => "ERC20", "Fantom" => "FTM", "Optimism" => "OPTIMISM", "Polygon" => "MATIC", "Solana" => "SOL" }, sandbox_mode: false }, order_mappings: nil, param_mappings: %{ "amount" => "quantity", "code" => "asset", "id" => "orderId", "limit" => "level", "since" => "startTime", "symbol" => "marketCode" }, parse_methods: [ %{ "comment" => nil, "examples" => [ "{\n \"accountId\": \"106526\",\n \"name\": \"testSubAccount\"\n }," ], "line_end" => 1680, "line_start" => 1667, "mappings" => [ %{ "comment" => nil, "key" => "id", "value" => "this.safeString (account, 'accountId')" }, %{ "comment" => nil, "key" => "type", "value" => "undefined" }, %{ "comment" => nil, "key" => "code", "value" => "undefined" }, %{ "comment" => nil, "key" => "info", "value" => "account" } ], "name" => "parseAccount", "signature" => "parseAccount (account)", "source" => "parseAccount (account) {\n //\n // {\n // \"accountId\": \"106526\",\n // \"name\": \"testSubAccount\"\n // },\n //\n return {\n 'id': this.safeString (account, 'accountId'),\n 'type': undefined,\n 'code': undefined,\n 'info': account,\n };\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"accountId\": \"106490\",\n \"name\": \"main\",\n \"balances\": [\n {\n \"asset\": \"OX\",\n \"total\": \"-7.55145065000\",\n \"available\": \"-71.16445065000\",\n \"reserved\": \"0\",\n \"lastUpdatedAt\": \"1715000448946\"\n },\n {\n \"asset\": \"ETH\",\n \"total\": \"0.01\",\n \"available\": \"0.01\",\n \"reserved\": \"0\",\n \"lastUpdatedAt\": \"1714914512750\"\n },\n ...\n ]\n }" ], "line_end" => 1637, "line_start" => 1598, "mappings" => [], "name" => "parseBalance", "signature" => "parseBalance (balance): Balances", "source" => "parseBalance (balance): Balances {\n //\n // {\n // \"accountId\": \"106490\",\n // \"name\": \"main\",\n // \"balances\": [\n // {\n // \"asset\": \"OX\",\n // \"total\": \"-7.55145065000\",\n // \"available\": \"-71.16445065000\",\n // \"reserved\": \"0\",\n // \"lastUpdatedAt\": \"1715000448946\"\n // },\n // {\n // \"asset\": \"ETH\",\n // \"total\": \"0.01\",\n // \"available\": \"0.01\",\n // \"reserved\": \"0\",\n // \"lastUpdatedAt\": \"1714914512750\"\n // },\n // ...\n // ]\n // }\n //\n const result: Dict = {\n 'info': balance,\n };\n const balances = this.safeList (balance, 'balances', []);\n for (let i = 0; i < balances.length; i++) {\n const balanceEntry = balances[i];\n const currencyId = this.safeString (balanceEntry, 'asset');\n const code = this.safeCurrencyCode (currencyId);\n const account = this.account ();\n account['total'] = this.safeString (balanceEntry, 'total');\n account['free'] = this.safeString (balanceEntry, 'available');\n account['used'] = this.safeString (balanceEntry, 'reserved');\n result[code] = account;\n }\n return this.safeBalance (result);\n }" }, %{ "comment" => nil, "examples" => [ "{\"address\":\"0x998dEc76151FB723963Bd8AFD517687b38D33dE8\"}" ], "line_end" => 1862, "line_start" => 1849, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "depositAddress" }, %{ "comment" => nil, "key" => "currency", "value" => "currency['code']" }, %{ "comment" => nil, "key" => "network", "value" => "undefined" }, %{ "comment" => nil, "key" => "address", "value" => "address" }, %{ "comment" => nil, "key" => "tag", "value" => "undefined" } ], "name" => "parseDepositAddress", "signature" => "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress", "source" => "parseDepositAddress (depositAddress, currency: Currency = undefined): DepositAddress {\n //\n // {\"address\":\"0x998dEc76151FB723963Bd8AFD517687b38D33dE8\"}\n //\n const address = this.safeString (depositAddress, 'address');\n this.checkAddress (address);\n return {\n 'info': depositAddress,\n 'currency': currency['code'],\n 'network': undefined,\n 'address': address,\n 'tag': undefined,\n } as DepositAddress;\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2088, "line_start" => 2083, "mappings" => [], "name" => "parseDepositStatus", "signature" => "parseDepositStatus (status)", "source" => "parseDepositStatus (status) {\n const statuses: Dict = {\n 'COMPLETED': 'ok',\n };\n return this.safeString (statuses, status, status);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"marketCode\": \"OX-USD-SWAP-LIN\",\n \"fundingAt\": \"1715515200000\",\n \"estFundingRate\": \"0.000200000\"\n }" ], "line_end" => 1102, "line_start" => 1071, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "fundingRate" }, %{ "comment" => nil, "key" => "symbol", "value" => "market['symbol']" }, %{ "comment" => nil, "key" => "markPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "indexPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "interestRate", "value" => "this.parseNumber ('0')" }, %{ "comment" => nil, "key" => "estimatedSettlePrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "timestamp", "value" => "estFundingRateTimestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (estFundingRateTimestamp)" }, %{ "comment" => nil, "key" => "fundingRate", "value" => "this.safeNumber (fundingRate, 'estFundingRate')" }, %{ "comment" => nil, "key" => "fundingTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "fundingDatetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "nextFundingRate", "value" => "undefined" }, %{ "comment" => nil, "key" => "nextFundingTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "nextFundingDatetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "previousFundingRate", "value" => "undefined" }, %{ "comment" => nil, "key" => "previousFundingTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "previousFundingDatetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "interval", "value" => "undefined" } ], "name" => "parseFundingRate", "signature" => "parseFundingRate (fundingRate, market: Market = undefined): FundingRate", "source" => "parseFundingRate (fundingRate, market: Market = undefined): FundingRate {\n //\n // {\n // \"marketCode\": \"OX-USD-SWAP-LIN\",\n // \"fundingAt\": \"1715515200000\",\n // \"estFundingRate\": \"0.000200000\"\n // }\n //\n const symbol = this.safeString (fundingRate, 'marketCode');\n market = this.market (symbol);\n const estFundingRateTimestamp = this.safeInteger (fundingRate, 'fundingAt');\n return {\n 'info': fundingRate,\n 'symbol': market['symbol'],\n 'markPrice': undefined,\n 'indexPrice': undefined,\n 'interestRate': this.parseNumber ('0'),\n 'estimatedSettlePrice': undefined,\n 'timestamp': estFundingRateTimestamp,\n 'datetime': this.iso8601 (estFundingRateTimestamp),\n 'fundingRate': this.safeNumber (fundingRate, 'estFundingRate'),\n 'fundingTimestamp': undefined,\n 'fundingDatetime': undefined,\n 'nextFundingRate': undefined,\n 'nextFundingTimestamp': undefined,\n 'nextFundingDatetime': undefined,\n 'previousFundingRate': undefined,\n 'previousFundingTimestamp': undefined,\n 'previousFundingDatetime': undefined,\n 'interval': undefined,\n } as FundingRate;\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 1184, "line_start" => 1155, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "info" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "fundingRate", "value" => "this.safeNumber (info, 'fundingRate')" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" } ], "name" => "parseFundingRateHistory", "signature" => "parseFundingRateHistory (info, market: Market = undefined)", "source" => "parseFundingRateHistory (info, market: Market = undefined) {\n //\n // {\n // success: true,\n // data: [\n // {\n // marketCode: 'NEAR-USD-SWAP-LIN',\n // fundingRate: '-0.000010000',\n // createdAt: '1715428870755'\n // },\n // {\n // marketCode: 'ENA-USD-SWAP-LIN',\n // fundingRate: '0.000150000',\n // createdAt: '1715428868616'\n // },\n // ...\n // }\n //\n const marketId = this.safeString (info, 'marketCode');\n market = this.safeMarket (marketId, market);\n const symbol = market['symbol'];\n const timestamp = this.safeInteger (info, 'createdAt');\n return {\n 'info': info,\n 'symbol': symbol,\n 'fundingRate': this.safeNumber (info, 'fundingRate'),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n };\n }" }, %{ "comment" => nil, "examples" => [ "{\n id: '966709913041305605',\n marketCode: 'ETH-USD-SWAP-LIN',\n payment: '-0.00430822',\n fundingRate: '0.000014',\n position: '0.001',\n indexPrice: '3077.3',\n createdAt: '1715086852890'\n }," ], "line_end" => 1275, "line_start" => 1246, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "income" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "code", "value" => "code" }, %{ "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 // id: '966709913041305605',\n // marketCode: 'ETH-USD-SWAP-LIN',\n // payment: '-0.00430822',\n // fundingRate: '0.000014',\n // position: '0.001',\n // indexPrice: '3077.3',\n // createdAt: '1715086852890'\n // },\n //\n const marketId = this.safeString (income, 'marketCode');\n const symbol = this.safeSymbol (marketId, market);\n const amount = this.safeNumber (income, 'payment');\n const code = this.safeCurrencyCode ('OX');\n const id = this.safeString (income, 'id');\n const timestamp = this.safeTimestamp (income, 'createdAt');\n const rate = this.safeNumber (income, 'fundingRate');\n return {\n 'info': income,\n 'symbol': symbol,\n 'code': code,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'id': id,\n 'amount': amount,\n 'rate': rate,\n };\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 570, "line_start" => 498, "mappings" => [ %{ "comment" => nil, "key" => "id", "value" => "id" }, %{ "comment" => nil, "key" => "numericId", "value" => "undefined" }, %{ "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" => "isSpot" }, %{ "comment" => nil, "key" => "margin", "value" => "false" }, %{ "comment" => nil, "key" => "swap", "value" => "isFuture" }, %{ "comment" => nil, "key" => "future", "value" => "false" }, %{ "comment" => nil, "key" => "option", "value" => "false" }, %{ "comment" => nil, "key" => "active", "value" => "true" }, %{ "comment" => nil, "key" => "contract", "value" => "isFuture" }, %{ "comment" => nil, "key" => "linear", "value" => "isFuture ? true : undefined" }, %{ "comment" => nil, "key" => "inverse", "value" => "isFuture ? false : undefined" }, %{ "comment" => nil, "key" => "taker", "value" => "this.fees['trading']['taker']" }, %{ "comment" => nil, "key" => "maker", "value" => "this.fees['trading']['maker']" }, %{ "comment" => nil, "key" => "contractSize", "value" => "isFuture ? 1 : 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" => "todo find it out\n 'price': this.safeNumber (market, 'tickSize'),\n }", "key" => "precision", "value" => "{\n 'amount': undefined" }, %{ "comment" => nil, "key" => "limits", "value" => "{\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n 'amount': {\n 'min': this.safeNumber (market, 'minSize'),\n 'max': undefined,\n },\n 'price': {\n 'min': undefined,\n 'max': undefined,\n },\n 'cost': {\n 'min': undefined,\n 'max': undefined,\n },\n }" }, %{ "comment" => nil, "key" => "created", "value" => "this.safeInteger (market, 'listedAt')" }, %{ "comment" => nil, "key" => "index", "value" => "undefined" }, %{ "comment" => nil, "key" => "info", "value" => "market" }, %{ "comment" => nil, "key" => "leverage", "value" => "{\n 'min': undefined,\n 'max': undefined,\n }" }, %{ "comment" => nil, "key" => "amount", "value" => "{\n 'min': this.safeNumber (market, 'minSize'),\n 'max': undefined,\n }" }, %{ "comment" => nil, "key" => "price", "value" => "{\n 'min': undefined,\n 'max': undefined,\n }" }, %{ "comment" => nil, "key" => "cost", "value" => "{\n 'min': undefined,\n 'max': undefined,\n }" }, %{ "comment" => nil, "key" => "min", "value" => "undefined" }, %{ "comment" => nil, "key" => "max", "value" => "undefined" } ], "name" => "parseMarket", "signature" => "parseMarket (market): Market", "source" => "parseMarket (market): Market {\n const id = this.safeString (market, 'marketCode', '');\n const parts = id.split ('-');\n const baseId = this.safeString (parts, 0);\n const quoteId = this.safeString (parts, 1);\n const base = this.safeCurrencyCode (baseId);\n const quote = this.safeCurrencyCode (quoteId);\n let symbol = base + '/' + quote;\n let type = this.safeStringLower (market, 'type', 'spot'); // markets from v3/tickers are spot and have no type\n let settleId: Str = undefined;\n let settle: Str = undefined;\n const isFuture = (type === 'future'); // the exchange has only perpetual futures\n if (isFuture) {\n type = 'swap';\n settleId = 'OX';\n settle = this.safeCurrencyCode ('OX');\n symbol = symbol + ':' + settle;\n }\n const isSpot = type === 'spot';\n return this.safeMarketStructure ({\n 'id': id,\n 'numericId': undefined,\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': isSpot,\n 'margin': false,\n 'swap': isFuture,\n 'future': false,\n 'option': false,\n 'active': true,\n 'contract': isFuture,\n 'linear': isFuture ? true : undefined,\n 'inverse': isFuture ? false : undefined,\n 'taker': this.fees['trading']['taker'],\n 'maker': this.fees['trading']['maker'],\n 'contractSize': isFuture ? 1 : undefined,\n 'expiry': undefined,\n 'expiryDatetime': undefined,\n 'strike': undefined,\n 'optionType': undefined,\n 'precision': {\n 'amount': undefined, // todo find it out\n 'price': this.safeNumber (market, 'tickSize'),\n },\n 'limits': {\n 'leverage': {\n 'min': undefined,\n 'max': undefined,\n },\n 'amount': {\n 'min': this.safeNumber (market, 'minSize'),\n 'max': undefined,\n },\n 'price': {\n 'min': undefined,\n 'max': undefined,\n },\n 'cost': {\n 'min': undefined,\n 'max': undefined,\n },\n },\n 'created': this.safeInteger (market, 'listedAt'),\n 'index': undefined,\n 'info': market,\n });\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 1369, "line_start" => 1334, "mappings" => [], "name" => "parseMarketLeverageTiers", "signature" => "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[]", "source" => "parseMarketLeverageTiers (info, market: Market = undefined): LeverageTier[] {\n //\n // {\n // marketCode: 'SOL-USD-SWAP-LIN',\n // tiers: [\n // {\n // tier: '1',\n // leverage: '10',\n // positionFloor: '0',\n // positionCap: '200000000',\n // initialMargin: '0.1',\n // maintenanceMargin: '0.05',\n // maintenanceAmount: '0'\n // ...\n // ]\n // },\n //\n const marketId = this.safeString (info, 'marketCode');\n market = this.safeMarket (marketId, market);\n const listOfTiers = this.safeList (info, 'tiers', []);\n const tiers = [];\n for (let j = 0; j < listOfTiers.length; j++) {\n const tier = listOfTiers[j];\n tiers.push ({\n 'tier': this.safeNumber (tier, 'tier'),\n 'symbol': this.safeSymbol (marketId, market),\n 'currency': market['settle'],\n 'minNotional': this.safeNumber (tier, 'positionFloor'),\n 'maxNotional': this.safeNumber (tier, 'positionCap'),\n 'maintenanceMarginRate': this.safeNumber (tier, 'maintenanceMargin'),\n 'maxLeverage': this.safeNumber (tier, 'leverage'),\n 'info': tier,\n });\n }\n return tiers as LeverageTier[];\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 496, "line_start" => 484, "mappings" => [], "name" => "parseMarkets", "signature" => "parseMarkets (markets): Market[]", "source" => "parseMarkets (markets): Market[] {\n const marketIds = [];\n const result = [];\n for (let i = 0; i < markets.length; i++) {\n const market = markets[i];\n const marketId = this.safeString (market, 'marketCode');\n if (!(this.inArray (marketId, marketIds))) {\n marketIds.push (marketId);\n result.push (this.parseMarket (market));\n }\n }\n return result;\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"open\": \"0.03240000\",\n \"high\": \"0.03240000\",\n \"low\": \"0.03240000\",\n \"close\": \"0.03240000\",\n \"volume\": \"0\",\n \"currencyVolume\": \"0\",\n \"openedAt\": \"1714906800000\"\n }" ], "line_end" => 964, "line_start" => 944, "mappings" => [], "name" => "parseOHLCV", "signature" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV", "source" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n //\n // {\n // \"open\": \"0.03240000\",\n // \"high\": \"0.03240000\",\n // \"low\": \"0.03240000\",\n // \"close\": \"0.03240000\",\n // \"volume\": \"0\",\n // \"currencyVolume\": \"0\",\n // \"openedAt\": \"1714906800000\"\n // }\n //\n return [\n this.safeInteger (ohlcv, 'openedAt'),\n this.safeNumber (ohlcv, 'open'),\n this.safeNumber (ohlcv, 'high'),\n this.safeNumber (ohlcv, 'low'),\n this.safeNumber (ohlcv, 'close'),\n this.safeNumber (ohlcv, 'currencyVolume'),\n ];\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"notice\": \"OrderMatched\",\n \"accountId\": \"106490\",\n \"orderId\": \"1000109901865\",\n \"submitted\": true,\n \"clientOrderId\": \"0\",\n \"marketCode\": \"OX-USDT\",\n \"status\": \"FILLED\",\n \"side\": \"SELL\",\n \"isTriggered\": false,\n \"quantity\": \"150.0\",\n \"amount\": \"0.0\",\n \"remainQuantity\": \"0.0\",\n \"matchId\": \"100017047880451399\",\n \"matchPrice\": \"0.01465\",\n \"matchQuantity\": \"150.0\",\n \"feeInstrumentId\": \"USDT\",\n \"fees\": \"0.0015382500\",\n \"orderType\": \"MARKET\",\n \"createdAt\": \"1715592472236\",\n \"lastMatchedAt\": \"1715592472200\",\n \"displayQuantity\": \"150.0\"\n }", "{\n \"notice\": \"OrderOpened\",\n \"accountId\": \"106490\",\n \"orderId\": \"1000111482406\",\n \"submitted\": true,\n \"clientOrderId\": \"0\",\n \"marketCode\": \"ETH-USD-SWAP-LIN\",\n \"status\": \"OPEN\",\n \"side\": \"SELL\",\n \"price\": \"4000.0\",\n \"isTriggered\": false,\n \"quantity\": \"0.01\",\n \"amount\": \"0.0\",\n \"orderType\": \"LIMIT\",\n \"timeInForce\": \"GTC\",\n \"createdAt\": \"1715763507682\",\n \"displayQuantity\": \"0.01\"\n }", "{\n \"accountId\": \"106490\",\n \"orderId\": \"1000109892193\",\n \"submitted\": true,\n \"marketCode\": \"OX-USDT\",\n \"side\": \"BUY\",\n \"price\": \"0.01961\",\n \"isTriggered\": false,\n \"quantity\": \"100\",\n \"orderType\": \"MARKET\",\n \"timeInForce\": \"IOC\",\n \"createdAt\": \"1715591529057\",\n \"selfTradePreventionMode\": \"NONE\"\n }", "{\n \"code\": \"710001\",\n \"message\": \"System failure, exception thrown -> null\",\n \"submitted\": false,\n \"marketCode\": \"OX-USDT\",\n \"side\": \"BUY\",\n \"price\": \"0.01961\",\n \"amount\": \"100\",\n \"orderType\": \"MARKET\",\n \"timeInForce\": \"IOC\",\n \"createdAt\": \"1715591678835\",\n \"source\": 11,\n \"selfTradePreventionMode\": \"NONE\"\n }", "{\n \"code\": \"20044\",\n \"message\": \"Amount is not supported for this order type\",\n \"submitted\": false,\n \"marketCode\": \"OX-USDT\",\n \"side\": \"SELL\",\n \"amount\": \"200\",\n \"orderType\": \"MARKET\",\n \"createdAt\": \"1715592079986\",\n \"source\": 11\n }" ], "line_end" => 2889, "line_start" => 2736, "mappings" => [ %{ "comment" => nil, "key" => "id", "value" => "this.safeString (order, 'orderId')" }, %{ "comment" => nil, "key" => "clientOrderId", "value" => "this.safeString (order, 'clientOrderId')" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "lastTradeTimestamp", "value" => "this.safeInteger (order, 'lastMatchedAt')" }, %{ "comment" => nil, "key" => "lastUpdateTimestamp", "value" => "this.safeInteger (order, 'lastModifiedAt')" }, %{ "comment" => nil, "key" => "status", "value" => "this.parseOrderStatus (status)" }, %{ "comment" => nil, "key" => "symbol", "value" => "market['symbol']" }, %{ "comment" => nil, "key" => "type", "value" => "this.parseOrderType (this.safeString (order, 'orderType'))" }, %{ "comment" => nil, "key" => "timeInForce", "value" => "this.parseOrderTimeInForce (this.safeString (order, 'timeInForce'))" }, %{ "comment" => nil, "key" => "price", "value" => "this.safeStringN (order, [ 'price', 'matchPrice', 'limitPrice' ])" }, %{ "comment" => nil, "key" => "average", "value" => "undefined" }, %{ "comment" => nil, "key" => "amount", "value" => "this.safeString2 (order, 'totalQuantity', 'quantity')" }, %{ "comment" => nil, "key" => "filled", "value" => "this.safeString2 (order, 'cumulativeMatchedQuantity', 'matchQuantity')" }, %{ "comment" => nil, "key" => "remaining", "value" => "this.safeString (order, 'remainQuantity')" }, %{ "comment" => nil, "key" => "triggerPrice", "value" => "triggerPrice" }, %{ "comment" => nil, "key" => "stopLossPrice", "value" => "triggerPrice" }, %{ "comment" => nil, "key" => "cost", "value" => "this.omitZero (this.safeString (order, 'amount'))" }, %{ "comment" => nil, "key" => "trades", "value" => "undefined" }, %{ "comment" => nil, "key" => "fee", "value" => "fee" }, %{ "comment" => nil, "key" => "info", "value" => "order" } ], "name" => "parseOrder", "signature" => "parseOrder (order, market: Market = undefined): Order", "source" => "parseOrder (order, market: Market = undefined): Order {\n //\n // accepted market order responseType FULL\n // {\n // \"notice\": \"OrderMatched\",\n // \"accountId\": \"106490\",\n // \"orderId\": \"1000109901865\",\n // \"submitted\": true,\n // \"clientOrderId\": \"0\",\n // \"marketCode\": \"OX-USDT\",\n // \"status\": \"FILLED\",\n // \"side\": \"SELL\",\n // \"isTriggered\": false,\n // \"quantity\": \"150.0\",\n // \"amount\": \"0.0\",\n // \"remainQuantity\": \"0.0\",\n // \"matchId\": \"100017047880451399\",\n // \"matchPrice\": \"0.01465\",\n // \"matchQuantity\": \"150.0\",\n // \"feeInstrumentId\": \"USDT\",\n // \"fees\": \"0.0015382500\",\n // \"orderType\": \"MARKET\",\n // \"createdAt\": \"1715592472236\",\n // \"lastMatchedAt\": \"1715592472200\",\n // \"displayQuantity\": \"150.0\"\n // }\n //\n // accepted limit order responseType FULL\n // {\n // \"notice\": \"OrderOpened\",\n // \"accountId\": \"106490\",\n // \"orderId\": \"1000111482406\",\n // \"submitted\": true,\n // \"clientOrderId\": \"0\",\n // \"marketCode\": \"ETH-USD-SWAP-LIN\",\n // \"status\": \"OPEN\",\n // \"side\": \"SELL\",\n // \"price\": \"4000.0\",\n // \"isTriggered\": false,\n // \"quantity\": \"0.01\",\n // \"amount\": \"0.0\",\n // \"orderType\": \"LIMIT\",\n // \"timeInForce\": \"GTC\",\n // \"createdAt\": \"1715763507682\",\n // \"displayQuantity\": \"0.01\"\n // }\n //\n // accepted order responseType ACK\n // {\n // \"accountId\": \"106490\",\n // \"orderId\": \"1000109892193\",\n // \"submitted\": true,\n // \"marketCode\": \"OX-USDT\",\n // \"side\": \"BUY\",\n // \"price\": \"0.01961\",\n // \"isTriggered\": false,\n // \"quantity\": \"100\",\n // \"orderType\": \"MARKET\",\n // \"timeInForce\": \"IOC\",\n // \"createdAt\": \"1715591529057\",\n // \"selfTradePreventionMode\": \"NONE\"\n // }\n //\n // rejected order (balance insufficient)\n // {\n // \"code\": \"710001\",\n // \"message\": \"System failure, exception thrown -> null\",\n // \"submitted\": false,\n // \"marketCode\": \"OX-USDT\",\n // \"side\": \"BUY\",\n // \"price\": \"0.01961\",\n // \"amount\": \"100\",\n // \"orderType\": \"MARKET\",\n // \"timeInForce\": \"IOC\",\n // \"createdAt\": \"1715591678835\",\n // \"source\": 11,\n // \"selfTradePreventionMode\": \"NONE\"\n // }\n //\n // rejected order (bad request)\n // {\n // \"code\": \"20044\",\n // \"message\": \"Amount is not supported for this order type\",\n // \"submitted\": false,\n // \"marketCode\": \"OX-USDT\",\n // \"side\": \"SELL\",\n // \"amount\": \"200\",\n // \"orderType\": \"MARKET\",\n // \"createdAt\": \"1715592079986\",\n // \"source\": 11\n // }\n //\n // fetchOrder\n // {\n // \"orderId\": \"1000111762980\",\n // \"clientOrderId\": \"0\",\n // \"marketCode\": \"ETH-USD-SWAP-LIN\",\n // \"status\": \"OPEN\",\n // \"side\": \"BUY\",\n // \"price\": \"2700.0\",\n // \"isTriggered\": false,\n // \"remainQuantity\": \"0.01\",\n // \"totalQuantity\": \"0.01\",\n // \"amount\": \"0\",\n // \"displayQuantity\": \"0.01\",\n // \"cumulativeMatchedQuantity\": \"0\",\n // \"orderType\": \"STOP_LIMIT\",\n // \"timeInForce\": \"GTC\",\n // \"source\": \"11\",\n // \"createdAt\": \"1715794191277\"\n // }\n //\n const marketId = this.safeString (order, 'marketCode');\n market = this.safeMarket (marketId, market);\n const timestamp = this.safeInteger (order, 'createdAt');\n let fee = undefined;\n const feeCurrency = this.safeString (order, 'feeInstrumentId');\n if (feeCurrency !== undefined) {\n fee = {\n 'currency': this.safeCurrencyCode (feeCurrency),\n 'cost': this.safeNumber (order, 'fees'),\n };\n }\n let status = this.safeString (order, 'status');\n const code = this.safeInteger (order, 'code'); // rejected orders have code of the error\n if (code !== undefined) {\n status = 'rejected';\n }\n const triggerPrice = this.safeString (order, 'stopPrice');\n return this.safeOrder ({\n 'id': this.safeString (order, 'orderId'),\n 'clientOrderId': this.safeString (order, 'clientOrderId'),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'lastTradeTimestamp': this.safeInteger (order, 'lastMatchedAt'),\n 'lastUpdateTimestamp': this.safeInteger (order, 'lastModifiedAt'),\n 'status': this.parseOrderStatus (status),\n 'symbol': market['symbol'],\n 'type': this.parseOrderType (this.safeString (order, 'orderType')),\n 'timeInForce': this.parseOrderTimeInForce (this.safeString (order, 'timeInForce')), // only for limit orders\n 'side': this.safeStringLower (order, 'side'),\n 'price': this.safeStringN (order, [ 'price', 'matchPrice', 'limitPrice' ]),\n 'average': undefined,\n 'amount': this.safeString2 (order, 'totalQuantity', 'quantity'),\n 'filled': this.safeString2 (order, 'cumulativeMatchedQuantity', 'matchQuantity'),\n 'remaining': this.safeString (order, 'remainQuantity'),\n 'triggerPrice': triggerPrice,\n 'stopLossPrice': triggerPrice,\n 'cost': this.omitZero (this.safeString (order, 'amount')),\n 'trades': undefined,\n 'fee': fee,\n 'info': order,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2906, "line_start" => 2891, "mappings" => [], "name" => "parseOrderStatus", "signature" => "parseOrderStatus (status)", "source" => "parseOrderStatus (status) {\n const statuses: Dict = {\n 'OPEN': 'open',\n 'PARTIALLY_FILLED': 'open',\n 'PARTIAL_FILL': 'open',\n 'FILLED': 'closed',\n 'CANCELED': 'canceled',\n 'CANCELED_BY_USER': 'canceled',\n 'CANCELED_BY_MAKER_ONLY': 'rejected',\n 'CANCELED_BY_FOK': 'rejected',\n 'CANCELED_ALL_BY_IOC': 'rejected',\n 'CANCELED_PARTIAL_BY_IOC': 'canceled',\n 'CANCELED_BY_SELF_TRADE_PROTECTION': 'rejected',\n };\n return this.safeString (statuses, status, status);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2927, "line_start" => 2918, "mappings" => [], "name" => "parseOrderTimeInForce", "signature" => "parseOrderTimeInForce (type)", "source" => "parseOrderTimeInForce (type) {\n const types: Dict = {\n 'GTC': 'GTC',\n 'IOC': 'IOC',\n 'FOK': 'FOK',\n 'MAKER_ONLY': 'PO',\n 'MAKER_ONLY_REPRICE': 'PO',\n };\n return this.safeString (types, type, type);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2916, "line_start" => 2908, "mappings" => [], "name" => "parseOrderType", "signature" => "parseOrderType (type)", "source" => "parseOrderType (type) {\n const types: Dict = {\n 'LIMIT': 'limit',\n 'STOP_LIMIT': 'limit',\n 'MARKET': 'market',\n 'STOP_MARKET': 'market',\n };\n return this.safeString (types, type, type);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"marketCode\": \"ETH-USD-SWAP-LIN\",\n \"baseAsset\": \"ETH\",\n \"counterAsset\": \"USD\",\n \"position\": \"0.001\",\n \"entryPrice\": \"3080.5\",\n \"markPrice\": \"3062.0\",\n \"positionPnl\": \"-1.8500\",\n \"estLiquidationPrice\": \"0\",\n \"lastUpdatedAt\": \"1715089678013\"\n }" ], "line_end" => 2278, "line_start" => 2232, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "position" }, %{ "comment" => nil, "key" => "id", "value" => "undefined" }, %{ "comment" => nil, "key" => "symbol", "value" => "market['symbol']" }, %{ "comment" => nil, "key" => "notional", "value" => "undefined" }, %{ "comment" => nil, "key" => "marginMode", "value" => "'cross'" }, %{ "comment" => nil, "key" => "liquidationPrice", "value" => "this.safeNumber (position, 'estLiquidationPrice')" }, %{ "comment" => nil, "key" => "entryPrice", "value" => "this.safeNumber (position, 'entryPrice')" }, %{ "comment" => nil, "key" => "unrealizedPnl", "value" => "this.safeNumber (position, 'positionPnl')" }, %{ "comment" => nil, "key" => "realizedPnl", "value" => "undefined" }, %{ "comment" => nil, "key" => "percentage", "value" => "undefined" }, %{ "comment" => nil, "key" => "contracts", "value" => "this.safeNumber (position, 'position')" }, %{ "comment" => nil, "key" => "contractSize", "value" => "undefined" }, %{ "comment" => nil, "key" => "markPrice", "value" => "this.safeNumber (position, 'markPrice')" }, %{ "comment" => nil, "key" => "lastPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "side", "value" => "undefined" }, %{ "comment" => nil, "key" => "hedged", "value" => "undefined" }, %{ "comment" => nil, "key" => "timestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "datetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "lastUpdateTimestamp", "value" => "this.safeInteger (position, 'lastUpdatedAt')" }, %{ "comment" => nil, "key" => "maintenanceMargin", "value" => "undefined" }, %{ "comment" => nil, "key" => "maintenanceMarginPercentage", "value" => "undefined" }, %{ "comment" => nil, "key" => "collateral", "value" => "undefined" }, %{ "comment" => nil, "key" => "initialMargin", "value" => "undefined" }, %{ "comment" => nil, "key" => "initialMarginPercentage", "value" => "undefined" }, %{ "comment" => nil, "key" => "leverage", "value" => "undefined" }, %{ "comment" => nil, "key" => "marginRatio", "value" => "undefined" }, %{ "comment" => nil, "key" => "stopLossPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "takeProfitPrice", "value" => "undefined" } ], "name" => "parsePosition", "signature" => "parsePosition (position, market: Market = undefined)", "source" => "parsePosition (position, market: Market = undefined) {\n //\n // {\n // \"marketCode\": \"ETH-USD-SWAP-LIN\",\n // \"baseAsset\": \"ETH\",\n // \"counterAsset\": \"USD\",\n // \"position\": \"0.001\",\n // \"entryPrice\": \"3080.5\",\n // \"markPrice\": \"3062.0\",\n // \"positionPnl\": \"-1.8500\",\n // \"estLiquidationPrice\": \"0\",\n // \"lastUpdatedAt\": \"1715089678013\"\n // }\n //\n const marketId = this.safeString (position, 'marketCode');\n market = this.safeMarket (marketId, market);\n return this.safePosition ({\n 'info': position,\n 'id': undefined,\n 'symbol': market['symbol'],\n 'notional': undefined,\n 'marginMode': 'cross',\n 'liquidationPrice': this.safeNumber (position, 'estLiquidationPrice'),\n 'entryPrice': this.safeNumber (position, 'entryPrice'),\n 'unrealizedPnl': this.safeNumber (position, 'positionPnl'),\n 'realizedPnl': undefined,\n 'percentage': undefined,\n 'contracts': this.safeNumber (position, 'position'),\n 'contractSize': undefined,\n 'markPrice': this.safeNumber (position, 'markPrice'),\n 'lastPrice': undefined,\n 'side': undefined,\n 'hedged': undefined,\n 'timestamp': undefined,\n 'datetime': undefined,\n 'lastUpdateTimestamp': this.safeInteger (position, 'lastUpdatedAt'),\n 'maintenanceMargin': undefined,\n 'maintenanceMarginPercentage': undefined,\n 'collateral': undefined,\n 'initialMargin': undefined,\n 'initialMarginPercentage': undefined,\n 'leverage': undefined,\n 'marginRatio': undefined,\n 'stopLossPrice': undefined,\n 'takeProfitPrice': undefined,\n });\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"marketCode\": \"BTC-USD-SWAP-LIN\",\n \"markPrice\": \"64276\",\n \"open24h\": \"63674\",\n \"high24h\": \"64607\",\n \"low24h\": \"62933\",\n \"volume24h\": \"306317655.80000\",\n \"currencyVolume24h\": \"48.06810\",\n \"openInterest\": \"72.39250\",\n \"lastTradedPrice\": \"64300.0\",\n \"lastTradedQuantity\": \"1.0\",\n \"lastUpdatedAt\": \"1714925196034\"\n }" ], "line_end" => 876, "line_start" => 832, "mappings" => [ %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "high", "value" => "this.safeString (ticker, 'high24h')" }, %{ "comment" => nil, "key" => "low", "value" => "this.safeString (ticker, 'low24h')" }, %{ "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" => "this.safeString (ticker, 'open24h')" }, %{ "comment" => nil, "key" => "close", "value" => "last" }, %{ "comment" => nil, "key" => "last", "value" => "last" }, %{ "comment" => nil, "key" => "previousClose", "value" => "undefined" }, %{ "comment" => nil, "key" => "change", "value" => "undefined" }, %{ "comment" => nil, "key" => "percentage", "value" => "undefined" }, %{ "comment" => nil, "key" => "average", "value" => "undefined" }, %{ "comment" => nil, "key" => "baseVolume", "value" => "this.safeString (ticker, 'currencyVolume24h')" }, %{ "comment" => nil, "key" => "quoteVolume", "value" => "undefined" }, %{ "comment" => nil, "key" => "info", "value" => "ticker" } ], "name" => "parseTicker", "signature" => "parseTicker (ticker, market: Market = undefined): Ticker", "source" => "parseTicker (ticker, market: Market = undefined): Ticker {\n //\n // {\n // \"marketCode\": \"BTC-USD-SWAP-LIN\",\n // \"markPrice\": \"64276\",\n // \"open24h\": \"63674\",\n // \"high24h\": \"64607\",\n // \"low24h\": \"62933\",\n // \"volume24h\": \"306317655.80000\",\n // \"currencyVolume24h\": \"48.06810\",\n // \"openInterest\": \"72.39250\",\n // \"lastTradedPrice\": \"64300.0\",\n // \"lastTradedQuantity\": \"1.0\",\n // \"lastUpdatedAt\": \"1714925196034\"\n // }\n //\n const timestamp = this.safeInteger (ticker, 'lastUpdatedAt');\n const marketId = this.safeString (ticker, 'marketCode');\n market = this.safeMarket (marketId, market);\n const symbol = market['symbol'];\n const last = this.safeString (ticker, 'lastTradedPrice');\n return this.safeTicker ({\n 'symbol': symbol,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'high': this.safeString (ticker, 'high24h'),\n 'low': this.safeString (ticker, 'low24h'),\n 'bid': undefined,\n 'bidVolume': undefined,\n 'ask': undefined,\n 'askVolume': undefined,\n 'vwap': undefined,\n 'open': this.safeString (ticker, 'open24h'),\n 'close': last,\n 'last': last,\n 'previousClose': undefined,\n 'change': undefined,\n 'percentage': undefined,\n 'average': undefined,\n 'baseVolume': this.safeString (ticker, 'currencyVolume24h'),\n 'quoteVolume': undefined, // the exchange returns cost in OX\n 'markPrice': this.safeString (ticker, 'markPrice'),\n 'info': ticker,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"marketCode\": \"BTC-USD-SWAP-LIN\",\n \"matchPrice\": \"63900\",\n \"matchQuantity\": \"1\",\n \"side\": \"SELL\",\n \"matchType\": \"TAKER\",\n \"matchedAt\": \"1714934112352\"\n }", "{\n \"orderId\": \"1000104903698\",\n \"clientOrderId\": \"1715000260094\",\n \"matchId\": \"400017129522773178\",\n \"marketCode\": \"ETH-USD-SWAP-LIN\",\n \"side\": \"BUY\",\n \"matchedQuantity\": \"0.001\",\n \"matchPrice\": \"3100.2\",\n \"total\": \"310.02\",\n \"orderMatchType\": \"MAKER\",\n \"feeAsset\": \"OX\",\n \"fee\": \"0.062004\",\n \"source\": \"0\",\n \"matchedAt\": \"1715000267420\"\n }" ], "line_end" => 1538, "line_start" => 1483, "mappings" => [ %{ "comment" => nil, "key" => "cost", "value" => "this.safeString (trade, 'fee')" }, %{ "comment" => nil, "key" => "currency", "value" => "this.safeCurrencyCode (this.safeString (trade, 'feeAsset'))" }, %{ "comment" => nil, "key" => "id", "value" => "this.safeString (trade, 'matchId')" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "type", "value" => "undefined" }, %{ "comment" => nil, "key" => "order", "value" => "this.safeString (trade, 'orderId')" }, %{ "comment" => nil, "key" => "side", "value" => "this.safeStringLower (trade, 'side')" }, %{ "comment" => nil, "key" => "takerOrMaker", "value" => "this.safeStringLower2 (trade, 'matchType', 'orderMatchType')" }, %{ "comment" => nil, "key" => "price", "value" => "this.safeString (trade, 'matchPrice')" }, %{ "comment" => nil, "key" => "amount", "value" => "this.safeString2 (trade, 'matchQuantity', 'matchedQuantity')" }, %{ "comment" => nil, "key" => "cost", "value" => "undefined" }, %{ "comment" => nil, "key" => "info", "value" => "trade" } ], "name" => "parseTrade", "signature" => "parseTrade (trade, market: Market = undefined): Trade", "source" => "parseTrade (trade, market: Market = undefined): Trade {\n //\n // public fetchTrades\n //\n // {\n // \"marketCode\": \"BTC-USD-SWAP-LIN\",\n // \"matchPrice\": \"63900\",\n // \"matchQuantity\": \"1\",\n // \"side\": \"SELL\",\n // \"matchType\": \"TAKER\",\n // \"matchedAt\": \"1714934112352\"\n // }\n //\n //\n // private fetchMyTrades\n //\n // {\n // \"orderId\": \"1000104903698\",\n // \"clientOrderId\": \"1715000260094\",\n // \"matchId\": \"400017129522773178\",\n // \"marketCode\": \"ETH-USD-SWAP-LIN\",\n // \"side\": \"BUY\",\n // \"matchedQuantity\": \"0.001\",\n // \"matchPrice\": \"3100.2\",\n // \"total\": \"310.02\",\n // \"orderMatchType\": \"MAKER\",\n // \"feeAsset\": \"OX\",\n // \"fee\": \"0.062004\",\n // \"source\": \"0\",\n // \"matchedAt\": \"1715000267420\"\n // }\n //\n const marketId = this.safeString (trade, 'marketCode');\n market = this.safeMarket (marketId, market);\n const symbol = market['symbol'];\n const timestamp = this.safeInteger (trade, 'matchedAt');\n const fee = {\n 'cost': this.safeString (trade, 'fee'),\n 'currency': this.safeCurrencyCode (this.safeString (trade, 'feeAsset')),\n };\n return this.safeTrade ({\n 'id': this.safeString (trade, 'matchId'),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'symbol': symbol,\n 'type': undefined,\n 'order': this.safeString (trade, 'orderId'),\n 'side': this.safeStringLower (trade, 'side'),\n 'takerOrMaker': this.safeStringLower2 (trade, 'matchType', 'orderMatchType'),\n 'price': this.safeString (trade, 'matchPrice'),\n 'amount': this.safeString2 (trade, 'matchQuantity', 'matchedQuantity'),\n 'cost': undefined, // the exchange returns total cost in OX\n 'fee': fee,\n 'info': trade,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"asset\":\"USDC\",\n \"network\":\"Ethereum\",\n \"address\": \"0x998dEc76151FB723963Bd8AFD517687b38D33dE8\",\n \"quantity\":\"50\",\n \"id\":\"5914\",\n \"status\": \"COMPLETED\",\n \"txId\":\"0xf5e79663830a0c6f94d46638dcfbc134566c12facf1832396f81ecb55d3c75dc\",\n \"creditedAt\":\"1714821645154\"\n }", "{\n id: '968163212989431811',\n asset: 'OX',\n network: 'Arbitrum',\n address: '0x90fc1fB49a4ED8f485dd02A2a1Cf576897f6Bfc9',\n quantity: '11.7444',\n fee: '1.744400000',\n status: 'COMPLETED',\n txId: '0xe96b2d128b737fdbca927edf355cff42202e65b0fb960e64ffb9bd68c121f69f',\n requestedAt: '1715530365450',\n completedAt: '1715530527000'\n }", "{\n \"id\": \"968364664449302529\",\n \"asset\": \"OX\",\n \"network\": \"Arbitrum\",\n \"address\": \"0x90fc1fB49a4ED8f485dd02A2a1Cf576897f6Bfc9\",\n \"quantity\": \"10\",\n \"externalFee\": false,\n \"fee\": \"1.6728\",\n \"status\": \"PENDING\",\n \"requestedAt\": \"1715591843616\"\n }" ], "line_end" => 2081, "line_start" => 1990, "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" => "networkCode" }, %{ "comment" => nil, "key" => "address", "value" => "address" }, %{ "comment" => nil, "key" => "addressTo", "value" => "addressTo" }, %{ "comment" => nil, "key" => "addressFrom", "value" => "undefined" }, %{ "comment" => nil, "key" => "tag", "value" => "undefined" }, %{ "comment" => nil, "key" => "tagTo", "value" => "undefined" }, %{ "comment" => nil, "key" => "tagFrom", "value" => "undefined" }, %{ "comment" => nil, "key" => "type", "value" => "type" }, %{ "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" => "undefined" }, %{ "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 // \"asset\":\"USDC\",\n // \"network\":\"Ethereum\",\n // \"address\": \"0x998dEc76151FB723963Bd8AFD517687b38D33dE8\",\n // \"quantity\":\"50\",\n // \"id\":\"5914\",\n // \"status\": \"COMPLETED\",\n // \"txId\":\"0xf5e79663830a0c6f94d46638dcfbc134566c12facf1832396f81ecb55d3c75dc\",\n // \"creditedAt\":\"1714821645154\"\n // }\n //\n // fetchWithdrawals\n // {\n // id: '968163212989431811',\n // asset: 'OX',\n // network: 'Arbitrum',\n // address: '0x90fc1fB49a4ED8f485dd02A2a1Cf576897f6Bfc9',\n // quantity: '11.7444',\n // fee: '1.744400000',\n // status: 'COMPLETED',\n // txId: '0xe96b2d128b737fdbca927edf355cff42202e65b0fb960e64ffb9bd68c121f69f',\n // requestedAt: '1715530365450',\n // completedAt: '1715530527000'\n // }\n //\n // withdraw\n // {\n // \"id\": \"968364664449302529\",\n // \"asset\": \"OX\",\n // \"network\": \"Arbitrum\",\n // \"address\": \"0x90fc1fB49a4ED8f485dd02A2a1Cf576897f6Bfc9\",\n // \"quantity\": \"10\",\n // \"externalFee\": false,\n // \"fee\": \"1.6728\",\n // \"status\": \"PENDING\",\n // \"requestedAt\": \"1715591843616\"\n // }\n //\n const id = this.safeString (transaction, 'id');\n const type = this.safeString (transaction, 'type');\n transaction = this.omit (transaction, 'type');\n let address: Str = undefined;\n let addressTo: Str = undefined;\n let status: Str = undefined;\n if (type === 'deposit') {\n address = this.safeString (transaction, 'address');\n status = this.parseDepositStatus (this.safeString (transaction, 'status'));\n } else if (type === 'withdrawal') {\n addressTo = this.safeString (transaction, 'address');\n status = this.parseWithdrawalStatus (this.safeString (transaction, 'status'));\n }\n const txid = this.safeString (transaction, 'txId');\n const currencyId = this.safeString (transaction, 'asset');\n const code = this.safeCurrencyCode (currencyId, currency);\n const network = this.safeString (transaction, 'network');\n const networkCode = this.networkIdToCode (network);\n const timestamp = this.safeInteger2 (transaction, 'creditedAt', 'requestedAt');\n const amount = this.safeNumber (transaction, 'quantity');\n const feeCost = this.safeNumber (transaction, 'fee');\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': networkCode,\n 'address': address,\n 'addressTo': addressTo,\n 'addressFrom': undefined,\n 'tag': undefined,\n 'tagTo': undefined,\n 'tagFrom': undefined,\n 'type': type,\n 'amount': amount,\n 'currency': code,\n 'status': status,\n 'updated': undefined,\n 'internal': undefined,\n 'comment': undefined,\n 'fee': fee,\n } as Transaction;\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 1988, "line_start" => 1978, "mappings" => [], "name" => "parseTransactions", "signature" => "parseTransactions (transactions, currency: Currency = undefined, since: Int = undefined, limit: Int = undefined, params = {}): Transaction[]", "source" => "parseTransactions (transactions, currency: Currency = undefined, since: Int = undefined, limit: Int = undefined, params = {}): Transaction[] {\n let result = [];\n for (let i = 0; i < transactions.length; i++) {\n transactions[i] = this.extend (transactions[i], params);\n const transaction = this.parseTransaction (transactions[i], currency);\n result.push (transaction);\n }\n result = this.sortBy (result, 'timestamp');\n const code = (currency !== undefined) ? currency['code'] : undefined;\n return this.filterByCurrencySinceLimit (result, code, since, limit);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"asset\": \"USDT\",\n \"quantity\": \"5\",\n \"fromAccount\": \"106490\",\n \"toAccount\": \"106526\",\n \"id\": \"966706320886267905\",\n \"status\": \"COMPLETED\",\n \"transferredAt\": \"1715085756708\"\n }" ], "line_end" => 1809, "line_start" => 1782, "mappings" => [ %{ "comment" => nil, "key" => "id", "value" => "this.safeString (transfer, 'id')" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "currency", "value" => "this.safeCurrencyCode (currencyId, currency)" }, %{ "comment" => nil, "key" => "amount", "value" => "this.safeNumber (transfer, 'quantity')" }, %{ "comment" => nil, "key" => "fromAccount", "value" => "this.safeString (transfer, 'fromAccount')" }, %{ "comment" => nil, "key" => "toAccount", "value" => "this.safeString (transfer, 'toAccount')" }, %{ "comment" => nil, "key" => "status", "value" => "this.parseTransferStatus (this.safeString (transfer, 'status'))" }, %{ "comment" => nil, "key" => "info", "value" => "transfer" } ], "name" => "parseTransfer", "signature" => "parseTransfer (transfer, currency: Currency = undefined)", "source" => "parseTransfer (transfer, currency: Currency = undefined) {\n //\n // fetchTransfers\n //\n // {\n // \"asset\": \"USDT\",\n // \"quantity\": \"5\",\n // \"fromAccount\": \"106490\",\n // \"toAccount\": \"106526\",\n // \"id\": \"966706320886267905\",\n // \"status\": \"COMPLETED\",\n // \"transferredAt\": \"1715085756708\"\n // }\n //\n const timestamp = this.safeInteger (transfer, 'transferredAt');\n const currencyId = this.safeString (transfer, 'asset');\n return {\n 'id': this.safeString (transfer, 'id'),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'currency': this.safeCurrencyCode (currencyId, currency),\n 'amount': this.safeNumber (transfer, 'quantity'),\n 'fromAccount': this.safeString (transfer, 'fromAccount'),\n 'toAccount': this.safeString (transfer, 'toAccount'),\n 'status': this.parseTransferStatus (this.safeString (transfer, 'status')),\n 'info': transfer,\n };\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 1816, "line_start" => 1811, "mappings" => [], "name" => "parseTransferStatus", "signature" => "parseTransferStatus (status)", "source" => "parseTransferStatus (status) {\n const statuses: Dict = {\n 'COMPLETED': 'ok',\n };\n return this.safeString (statuses, status, status);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2101, "line_start" => 2090, "mappings" => [], "name" => "parseWithdrawalStatus", "signature" => "parseWithdrawalStatus (status)", "source" => "parseWithdrawalStatus (status) {\n const statuses: Dict = {\n 'COMPLETED': 'ok',\n 'PROCESSING': 'pending',\n 'IN SWEEPING': 'pending',\n 'PENDING': 'pending',\n 'ON HOLD': 'pending',\n 'CANCELED': 'canceled',\n 'FAILED': 'failed',\n };\n return this.safeString (statuses, status, status);\n }" } ], path_prefix: "", pro: true, quote_json_numbers: nil, rate_limits: %{ interval_ms: 120, period: 1000, requests: 8, rolling_window_size: 60000 }, raw_endpoints: %{ private: [ %{ auth: false, cost: 1, method: :get, path: "/v3/account" }, %{ auth: false, cost: 1, method: :get, path: "/v3/account/names" }, %{ auth: false, cost: 1, method: :get, path: "/v3/balances" }, %{ auth: false, cost: 1, method: :get, path: "/v3/deposit" }, %{ auth: false, cost: 1, method: :get, path: "/v3/deposit-addresses" }, %{ auth: false, cost: 1, method: :get, path: "/v3/funding" }, %{ auth: false, cost: 1, method: :get, path: "/v3/orders/status" }, %{ auth: false, cost: 1, method: :get, path: "/v3/orders/working" }, %{ auth: false, cost: 1, method: :get, path: "/v3/positions" }, %{ auth: false, cost: 1, method: :get, path: "/v3/trades" }, %{ auth: false, cost: 1, method: :get, path: "/v3/transfer" }, %{ auth: false, cost: 1, method: :get, path: "/v3/wallet" }, %{ auth: false, cost: 1, method: :get, path: "/v3/withdrawal" }, %{ auth: false, cost: 1, method: :get, path: "/v3/withdrawal-addresses" }, %{ auth: false, cost: 1, method: :get, path: "/v3/withdrawal-fees" }, %{ auth: false, cost: 1, method: :post, path: "/v3/orders/place" }, %{ auth: false, cost: 1, method: :post, path: "/v3/transfer" }, %{ auth: false, cost: 1, method: :post, path: "/v3/withdrawal" }, %{ auth: false, cost: 1, method: :delete, path: "/v3/orders/cancel" }, %{ auth: false, cost: 1, method: :delete, path: "/v3/orders/cancel-all" } ], public: [ %{ auth: false, cost: 1, method: :get, path: "/v3/assets" }, %{ auth: false, cost: 1, method: :get, path: "/v3/candles" }, %{ auth: false, cost: 1, method: :get, path: "/v3/depth" }, %{ auth: false, cost: 1, method: :get, path: "/v3/exchange-trades" }, %{ auth: false, cost: 1, method: :get, path: "/v3/funding/estimates" }, %{ auth: false, cost: 1, method: :get, path: "/v3/funding/rates" }, %{ auth: false, cost: 1, method: :get, path: "/v3/leverage/tiers" }, %{ auth: false, cost: 1, method: :get, path: "/v3/markets" }, %{ auth: false, cost: 1, method: :get, path: "/v3/markets/operational" }, %{ auth: false, cost: 1, method: :get, path: "/v3/tickers" } ] }, required_credentials: %{ api_key: true, password: false, secret: true, uid: false }, requires_eddsa: false, response_error: nil, signing: %{ api_key_header: "AccessKey", confidence: :medium, nonce_header: "Nonce", pattern: :hmac_sha256_headers, signature_encoding: :base64, signature_header: "Signature", timestamp_format: :iso8601 }, spec_format_version: 1, status: %{ "eta" => nil, "status" => "ok", "updated" => nil, "url" => nil }, symbol_format: nil, symbol_formats: nil, symbol_patterns: %{}, timeframes: %{ "15m" => "900s", "1d" => "86400s", "1h" => "3600s", "1m" => "60s", "2h" => "7200s", "30m" => "1800s", "4h" => "14400s", "5m" => "300s" }, url_strategy: %{ detected_from: "api_structure", note: "paths_already_versioned", pattern: :version_in_path, prefix: nil }, urls: %{ api: "https://api.ox.fun", api_sections: %{ "private" => "https://api.ox.fun", "public" => "https://api.ox.fun" }, doc: "https://docs.ox.fun/", other: nil, sandbox: %{ "private" => "https://stgapi.ox.fun", "public" => "https://stgapi.ox.fun" }, www: "https://ox.fun/" }, version: "v3", ws: %{ auth: %{ algorithm: :sha256, encoding: :base64, market_specific: false, message_format: :op_args, op_field: "op", op_value: "login", pattern: :generic_hmac, payload_format: "custom", requires_passphrase: false, timestamp_unit: :milliseconds }, channel_templates: %{ watch_balance: %{ auth_required: true, market_id_format: :native, params: [], pattern: :topic_based, separator: "." }, watch_bids_asks: %{ market_id_format: :native, params: [], pattern: :topic_based, separator: "." }, watch_ohlcv: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "interval" }, %{ "default" => nil, "name" => "limit" } ], pattern: :topic_based, separator: "." }, watch_ohlcv_for_symbols: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "interval" }, %{ "default" => nil, "name" => "limit" } ], pattern: :topic_based, separator: "." }, watch_order_book: %{ channel_name: "depth", market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :topic_based, separator: "." }, watch_order_book_for_symbols: %{ channel_name: "depth", market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :topic_based, separator: "." }, watch_orders: %{ auth_required: true, market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :topic_based, separator: "." }, watch_positions: %{ auth_required: true, market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :topic_based, separator: "." }, watch_ticker: %{ market_id_format: :native, params: [], pattern: :topic_based, separator: "." }, watch_tickers: %{ market_id_format: :native, params: [], pattern: :topic_based, separator: "." }, watch_trades: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :topic_based, separator: "." }, watch_trades_for_symbols: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :topic_based, separator: "." } }, has: %{ watch_balance: true, 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: nil, watch_status: nil, watch_ticker: true, watch_tickers: true, watch_trades: true, watch_trades_for_symbols: true }, message_patterns: [ %{ args_field: "data", format: :op, keys: [ "data", "op" ], kind_field: "op", kind_value: "login", sources: [ :send, :watch ] }, %{ args_field: "args", format: :op, keys: [ "args", "op" ], kind_field: "op", kind_value: "subscribe", sources: [ :send, :watch, :watch_multiple ] }, %{ format: :string, sources: [ :ping ] } ], options: %{ "watchOrderBook" => %{ "channel" => "depth" } }, streaming: %{ keep_alive: 50000 }, subscription_config: %{ args_field: "args", args_format: :string_list, market_id_format: :native, op_field: "op", separator: "." }, subscription_pattern: :op_subscribe, urls: "wss://api.ox.fun/v2/websocket", watch_methods: [ "watchBalance", "watchBidsAsks", "watchOHLCV", "watchOHLCVForSymbols", "watchOrderBook", "watchOrderBookForSymbols", "watchOrders", "watchPositions", "watchTicker", "watchTickers", "watchTrades", "watchTradesForSymbols" ] } }