# Bitfinex Exchange Specification # # Auto-generated by: mix ccxt.extract bitfinex # 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: [ "VG" ], currencies: %{}, currency_aliases: %{ "ALG" => "ALGO", "AMP" => "AMPL", "ATO" => "ATOM", "BCHABC" => "XEC", "BCHN" => "BCH", "BCHSV" => "BSV", "DAT" => "DATA", "DOG" => "MDOGE", "DSH" => "DASH", "EDO" => "PNT", "EUS" => "EURS", "EUT" => "EURT", "EUTF0" => "EURT", "HTX" => "HT", "IDX" => "ID", "IOT" => "IOTA", "IQX" => "IQ", "LUNA" => "LUNC", "LUNA2" => "LUNA", "MNA" => "MANA", "ORS" => "ORS Group", "PAS" => "PASS", "QSH" => "QASH", "QTM" => "QTUM", "RBT" => "RBTC", "SNG" => "SNGLS", "STJ" => "STORJ", "TERRAUST" => "USTC", "TSD" => "TUSD", "UDC" => "USDC", "UST" => "USDT", "USTF0" => "USDT", "VSY" => "VSYS", "WAX" => "WAXP", "XBT" => "BTC", "XCH" => "XCHF", "YGG" => "YEED", "YYW" => "YOYOW", "ZBT" => "ZB" }, dex: false, enable_rate_limit: true, endpoint_extraction_stats: %{ "capturedMethods" => 45, "coveragePercent" => 100, "enabledMethods" => 48, "excluded" => [ %{ "method" => "setMargin", "reason" => "symbol.endsWith is not a function" }, %{ "method" => "fetchFundingRate", "reason" => "emulated (returns cached data, no HTTP call)" }, %{ "method" => "fetchTransactions", "reason" => "emulated (returns cached data, no HTTP call)" } ], "excludedMethods" => 3, "extractableMethods" => 45, "failures" => [] }, endpoints: [ %{ api_section: "private", auth: true, cost: 2.7, default_params: %{ "all" => 1 }, market_type: :spot, method: :post, name: :cancel_all_orders, param_mappings: %{}, params: [ :symbol ], path: "/auth/w/order/cancel/multi", source: :intercepted }, %{ api_section: "private", auth: true, cost: 2.7, market_type: :spot, method: :post, name: :cancel_order, param_mappings: %{}, params: [ :id, :symbol ], path: "/auth/w/order/cancel", source: :intercepted }, %{ api_section: "private", auth: true, cost: 2.7, default_params: %{ "id" => [ nil ] }, market_type: :spot, method: :post, name: :cancel_orders, param_mappings: %{}, params: [ :ids, :symbol ], path: "/auth/w/order/cancel/multi", source: :intercepted }, %{ api_section: "private", auth: true, cost: 24, default_params: %{ "op_renew" => 1, "wallet" => "exchange" }, market_type: :spot, method: :post, name: :create_deposit_address, param_mappings: %{ "code" => "method" }, params: [ :code ], path: "/auth/w/deposit/address", source: :intercepted }, %{ api_section: "private", auth: true, cost: 2.7, default_params: %{ "type" => "EXCHANGE LIMIT" }, market_type: :spot, method: :post, name: :create_limit_order, param_mappings: %{}, params: [ :symbol, :side, :amount, :price ], path: "/auth/w/order/submit", source: :intercepted }, %{ api_section: "private", auth: true, cost: 2.7, default_params: %{ "type" => "EXCHANGE MARKET" }, market_type: :spot, method: :post, name: :create_market_order, param_mappings: %{}, params: [ :symbol, :side, :amount, :price ], path: "/auth/w/order/submit", source: :intercepted }, %{ api_section: "private", auth: true, cost: 2.7, default_params: %{ "type" => "EXCHANGE LIMIT" }, market_type: :spot, method: :post, name: :create_order, param_mappings: %{}, params: [ :symbol, :type, :side, :amount, :price ], path: "/auth/w/order/submit", source: :intercepted }, %{ api_section: "private", auth: true, cost: 2.7, default_params: %{ "flags" => 4096, "type" => "EXCHANGE LIMIT" }, market_type: :spot, method: :post, name: :create_post_only_order, param_mappings: %{}, params: [ :symbol, :type, :side, :amount, :price ], path: "/auth/w/order/submit", source: :intercepted }, %{ api_section: "private", auth: true, cost: 2.7, default_params: %{ "flags" => 1024, "symbol" => "BTCUSDT" }, market_type: :swap, method: :post, name: :create_reduce_only_order, param_mappings: %{}, params: [ :symbol, :type, :side, :amount, :price ], path: "/auth/w/order/submit", source: :intercepted }, %{ api_section: "private", auth: true, cost: 2.7, default_params: %{ "symbol" => "BTCUSDT", "triggerDirection" => "below", "type" => "STOP LIMIT" }, market_type: :swap, method: :post, name: :create_stop_limit_order, param_mappings: %{ "price" => "price_aux_limit", "triggerPrice" => "price" }, params: [ :symbol, :side, :amount, :price, :triggerPrice ], path: "/auth/w/order/submit", source: :intercepted }, %{ api_section: "private", auth: true, cost: 2.7, default_params: %{ "symbol" => "BTCUSDT", "triggerDirection" => "below", "type" => "STOP" }, market_type: :swap, method: :post, name: :create_stop_market_order, param_mappings: %{ "triggerPrice" => "price" }, params: [ :symbol, :side, :amount, :triggerPrice ], path: "/auth/w/order/submit", source: :intercepted }, %{ api_section: "private", auth: true, cost: 2.7, default_params: %{ "symbol" => "BTCUSDT", "triggerDirection" => "below", "type" => "STOP LIMIT" }, market_type: :swap, method: :post, name: :create_stop_order, param_mappings: %{ "price" => "price_aux_limit", "triggerPrice" => "price" }, params: [ :symbol, :type, :side, :amount, :price, :triggerPrice ], path: "/auth/w/order/submit", source: :intercepted }, %{ api_section: "private", auth: true, cost: 2.7, default_params: %{ "symbol" => "BTCUSDT", "type" => "TRAILING STOP" }, market_type: :swap, method: :post, name: :create_trailing_amount_order, param_mappings: %{ "trailingAmount" => "price_trailing" }, params: [ :symbol, :type, :side, :amount, :price, :trailingAmount, :trailingTriggerPrice ], path: "/auth/w/order/submit", source: :intercepted }, %{ api_section: "private", auth: true, cost: 2.7, default_params: %{ "symbol" => "BTCUSDT", "triggerDirection" => "below", "type" => "STOP LIMIT" }, market_type: :swap, method: :post, name: :create_trigger_order, param_mappings: %{ "price" => "price_aux_limit", "triggerPrice" => "price" }, params: [ :symbol, :type, :side, :amount, :price, :triggerPrice ], path: "/auth/w/order/submit", source: :intercepted }, %{ api_section: "private", auth: true, cost: 2.7, market_type: :spot, method: :post, name: :edit_order, param_mappings: %{}, params: [ :id, :symbol, :type, :side, :amount, :price ], path: "/auth/w/order/update", source: :intercepted }, %{ api_section: "private", auth: true, cost: 2.7, market_type: :spot, method: :post, name: :fetch_balance, param_mappings: %{}, params: [], path: "/auth/r/wallets", source: :intercepted }, %{ api_section: "private", auth: true, cost: 2.7, default_params: %{ "id" => [ nil ] }, market_type: :spot, method: :post, name: :fetch_closed_order, param_mappings: %{ "arg1" => "symbol" }, params: [], path: "/auth/r/orders/{symbol}/hist", source: :intercepted }, %{ api_section: "private", auth: true, cost: 2.7, market_type: :spot, method: :post, name: :fetch_closed_orders, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/auth/r/orders/{symbol}/hist", source: :intercepted }, %{ api_section: "public", auth: false, cost: 2.7, default_params: %{ "config" => "pub:list:currency,pub:map:currency:sym,pub:map:currency:label,pub:map:currency:unit,pub:map:currency:undl,pub:map:currency:pool,pub:map:currency:explorer,pub:map:currency:tx:fee,pub:map:tx:method,pub:info:tx:status" }, market_type: :spot, method: :get, name: :fetch_currencies, param_mappings: %{}, params: [], path: "/conf/{config}", source: :intercepted }, %{ api_section: "private", auth: true, cost: 24, default_params: %{ "op_renew" => 0, "wallet" => "exchange" }, market_type: :spot, method: :post, name: :fetch_deposit_address, param_mappings: %{ "code" => "method" }, params: [ :code ], path: "/auth/w/deposit/address", source: :intercepted }, %{ api_section: "private", auth: true, cost: 2.7, market_type: :spot, method: :post, name: :fetch_deposits_withdrawals, param_mappings: %{ "code" => "currency" }, params: [ :code, :since, :limit ], path: "/auth/r/movements/{currency}/hist", source: :intercepted }, %{ api_section: "public", auth: false, cost: 2.7, default_params: %{ "symbol" => "BTCUSDT" }, market_type: :swap, method: :get, name: :fetch_funding_rate_history, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/status/deriv/{symbol}/hist", source: :intercepted }, %{ api_section: "public", auth: false, cost: 2.7, default_params: %{ "keys" => "BTCUSDT" }, market_type: :swap, method: :get, name: :fetch_funding_rates, param_mappings: %{}, params: [ :symbols ], path: "/status/deriv", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, default_params: %{ "precision" => "R0" }, market_type: :spot, method: :get, name: :fetch_l2_order_book, param_mappings: %{}, params: [ :symbol, :limit ], path: "/book/{symbol}/{precision}", source: :intercepted }, %{ api_section: "private", auth: true, cost: 2.7, market_type: :spot, method: :post, name: :fetch_ledger, param_mappings: %{ "code" => "currency" }, params: [ :code, :since, :limit ], path: "/auth/r/ledgers/{currency}/hist", source: :intercepted }, %{ api_section: "public", auth: false, cost: 80, market_type: :swap, method: :get, name: :fetch_liquidations, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/liquidations/hist", source: :intercepted }, %{ api_section: "public", auth: false, cost: 2.7, market_type: :spot, method: :get, name: :fetch_markets, param_mappings: %{}, params: [], path: "/conf/pub:info:pair", source: :intercepted }, %{ api_section: "private", auth: true, cost: 2.7, default_params: %{ "end" => "" }, market_type: :spot, method: :post, name: :fetch_my_trades, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/auth/r/trades/{symbol}/hist", source: :intercepted }, %{ api_section: "public", auth: false, cost: 2.7, default_params: %{ "sort" => 1 }, market_type: :spot, method: :get, name: :fetch_ohlcv, param_mappings: %{ "since" => "start" }, params: [ :symbol, :timeframe, :since, :limit ], path: "/candles/trade:{timeframe}:{symbol}/hist", source: :intercepted }, %{ api_section: "public", auth: false, cost: 2.7, default_params: %{ "keys" => "BTCUSDT" }, market_type: :swap, method: :get, name: :fetch_open_interest, param_mappings: %{}, params: [ :symbol ], path: "/status/deriv", source: :intercepted }, %{ api_section: "public", auth: false, cost: 2.7, default_params: %{ "symbol" => "BTCUSDT" }, market_type: :swap, method: :get, name: :fetch_open_interest_history, param_mappings: %{}, params: [ :symbol, :timeframe, :since, :limit ], path: "/status/deriv/{symbol}/hist", source: :intercepted }, %{ api_section: "public", auth: false, cost: 2.7, default_params: %{ "keys" => "BTCUSDT" }, market_type: :spot, method: :get, name: :fetch_open_interests, param_mappings: %{}, params: [ :symbols ], path: "/status/deriv", source: :intercepted }, %{ api_section: "private", auth: true, cost: 2.7, default_params: %{ "id" => [ nil ] }, market_type: :spot, method: :post, name: :fetch_open_order, param_mappings: %{ "arg1" => "symbol" }, params: [], path: "/auth/r/orders/{symbol}", source: :intercepted }, %{ api_section: "private", auth: true, cost: 2.7, market_type: :spot, method: :post, name: :fetch_open_orders, param_mappings: %{}, params: [ :symbol, :since, :limit ], path: "/auth/r/orders/{symbol}", source: :intercepted }, %{ api_section: "private", auth: true, cost: 2.7, default_params: %{ "id" => [ nil ] }, market_type: :spot, method: :post, name: :fetch_order, param_mappings: %{}, params: [ :id, :symbol ], path: "/auth/r/orders/{symbol}", source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, default_params: %{ "precision" => "R0" }, market_type: :spot, method: :get, name: :fetch_order_book, param_mappings: %{ "limit" => "len" }, params: [ :symbol, :limit ], path: "/book/{symbol}/{precision}", source: :intercepted }, %{ api_section: "private", auth: true, cost: 2.7, market_type: :spot, method: :post, name: :fetch_order_trades, param_mappings: %{}, params: [ :id, :symbol, :since, :limit ], path: "/auth/r/order/{symbol}:{id}/trades", source: :intercepted }, %{ api_section: "private", auth: true, cost: 2.7, market_type: :swap, method: :post, name: :fetch_positions, param_mappings: %{}, params: [ :symbols ], path: "/auth/r/positions", source: :intercepted }, %{ api_section: "public", auth: false, cost: 8, market_type: :spot, method: :get, name: :fetch_status, param_mappings: %{}, params: [], path: "/platform/status", source: :intercepted }, %{ api_section: "public", auth: false, cost: 2.7, market_type: :spot, method: :get, name: :fetch_ticker, param_mappings: %{}, params: [ :symbol ], path: "/ticker/{symbol}", source: :intercepted }, %{ api_section: "public", auth: false, cost: 2.7, default_params: %{ "symbols" => "BTCUSDT" }, market_type: :spot, method: :get, name: :fetch_tickers, param_mappings: %{}, params: [ :symbols ], path: "/tickers", source: :intercepted }, %{ api_section: "public", auth: false, cost: 2.7, default_params: %{ "sort" => "1" }, market_type: :spot, method: :get, name: :fetch_trades, param_mappings: %{ "since" => "start" }, params: [ :symbol, :since, :limit ], path: "/trades/{symbol}/hist", source: :intercepted }, %{ api_section: "private", auth: true, cost: 2.7, market_type: :spot, method: :post, name: :fetch_trading_fees, param_mappings: %{}, params: [], path: "/auth/r/summary", source: :intercepted }, %{ api_section: "private", auth: true, cost: 2.7, default_params: %{ "from" => "", "to" => "" }, market_type: :spot, method: :post, name: :transfer, param_mappings: %{}, params: [ :code, :amount, :fromAccount, :toAccount ], path: "/auth/w/transfer", source: :intercepted }, %{ api_section: "private", auth: true, cost: 24, default_params: %{ "wallet" => "exchange" }, market_type: :spot, method: :post, name: :withdraw, param_mappings: %{ "code" => "method" }, params: [ :code, :amount, :address, :tag ], path: "/auth/w/withdraw", source: :intercepted } ], error_code_details: %{ 10001 => %{ description: "api_key: permission invalid (#10001)", type: :access_restricted }, 10020 => %{ description: nil, type: :invalid_parameters }, 10100 => %{ description: nil, type: :invalid_credentials }, 10114 => %{ description: nil, type: :invalid_credentials }, 11010 => %{ description: nil, type: :rate_limited }, 20060 => %{ description: "{\"code\":503,\"error\":\"temporarily_unavailable\",\"error_description\":\"Sorry, the service is temporarily unavailable. See https://www.bitfinex.com/ for more info.\"}", type: :network_error }, "Order not found" => %{ description: nil, type: :order_not_found }, "available balance is only" => %{ description: nil, type: :insufficient_balance }, "not enough exchange balance" => %{ description: nil, type: :insufficient_balance }, "symbol: invalid" => %{ description: nil, type: :invalid_order }, "temporarily_unavailable" => %{ description: nil, type: :network_error } }, error_codes: %{ 10001 => :access_restricted, 10020 => :invalid_parameters, 10100 => :invalid_credentials, 10114 => :invalid_credentials, 11010 => :rate_limited, 20060 => :network_error, "Order not found" => :order_not_found, "available balance is only" => :insufficient_balance, "not enough exchange balance" => :insufficient_balance, "symbol: invalid" => :invalid_order, "temporarily_unavailable" => :network_error }, exceptions: %{ broad: %{ "Order not found" => :order_not_found, "available balance is only" => :insufficient_funds, "not enough exchange balance" => :insufficient_funds, "symbol: invalid" => :bad_symbol }, exact: %{ "10001" => :permission_denied, "10020" => :bad_request, "10100" => :authentication_error, "10114" => :invalid_nonce, "11010" => :rate_limit_exceeded, "20060" => :on_maintenance, "temporarily_unavailable" => :exchange_not_available } }, exchange_options: %{ "defaultNetworkCodeReplacements" => %{ "BRC20" => %{ "BRC20" => "BTC" }, "CRO" => %{ "CRC20" => "CRONOS" }, "ETH" => %{ "ERC20" => "ETH" }, "TRX" => %{ "TRC20" => "TRX" } }, "exchangeTypes" => %{ "EXCHANGE FOK" => "limit", "EXCHANGE IOC" => "limit", "EXCHANGE LIMIT" => "limit", "EXCHANGE MARKET" => "market", "EXCHANGE STOP" => "market", "EXCHANGE STOP LIMIT" => "limit", "LIMIT" => "limit", "MARKET" => "market" }, "fiat" => %{ "CHN" => "CHN", "EUR" => "EUR", "GBP" => "GBP", "JPY" => "JPY", "USD" => "USD" }, "networks" => %{ "ALGO" => "TETHERUSDTALG", "AVAX" => "TETHERUSDTAVAX", "BCH" => "TETHERUSDTBCH", "BTC" => "BITCOIN", "DVF" => "TETHERUSDTDVF", "EOS" => "TETHERUSS", "ERC20" => "ETHEREUM", "KSM" => "TETHERUSDTKSM", "LIQUID" => "TETHERUSL", "LTC" => "LITECOIN", "OMG" => "TETHERUSDTOMG", "OMNI" => "TETHERUSO", "SOL" => "TETHERUSDTSOL", "TRC20" => "TETHERUSX" }, "networksById" => %{ "BITCOIN" => "BTC", "ETHEREUM" => "ERC20", "LITECOIN" => "LTC", "TETHERUSDTALG" => "ALGO", "TETHERUSDTAVAX" => "AVAX", "TETHERUSDTBCH" => "BCH", "TETHERUSDTDVF" => "DVF", "TETHERUSDTKSM" => "KSM", "TETHERUSDTOMG" => "OMG", "TETHERUSDTSOL" => "SOL", "TETHERUSE" => "ERC20", "TETHERUSL" => "LIQUID", "TETHERUSO" => "OMNI", "TETHERUSS" => "EOS", "TETHERUSX" => "TRC20" }, "orderTypes" => %{ "limit" => "EXCHANGE LIMIT", "market" => "EXCHANGE MARKET" }, "precision" => "R0", "v2AccountsByType" => %{ "derivatives" => "margin", "exchange" => "exchange", "funding" => "funding", "future" => "margin", "margin" => "margin", "spot" => "exchange", "swap" => "margin" }, "withdraw" => %{ "includeFee" => false } }, extended_metadata: %{ fees_url: "https://www.bitfinex.com/fees", limits: %{ "amount" => %{}, "cost" => %{}, "leverage" => %{}, "price" => %{} }, logo_url: "https://github.com/user-attachments/assets/4a8e947f-ab46-481a-a8ae-8b20e9b03178" }, extracted_metadata: %{ ccxt_version: "4.5.34" }, features: %{ default: %{ create_order: %{ hedged: false, iceberg: false, leverage: true, margin_mode: true, market_buy_by_cost: true, market_buy_requires_price: false, self_trade_prevention: false, stop_loss_price: true, take_profit_price: true, time_in_force: %{ fok: true, gtd: false, ioc: true, po: true }, trailing: true, trigger_direction: false, trigger_price: true }, create_orders: %{ max: 75 }, fetch_closed_orders: %{ margin_mode: false, symbol_required: false, trailing: false, trigger: false, until_days: 100000 }, fetch_my_trades: %{ limit: 2500, margin_mode: false, symbol_required: false, until_days: 100000 }, fetch_ohlcv: %{ limit: 10000 }, 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: false }, future: %{}, spot: %{ extends: "default" }, swap: %{ linear: %{ extends: "default" } } }, fees: %{ trading: %{ fee_side: "get", maker: 0.001, percentage: true, taker: 0.002, tier_based: true, tiers: %{ maker: [ %{ fee: 0.001, volume: 0 }, %{ fee: 0.0008, volume: 500000 }, %{ fee: 0.0006, volume: 1000000 }, %{ fee: 0.0004, volume: 2500000 }, %{ fee: 0.0002, volume: 5000000 }, %{ fee: 0, volume: 7500000 }, %{ fee: 0, volume: 10000000 }, %{ fee: 0, volume: 15000000 }, %{ fee: 0, volume: 20000000 }, %{ fee: 0, volume: 25000000 }, %{ fee: 0, volume: 30000000 } ], taker: [ %{ fee: 0.002, volume: 0 }, %{ fee: 0.002, volume: 500000 }, %{ fee: 0.002, volume: 1000000 }, %{ fee: 0.002, volume: 2500000 }, %{ fee: 0.002, volume: 5000000 }, %{ fee: 0.002, volume: 7500000 }, %{ fee: 0.0018, volume: 10000000 }, %{ fee: 0.0016, volume: 15000000 }, %{ fee: 0.0014, volume: 20000000 }, %{ fee: 0.0012, volume: 25000000 }, %{ fee: 0.001, volume: 30000000 } ] } } }, handle_content_type_application_zip: nil, handle_errors_source: "handleErrors(statusCode, statusText, url, method, headers, body, response, requestHeaders, requestBody) {\n // [\"error\", 11010, \"ratelimit: error\"]\n if (response !== undefined) {\n if (!Array.isArray(response)) {\n const message = this.safeString2(response, 'message', 'error');\n const feedback = this.id + ' ' + body;\n this.throwExactlyMatchedException(this.exceptions['exact'], message, feedback);\n this.throwBroadlyMatchedException(this.exceptions['broad'], message, feedback);\n throw new errors.ExchangeError(this.id + ' ' + body);\n }\n }\n else if (response === '') {\n throw new errors.ExchangeError(this.id + ' returned empty response');\n }\n if (statusCode === 429) {\n throw new errors.RateLimitExceeded(this.id + ' ' + body);\n }\n if (statusCode === 500) {\n // See https://docs.bitfinex.com/docs/abbreviations-glossary#section-errorinfo-codes\n const errorCode = this.safeString(response, 1, '');\n const errorText = this.safeString(response, 2, '');\n const feedback = this.id + ' ' + errorText;\n this.throwBroadlyMatchedException(this.exceptions['broad'], errorText, feedback);\n this.throwExactlyMatchedException(this.exceptions['exact'], errorCode, feedback);\n this.throwExactlyMatchedException(this.exceptions['exact'], errorText, feedback);\n throw new errors.ExchangeError(this.id + ' ' + errorText + ' (#' + errorCode + ')');\n }\n return response;\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: true, create_limit_buy_order: false, create_limit_buy_order_ws: false, create_limit_order: true, create_limit_order_ws: false, create_limit_sell_order: false, create_limit_sell_order_ws: false, create_market_buy_order: false, create_market_buy_order_with_cost: false, create_market_buy_order_with_cost_ws: false, create_market_buy_order_ws: false, create_market_order: 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: false, 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: 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: true, 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: true, fetch_closed_orders: true, fetch_closed_orders_ws: false, fetch_convert_currencies: false, fetch_convert_quote: false, fetch_convert_trade: false, fetch_convert_trade_history: false, fetch_cross_borrow_rate: false, fetch_cross_borrow_rates: false, fetch_currencies: 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: false, fetch_deposits_withdrawals: true, fetch_deposits_ws: false, fetch_funding_history: false, 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: true, fetch_ledger_entry: false, fetch_leverage: false, fetch_leverage_tiers: false, fetch_leverages: false, fetch_liquidations: true, fetch_long_short_ratio: false, fetch_long_short_ratio_history: false, fetch_margin_adjustment_history: false, fetch_margin_mode: false, fetch_margin_modes: false, fetch_mark_ohlcv: false, fetch_mark_prices: false, fetch_market_leverage_tiers: false, fetch_markets: true, fetch_markets_ws: false, fetch_my_liquidations: false, fetch_my_settlement_history: false, fetch_my_trades: 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: true, fetch_open_order: true, 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: true, 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: true, 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: true, fetch_trading_fees_ws: false, fetch_trading_limits: false, fetch_transaction_fee: false, fetch_transaction_fees: false, fetch_transactions: true, 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: false, 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: true, 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: false, watch_liquidations: false, watch_liquidations_for_symbols: false, watch_my_liquidations: false, watch_my_liquidations_for_symbols: false, watch_my_trades: true, watch_ohlcv: true, watch_ohlcv_for_symbols: false, watch_order_book: true, watch_order_book_for_symbols: false, watch_orders: true, watch_orders_for_symbols: false, watch_position: false, watch_positions: false, watch_status: false, watch_ticker: true, watch_tickers: false, watch_trades: true, watch_trades_for_symbols: false, withdraw: true, ws: false }, http_config: nil, id: "bitfinex", markets: nil, name: "Bitfinex", ohlcv_timestamp_resolution: :milliseconds, options: %{ exchange_types: %{ "EXCHANGE FOK" => "limit", "EXCHANGE IOC" => "limit", "EXCHANGE LIMIT" => "limit", "EXCHANGE MARKET" => "market", "EXCHANGE STOP" => "market", "EXCHANGE STOP LIMIT" => "limit", "LIMIT" => "limit", "MARKET" => "market" }, fiat: %{ "CHN" => "CHN", "EUR" => "EUR", "GBP" => "GBP", "JPY" => "JPY", "USD" => "USD" }, networks: %{ "ALGO" => "TETHERUSDTALG", "AVAX" => "TETHERUSDTAVAX", "BCH" => "TETHERUSDTBCH", "BTC" => "BITCOIN", "DVF" => "TETHERUSDTDVF", "EOS" => "TETHERUSS", "ERC20" => "ETHEREUM", "KSM" => "TETHERUSDTKSM", "LIQUID" => "TETHERUSL", "LTC" => "LITECOIN", "OMG" => "TETHERUSDTOMG", "OMNI" => "TETHERUSO", "SOL" => "TETHERUSDTSOL", "TRC20" => "TETHERUSX" }, networks_by_id: %{ "TETHERUSE" => "ERC20" }, order_types: %{ "limit" => "EXCHANGE LIMIT", "market" => "EXCHANGE MARKET" }, precision: "R0", v2_accounts_by_type: %{ "derivatives" => "margin", "exchange" => "exchange", "funding" => "funding", "future" => "margin", "margin" => "margin", "spot" => "exchange", "swap" => "margin" }, withdraw: %{ "includeFee" => false } }, order_mappings: nil, param_mappings: %{ "arg1" => "symbol", "code" => "method", "limit" => "len", "price" => "price_aux_limit", "since" => "start", "trailingAmount" => "price_trailing", "triggerPrice" => "price" }, parse_methods: [ %{ "comment" => nil, "examples" => [ "[\n \"tBTCF0:USTF0\",\n 1691165059000,\n null,\n 29297.851276225,\n 29277.5,\n null,\n 36950860.76010306,\n null,\n 1691193600000,\n 0.00000527,\n 82,\n null,\n 0.00014548,\n null,\n null,\n 29278.8925,\n null,\n null,\n 9636.07644994,\n null,\n null,\n null,\n 0.0005,\n 0.0025\n ]" ], "line_end" => 3342, "line_start" => 3290, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "contract" }, %{ "comment" => nil, "key" => "symbol", "value" => "this.safeSymbol (marketId, market)" }, %{ "comment" => nil, "key" => "markPrice", "value" => "this.safeNumber (contract, 15)" }, %{ "comment" => nil, "key" => "indexPrice", "value" => "this.safeNumber (contract, 3)" }, %{ "comment" => nil, "key" => "interestRate", "value" => "undefined" }, %{ "comment" => nil, "key" => "estimatedSettlePrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "fundingRate", "value" => "this.safeNumber (contract, 12)" }, %{ "comment" => nil, "key" => "fundingTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "fundingDatetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "nextFundingRate", "value" => "this.safeNumber (contract, 9)" }, %{ "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" => "undefined" } ], "name" => "parseFundingRate", "signature" => "parseFundingRate (contract, market: Market = undefined): FundingRate", "source" => "parseFundingRate (contract, market: Market = undefined): FundingRate {\n //\n // [\n // \"tBTCF0:USTF0\",\n // 1691165059000,\n // null,\n // 29297.851276225,\n // 29277.5,\n // null,\n // 36950860.76010306,\n // null,\n // 1691193600000,\n // 0.00000527,\n // 82,\n // null,\n // 0.00014548,\n // null,\n // null,\n // 29278.8925,\n // null,\n // null,\n // 9636.07644994,\n // null,\n // null,\n // null,\n // 0.0005,\n // 0.0025\n // ]\n //\n const marketId = this.safeString (contract, 0);\n const timestamp = this.safeInteger (contract, 1);\n const nextFundingTimestamp = this.safeInteger (contract, 8);\n return {\n 'info': contract,\n 'symbol': this.safeSymbol (marketId, market),\n 'markPrice': this.safeNumber (contract, 15),\n 'indexPrice': this.safeNumber (contract, 3),\n 'interestRate': undefined,\n 'estimatedSettlePrice': undefined,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'fundingRate': this.safeNumber (contract, 12),\n 'fundingTimestamp': undefined,\n 'fundingDatetime': undefined,\n 'nextFundingRate': this.safeNumber (contract, 9),\n 'nextFundingTimestamp': nextFundingTimestamp,\n 'nextFundingDatetime': this.iso8601 (nextFundingTimestamp),\n 'previousFundingRate': undefined,\n 'previousFundingTimestamp': undefined,\n 'previousFundingDatetime': undefined,\n 'interval': undefined,\n } as FundingRate;\n }" }, %{ "comment" => nil, "examples" => [ "[\n 1691165494000,\n null,\n 29278.95838065,\n 29260.5,\n null,\n 36950860.76010305,\n null,\n 1691193600000,\n 0.00001449,\n 222,\n null,\n 0.00014548,\n null,\n null,\n 29260.005,\n null,\n null,\n 9635.86484562,\n null,\n null,\n null,\n 0.0005,\n 0.0025\n ]" ], "line_end" => 3393, "line_start" => 3344, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "contract" }, %{ "comment" => nil, "key" => "symbol", "value" => "this.safeSymbol (undefined, market)" }, %{ "comment" => nil, "key" => "markPrice", "value" => "this.safeNumber (contract, 14)" }, %{ "comment" => nil, "key" => "indexPrice", "value" => "this.safeNumber (contract, 2)" }, %{ "comment" => nil, "key" => "interestRate", "value" => "undefined" }, %{ "comment" => nil, "key" => "estimatedSettlePrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "fundingRate", "value" => "this.safeNumber (contract, 11)" }, %{ "comment" => nil, "key" => "fundingTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "fundingDatetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "nextFundingRate", "value" => "this.safeNumber (contract, 8)" }, %{ "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" } ], "name" => "parseFundingRateHistory", "signature" => "parseFundingRateHistory (contract, market: Market = undefined)", "source" => "parseFundingRateHistory (contract, market: Market = undefined) {\n //\n // [\n // 1691165494000,\n // null,\n // 29278.95838065,\n // 29260.5,\n // null,\n // 36950860.76010305,\n // null,\n // 1691193600000,\n // 0.00001449,\n // 222,\n // null,\n // 0.00014548,\n // null,\n // null,\n // 29260.005,\n // null,\n // null,\n // 9635.86484562,\n // null,\n // null,\n // null,\n // 0.0005,\n // 0.0025\n // ]\n //\n const timestamp = this.safeInteger (contract, 0);\n const nextFundingTimestamp = this.safeInteger (contract, 7);\n return {\n 'info': contract,\n 'symbol': this.safeSymbol (undefined, market),\n 'markPrice': this.safeNumber (contract, 14),\n 'indexPrice': this.safeNumber (contract, 2),\n 'interestRate': undefined,\n 'estimatedSettlePrice': undefined,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'fundingRate': this.safeNumber (contract, 11),\n 'fundingTimestamp': undefined,\n 'fundingDatetime': undefined,\n 'nextFundingRate': this.safeNumber (contract, 8),\n 'nextFundingTimestamp': nextFundingTimestamp,\n 'nextFundingDatetime': this.iso8601 (nextFundingTimestamp),\n 'previousFundingRate': undefined,\n 'previousFundingTimestamp': undefined,\n 'previousFundingDatetime': undefined,\n };\n }" }, %{ "comment" => nil, "examples" => [ "[\n [\n 2531822314, // ID: Ledger identifier\n \"USD\", // CURRENCY: The symbol of the currency (ex. \"BTC\")\n null, // PLACEHOLDER\n 1573521810000, // MTS: Timestamp in milliseconds\n null, // PLACEHOLDER\n 0.01644445, // AMOUNT: Amount of funds moved\n 0, // BALANCE: New balance\n null, // PLACEHOLDER\n \"Settlement @ 185.79 on wallet margin\" // DESCRIPTION: Description of ledger transaction\n ]\n ]" ], "line_end" => 3097, "line_start" => 3049, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "item" }, %{ "comment" => nil, "key" => "id", "value" => "id" }, %{ "comment" => nil, "key" => "direction", "value" => "undefined" }, %{ "comment" => nil, "key" => "account", "value" => "undefined" }, %{ "comment" => nil, "key" => "referenceId", "value" => "id" }, %{ "comment" => nil, "key" => "referenceAccount", "value" => "undefined" }, %{ "comment" => nil, "key" => "type", "value" => "type" }, %{ "comment" => nil, "key" => "currency", "value" => "code" }, %{ "comment" => nil, "key" => "amount", "value" => "amount" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "before", "value" => "undefined" }, %{ "comment" => nil, "key" => "after", "value" => "after" }, %{ "comment" => nil, "key" => "status", "value" => "undefined" }, %{ "comment" => nil, "key" => "fee", "value" => "undefined" } ], "name" => "parseLedgerEntry", "signature" => "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry", "source" => "parseLedgerEntry (item: Dict, currency: Currency = undefined): LedgerEntry {\n //\n // [\n // [\n // 2531822314, // ID: Ledger identifier\n // \"USD\", // CURRENCY: The symbol of the currency (ex. \"BTC\")\n // null, // PLACEHOLDER\n // 1573521810000, // MTS: Timestamp in milliseconds\n // null, // PLACEHOLDER\n // 0.01644445, // AMOUNT: Amount of funds moved\n // 0, // BALANCE: New balance\n // null, // PLACEHOLDER\n // \"Settlement @ 185.79 on wallet margin\" // DESCRIPTION: Description of ledger transaction\n // ]\n // ]\n //\n const itemList = this.safeList (item, 'result', []);\n let type = undefined;\n const id = this.safeString (itemList, 0);\n const currencyId = this.safeString (itemList, 1);\n const code = this.safeCurrencyCode (currencyId, currency);\n currency = this.safeCurrency (currencyId, currency);\n const timestamp = this.safeInteger (itemList, 3);\n const amount = this.safeNumber (itemList, 5);\n const after = this.safeNumber (itemList, 6);\n const description = this.safeString (itemList, 8);\n if (description !== undefined) {\n const parts = description.split (' @ ');\n const first = this.safeStringLower (parts, 0);\n type = this.parseLedgerEntryType (first);\n }\n return this.safeLedgerEntry ({\n 'info': item,\n 'id': id,\n 'direction': undefined,\n 'account': undefined,\n 'referenceId': id,\n 'referenceAccount': undefined,\n 'type': type,\n 'currency': code,\n 'amount': amount,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'before': undefined,\n 'after': after,\n 'status': undefined,\n 'fee': undefined,\n }, currency) as LedgerEntry;\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 3047, "line_start" => 3029, "mappings" => [], "name" => "parseLedgerEntryType", "signature" => "parseLedgerEntryType (type: Str)", "source" => "parseLedgerEntryType (type: Str) {\n if (type === undefined) {\n return undefined;\n } else if (type.indexOf ('fee') >= 0 || type.indexOf ('charged') >= 0) {\n return 'fee';\n } else if (type.indexOf ('rebate') >= 0) {\n return 'rebate';\n } else if (type.indexOf ('deposit') >= 0 || type.indexOf ('withdrawal') >= 0) {\n return 'transaction';\n } else if (type.indexOf ('transfer') >= 0) {\n return 'transfer';\n } else if (type.indexOf ('payment') >= 0) {\n return 'payout';\n } else if (type.indexOf ('exchange') >= 0 || type.indexOf ('position') >= 0) {\n return 'trade';\n } else {\n return type;\n }\n }" }, %{ "comment" => nil, "examples" => [ "[\n [\n \"pos\",\n 171085137, // position id\n 1706395919788, // timestamp\n null,\n \"tAVAXF0:USTF0\", // market id\n -8, // amount in contracts\n 32.868, // base price\n null,\n 1,\n 1,\n null,\n 33.255 // acquired price\n ]\n ]" ], "line_end" => 3729, "line_start" => 3689, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "entry" }, %{ "comment" => nil, "key" => "symbol", "value" => "this.safeSymbol (marketId, market, undefined, 'contract')" }, %{ "comment" => nil, "key" => "contracts", "value" => "this.parseNumber (contracts)" }, %{ "comment" => nil, "key" => "contractSize", "value" => "this.parseNumber (contractSize)" }, %{ "comment" => nil, "key" => "price", "value" => "this.parseNumber (price)" }, %{ "comment" => nil, "key" => "side", "value" => "side" }, %{ "comment" => nil, "key" => "baseValue", "value" => "this.parseNumber (baseValue)" }, %{ "comment" => nil, "key" => "quoteValue", "value" => "this.parseNumber (Precise.stringMul (baseValue, price))" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" } ], "name" => "parseLiquidation", "signature" => "parseLiquidation (liquidation, market: Market = undefined)", "source" => "parseLiquidation (liquidation, market: Market = undefined) {\n //\n // [\n // [\n // \"pos\",\n // 171085137, // position id\n // 1706395919788, // timestamp\n // null,\n // \"tAVAXF0:USTF0\", // market id\n // -8, // amount in contracts\n // 32.868, // base price\n // null,\n // 1,\n // 1,\n // null,\n // 33.255 // acquired price\n // ]\n // ]\n //\n const entry = liquidation[0];\n const timestamp = this.safeInteger (entry, 2);\n const marketId = this.safeString (entry, 4);\n const contracts = Precise.stringAbs (this.safeString (entry, 5));\n const contractSize = this.safeString (market, 'contractSize');\n const baseValue = Precise.stringMul (contracts, contractSize);\n const price = this.safeString (entry, 11);\n const sideFlag = this.safeInteger (entry, 8);\n const side = (sideFlag === 1) ? 'buy' : 'sell';\n return this.safeLiquidation ({\n 'info': entry,\n 'symbol': this.safeSymbol (marketId, market, undefined, 'contract'),\n 'contracts': this.parseNumber (contracts),\n 'contractSize': this.parseNumber (contractSize),\n 'price': this.parseNumber (price),\n 'side': side,\n 'baseValue': this.parseNumber (baseValue),\n 'quoteValue': this.parseNumber (Precise.stringMul (baseValue, price)),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n });\n }" }, %{ "comment" => nil, "examples" => [ "[\n [\n 1\n ]\n ]" ], "line_end" => 3787, "line_start" => 3763, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "data" }, %{ "comment" => nil, "key" => "symbol", "value" => "market['symbol']" }, %{ "comment" => nil, "key" => "type", "value" => "undefined" }, %{ "comment" => nil, "key" => "marginMode", "value" => "'isolated'" }, %{ "comment" => nil, "key" => "amount", "value" => "undefined" }, %{ "comment" => nil, "key" => "total", "value" => "undefined" }, %{ "comment" => nil, "key" => "code", "value" => "undefined" }, %{ "comment" => nil, "key" => "status", "value" => "marginStatus" }, %{ "comment" => nil, "key" => "timestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "datetime", "value" => "undefined" } ], "name" => "parseMarginModification", "signature" => "parseMarginModification (data, market = undefined): MarginModification", "source" => "parseMarginModification (data, market = undefined): MarginModification {\n //\n // setMargin\n //\n // [\n // [\n // 1\n // ]\n // ]\n //\n const marginStatusRaw = data[0];\n const marginStatus = (marginStatusRaw === 1) ? 'ok' : 'failed';\n return {\n 'info': data,\n 'symbol': market['symbol'],\n 'type': undefined,\n 'marginMode': 'isolated',\n 'amount': undefined,\n 'total': undefined,\n 'code': undefined,\n 'status': marginStatus,\n 'timestamp': undefined,\n 'datetime': undefined,\n };\n }" }, %{ "comment" => nil, "examples" => [ "[\n 1457539800000,\n 0.02594,\n 0.02594,\n 0.02594,\n 0.02594,\n 0.1\n ]" ], "line_end" => 1574, "line_start" => 1555, "mappings" => [], "name" => "parseOHLCV", "signature" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV", "source" => "parseOHLCV (ohlcv, market: Market = undefined): OHLCV {\n //\n // [\n // 1457539800000,\n // 0.02594,\n // 0.02594,\n // 0.02594,\n // 0.02594,\n // 0.1\n // ]\n //\n return [\n this.safeInteger (ohlcv, 0),\n this.safeNumber (ohlcv, 1),\n this.safeNumber (ohlcv, 3),\n this.safeNumber (ohlcv, 4),\n this.safeNumber (ohlcv, 2),\n this.safeNumber (ohlcv, 5),\n ];\n }" }, %{ "comment" => nil, "examples" => [ "[\n \"tXRPF0:USTF0\", // market id\n 1706256986000, // millisecond timestamp\n null,\n 0.512705, // derivative mid price\n 0.512395, // underlying spot mid price\n null,\n 37671483.04, // insurance fund balance\n null,\n 1706284800000, // timestamp of next funding\n 0.00002353, // accrued funding for next period\n 317, // next funding step\n null,\n 0, // current funding\n null,\n null,\n 0.5123016, // mark price\n null,\n null,\n 2233562.03115, // open interest in contracts\n null,\n null,\n null,\n 0.0005, // average spread without funding payment\n 0.0025 // funding payment cap\n ]", "[\n 1706295191000, // timestamp\n null,\n 42152.425382, // derivative mid price\n 42133, // spot mid price\n null,\n 37671589.7853521, // insurance fund balance\n null,\n 1706313600000, // timestamp of next funding\n 0.00018734, // accrued funding for next period\n 3343, // next funding step\n null,\n 0.00007587, // current funding\n null,\n null,\n 42134.1, // mark price\n null,\n null,\n 5775.20348804, // open interest number of contracts\n null,\n null,\n null,\n 0.0005, // average spread without funding payment\n 0.0025 // funding payment cap\n ]" ], "line_end" => 3634, "line_start" => 3563, "mappings" => [ %{ "comment" => nil, "key" => "symbol", "value" => "this.safeSymbol (marketId, market, undefined, 'swap')" }, %{ "comment" => nil, "key" => "openInterestAmount", "value" => "this.safeNumber (interest, openInterestIndex)" }, %{ "comment" => nil, "key" => "openInterestValue", "value" => "undefined" }, %{ "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 // fetchOpenInterest:\n //\n // [\n // \"tXRPF0:USTF0\", // market id\n // 1706256986000, // millisecond timestamp\n // null,\n // 0.512705, // derivative mid price\n // 0.512395, // underlying spot mid price\n // null,\n // 37671483.04, // insurance fund balance\n // null,\n // 1706284800000, // timestamp of next funding\n // 0.00002353, // accrued funding for next period\n // 317, // next funding step\n // null,\n // 0, // current funding\n // null,\n // null,\n // 0.5123016, // mark price\n // null,\n // null,\n // 2233562.03115, // open interest in contracts\n // null,\n // null,\n // null,\n // 0.0005, // average spread without funding payment\n // 0.0025 // funding payment cap\n // ]\n //\n // fetchOpenInterestHistory:\n //\n // [\n // 1706295191000, // timestamp\n // null,\n // 42152.425382, // derivative mid price\n // 42133, // spot mid price\n // null,\n // 37671589.7853521, // insurance fund balance\n // null,\n // 1706313600000, // timestamp of next funding\n // 0.00018734, // accrued funding for next period\n // 3343, // next funding step\n // null,\n // 0.00007587, // current funding\n // null,\n // null,\n // 42134.1, // mark price\n // null,\n // null,\n // 5775.20348804, // open interest number of contracts\n // null,\n // null,\n // null,\n // 0.0005, // average spread without funding payment\n // 0.0025 // funding payment cap\n // ]\n //\n const interestLength = interest.length;\n const openInterestIndex = (interestLength === 23) ? 17 : 18;\n const timestamp = this.safeInteger (interest, 1);\n const marketId = this.safeString (interest, 0);\n return this.safeOpenInterest ({\n 'symbol': this.safeSymbol (marketId, market, undefined, 'swap'),\n 'openInterestAmount': this.safeNumber (interest, openInterestIndex),\n 'openInterestValue': undefined,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'info': interest,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 1686, "line_start" => 1621, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "orderList" }, %{ "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" => "side", "value" => "side" }, %{ "comment" => nil, "key" => "price", "value" => "price" }, %{ "comment" => nil, "key" => "triggerPrice", "value" => "triggerPrice" }, %{ "comment" => nil, "key" => "amount", "value" => "amount" }, %{ "comment" => nil, "key" => "cost", "value" => "undefined" }, %{ "comment" => nil, "key" => "average", "value" => "average" }, %{ "comment" => nil, "key" => "filled", "value" => "undefined" }, %{ "comment" => nil, "key" => "remaining", "value" => "remaining" }, %{ "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 const orderList = this.safeList (order, 'result');\n const id = this.safeString (orderList, 0);\n const marketId = this.safeString (orderList, 3);\n const symbol = this.safeSymbol (marketId);\n // https://github.com/ccxt/ccxt/issues/6686\n // const timestamp = this.safeTimestamp (orderObject, 5);\n const timestamp = this.safeInteger (orderList, 5);\n const remaining = Precise.stringAbs (this.safeString (orderList, 6));\n const signedAmount = this.safeString (orderList, 7);\n const amount = Precise.stringAbs (signedAmount);\n const side = Precise.stringLt (signedAmount, '0') ? 'sell' : 'buy';\n const orderType = this.safeString (orderList, 8);\n const type = this.safeString (this.safeValue (this.options, 'exchangeTypes'), orderType);\n const timeInForce = this.parseTimeInForce (orderType);\n const rawFlags = this.safeString (orderList, 12);\n const flags = this.parseOrderFlags (rawFlags);\n let postOnly = false;\n if (flags !== undefined) {\n for (let i = 0; i < flags.length; i++) {\n if (flags[i] === 'postOnly') {\n postOnly = true;\n }\n }\n }\n let price = this.safeString (orderList, 16);\n let triggerPrice = undefined;\n if ((orderType === 'EXCHANGE STOP') || (orderType === 'EXCHANGE STOP LIMIT')) {\n price = undefined;\n triggerPrice = this.safeString (orderList, 16);\n if (orderType === 'EXCHANGE STOP LIMIT') {\n price = this.safeString (orderList, 19);\n }\n }\n let status = undefined;\n const statusString = this.safeString (orderList, 13);\n if (statusString !== undefined) {\n const parts = statusString.split (' @ ');\n status = this.parseOrderStatus (this.safeString (parts, 0));\n }\n const average = this.safeString (orderList, 17);\n const clientOrderId = this.safeString (orderList, 2);\n return this.safeOrder ({\n 'info': orderList,\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 'side': side,\n 'price': price,\n 'triggerPrice': triggerPrice,\n 'amount': amount,\n 'cost': undefined,\n 'average': average,\n 'filled': undefined,\n 'remaining': remaining,\n 'status': status,\n 'fee': undefined,\n 'trades': undefined,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 1609, "line_start" => 1597, "mappings" => [], "name" => "parseOrderFlags", "signature" => "parseOrderFlags (flags)", "source" => "parseOrderFlags (flags) {\n // flags can be added to each other...\n const flagValues: Dict = {\n '1024': [ 'reduceOnly' ],\n '4096': [ 'postOnly' ],\n '5120': [ 'reduceOnly', 'postOnly' ],\n // '64': 'hidden', // The hidden order option ensures an order does not appear in the order book\n // '512': 'close', // Close position if position present.\n // '16384': 'OCO', // The one cancels other order option allows you to place a pair of orders stipulating that if one order is executed fully or partially, then the other is automatically canceled.\n // '524288': 'No Var Rates' // Excludes variable rate funding offers from matching against this order, if on margin\n };\n return this.safeValue (flagValues, flags, undefined);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 1595, "line_start" => 1576, "mappings" => [ %{ "comment" => nil, "key" => "ACTIVE", "value" => "'open'" }, %{ "comment" => nil, "key" => "PARTIALLY", "value" => "'open'" }, %{ "comment" => nil, "key" => "EXECUTED", "value" => "'closed'" }, %{ "comment" => nil, "key" => "CANCELED", "value" => "'canceled'" }, %{ "comment" => nil, "key" => "INSUFFICIENT", "value" => "'canceled'" }, %{ "comment" => nil, "key" => "POSTONLY CANCELED", "value" => "'canceled'" }, %{ "comment" => nil, "key" => "RSN_DUST", "value" => "'rejected'" }, %{ "comment" => nil, "key" => "RSN_PAUSE", "value" => "'rejected'" }, %{ "comment" => nil, "key" => "IOC CANCELED", "value" => "'canceled'" }, %{ "comment" => nil, "key" => "FILLORKILL CANCELED", "value" => "'canceled'" } ], "name" => "parseOrderStatus", "signature" => "parseOrderStatus (status: Str)", "source" => "parseOrderStatus (status: Str) {\n if (status === undefined) {\n return status;\n }\n const parts = status.split (' ');\n const state = this.safeString (parts, 0);\n const statuses: Dict = {\n 'ACTIVE': 'open',\n 'PARTIALLY': 'open',\n 'EXECUTED': 'closed',\n 'CANCELED': 'canceled',\n 'INSUFFICIENT': 'canceled',\n 'POSTONLY CANCELED': 'canceled',\n 'RSN_DUST': 'rejected',\n 'RSN_PAUSE': 'rejected',\n 'IOC CANCELED': 'canceled',\n 'FILLORKILL CANCELED': 'canceled',\n };\n return this.safeString (statuses, state, status);\n }" }, %{ "comment" => nil, "examples" => [ "[\n \"tBTCUSD\", // SYMBOL\n \"ACTIVE\", // STATUS\n 0.0195, // AMOUNT\n 8565.0267019, // BASE_PRICE\n 0, // MARGIN_FUNDING\n 0, // MARGIN_FUNDING_TYPE\n -0.33455568705000516, // PL\n -0.0003117550117425625, // PL_PERC\n 7045.876419249083, // PRICE_LIQ\n 3.0673001895895604, // LEVERAGE\n null, // _PLACEHOLDER\n 142355652, // POSITION_ID\n 1574002216000, // MTS_CREATE\n 1574002216000, // MTS_UPDATE\n null, // _PLACEHOLDER\n 0, // TYPE\n null, // _PLACEHOLDER\n 0, // COLLATERAL\n 0, // COLLATERAL_MIN\n // META\n {\n \"reason\": \"TRADE\",\n \"order_id\": 34271018124,\n \"liq_stage\": null,\n \"trade_price\": \"8565.0267019\",\n \"trade_amount\": \"0.0195\",\n \"order_id_oppo\": 34277498022\n }\n ]" ], "line_end" => 2964, "line_start" => 2895, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "positionList" }, %{ "comment" => nil, "key" => "id", "value" => "this.safeString (positionList, 11)" }, %{ "comment" => nil, "key" => "symbol", "value" => "this.safeSymbol (marketId, market)" }, %{ "comment" => nil, "key" => "notional", "value" => "this.parseNumber (amount)" }, %{ "comment" => nil, "key" => "marginMode", "value" => "'isolated'" }, %{ "comment" => nil, "key" => "entryPrice", "value" => "this.safeNumber (positionList, 3)" }, %{ "comment" => nil, "key" => "unrealizedPnl", "value" => "this.safeNumber (positionList, 6)" }, %{ "comment" => nil, "key" => "percentage", "value" => "this.safeNumber (positionList, 7)" }, %{ "comment" => nil, "key" => "contracts", "value" => "undefined" }, %{ "comment" => nil, "key" => "contractSize", "value" => "undefined" }, %{ "comment" => nil, "key" => "markPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "lastPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "side", "value" => "Precise.stringGt (amount, '0') ? 'long' : 'short'" }, %{ "comment" => nil, "key" => "hedged", "value" => "undefined" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "lastUpdateTimestamp", "value" => "this.safeInteger (positionList, 13)" }, %{ "comment" => nil, "key" => "maintenanceMargin", "value" => "this.safeNumber (positionList, 18)" }, %{ "comment" => nil, "key" => "maintenanceMarginPercentage", "value" => "undefined" }, %{ "comment" => nil, "key" => "collateral", "value" => "this.safeNumber (positionList, 17)" }, %{ "comment" => nil, "key" => "initialMargin", "value" => "this.parseNumber (Precise.stringMul (tradeAmount, tradePrice))" }, %{ "comment" => nil, "key" => "initialMarginPercentage", "value" => "undefined" }, %{ "comment" => nil, "key" => "leverage", "value" => "this.safeNumber (positionList, 9)" }, %{ "comment" => nil, "key" => "marginRatio", "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 // [\n // \"tBTCUSD\", // SYMBOL\n // \"ACTIVE\", // STATUS\n // 0.0195, // AMOUNT\n // 8565.0267019, // BASE_PRICE\n // 0, // MARGIN_FUNDING\n // 0, // MARGIN_FUNDING_TYPE\n // -0.33455568705000516, // PL\n // -0.0003117550117425625, // PL_PERC\n // 7045.876419249083, // PRICE_LIQ\n // 3.0673001895895604, // LEVERAGE\n // null, // _PLACEHOLDER\n // 142355652, // POSITION_ID\n // 1574002216000, // MTS_CREATE\n // 1574002216000, // MTS_UPDATE\n // null, // _PLACEHOLDER\n // 0, // TYPE\n // null, // _PLACEHOLDER\n // 0, // COLLATERAL\n // 0, // COLLATERAL_MIN\n // // META\n // {\n // \"reason\": \"TRADE\",\n // \"order_id\": 34271018124,\n // \"liq_stage\": null,\n // \"trade_price\": \"8565.0267019\",\n // \"trade_amount\": \"0.0195\",\n // \"order_id_oppo\": 34277498022\n // }\n // ]\n //\n const positionList = this.safeList (position, 'result');\n const marketId = this.safeString (positionList, 0);\n const amount = this.safeString (positionList, 2);\n const timestamp = this.safeInteger (positionList, 12);\n const meta = this.safeString (positionList, 19);\n const tradePrice = this.safeString (meta, 'trade_price');\n const tradeAmount = this.safeString (meta, 'trade_amount');\n return this.safePosition ({\n 'info': positionList,\n 'id': this.safeString (positionList, 11),\n 'symbol': this.safeSymbol (marketId, market),\n 'notional': this.parseNumber (amount),\n 'marginMode': 'isolated', // derivatives use isolated, margin uses cross, https://support.bitfinex.com/hc/en-us/articles/360035475374-Derivatives-Trading-on-Bitfinex\n 'liquidationPrice': this.safeNumber (positionList, 8),\n 'entryPrice': this.safeNumber (positionList, 3),\n 'unrealizedPnl': this.safeNumber (positionList, 6),\n 'percentage': this.safeNumber (positionList, 7),\n 'contracts': undefined,\n 'contractSize': undefined,\n 'markPrice': undefined,\n 'lastPrice': undefined,\n 'side': Precise.stringGt (amount, '0') ? 'long' : 'short',\n 'hedged': undefined,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'lastUpdateTimestamp': this.safeInteger (positionList, 13),\n 'maintenanceMargin': this.safeNumber (positionList, 18),\n 'maintenanceMarginPercentage': undefined,\n 'collateral': this.safeNumber (positionList, 17),\n 'initialMargin': this.parseNumber (Precise.stringMul (tradeAmount, tradePrice)),\n 'initialMarginPercentage': undefined,\n 'leverage': this.safeNumber (positionList, 9),\n 'marginRatio': undefined,\n 'stopLossPrice': undefined,\n 'takeProfitPrice': undefined,\n });\n }" }, %{ "comment" => nil, "examples" => [ "[\n SYMBOL, // this index is not present in singular-ticker\n BID,\n BID_SIZE,\n ASK,\n ASK_SIZE,\n DAILY_CHANGE,\n DAILY_CHANGE_RELATIVE,\n LAST_PRICE,\n VOLUME,\n HIGH,\n LOW\n ]", "[\n SYMBOL, // this index is not present in singular-ticker\n FRR,\n BID,\n BID_PERIOD,\n BID_SIZE,\n ASK,\n ASK_PERIOD,\n ASK_SIZE,\n DAILY_CHANGE,\n DAILY_CHANGE_RELATIVE,\n LAST_PRICE,\n VOLUME,\n HIGH,\n LOW,\n _PLACEHOLDER,\n _PLACEHOLDER,\n FRR_AMOUNT_AVAILABLE\n ]" ], "line_end" => 1287, "line_start" => 1180, "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" => "bid" }, %{ "comment" => nil, "key" => "bidVolume", "value" => "undefined" }, %{ "comment" => nil, "key" => "ask", "value" => "ask" }, %{ "comment" => nil, "key" => "askVolume", "value" => "undefined" }, %{ "comment" => nil, "key" => "vwap", "value" => "undefined" }, %{ "comment" => nil, "key" => "open", "value" => "undefined" }, %{ "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" => "volume" }, %{ "comment" => nil, "key" => "quoteVolume", "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 // on trading pairs (ex. tBTCUSD)\n //\n // [\n // SYMBOL, // this index is not present in singular-ticker\n // BID,\n // BID_SIZE,\n // ASK,\n // ASK_SIZE,\n // DAILY_CHANGE,\n // DAILY_CHANGE_RELATIVE,\n // LAST_PRICE,\n // VOLUME,\n // HIGH,\n // LOW\n // ]\n //\n //\n // on funding currencies (ex. fUSD)\n //\n // [\n // SYMBOL, // this index is not present in singular-ticker\n // FRR,\n // BID,\n // BID_PERIOD,\n // BID_SIZE,\n // ASK,\n // ASK_PERIOD,\n // ASK_SIZE,\n // DAILY_CHANGE,\n // DAILY_CHANGE_RELATIVE,\n // LAST_PRICE,\n // VOLUME,\n // HIGH,\n // LOW,\n // _PLACEHOLDER,\n // _PLACEHOLDER,\n // FRR_AMOUNT_AVAILABLE\n // ]\n //\n const length = ticker.length;\n const isFetchTicker = (length === 10) || (length === 16);\n let symbol: Str = undefined;\n let minusIndex = 0;\n let isFundingCurrency = false;\n if (isFetchTicker) {\n minusIndex = 1;\n isFundingCurrency = (length === 16);\n } else {\n const marketId = this.safeString (ticker, 0);\n market = this.safeMarket (marketId, market);\n isFundingCurrency = (length === 17);\n }\n symbol = this.safeSymbol (undefined, market);\n let last: Str = undefined;\n let bid: Str = undefined;\n let ask: Str = undefined;\n let change: Str = undefined;\n let percentage: Str = undefined;\n let volume: Str = undefined;\n let high: Str = undefined;\n let low: Str = undefined;\n if (isFundingCurrency) {\n // per api docs, they are different array type\n last = this.safeString (ticker, 10 - minusIndex);\n bid = this.safeString (ticker, 2 - minusIndex);\n ask = this.safeString (ticker, 5 - minusIndex);\n change = this.safeString (ticker, 8 - minusIndex);\n percentage = this.safeString (ticker, 9 - minusIndex);\n volume = this.safeString (ticker, 11 - minusIndex);\n high = this.safeString (ticker, 12 - minusIndex);\n low = this.safeString (ticker, 13 - minusIndex);\n } else {\n // on trading pairs (ex. tBTCUSD or tHMSTR:USD)\n last = this.safeString (ticker, 7 - minusIndex);\n bid = this.safeString (ticker, 1 - minusIndex);\n ask = this.safeString (ticker, 3 - minusIndex);\n change = this.safeString (ticker, 5 - minusIndex);\n percentage = this.safeString (ticker, 6 - minusIndex);\n percentage = Precise.stringMul (percentage, '100');\n volume = this.safeString (ticker, 8 - minusIndex);\n high = this.safeString (ticker, 9 - minusIndex);\n low = this.safeString (ticker, 10 - minusIndex);\n }\n return this.safeTicker ({\n 'symbol': symbol,\n 'timestamp': undefined,\n 'datetime': undefined,\n 'high': high,\n 'low': low,\n 'bid': bid,\n 'bidVolume': undefined,\n 'ask': ask,\n 'askVolume': undefined,\n 'vwap': undefined,\n 'open': undefined,\n 'close': last,\n 'last': last,\n 'previousClose': undefined,\n 'change': change,\n 'percentage': percentage,\n 'average': undefined,\n 'baseVolume': volume,\n 'quoteVolume': undefined,\n 'info': ticker,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 1619, "line_start" => 1611, "mappings" => [], "name" => "parseTimeInForce", "signature" => "parseTimeInForce (orderType)", "source" => "parseTimeInForce (orderType) {\n const orderTypes: Dict = {\n 'EXCHANGE IOC': 'IOC',\n 'EXCHANGE FOK': 'FOK',\n 'IOC': 'IOC', // Margin\n 'FOK': 'FOK', // Margin\n };\n return this.safeString (orderTypes, orderType, 'GTC');\n }" }, %{ "comment" => nil, "examples" => [ "[\n ID,\n MTS, // timestamp\n AMOUNT,\n PRICE\n ]", "[\n ID,\n PAIR,\n MTS_CREATE,\n ORDER_ID,\n EXEC_AMOUNT,\n EXEC_PRICE,\n ORDER_TYPE,\n ORDER_PRICE,\n MAKER,\n FEE,\n FEE_CURRENCY,\n ...\n ]" ], "line_end" => 1452, "line_start" => 1370, "mappings" => [ %{ "comment" => nil, "key" => "id", "value" => "id" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "order", "value" => "orderId" }, %{ "comment" => nil, "key" => "side", "value" => "side" }, %{ "comment" => nil, "key" => "type", "value" => "type" }, %{ "comment" => nil, "key" => "takerOrMaker", "value" => "takerOrMaker" }, %{ "comment" => nil, "key" => "price", "value" => "priceString" }, %{ "comment" => nil, "key" => "amount", "value" => "amountString" }, %{ "comment" => nil, "key" => "cost", "value" => "undefined" }, %{ "comment" => nil, "key" => "fee", "value" => "fee" }, %{ "comment" => nil, "key" => "info", "value" => "tradeList" }, %{ "comment" => nil, "key" => "cost", "value" => "feeCostString" }, %{ "comment" => nil, "key" => "currency", "value" => "feeCurrency" } ], "name" => "parseTrade", "signature" => "parseTrade (trade: Dict, market: Market = undefined): Trade", "source" => "parseTrade (trade: Dict, market: Market = undefined): Trade {\n //\n // fetchTrades (public)\n //\n // [\n // ID,\n // MTS, // timestamp\n // AMOUNT,\n // PRICE\n // ]\n //\n // fetchMyTrades (private)\n //\n // [\n // ID,\n // PAIR,\n // MTS_CREATE,\n // ORDER_ID,\n // EXEC_AMOUNT,\n // EXEC_PRICE,\n // ORDER_TYPE,\n // ORDER_PRICE,\n // MAKER,\n // FEE,\n // FEE_CURRENCY,\n // ...\n // ]\n //\n const tradeList = this.safeList (trade, 'result', []);\n const tradeLength = tradeList.length;\n const isPrivate = (tradeLength > 5);\n const id = this.safeString (tradeList, 0);\n const amountIndex = isPrivate ? 4 : 2;\n let side = undefined;\n let amountString = this.safeString (tradeList, amountIndex);\n const priceIndex = isPrivate ? 5 : 3;\n const priceString = this.safeString (tradeList, priceIndex);\n if (amountString[0] === '-') {\n side = 'sell';\n amountString = Precise.stringAbs (amountString);\n } else {\n side = 'buy';\n }\n let orderId = undefined;\n let takerOrMaker = undefined;\n let type = undefined;\n let fee = undefined;\n let symbol = this.safeSymbol (undefined, market);\n const timestampIndex = isPrivate ? 2 : 1;\n const timestamp = this.safeInteger (tradeList, timestampIndex);\n if (isPrivate) {\n const marketId = tradeList[1];\n symbol = this.safeSymbol (marketId);\n orderId = this.safeString (tradeList, 3);\n const maker = this.safeInteger (tradeList, 8);\n takerOrMaker = (maker === 1) ? 'maker' : 'taker';\n let feeCostString = this.safeString (tradeList, 9);\n feeCostString = Precise.stringNeg (feeCostString);\n const feeCurrencyId = this.safeString (tradeList, 10);\n const feeCurrency = this.safeCurrencyCode (feeCurrencyId);\n fee = {\n 'cost': feeCostString,\n 'currency': feeCurrency,\n };\n const orderType = tradeList[6];\n type = this.safeString (this.options['exchangeTypes'], orderType);\n }\n return this.safeTrade ({\n 'id': id,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'symbol': symbol,\n 'order': orderId,\n 'side': side,\n 'type': type,\n 'takerOrMaker': takerOrMaker,\n 'price': priceString,\n 'amount': amountString,\n 'cost': undefined,\n 'fee': fee,\n 'info': tradeList,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [ "[\n 1582271520931, // MTS Millisecond Time Stamp of the update\n \"acc_wd-req\", // TYPE Purpose of notification \"acc_wd-req\" account withdrawal request\n null, // MESSAGE_ID unique ID of the message\n null, // not documented\n [\n 0, // WITHDRAWAL_ID Unique Withdrawal ID\n null, // PLACEHOLDER\n \"bitcoin\", // METHOD Method of withdrawal\n null, // PAYMENT_ID Payment ID if relevant\n \"exchange\", // WALLET Sending wallet\n 1, // AMOUNT Amount of Withdrawal less fee\n null, // PLACEHOLDER\n null, // PLACEHOLDER\n 0.0004, // WITHDRAWAL_FEE Fee on withdrawal\n ],\n null, // CODE null or integer Work in progress\n \"SUCCESS\", // STATUS Status of the notification, it may vary over time SUCCESS, ERROR, FAILURE\n \"Invalid bitcoin address (abcdef)\", // TEXT Text of the notification\n ]", "[\n 13293039, // ID\n \"ETH\", // CURRENCY\n \"ETHEREUM\", // CURRENCY_NAME\n null,\n null,\n 1574175052000, // MTS_STARTED\n 1574181326000, // MTS_UPDATED\n null,\n null,\n \"CANCELED\", // STATUS\n null,\n null,\n -0.24, // AMOUNT, negative for withdrawals\n -0.00135, // FEES\n null,\n null,\n \"0x38110e0Fc932CB2BE...........\", // DESTINATION_ADDRESS\n null,\n null,\n null,\n \"0x523ec8945500.....................................\", // TRANSACTION_ID\n \"Purchase of 100 pizzas\", // WITHDRAW_TRANSACTION_NOTE, might also be: null\n ]" ], "line_end" => 2577, "line_start" => 2438, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "transaction" }, %{ "comment" => nil, "key" => "id", "value" => "id" }, %{ "comment" => nil, "key" => "txid", "value" => "txid" }, %{ "comment" => nil, "key" => "type", "value" => "type" }, %{ "comment" => nil, "key" => "currency", "value" => "code" }, %{ "comment" => nil, "key" => "network", "value" => "network" }, %{ "comment" => nil, "key" => "amount", "value" => "this.parseNumber (amount)" }, %{ "comment" => nil, "key" => "status", "value" => "status" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "address", "value" => "addressTo" }, %{ "comment" => nil, "key" => "addressTo", "value" => "addressTo" }, %{ "comment" => nil, "key" => "tag", "value" => "tag" }, %{ "comment" => nil, "key" => "tagTo", "value" => "tag" }, %{ "comment" => nil, "key" => "updated", "value" => "updated" }, %{ "comment" => nil, "key" => "comment", "value" => "comment" }, %{ "comment" => nil, "key" => "internal", "value" => "undefined" }, %{ "comment" => nil, "key" => "fee", "value" => "{\n 'currency': code,\n 'cost': this.parseNumber (feeCost),\n 'rate': undefined,\n }" } ], "name" => "parseTransaction", "signature" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction", "source" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n //\n // withdraw\n //\n // [\n // 1582271520931, // MTS Millisecond Time Stamp of the update\n // \"acc_wd-req\", // TYPE Purpose of notification \"acc_wd-req\" account withdrawal request\n // null, // MESSAGE_ID unique ID of the message\n // null, // not documented\n // [\n // 0, // WITHDRAWAL_ID Unique Withdrawal ID\n // null, // PLACEHOLDER\n // \"bitcoin\", // METHOD Method of withdrawal\n // null, // PAYMENT_ID Payment ID if relevant\n // \"exchange\", // WALLET Sending wallet\n // 1, // AMOUNT Amount of Withdrawal less fee\n // null, // PLACEHOLDER\n // null, // PLACEHOLDER\n // 0.0004, // WITHDRAWAL_FEE Fee on withdrawal\n // ],\n // null, // CODE null or integer Work in progress\n // \"SUCCESS\", // STATUS Status of the notification, it may vary over time SUCCESS, ERROR, FAILURE\n // \"Invalid bitcoin address (abcdef)\", // TEXT Text of the notification\n // ]\n //\n // fetchDepositsWithdrawals\n //\n // [\n // 13293039, // ID\n // \"ETH\", // CURRENCY\n // \"ETHEREUM\", // CURRENCY_NAME\n // null,\n // null,\n // 1574175052000, // MTS_STARTED\n // 1574181326000, // MTS_UPDATED\n // null,\n // null,\n // \"CANCELED\", // STATUS\n // null,\n // null,\n // -0.24, // AMOUNT, negative for withdrawals\n // -0.00135, // FEES\n // null,\n // null,\n // \"0x38110e0Fc932CB2BE...........\", // DESTINATION_ADDRESS\n // null,\n // null,\n // null,\n // \"0x523ec8945500.....................................\", // TRANSACTION_ID\n // \"Purchase of 100 pizzas\", // WITHDRAW_TRANSACTION_NOTE, might also be: null\n // ]\n //\n const transactionLength = transaction.length;\n let timestamp = undefined;\n let updated = undefined;\n let code = undefined;\n let amount = undefined;\n let id = undefined;\n let status = undefined;\n let tag = undefined;\n let type = undefined;\n let feeCost = undefined;\n let txid = undefined;\n let addressTo = undefined;\n let network = undefined;\n let comment = undefined;\n if (transactionLength === 8) {\n const data = this.safeValue (transaction, 4, []);\n timestamp = this.safeInteger (transaction, 0);\n if (currency !== undefined) {\n code = currency['code'];\n }\n feeCost = this.safeString (data, 8);\n if (feeCost !== undefined) {\n feeCost = Precise.stringAbs (feeCost);\n }\n amount = this.safeNumber (data, 5);\n id = this.safeInteger (data, 0);\n status = 'ok';\n if (id === 0) {\n id = undefined;\n status = 'failed';\n }\n tag = this.safeString (data, 3);\n type = 'withdrawal';\n const networkId = this.safeString (data, 2);\n network = this.networkIdToCode (networkId.toUpperCase ()); // withdraw returns in lowercase\n } else if (transactionLength === 22) {\n id = this.safeString (transaction, 0);\n const currencyId = this.safeString (transaction, 1);\n code = this.safeCurrencyCode (currencyId, currency);\n const networkId = this.safeString (transaction, 2);\n network = this.networkIdToCode (networkId);\n timestamp = this.safeInteger (transaction, 5);\n updated = this.safeInteger (transaction, 6);\n status = this.parseTransactionStatus (this.safeString (transaction, 9));\n const signedAmount = this.safeString (transaction, 12);\n amount = Precise.stringAbs (signedAmount);\n if (signedAmount !== undefined) {\n if (Precise.stringLt (signedAmount, '0')) {\n type = 'withdrawal';\n } else {\n type = 'deposit';\n }\n }\n feeCost = this.safeString (transaction, 13);\n if (feeCost !== undefined) {\n feeCost = Precise.stringAbs (feeCost);\n }\n addressTo = this.safeString (transaction, 16);\n txid = this.safeString (transaction, 20);\n comment = this.safeString (transaction, 21);\n }\n return {\n 'info': transaction,\n 'id': id,\n 'txid': txid,\n 'type': type,\n 'currency': code,\n 'network': network,\n 'amount': this.parseNumber (amount),\n 'status': status,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'address': addressTo, // this is actually the tag for XRP transfers (the address is missing)\n 'addressFrom': undefined,\n 'addressTo': addressTo,\n 'tag': tag, // refix it properly for the tag from description\n 'tagFrom': undefined,\n 'tagTo': tag,\n 'updated': updated,\n 'comment': comment,\n 'internal': undefined,\n 'fee': {\n 'currency': code,\n 'cost': this.parseNumber (feeCost),\n 'rate': undefined,\n },\n } as Transaction;\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2436, "line_start" => 2421, "mappings" => [], "name" => "parseTransactionStatus", "signature" => "parseTransactionStatus (status: Str)", "source" => "parseTransactionStatus (status: Str) {\n const statuses: Dict = {\n 'SUCCESS': 'ok',\n 'COMPLETED': 'ok',\n 'ERROR': 'failed',\n 'FAILURE': 'failed',\n 'CANCELED': 'canceled',\n 'PENDING APPROVAL': 'pending',\n 'PENDING': 'pending',\n 'PENDING REVIEW': 'pending',\n 'PENDING CANCELLATION': 'pending',\n 'SENDING': 'pending',\n 'USER APPROVED': 'pending',\n };\n return this.safeString (statuses, status, status);\n }" }, %{ "comment" => nil, "examples" => [ "[\n 1616451183763,\n \"acc_tf\",\n null,\n null,\n [\n 1616451183763,\n \"exchange\",\n \"margin\",\n null,\n \"UST\",\n \"UST\",\n null,\n 1\n ],\n null,\n \"SUCCESS\",\n \"1.0 Tether USDt transfered from Exchange to Margin\"\n ]" ], "line_end" => 1097, "line_start" => 1055, "mappings" => [ %{ "comment" => nil, "key" => "id", "value" => "undefined" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "status", "value" => "this.parseTransferStatus (status)" }, %{ "comment" => nil, "key" => "amount", "value" => "this.safeNumber (info, 7)" }, %{ "comment" => nil, "key" => "currency", "value" => "this.safeCurrencyCode (currencyId, currency)" }, %{ "comment" => nil, "key" => "fromAccount", "value" => "fromAccount" }, %{ "comment" => nil, "key" => "toAccount", "value" => "toAccount" }, %{ "comment" => nil, "key" => "info", "value" => "result" } ], "name" => "parseTransfer", "signature" => "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry", "source" => "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n //\n // transfer\n //\n // [\n // 1616451183763,\n // \"acc_tf\",\n // null,\n // null,\n // [\n // 1616451183763,\n // \"exchange\",\n // \"margin\",\n // null,\n // \"UST\",\n // \"UST\",\n // null,\n // 1\n // ],\n // null,\n // \"SUCCESS\",\n // \"1.0 Tether USDt transfered from Exchange to Margin\"\n // ]\n //\n const result = this.safeList (transfer, 'result');\n const timestamp = this.safeInteger (result, 0);\n const info = this.safeValue (result, 4);\n const fromAccount = this.safeString (info, 1);\n const toAccount = this.safeString (info, 2);\n const currencyId = this.safeString (info, 5);\n const status = this.safeString (result, 6);\n return {\n 'id': undefined,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'status': this.parseTransferStatus (status),\n 'amount': this.safeNumber (info, 7),\n 'currency': this.safeCurrencyCode (currencyId, currency),\n 'fromAccount': fromAccount,\n 'toAccount': toAccount,\n 'info': result,\n };\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 1106, "line_start" => 1099, "mappings" => [], "name" => "parseTransferStatus", "signature" => "parseTransferStatus (status: Str): Str", "source" => "parseTransferStatus (status: Str): Str {\n const statuses: Dict = {\n 'SUCCESS': 'ok',\n 'ERROR': 'failed',\n 'FAILURE': 'failed',\n };\n return this.safeString (statuses, status, status);\n }" } ], path_prefix: "", pro: true, quote_json_numbers: nil, rate_limits: %{ interval_ms: 250, period: 1000, requests: 4, rolling_window_size: 60000 }, raw_endpoints: %{ private: [ %{ auth: false, cost: 2.7, method: :post, path: "/auth/w/position/increase:" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/positions/audit" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/wallets" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/audit/hist" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/logins/hist" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/w/token" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/w/alert/set" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/funding/offers/{symbol}/hist" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/info/funding/{key}" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/funding/loans/hist" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/w/alert/price:{symbol}:{price}/del" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/permissions" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/w/funding/offer/cancel/all" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/order/{symbol}:{id}/trades" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/funding/trades/{symbol}/hist" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/w/settings/del" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/info/margin/sym_all" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/w/order/multi" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/w/position/claim" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/w/funding/auto" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/info/user" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/funding/loans/{symbol}" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/w/funding/offer/submit" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/w/settings/set" }, %{ auth: false, cost: 24, method: :post, path: "/auth/w/withdraw" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/position/increase/info" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/funding/credits/{symbol}" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/w/order/cancel" }, %{ auth: false, cost: 24, method: :post, path: "/auth/w/deposit/address" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/movements/{currency}/hist" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/funding/offers/{symbol}" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/positions" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/wallets/hist" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/settings" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/funding/credits/{symbol}/hist" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/funding/credits" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/orders/{symbol}" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/info/margin/{key}" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/orders/{symbol}/hist" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/w/funding/close" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/pulse/hist" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/funding/loans" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/calc/order/avail" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/positions/snap" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/ledgers/hist" }, %{ auth: false, cost: 5.34, method: :post, path: "/auth/r/alerts" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/positions/hist" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/w/order/submit" }, %{ auth: false, cost: 16, method: :post, path: "/auth/w/pulse/add" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/w/alert/{type}:{symbol}:{price}/del" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/info/margin/base" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/funding/offers/hist" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/w/deriv/collateral/set" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/funding/credits/hist" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/movements/hist" }, %{ auth: false, cost: 24, method: :post, path: "/auth/w/deposit/invoice" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/w/transfer" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/orders" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/w/order/cancel/multi" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/ledgers/{currency}/hist" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/trades/hist" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/summary" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/trades/{symbol}/hist" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/w/deriv/collateral/limits" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/w/funding/keep" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/w/order/update" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/w/funding/offer/cancel" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/funding/offers" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/orders/hist" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/funding/loans/{symbol}/hist" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/r/funding/trades/hist" }, %{ auth: false, cost: 2.7, method: :post, path: "/auth/w/pulse/del" } ], public: [ %{ auth: false, cost: 1, method: :get, path: "/ext/vasps" }, %{ auth: false, cost: 1, method: :get, path: "/book/{symbol}/R0" }, %{ auth: false, cost: 2.7, method: :get, path: "/pulse/hist" }, %{ auth: false, cost: 2.7, method: :get, path: "/pulse/profile/{nickname}" }, %{ auth: false, cost: 2.7, method: :get, path: "/tickers" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/pub:list:competitions" }, %{ auth: false, cost: 2.7, method: :get, path: "/trades/{symbol}/hist" }, %{ auth: false, cost: 1, method: :get, path: "/book/{symbol}/P1" }, %{ auth: false, cost: 2.7, method: :get, path: "/candles/trade:{timeframe}:{symbol}/hist" }, %{ auth: false, cost: 2.7, method: :get, path: "/stats1/{key}:{size}:{symbol}:short/last" }, %{ auth: false, cost: 80, method: :get, path: "/liquidations/hist" }, %{ auth: false, cost: 1, method: :get, path: "/book/{symbol}/P0" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/pub:list:{object}:{detail}" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/pub:map:currency:{detail}" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/pub:map:tx:method" }, %{ auth: false, cost: 2.7, method: :get, path: "/stats1/{key}:{size}:{symbol}/hist" }, %{ auth: false, cost: 2.7, method: :get, path: "/stats1/{key}:{size}:{symbol}/last" }, %{ auth: false, cost: 2.7, method: :get, path: "/tickers/hist" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/pub:list:pair:futures" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/{config}" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/pub:info:{object}:{detail}" }, %{ auth: false, cost: 2.7, method: :get, path: "/rankings/{key}:{timeframe}:{symbol}/{section}" }, %{ auth: false, cost: 1, method: :get, path: "/book/{symbol}/P2" }, %{ auth: false, cost: 2.7, method: :get, path: "/stats1/{key}:{size}:{symbol}/{section}" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/pub:map:currency:unit" }, %{ auth: false, cost: 2.7, method: :get, path: "/stats1/{key}:{size}:{symbol}:short/hist" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/pub:list:{object}" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/pub:list:pair:margin" }, %{ auth: false, cost: 2.7, method: :get, path: "/candles/trade:{timeframe}:{symbol}:{period}/{section}" }, %{ auth: false, cost: 10, method: :get, path: "/funding/stats/{symbol}/hist" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/pub:map:{object}:{detail}" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/pub:map:currency:sym" }, %{ auth: false, cost: 2.7, method: :get, path: "/stats1/{key}:{size}:{symbol}:{side}/{section}" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/pub:{action}:{object}:{detail}" }, %{ auth: false, cost: 2.7, method: :get, path: "/status/deriv/{symbol}/hist" }, %{ auth: false, cost: 2.7, method: :get, path: "/candles/trade:{timeframe}:{symbol}/last" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/pub:info:pair:futures" }, %{ auth: false, cost: 2.7, method: :get, path: "/stats1/{key}:{size}:{symbol}:long/last" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/pub:map:currency:tx:fee" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/pub:map:currency:pool" }, %{ auth: false, cost: 2.7, method: :get, path: "/stats1/{key}:{size}:{symbol}:{side}/hist" }, %{ auth: false, cost: 2.7, method: :get, path: "/rankings/{key}:{timeframe}:{symbol}/hist" }, %{ auth: false, cost: 2.7, method: :get, path: "/candles/trade:{timeframe}:{symbol}/{section}" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/pub:list:currency" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/pub:info:pair" }, %{ auth: false, cost: 1, method: :get, path: "/book/{symbol}/{precision}" }, %{ auth: false, cost: 2.7, method: :get, path: "/stats1/{key}:{size}:{symbol}:{side}/last" }, %{ auth: false, cost: 2.7, method: :get, path: "/status/deriv" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/pub:map:{object}" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/pub:info:tx:status" }, %{ auth: false, cost: 2.7, method: :get, path: "/stats1/{key}:{size}:{symbol}:long/hist" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/pub:fees" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/pub:map:currency:undl" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/pub:map:currency:label" }, %{ auth: false, cost: 2.7, method: :get, path: "/ticker/{symbol}" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/pub:map:currency:explorer" }, %{ auth: false, cost: 1, method: :get, path: "/book/{symbol}/P3" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/pub:{action}:{object}" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/pub:list:pair:exchange" }, %{ auth: false, cost: 8, method: :get, path: "/platform/status" }, %{ auth: false, cost: 2.7, method: :get, path: "/conf/pub:info:{object}" }, %{ auth: false, cost: 2.7, method: :get, path: "/status/{type}" }, %{ auth: false, cost: 2.7, method: :post, path: "/calc/fx" }, %{ auth: false, cost: 2.7, method: :post, path: "/calc/trade/avg" } ] }, required_credentials: %{ api_key: true, password: false, secret: true, uid: false }, requires_eddsa: false, response_error: %{ code_field: nil, field: "error", message_field: "error", success_values: nil, type: :error_array }, signing: %{ api_key_header: "bfx-apikey", confidence: :high, nonce_header: "bfx-nonce", pattern: :hmac_sha384_payload, signature_header: "bfx-signature" }, spec_format_version: 1, status: %{ "eta" => nil, "status" => "ok", "updated" => nil, "url" => nil }, symbol_format: nil, symbol_formats: %{ precision_mode: 3, sample_limits: %{ "amount" => %{ "max" => 5000, "min" => 0.02 }, "cost" => %{}, "price" => %{ "min" => 1.0e-8 } }, sample_precision: %{ "amount" => 8, "price" => 5 }, spot: %{ base: "AAVE", base_id: "AAVE", contract: false, id: "tAAVE:USD", limits: %{ "amount" => %{ "max" => 5000, "min" => 0.02 }, "cost" => %{}, "leverage" => %{}, "price" => %{ "min" => 1.0e-8 } }, maker: 0.001, precision: %{ "amount" => 8, "price" => 5 }, quote: "USD", quote_id: "USD", separator: "", symbol: "AAVE/USD", taker: 0.002 }, swap: %{ base: "AAVE", base_id: "AAVEF0", contract: true, contract_size: 1, id: "tAAVEF0:USTF0", inverse: false, limits: %{ "amount" => %{ "max" => 5000, "min" => 0.02 }, "cost" => %{}, "leverage" => %{}, "price" => %{ "min" => 1.0e-8 } }, linear: true, maker: 0.001, precision: %{ "amount" => 8, "price" => 5 }, quote: "USDT", quote_id: "USTF0", separator: "", settle: "USDT", settle_id: "USDT", symbol: "AAVE/USDT:USDT", taker: 0.002 } }, symbol_patterns: %{ spot: %{ case: :mixed, component_order: nil, date_format: nil, pattern: :no_separator_mixed, separator: "", suffix: nil }, swap: %{ case: :mixed, component_order: nil, date_format: nil, pattern: :implicit, separator: "", suffix: nil } }, timeframes: %{ "12h" => "12h", "15m" => "15m", "1M" => "1M", "1d" => "1D", "1h" => "1h", "1m" => "1m", "1w" => "7D", "2w" => "14D", "30m" => "30m", "3h" => "3h", "4h" => "4h", "5m" => "5m", "6h" => "6h" }, url_strategy: %{ detected_from: "fallback", pattern: :no_prefix, prefix: nil }, urls: %{ api: "https://api-pub.bitfinex.com", api_sections: %{ "private" => "https://api.bitfinex.com", "public" => "https://api-pub.bitfinex.com", "v1" => "https://api.bitfinex.com" }, doc: [ "https://docs.bitfinex.com/v2/docs/", "https://github.com/bitfinexcom/bitfinex-api-node" ], other: nil, sandbox: nil, www: "https://www.bitfinex.com" }, version: "v2", ws: %{ auth: %{ algorithm: :sha384, encoding: :hex, event_field: "event", event_value: "auth", market_specific: false, message_format: :event_auth, pattern: :sha384_nonce, payload_format: "AUTH{nonce}", requires_passphrase: false, timestamp_unit: :milliseconds }, channel_templates: %{ watch_balance: %{ market_id_format: :native, params: [ %{ "default" => "exchange", "name" => "wallet" } ], pattern: :event_based }, watch_my_trades: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :event_based }, watch_ohlcv: %{ channel_name: "candles", market_id_format: :native, params: [ %{ "default" => nil, "name" => "interval" }, %{ "default" => nil, "name" => "limit" } ], pattern: :event_based }, watch_order_book: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :event_based }, watch_orders: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :event_based }, watch_ticker: %{ market_id_format: :native, params: [], pattern: :event_based }, watch_trades: %{ market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :event_based } }, has: %{ watch_balance: true, watch_bids_asks: nil, watch_liquidations: nil, watch_liquidations_for_symbols: nil, watch_my_liquidations: nil, watch_my_liquidations_for_symbols: nil, watch_my_trades: true, watch_ohlcv: true, watch_ohlcv_for_symbols: nil, watch_order_book: true, watch_order_book_for_symbols: nil, watch_orders: true, watch_orders_for_symbols: nil, watch_position: nil, watch_positions: nil, watch_status: nil, watch_ticker: true, watch_tickers: false, watch_trades: true, watch_trades_for_symbols: false }, message_patterns: [ %{ format: :event, keys: [ "apiKey", "authNonce", "authPayload", "authSig", "event" ], kind_field: "event", kind_value: "auth", sources: [ :send, :watch ] }, %{ format: :event, keys: [ "event", "flags" ], kind_field: "event", kind_value: "conf", sources: [ :send ] }, %{ args_field: "channel", format: :event, keys: [ "channel", "event", "freq", "len", "prec", "symbol" ], kind_field: "event", kind_value: "subscribe", sources: [ :send, :watch ] }, %{ args_field: "channel", format: :event, keys: [ "channel", "event", "key" ], kind_field: "event", kind_value: "subscribe", sources: [ :send, :watch ] }, %{ args_field: "channel", format: :event, keys: [ "channel", "event", "symbol" ], kind_field: "event", kind_value: "subscribe", sources: [ :send, :watch ] }, %{ format: :event, keys: [ "event" ], kind_field: "event", kind_value: "unsubscribe", sources: [ :send, :watch ] } ], options: %{ "watchOrderBook" => %{ "checksum" => true, "freq" => "F0", "prec" => "P0" } }, subscription_config: %{ args_field: "channel", args_format: :string, market_id_format: :native, op_field: "event" }, subscription_pattern: :event_subscribe, urls: %{ "private" => "wss://api.bitfinex.com/ws/2", "public" => "wss://api-pub.bitfinex.com/ws/2" }, watch_methods: [ "watchBalance", "watchMyTrades", "watchOHLCV", "watchOrderBook", "watchOrders", "watchTicker", "watchTrades" ] } }