# Deribit Exchange Specification # # Auto-generated by: mix ccxt.extract deribit # 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: [ "NL" ], currencies: %{}, currency_aliases: %{ "BCHSV" => "BSV", "XBT" => "BTC" }, dex: false, enable_rate_limit: true, endpoint_extraction_stats: %{ "capturedMethods" => 48, "coveragePercent" => 100, "enabledMethods" => 48, "excluded" => [], "excludedMethods" => 0, "extractableMethods" => 48, "failures" => [] }, endpoints: [ %{ api_section: "private", auth: true, cost: 4, market_type: :swap, method: :get, name: :cancel_all_orders, param_mappings: %{ "symbol" => "instrument_name" }, params: [ :symbol ], path: "/private/cancel_all_by_instrument", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 4, market_type: :swap, method: :get, name: :cancel_order, param_mappings: %{ "id" => "order_id" }, params: [ :id, :symbol ], path: "/private/cancel", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :swap, method: :get, name: :create_deposit_address, param_mappings: %{ "code" => "currency" }, params: [ :code ], path: "/private/create_deposit_address", response_transformer: {:extract_path, ["result", "address"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 4, default_params: %{ "type" => "limit" }, market_type: :swap, method: :get, name: :create_limit_order, param_mappings: %{ "symbol" => "instrument_name" }, params: [ :symbol, :side, :amount, :price ], path: "/private/buy", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 4, default_params: %{ "type" => "market" }, market_type: :swap, method: :get, name: :create_market_order, param_mappings: %{ "symbol" => "instrument_name" }, params: [ :symbol, :side, :amount, :price ], path: "/private/buy", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 4, market_type: :swap, method: :get, name: :create_order, param_mappings: %{ "symbol" => "instrument_name" }, params: [ :symbol, :type, :side, :amount, :price ], path: "/private/buy", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 4, default_params: %{ "reduce_only" => true }, market_type: :swap, method: :get, name: :create_reduce_only_order, param_mappings: %{ "symbol" => "instrument_name" }, params: [ :symbol, :type, :side, :amount, :price ], path: "/private/buy", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 4, default_params: %{ "triggerDirection" => "below", "type" => "limit" }, market_type: :swap, method: :get, name: :create_stop_limit_order, param_mappings: %{ "symbol" => "instrument_name", "triggerPrice" => "stopPrice" }, params: [ :symbol, :side, :amount, :price, :triggerPrice ], path: "/private/buy", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 4, default_params: %{ "triggerDirection" => "below", "type" => "market" }, market_type: :swap, method: :get, name: :create_stop_market_order, param_mappings: %{ "symbol" => "instrument_name", "triggerPrice" => "stopPrice" }, params: [ :symbol, :side, :amount, :triggerPrice ], path: "/private/buy", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 4, default_params: %{ "triggerDirection" => "below" }, market_type: :swap, method: :get, name: :create_stop_order, param_mappings: %{ "symbol" => "instrument_name", "triggerPrice" => "stopPrice" }, params: [ :symbol, :type, :side, :amount, :price, :triggerPrice ], path: "/private/buy", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 4, default_params: %{ "trigger" => "last_price", "type" => "trailing_stop" }, market_type: :swap, method: :get, name: :create_trailing_amount_order, param_mappings: %{ "symbol" => "instrument_name", "trailingAmount" => "trigger_offset" }, params: [ :symbol, :type, :side, :amount, :price, :trailingAmount, :trailingTriggerPrice ], path: "/private/buy", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 4, market_type: :swap, method: :get, name: :edit_order, param_mappings: %{ "id" => "order_id" }, params: [ :id, :symbol, :type, :side, :amount, :price ], path: "/private/edit", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :swap, method: :get, name: :fetch_accounts, param_mappings: %{}, params: [], path: "/private/get_subaccounts", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :swap, method: :get, name: :fetch_balance, param_mappings: %{}, params: [], path: "/private/get_account_summaries", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "count" => 1000 }, market_type: :swap, method: :get, name: :fetch_closed_orders, param_mappings: %{ "symbol" => "instrument_name" }, params: [ :symbol, :since, :limit ], path: "/private/get_order_history_by_instrument", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :swap, method: :get, name: :fetch_currencies, param_mappings: %{}, params: [], path: "/public/get_currencies", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :swap, method: :get, name: :fetch_deposit_address, param_mappings: %{ "code" => "currency" }, params: [ :code ], path: "/private/get_current_deposit_address", response_transformer: {:extract_path_unwrap, ["result", "address"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :swap, method: :get, name: :fetch_deposit_withdraw_fees, param_mappings: %{}, params: [ :codes ], path: "/public/get_currencies", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :swap, method: :get, name: :fetch_deposits, param_mappings: %{ "code" => "currency" }, params: [ :code, :since, :limit ], path: "/private/get_deposits", response_transformer: {:extract_path, ["result", "data"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, default_params: %{ "end_timestamp" => "", "start_timestamp" => "" }, market_type: :swap, method: :get, name: :fetch_funding_rate, param_mappings: %{ "symbol" => "instrument_name" }, params: [ :symbol ], path: "/public/get_funding_rate_value", response_transformer: {:extract_path_unwrap, ["result"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, default_params: %{ "end_timestamp" => "", "start_timestamp" => "" }, market_type: :swap, method: :get, name: :fetch_funding_rate_history, param_mappings: %{ "since" => "start_timestamp", "symbol" => "instrument_name" }, params: [ :symbol, :since, :limit ], path: "/public/get_funding_rate_history", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :option, method: :get, name: :fetch_greeks, param_mappings: %{ "symbol" => "instrument_name" }, params: [ :symbol ], path: "/public/ticker", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :swap, method: :get, name: :fetch_l2_order_book, param_mappings: %{ "symbol" => "instrument_name" }, params: [ :symbol, :limit ], path: "/public/get_order_book", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, default_params: %{ "type" => "bankruptcy" }, market_type: :swap, method: :get, name: :fetch_liquidations, param_mappings: %{ "symbol" => "instrument_name" }, params: [ :symbol, :since, :limit ], path: "/public/get_last_settlements_by_instrument", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :swap, method: :get, name: :fetch_markets, param_mappings: %{}, params: [], path: "/public/get_instruments", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "type" => "bankruptcy" }, market_type: :swap, method: :get, name: :fetch_my_liquidations, param_mappings: %{ "symbol" => "instrument_name" }, params: [ :symbol, :since, :limit ], path: "/private/get_settlement_history_by_instrument", response_transformer: {:extract_path, ["result", "settlements"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "include_old" => true }, market_type: :swap, method: :get, name: :fetch_my_trades, param_mappings: %{ "symbol" => "instrument_name" }, params: [ :symbol, :since, :limit ], path: "/private/get_user_trades_by_instrument", response_transformer: {:extract_path, ["result", "trades"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, default_params: %{ "end_timestamp" => "", "resolution" => "60", "start_timestamp" => "" }, market_type: :swap, method: :get, name: :fetch_ohlcv, param_mappings: %{ "since" => "start_timestamp", "symbol" => "instrument_name", "timeframe" => "resolution" }, params: [ :symbol, :timeframe, :since, :limit ], path: "/public/get_tradingview_chart_data", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :swap, method: :get, name: :fetch_open_interest, param_mappings: %{ "symbol" => "instrument_name" }, params: [ :symbol ], path: "/public/get_book_summary_by_instrument", response_transformer: {:extract_path_unwrap, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :swap, method: :get, name: :fetch_open_orders, param_mappings: %{ "symbol" => "instrument_name" }, params: [ :symbol, :since, :limit ], path: "/private/get_open_orders_by_instrument", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :option, method: :get, name: :fetch_option, param_mappings: %{ "symbol" => "instrument_name" }, params: [ :symbol ], path: "/public/get_book_summary_by_instrument", response_transformer: {:extract_path_unwrap, ["result"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, default_params: %{ "kind" => "option" }, market_type: :option, method: :get, name: :fetch_option_chain, param_mappings: %{ "code" => "currency" }, params: [ :code ], path: "/public/get_book_summary_by_currency", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :swap, method: :get, name: :fetch_order, param_mappings: %{ "id" => "order_id" }, params: [ :id, :symbol ], path: "/private/get_order_state", response_transformer: {:extract_path_unwrap, ["result"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :swap, method: :get, name: :fetch_order_book, param_mappings: %{ "limit" => "depth", "symbol" => "instrument_name" }, params: [ :symbol, :limit ], path: "/public/get_order_book", response_transformer: {:extract_path_unwrap, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :swap, method: :get, name: :fetch_order_trades, param_mappings: %{ "id" => "order_id" }, params: [ :id, :symbol, :since, :limit ], path: "/private/get_user_trades_by_order", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :swap, method: :get, name: :fetch_position, param_mappings: %{ "symbol" => "instrument_name" }, params: [ :symbol ], path: "/private/get_position", response_transformer: {:extract_path_unwrap, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :swap, method: :get, name: :fetch_positions, param_mappings: %{}, params: [ :symbols ], path: "/private/get_positions", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :swap, method: :get, name: :fetch_status, param_mappings: %{}, params: [], path: "/public/status", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :swap, method: :get, name: :fetch_ticker, param_mappings: %{ "symbol" => "instrument_name" }, params: [ :symbol ], path: "/public/ticker", response_transformer: {:extract_path_unwrap, ["result"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, default_params: %{ "currency" => "BTC", "kind" => "spot" }, market_type: :swap, method: :get, name: :fetch_tickers, param_mappings: %{}, params: [ :symbols ], path: "/public/get_book_summary_by_currency", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :swap, method: :get, name: :fetch_time, param_mappings: %{}, params: [], path: "/public/get_time", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, default_params: %{ "end_timestamp" => "", "include_old" => true }, market_type: :swap, method: :get, name: :fetch_trades, param_mappings: %{ "limit" => "count", "since" => "start_timestamp", "symbol" => "instrument_name" }, params: [ :symbol, :since, :limit ], path: "/public/get_last_trades_by_instrument_and_time", response_transformer: {:extract_path, ["result", "trades"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, default_params: %{ "currency" => "BTC", "extended" => true }, market_type: :swap, method: :get, name: :fetch_trading_fees, param_mappings: %{}, params: [], path: "/private/get_account_summary", response_transformer: {:extract_path, ["result", "fees"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :swap, method: :get, name: :fetch_transfers, param_mappings: %{ "code" => "currency" }, params: [ :code, :since, :limit ], path: "/private/get_transfers", response_transformer: {:extract_path, ["result", "data"]}, source: :intercepted }, %{ api_section: "public", auth: false, cost: 1, market_type: :option, method: :get, name: :fetch_volatility_history, param_mappings: %{ "arg0" => "currency" }, params: [], path: "/public/get_historical_volatility", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :swap, method: :get, name: :fetch_withdrawals, param_mappings: %{ "code" => "currency" }, params: [ :code, :since, :limit ], path: "/private/get_withdrawals", response_transformer: {:extract_path, ["result", "data"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :swap, method: :get, name: :transfer, param_mappings: %{ "code" => "currency", "toAccount" => "destination" }, params: [ :code, :amount, :fromAccount, :toAccount ], path: "/private/submit_transfer_to_subaccount", response_transformer: {:extract_path, ["result"]}, source: :intercepted }, %{ api_section: "private", auth: true, cost: 1, market_type: :swap, method: :get, name: :withdraw, param_mappings: %{ "code" => "currency" }, params: [ :code, :amount, :address, :tag ], path: "/private/withdraw", response_transformer: {:extract_path, ["result"]}, source: :intercepted } ], error_code_details: %{ -32000 => %{ description: "'Missing params' see JSON-RPC spec.", type: :invalid_parameters }, -32601 => %{ description: "'Method not found' see JSON-RPC spec.", type: :invalid_parameters }, -32602 => %{ description: "'Invalid params' see JSON-RPC spec.", type: :invalid_parameters }, -32700 => %{ description: "'Parse error' see JSON-RPC spec.", type: :invalid_parameters }, 10000 => %{ description: "'authorization_required' Authorization issue, invalid or absent signature etc.", type: :invalid_credentials }, 10001 => %{ description: "'error' Some general failure, no public information available.", type: :exchange_error }, 10002 => %{ description: "'qty_too_low' Order quantity is too low.", type: :invalid_order }, 10003 => %{ description: "'order_overlap' Rejection, order overlap is found and self-trading is not enabled.", type: :invalid_order }, 10004 => %{ description: "'order_not_found' Attempt to operate with order that can't be found by specified id.", type: :order_not_found }, 10005 => %{ description: "'price_too_low ' Price is too low, defines current limit for the operation.", type: :invalid_order }, 10006 => %{ description: "'price_too_low4idx ' Price is too low for current index, defines current bottom limit for the operation.", type: :invalid_order }, 10007 => %{ description: "'price_too_high ' Price is too high, defines current up limit for the operation.", type: :invalid_order }, 10008 => %{ description: "'price_too_high4idx ' Price is too high for current index, defines current up limit for the operation.", type: :invalid_order }, 10009 => %{ description: "'not_enough_funds' Account has not enough funds for the operation.", type: :insufficient_balance }, 10010 => %{ description: "'already_closed' Attempt of doing something with closed order.", type: :order_not_found }, 10011 => %{ description: "'price_not_allowed' This price is not allowed for some reason.", type: :invalid_order }, 10012 => %{ description: "'book_closed' Operation for instrument which order book had been closed.", type: :invalid_order }, 10013 => %{ description: "'pme_max_total_open_orders ' Total limit of open orders has been exceeded, it is applicable for PME users.", type: :access_restricted }, 10014 => %{ description: "'pme_max_future_open_orders ' Limit of count of futures' open orders has been exceeded, it is applicable for PME users.", type: :access_restricted }, 10015 => %{ description: "'pme_max_option_open_orders ' Limit of count of options' open orders has been exceeded, it is applicable for PME users.", type: :access_restricted }, 10016 => %{ description: "'pme_max_future_open_orders_size ' Limit of size for futures has been exceeded, it is applicable for PME users.", type: :access_restricted }, 10017 => %{ description: "'pme_max_option_open_orders_size ' Limit of size for options has been exceeded, it is applicable for PME users.", type: :access_restricted }, 10018 => %{ description: "'non_pme_max_future_position_size ' Limit of size for futures has been exceeded, it is applicable for non-PME users.", type: :access_restricted }, 10019 => %{ description: "'locked_by_admin' Trading is temporary locked by admin.", type: :access_restricted }, 10020 => %{ description: "'invalid_or_unsupported_instrument' Instrument name is not valid.", type: :exchange_error }, 10021 => %{ description: "'invalid_amount' Amount is not valid.", type: :invalid_order }, 10022 => %{ description: "'invalid_quantity' quantity was not recognized as a valid number (for API v1).", type: :invalid_order }, 10023 => %{ description: "'invalid_price' price was not recognized as a valid number.", type: :invalid_order }, 10024 => %{ description: "'invalid_max_show' max_show parameter was not recognized as a valid number.", type: :invalid_order }, 10025 => %{ description: "'invalid_order_id' Order id is missing or its format was not recognized as valid.", type: :invalid_order }, 10026 => %{ description: "'price_precision_exceeded' Extra precision of the price is not supported.", type: :invalid_order }, 10027 => %{ description: "'non_integer_contract_amount' Futures contract amount was not recognized as integer.", type: :invalid_order }, 10028 => %{ description: "'too_many_requests' Allowed request rate has been exceeded.", type: :rate_limited }, 10029 => %{ description: "'not_owner_of_order' Attempt to operate with not own order.", type: :order_not_found }, 10030 => %{ description: "'must_be_websocket_request' REST request where Websocket is expected.", type: :exchange_error }, 10031 => %{ description: "'invalid_args_for_instrument' Some of arguments are not recognized as valid.", type: :exchange_error }, 10032 => %{ description: "'whole_cost_too_low' Total cost is too low.", type: :invalid_order }, 10033 => %{ description: "'not_implemented' Method is not implemented yet.", type: :exchange_error }, 10034 => %{ description: "'stop_price_too_high' Stop price is too high.", type: :invalid_order }, 10035 => %{ description: "'stop_price_too_low' Stop price is too low.", type: :invalid_order }, 10036 => %{ description: "'invalid_max_show_amount' Max Show Amount is not valid.", type: :invalid_order }, 10040 => %{ description: "'retry' Request can't be processed right now and should be retried.", type: :network_error }, 10041 => %{ description: "'settlement_in_progress' Settlement is in progress. Every day at settlement time for several seconds, the system calculates user profits and updates balances. That time trading is paused for several seconds till the calculation is completed.", type: :network_error }, 10043 => %{ description: "'price_wrong_tick' Price has to be rounded to a certain tick size.", type: :invalid_order }, 10044 => %{ description: "'stop_price_wrong_tick' Stop Price has to be rounded to a certain tick size.", type: :invalid_order }, 10045 => %{ description: "'can_not_cancel_liquidation_order' Liquidation order can't be canceled.", type: :invalid_order }, 10046 => %{ description: "'can_not_edit_liquidation_order' Liquidation order can't be edited.", type: :invalid_order }, 10047 => %{ description: "'matching_engine_queue_full' Reached limit of pending Matching Engine requests for user.", type: :rate_limited }, 10048 => %{ description: "'not_on_this_server' The requested operation is not available on this server.", type: :exchange_error }, 11008 => %{ description: "'already_filled' This request is not allowed in regards to the filled order.", type: :invalid_order }, 11029 => %{ description: "'invalid_arguments' Some invalid input has been detected.", type: :invalid_parameters }, 11030 => %{ description: "'other_reject ' Some rejects which are not considered as very often, more info may be specified in .", type: :exchange_error }, 11031 => %{ description: "'other_error ' Some errors which are not considered as very often, more info may be specified in .", type: :exchange_error }, 11035 => %{ description: "'no_more_stops ' Allowed amount of stop orders has been exceeded.", type: :rate_limited }, 11036 => %{ description: "'invalid_stoppx_for_index_or_last' Invalid StopPx (too high or too low) as to current index or market.", type: :invalid_order }, 11037 => %{ description: "'outdated_instrument_for_IV_order' Instrument already not available for trading.", type: :invalid_parameters }, 11038 => %{ description: "'no_adv_for_futures' Advanced orders are not available for futures.", type: :invalid_order }, 11039 => %{ description: "'no_adv_postonly' Advanced post-only orders are not supported yet.", type: :invalid_order }, 11041 => %{ description: "'not_adv_order' Advanced order properties can't be set if the order is not advanced.", type: :invalid_order }, 11042 => %{ description: "'permission_denied' Permission for the operation has been denied.", type: :access_restricted }, 11043 => %{ description: "'bad_argument' Bad argument has been passed.", type: :invalid_parameters }, 11044 => %{ description: "'not_open_order' Attempt to do open order operations with the not open order.", type: :invalid_order }, 11045 => %{ description: "'invalid_event' Event name has not been recognized.", type: :invalid_parameters }, 11046 => %{ description: "'outdated_instrument' At several minutes to instrument expiration, corresponding advanced implied volatility orders are not allowed.", type: :invalid_parameters }, 11047 => %{ description: "'unsupported_arg_combination' The specified combination of arguments is not supported.", type: :invalid_parameters }, 11048 => %{ description: "'wrong_max_show_for_option' Wrong Max Show for options.", type: :exchange_error }, 11049 => %{ description: "'bad_arguments' Several bad arguments have been passed.", type: :invalid_parameters }, 11050 => %{ description: "'bad_request' Request has not been parsed properly.", type: :invalid_parameters }, 11051 => %{ description: "'system_maintenance' System is under maintenance.", type: :network_error }, 11052 => %{ description: "'subscribe_error_unsubscribed' Subscription error. However, subscription may fail without this error, please check list of subscribed channels returned, as some channels can be not subscribed due to wrong input or lack of permissions.", type: :exchange_error }, 11053 => %{ description: "'transfer_not_found' Specified transfer is not found.", type: :exchange_error }, 11054 => %{ description: "'post_only_reject' post order would be filled immediately", type: :invalid_order }, 11090 => %{ description: "'invalid_addr' Invalid address.", type: :invalid_parameters }, 11091 => %{ description: "'invalid_transfer_address' Invalid addres for the transfer.", type: :invalid_parameters }, 11092 => %{ description: "'address_already_exist' The address already exists.", type: :invalid_parameters }, 11093 => %{ description: "'max_addr_count_exceeded' Limit of allowed addresses has been reached.", type: :rate_limited }, 11094 => %{ description: "'internal_server_error' Some unhandled error on server. Please report to admin. The details of the request will help to locate the problem.", type: :exchange_error }, 11095 => %{ description: "'disabled_deposit_address_creation' Deposit address creation has been disabled by admin.", type: :exchange_error }, 11096 => %{ description: "'address_belongs_to_user' Withdrawal instead of transfer.", type: :exchange_error }, 12000 => %{ description: "'bad_tfa' Wrong TFA code", type: :invalid_credentials }, 12001 => %{ description: "'too_many_subaccounts' Limit of subbacounts is reached.", type: :rate_limited }, 12002 => %{ description: "'wrong_subaccount_name' The input is not allowed as name of subaccount.", type: :exchange_error }, 12003 => %{ description: "'login_over_limit' The number of failed login attempts is limited.", type: :invalid_credentials }, 12004 => %{ description: "'registration_over_limit' The number of registration requests is limited.", type: :invalid_credentials }, 12005 => %{ description: "'country_is_banned' The country is banned (possibly via IP check).", type: :invalid_credentials }, 12100 => %{ description: "'transfer_not_allowed' Transfer is not allowed. Possible wrong direction or other mistake.", type: :exchange_error }, 12998 => %{ description: "'tfa_over_limit' The number of failed TFA attempts is limited.", type: :invalid_credentials }, 12999 => %{ description: "'tfa_used' TFA code is correct but it is already used. Please, use next code.", type: :invalid_credentials }, 13000 => %{ description: "'invalid_login' Login name is invalid (not allowed or it contains wrong characters).", type: :invalid_credentials }, 13001 => %{ description: "'account_not_activated' Account must be activated.", type: :invalid_credentials }, 13002 => %{ description: "'account_blocked' Account is blocked by admin.", type: :access_restricted }, 13003 => %{ description: "'tfa_required' This action requires TFA authentication.", type: :invalid_credentials }, 13004 => %{ description: "'invalid_credentials' Invalid credentials has been used.", type: :invalid_credentials }, 13005 => %{ description: "'pwd_match_error' Password confirmation error.", type: :invalid_credentials }, 13006 => %{ description: "'security_error' Invalid Security Code.", type: :invalid_credentials }, 13007 => %{ description: "'user_not_found' User's security code has been changed or wrong.", type: :invalid_credentials }, 13008 => %{ description: "'request_failed' Request failed because of invalid input or internal failure.", type: :exchange_error }, 13009 => %{ description: "'unauthorized' Wrong or expired authorization token or bad signature. For example, please check scope of the token, 'connection' scope can't be reused for other connections.", type: :invalid_credentials }, 13010 => %{ description: "'value_required' Invalid input, missing value.", type: :invalid_parameters }, 13011 => %{ description: "'value_too_short' Input is too short.", type: :invalid_parameters }, 13012 => %{ description: "'unavailable_in_subaccount' Subaccount restrictions.", type: :access_restricted }, 13013 => %{ description: "'invalid_phone_number' Unsupported or invalid phone number.", type: :invalid_parameters }, 13014 => %{ description: "'cannot_send_sms' SMS sending failed -- phone number is wrong.", type: :invalid_parameters }, 13015 => %{ description: "'invalid_sms_code' Invalid SMS code.", type: :invalid_parameters }, 13016 => %{ description: "'invalid_input' Invalid input.", type: :invalid_parameters }, 13017 => %{ description: "'subscription_failed' Subscription hailed, invalid subscription parameters.", type: :exchange_error }, 13018 => %{ description: "'invalid_content_type' Invalid content type of the request.", type: :exchange_error }, 13019 => %{ description: "'orderbook_closed' Closed, expired order book.", type: :exchange_error }, 13020 => %{ description: "'not_found' Instrument is not found, invalid instrument name.", type: :exchange_error }, 13021 => %{ description: "'forbidden' Not enough permissions to execute the request, forbidden.", type: :access_restricted }, 13025 => %{ description: "'method_switched_off_by_admin' API method temporarily switched off by administrator.", type: :exchange_error }, 9999 => %{ description: "'api_not_enabled' User didn't enable API for the Account.", type: :access_restricted } }, error_codes: %{ -32000 => :invalid_parameters, -32601 => :invalid_parameters, -32602 => :invalid_parameters, -32700 => :invalid_parameters, 10000 => :invalid_credentials, 10001 => :exchange_error, 10002 => :invalid_order, 10003 => :invalid_order, 10004 => :order_not_found, 10005 => :invalid_order, 10006 => :invalid_order, 10007 => :invalid_order, 10008 => :invalid_order, 10009 => :insufficient_balance, 10010 => :order_not_found, 10011 => :invalid_order, 10012 => :invalid_order, 10013 => :access_restricted, 10014 => :access_restricted, 10015 => :access_restricted, 10016 => :access_restricted, 10017 => :access_restricted, 10018 => :access_restricted, 10019 => :access_restricted, 10020 => :exchange_error, 10021 => :invalid_order, 10022 => :invalid_order, 10023 => :invalid_order, 10024 => :invalid_order, 10025 => :invalid_order, 10026 => :invalid_order, 10027 => :invalid_order, 10028 => :rate_limited, 10029 => :order_not_found, 10030 => :exchange_error, 10031 => :exchange_error, 10032 => :invalid_order, 10033 => :exchange_error, 10034 => :invalid_order, 10035 => :invalid_order, 10036 => :invalid_order, 10040 => :network_error, 10041 => :network_error, 10043 => :invalid_order, 10044 => :invalid_order, 10045 => :invalid_order, 10046 => :invalid_order, 10047 => :rate_limited, 10048 => :exchange_error, 11008 => :invalid_order, 11029 => :invalid_parameters, 11030 => :exchange_error, 11031 => :exchange_error, 11035 => :rate_limited, 11036 => :invalid_order, 11037 => :invalid_parameters, 11038 => :invalid_order, 11039 => :invalid_order, 11041 => :invalid_order, 11042 => :access_restricted, 11043 => :invalid_parameters, 11044 => :invalid_order, 11045 => :invalid_parameters, 11046 => :invalid_parameters, 11047 => :invalid_parameters, 11048 => :exchange_error, 11049 => :invalid_parameters, 11050 => :invalid_parameters, 11051 => :network_error, 11052 => :exchange_error, 11053 => :exchange_error, 11054 => :invalid_order, 11090 => :invalid_parameters, 11091 => :invalid_parameters, 11092 => :invalid_parameters, 11093 => :rate_limited, 11094 => :exchange_error, 11095 => :exchange_error, 11096 => :exchange_error, 12000 => :invalid_credentials, 12001 => :rate_limited, 12002 => :exchange_error, 12003 => :invalid_credentials, 12004 => :invalid_credentials, 12005 => :invalid_credentials, 12100 => :exchange_error, 12998 => :invalid_credentials, 12999 => :invalid_credentials, 13000 => :invalid_credentials, 13001 => :invalid_credentials, 13002 => :access_restricted, 13003 => :invalid_credentials, 13004 => :invalid_credentials, 13005 => :invalid_credentials, 13006 => :invalid_credentials, 13007 => :invalid_credentials, 13008 => :exchange_error, 13009 => :invalid_credentials, 13010 => :invalid_parameters, 13011 => :invalid_parameters, 13012 => :access_restricted, 13013 => :invalid_parameters, 13014 => :invalid_parameters, 13015 => :invalid_parameters, 13016 => :invalid_parameters, 13017 => :exchange_error, 13018 => :exchange_error, 13019 => :exchange_error, 13020 => :exchange_error, 13021 => :access_restricted, 13025 => :exchange_error, 9999 => :access_restricted }, exceptions: nil, exchange_options: %{ "code" => "BTC", "defaultNetworkCodeReplacements" => %{ "BRC20" => %{ "BRC20" => "BTC" }, "CRO" => %{ "CRC20" => "CRONOS" }, "ETH" => %{ "ERC20" => "ETH" }, "TRX" => %{ "TRC20" => "TRX" } }, "fetchBalance" => %{ "code" => "BTC" }, "networksById" => %{}, "transfer" => %{ "method" => "privateGetSubmitTransferToSubaccount" } }, extended_metadata: %{ fees_url: "https://www.deribit.com/pages/information/fees", limits: %{ "amount" => %{}, "cost" => %{}, "leverage" => %{}, "price" => %{} }, logo_url: "https://user-images.githubusercontent.com/1294454/41933112-9e2dd65a-798b-11e8-8440-5bab2959fcb8.jpg", referral_discount: 0.1, referral_url: "https://www.deribit.com/reg-1189.4038" }, extracted_metadata: %{ ccxt_version: "4.5.34" }, features: %{ default: %{ create_order: %{ hedged: false, iceberg: true, leverage: false, margin_mode: false, market_buy_by_cost: true, market_buy_requires_price: false, self_trade_prevention: false, stop_loss_price: false, take_profit_price: false, time_in_force: %{ fok: true, gtd: true, ioc: true, po: true }, trailing: true, trigger_direction: false, trigger_price: true, trigger_price_type: %{ index: true, last: true, mark: true } }, fetch_closed_orders: %{ days_back: 100000, days_back_canceled: 1, limit: 100, margin_mode: false, symbol_required: true, trailing: false, trigger: false, until_days: 100000 }, fetch_my_trades: %{ days_back: 100000, limit: 100, margin_mode: false, symbol_required: true, until_days: 100000 }, fetch_ohlcv: %{ limit: 1000 }, fetch_open_orders: %{ margin_mode: false, symbol_required: true, trailing: false, trigger: false }, fetch_order: %{ margin_mode: false, symbol_required: true, trailing: false, trigger: false }, sandbox: true }, future: %{ inverse: %{ extends: "default" }, linear: %{ extends: "default" } }, spot: %{ extends: "default" }, swap: %{ inverse: %{ extends: "default" }, linear: %{ extends: "default" } } }, fees: nil, handle_content_type_application_zip: nil, handle_errors_source: "handleErrors(httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody) {\n if (!response) {\n return undefined; // fallback to default error handler\n }\n //\n // {\n // \"jsonrpc\": \"2.0\",\n // \"error\": {\n // \"message\": \"Invalid params\",\n // \"data\": { reason: \"invalid currency\", param: \"currency\" },\n // \"code\": -32602\n // },\n // \"testnet\": false,\n // \"usIn\": 1583763842150374,\n // \"usOut\": 1583763842150410,\n // \"usDiff\": 36\n // }\n //\n const error = this.safeValue(response, 'error');\n if (error !== undefined) {\n const errorCode = this.safeString(error, 'code');\n const feedback = this.id + ' ' + body;\n this.throwExactlyMatchedException(this.exceptions, errorCode, feedback);\n throw new errors.ExchangeError(feedback); // unknown message\n }\n return undefined;\n }", has: %{ add_margin: false, borrow_cross_margin: false, borrow_isolated_margin: false, borrow_margin: false, c_o_r_s: true, 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: false, 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: false, 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: false, create_trigger_order_ws: false, deposit: false, edit_order: true, edit_order_with_client_order_id: false, edit_order_ws: false, edit_orders: false, fetch_accounts: true, fetch_balance: true, fetch_balance_ws: false, fetch_bids_asks: false, fetch_borrow_interest: false, fetch_borrow_rate: false, fetch_borrow_rate_histories: false, fetch_borrow_rate_history: false, fetch_borrow_rates: false, fetch_borrow_rates_per_symbol: false, fetch_canceled_and_closed_orders: false, fetch_canceled_orders: false, fetch_closed_order: false, fetch_closed_orders: true, fetch_closed_orders_ws: false, fetch_convert_currencies: false, fetch_convert_quote: false, fetch_convert_trade: false, fetch_convert_trade_history: false, fetch_cross_borrow_rate: false, fetch_cross_borrow_rates: false, fetch_currencies: 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: true, fetch_deposits: true, fetch_deposits_withdrawals: false, 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: false, fetch_greeks: true, fetch_index_ohlcv: false, fetch_isolated_borrow_rate: false, fetch_isolated_borrow_rates: false, fetch_isolated_positions: false, fetch_l2_order_book: true, fetch_l3_order_book: false, fetch_last_prices: false, fetch_ledger: false, fetch_ledger_entry: false, fetch_leverage: false, fetch_leverage_tiers: 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: true, 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: false, fetch_open_interests: false, fetch_open_order: false, fetch_open_orders: true, fetch_open_orders_ws: false, fetch_option: true, fetch_option_chain: true, 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: true, fetch_position_history: false, fetch_position_mode: false, fetch_position_ws: false, fetch_positions: true, fetch_positions_for_symbol: false, fetch_positions_for_symbol_ws: false, fetch_positions_history: false, fetch_positions_risk: false, fetch_positions_ws: false, fetch_premium_index_ohlcv: false, fetch_settlement_history: false, fetch_status: true, fetch_ticker: true, fetch_ticker_ws: false, fetch_tickers: true, fetch_tickers_ws: false, fetch_time: true, fetch_trades: true, fetch_trades_ws: false, fetch_trading_fee: false, fetch_trading_fees: true, fetch_trading_fees_ws: false, fetch_trading_limits: false, fetch_transaction_fee: false, fetch_transaction_fees: false, fetch_transactions: false, fetch_transfer: false, fetch_transfers: true, fetch_underlying_assets: false, fetch_volatility_history: true, fetch_withdraw_addresses: false, fetch_withdrawal: false, fetch_withdrawal_whitelist: false, fetch_withdrawals: true, fetch_withdrawals_ws: false, future: true, margin: false, option: true, private_api: true, public_api: true, reduce_margin: false, repay_cross_margin: false, repay_isolated_margin: false, sandbox: true, set_leverage: false, set_margin: false, set_margin_mode: false, set_position_mode: false, sign_in: false, spot: false, swap: true, transfer: true, un_watch_my_trades: false, un_watch_ohlcv: false, un_watch_ohlcv_for_symbols: false, un_watch_order_book: false, un_watch_order_book_for_symbols: false, un_watch_orders: false, un_watch_positions: false, un_watch_ticker: false, un_watch_tickers: false, un_watch_trades: false, un_watch_trades_for_symbols: false, watch_balance: true, watch_bids_asks: true, watch_liquidations: false, watch_liquidations_for_symbols: false, watch_my_liquidations: false, watch_my_liquidations_for_symbols: false, watch_my_trades: true, watch_ohlcv: true, watch_ohlcv_for_symbols: true, watch_order_book: true, watch_order_book_for_symbols: true, watch_orders: true, watch_orders_for_symbols: false, watch_position: false, watch_positions: false, watch_status: false, watch_ticker: true, watch_tickers: true, watch_trades: true, watch_trades_for_symbols: true, withdraw: true, ws: false }, http_config: nil, id: "deribit", markets: nil, name: "Deribit", ohlcv_timestamp_resolution: :milliseconds, options: %{ code: "BTC", fetch_balance: %{ "code" => "BTC" }, transfer: %{ "method" => "privateGetSubmitTransferToSubaccount" } }, order_mappings: %{ side_format: nil, side_key: nil, type_format: :lowercase, type_key: "type" }, param_mappings: %{ "arg0" => "currency", "code" => "currency", "id" => "order_id", "limit" => "count", "since" => "start_timestamp", "symbol" => "instrument_name", "timeframe" => "resolution", "toAccount" => "destination", "trailingAmount" => "trigger_offset", "triggerPrice" => "stopPrice" }, parse_methods: [ %{ "comment" => nil, "examples" => [ "{\n \"username\": \"someusername_1\",\n \"type\": \"subaccount\",\n \"system_name\": \"someusername_1\",\n \"security_keys_enabled\": false,\n \"security_keys_assignments\": [],\n \"receive_notifications\": false,\n \"login_enabled\": false,\n \"is_password\": false,\n \"id\": \"245499\",\n \"email\": \"pablo@abcdef.com\"\n }" ], "line_end" => 792, "line_start" => 771, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "account" }, %{ "comment" => nil, "key" => "id", "value" => "this.safeString (account, 'id')" }, %{ "comment" => nil, "key" => "type", "value" => "this.safeString (account, 'type')" }, %{ "comment" => nil, "key" => "code", "value" => "undefined" } ], "name" => "parseAccount", "signature" => "parseAccount (account)", "source" => "parseAccount (account) {\n //\n // {\n // \"username\": \"someusername_1\",\n // \"type\": \"subaccount\",\n // \"system_name\": \"someusername_1\",\n // \"security_keys_enabled\": false,\n // \"security_keys_assignments\": [],\n // \"receive_notifications\": false,\n // \"login_enabled\": false,\n // \"is_password\": false,\n // \"id\": \"245499\",\n // \"email\": \"pablo@abcdef.com\"\n // }\n //\n return {\n 'info': account,\n 'id': this.safeString (account, 'id'),\n 'type': this.safeString (account, 'type'),\n 'code': undefined,\n };\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 1053, "line_start" => 1032, "mappings" => [], "name" => "parseBalance", "signature" => "parseBalance (balance): Balances", "source" => "parseBalance (balance): Balances {\n const result: Dict = {\n 'info': balance,\n };\n let summaries = [];\n if ('summaries' in balance) {\n summaries = this.safeList (balance, 'summaries');\n } else {\n summaries = [ balance ];\n }\n for (let i = 0; i < summaries.length; i++) {\n const data = summaries[i];\n const currencyId = this.safeString (data, 'currency');\n const currencyCode = this.safeCurrencyCode (currencyId);\n const account = this.account ();\n account['free'] = this.safeString (data, 'available_funds');\n account['used'] = this.safeString (data, 'maintenance_margin');\n account['total'] = this.safeString (data, 'equity');\n result[currencyCode] = account;\n }\n return this.safeBalance (result);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"withdrawal_priorities\": [],\n \"withdrawal_fee\": 0.01457324,\n \"min_withdrawal_fee\": 0.000001,\n \"min_confirmations\": 1,\n \"fee_precision\": 8,\n \"currency_long\": \"Solana\",\n \"currency\": \"SOL\",\n \"coin_type\": \"SOL\"\n }" ], "line_end" => 3127, "line_start" => 3102, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "fee" }, %{ "comment" => nil, "key" => "withdraw", "value" => "{\n 'fee': this.safeNumber (fee, 'withdrawal_fee'),\n 'percentage': false,\n }" }, %{ "comment" => nil, "key" => "deposit", "value" => "{\n 'fee': undefined,\n 'percentage': undefined,\n }" }, %{ "comment" => nil, "key" => "networks", "value" => "{}" }, %{ "comment" => nil, "key" => "fee", "value" => "undefined" }, %{ "comment" => nil, "key" => "percentage", "value" => "undefined" } ], "name" => "parseDepositWithdrawFee", "signature" => "parseDepositWithdrawFee (fee, currency: Currency = undefined)", "source" => "parseDepositWithdrawFee (fee, currency: Currency = undefined) {\n //\n // {\n // \"withdrawal_priorities\": [],\n // \"withdrawal_fee\": 0.01457324,\n // \"min_withdrawal_fee\": 0.000001,\n // \"min_confirmations\": 1,\n // \"fee_precision\": 8,\n // \"currency_long\": \"Solana\",\n // \"currency\": \"SOL\",\n // \"coin_type\": \"SOL\"\n // }\n //\n return {\n 'info': fee,\n 'withdraw': {\n 'fee': this.safeNumber (fee, 'withdrawal_fee'),\n 'percentage': false,\n },\n 'deposit': {\n 'fee': undefined,\n 'percentage': undefined,\n },\n 'networks': {},\n };\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"jsonrpc\":\"2.0\",\n \"result\":\"0\",\n \"usIn\":\"1691161645596519\",\n \"usOut\":\"1691161645597149\",\n \"usDiff\":\"630\",\n \"testnet\":false\n }", "{\n \"timestamp\": 1569891600000,\n \"index_price\": 8222.87,\n \"prev_index_price\": 8305.72,\n \"interest_8h\": -0.00009234260068476106,\n \"interest_1h\": -4.739622041017375e-7\n }" ], "line_end" => 3317, "line_start" => 3275, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "contract" }, %{ "comment" => nil, "key" => "symbol", "value" => "this.safeSymbol (undefined, market)" }, %{ "comment" => nil, "key" => "markPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "indexPrice", "value" => "this.safeNumber (contract, 'index_price')" }, %{ "comment" => nil, "key" => "interestRate", "value" => "undefined" }, %{ "comment" => nil, "key" => "estimatedSettlePrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "datetime" }, %{ "comment" => nil, "key" => "fundingRate", "value" => "result" }, %{ "comment" => nil, "key" => "fundingTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "fundingDatetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "nextFundingRate", "value" => "undefined" }, %{ "comment" => nil, "key" => "nextFundingTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "nextFundingDatetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "previousFundingRate", "value" => "undefined" }, %{ "comment" => nil, "key" => "previousFundingTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "previousFundingDatetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "interval", "value" => "'8h'" } ], "name" => "parseFundingRate", "signature" => "parseFundingRate (contract, market: Market = undefined): FundingRate", "source" => "parseFundingRate (contract, market: Market = undefined): FundingRate {\n //\n // {\n // \"jsonrpc\":\"2.0\",\n // \"result\":\"0\",\n // \"usIn\":\"1691161645596519\",\n // \"usOut\":\"1691161645597149\",\n // \"usDiff\":\"630\",\n // \"testnet\":false\n // }\n // history\n // {\n // \"timestamp\": 1569891600000,\n // \"index_price\": 8222.87,\n // \"prev_index_price\": 8305.72,\n // \"interest_8h\": -0.00009234260068476106,\n // \"interest_1h\": -4.739622041017375e-7\n // }\n //\n const timestamp = this.safeInteger (contract, 'timestamp');\n const datetime = this.iso8601 (timestamp);\n const result = this.safeNumber2 (contract, 'result', 'interest_8h');\n return {\n 'info': contract,\n 'symbol': this.safeSymbol (undefined, market),\n 'markPrice': undefined,\n 'indexPrice': this.safeNumber (contract, 'index_price'),\n 'interestRate': undefined,\n 'estimatedSettlePrice': undefined,\n 'timestamp': timestamp,\n 'datetime': datetime,\n 'fundingRate': result,\n 'fundingTimestamp': undefined,\n 'fundingDatetime': undefined,\n 'nextFundingRate': undefined,\n 'nextFundingTimestamp': undefined,\n 'nextFundingDatetime': undefined,\n 'previousFundingRate': undefined,\n 'previousFundingTimestamp': undefined,\n 'previousFundingDatetime': undefined,\n 'interval': '8h',\n } as FundingRate;\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"estimated_delivery_price\": 36552.72,\n \"best_bid_amount\": 0.2,\n \"best_ask_amount\": 9.1,\n \"interest_rate\": 0.0,\n \"best_bid_price\": 0.214,\n \"best_ask_price\": 0.219,\n \"open_interest\": 368.8,\n \"settlement_price\": 0.22103022,\n \"last_price\": 0.215,\n \"bid_iv\": 60.51,\n \"ask_iv\": 61.88,\n \"mark_iv\": 61.27,\n \"underlying_index\": \"BTC-27SEP24\",\n \"underlying_price\": 38992.71,\n \"min_price\": 0.1515,\n \"max_price\": 0.326,\n \"mark_price\": 0.2168,\n \"instrument_name\": \"BTC-27SEP24-40000-C\",\n \"index_price\": 36552.72,\n \"greeks\": {\n \"rho\": 130.63998,\n \"theta\": -13.48784,\n \"vega\": 141.90146,\n \"gamma\": 0.00002,\n \"delta\": 0.59621\n },\n \"stats\": {\n \"volume_usd\": 100453.9,\n \"volume\": 12.0,\n \"price_change\": -2.2727,\n \"low\": 0.2065,\n \"high\": 0.238\n },\n \"state\": \"open\",\n \"timestamp\": 1699578548021\n }" ], "line_end" => 3617, "line_start" => 3552, "mappings" => [ %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "delta", "value" => "this.safeNumber (stats, 'delta')" }, %{ "comment" => nil, "key" => "gamma", "value" => "this.safeNumber (stats, 'gamma')" }, %{ "comment" => nil, "key" => "theta", "value" => "this.safeNumber (stats, 'theta')" }, %{ "comment" => nil, "key" => "vega", "value" => "this.safeNumber (stats, 'vega')" }, %{ "comment" => nil, "key" => "rho", "value" => "this.safeNumber (stats, 'rho')" }, %{ "comment" => nil, "key" => "bidSize", "value" => "this.safeNumber (greeks, 'best_bid_amount')" }, %{ "comment" => nil, "key" => "askSize", "value" => "this.safeNumber (greeks, 'best_ask_amount')" }, %{ "comment" => nil, "key" => "bidImpliedVolatility", "value" => "this.safeNumber (greeks, 'bid_iv')" }, %{ "comment" => nil, "key" => "askImpliedVolatility", "value" => "this.safeNumber (greeks, 'ask_iv')" }, %{ "comment" => nil, "key" => "markImpliedVolatility", "value" => "this.safeNumber (greeks, 'mark_iv')" }, %{ "comment" => nil, "key" => "bidPrice", "value" => "this.safeNumber (greeks, 'best_bid_price')" }, %{ "comment" => nil, "key" => "askPrice", "value" => "this.safeNumber (greeks, 'best_ask_price')" }, %{ "comment" => nil, "key" => "markPrice", "value" => "this.safeNumber (greeks, 'mark_price')" }, %{ "comment" => nil, "key" => "lastPrice", "value" => "this.safeNumber (greeks, 'last_price')" }, %{ "comment" => nil, "key" => "underlyingPrice", "value" => "this.safeNumber (greeks, 'underlying_price')" }, %{ "comment" => nil, "key" => "info", "value" => "greeks" } ], "name" => "parseGreeks", "signature" => "parseGreeks (greeks: Dict, market: Market = undefined): Greeks", "source" => "parseGreeks (greeks: Dict, market: Market = undefined): Greeks {\n //\n // {\n // \"estimated_delivery_price\": 36552.72,\n // \"best_bid_amount\": 0.2,\n // \"best_ask_amount\": 9.1,\n // \"interest_rate\": 0.0,\n // \"best_bid_price\": 0.214,\n // \"best_ask_price\": 0.219,\n // \"open_interest\": 368.8,\n // \"settlement_price\": 0.22103022,\n // \"last_price\": 0.215,\n // \"bid_iv\": 60.51,\n // \"ask_iv\": 61.88,\n // \"mark_iv\": 61.27,\n // \"underlying_index\": \"BTC-27SEP24\",\n // \"underlying_price\": 38992.71,\n // \"min_price\": 0.1515,\n // \"max_price\": 0.326,\n // \"mark_price\": 0.2168,\n // \"instrument_name\": \"BTC-27SEP24-40000-C\",\n // \"index_price\": 36552.72,\n // \"greeks\": {\n // \"rho\": 130.63998,\n // \"theta\": -13.48784,\n // \"vega\": 141.90146,\n // \"gamma\": 0.00002,\n // \"delta\": 0.59621\n // },\n // \"stats\": {\n // \"volume_usd\": 100453.9,\n // \"volume\": 12.0,\n // \"price_change\": -2.2727,\n // \"low\": 0.2065,\n // \"high\": 0.238\n // },\n // \"state\": \"open\",\n // \"timestamp\": 1699578548021\n // }\n //\n const timestamp = this.safeInteger (greeks, 'timestamp');\n const marketId = this.safeString (greeks, 'instrument_name');\n const symbol = this.safeSymbol (marketId, market);\n const stats = this.safeValue (greeks, 'greeks', {});\n return {\n 'symbol': symbol,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'delta': this.safeNumber (stats, 'delta'),\n 'gamma': this.safeNumber (stats, 'gamma'),\n 'theta': this.safeNumber (stats, 'theta'),\n 'vega': this.safeNumber (stats, 'vega'),\n 'rho': this.safeNumber (stats, 'rho'),\n 'bidSize': this.safeNumber (greeks, 'best_bid_amount'),\n 'askSize': this.safeNumber (greeks, 'best_ask_amount'),\n 'bidImpliedVolatility': this.safeNumber (greeks, 'bid_iv'),\n 'askImpliedVolatility': this.safeNumber (greeks, 'ask_iv'),\n 'markImpliedVolatility': this.safeNumber (greeks, 'mark_iv'),\n 'bidPrice': this.safeNumber (greeks, 'best_bid_price'),\n 'askPrice': this.safeNumber (greeks, 'best_ask_price'),\n 'markPrice': this.safeNumber (greeks, 'mark_price'),\n 'lastPrice': this.safeNumber (greeks, 'last_price'),\n 'underlyingPrice': this.safeNumber (greeks, 'underlying_price'),\n 'info': greeks,\n };\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"type\": \"bankruptcy\",\n \"timestamp\": 1696579200041,\n \"funded\": 1,\n \"session_bankrupcy\": 0.001,\n \"session_profit_loss\": 0.001,\n \"session_tax\": 0.0015,\n \"session_tax_rate\": 0.0015,\n \"socialized\": 0.001,\n }" ], "line_end" => 3484, "line_start" => 3459, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "liquidation" }, %{ "comment" => nil, "key" => "symbol", "value" => "this.safeSymbol (undefined, market)" }, %{ "comment" => nil, "key" => "contracts", "value" => "undefined" }, %{ "comment" => nil, "key" => "contractSize", "value" => "this.safeNumber (market, 'contractSize')" }, %{ "comment" => nil, "key" => "price", "value" => "undefined" }, %{ "comment" => nil, "key" => "baseValue", "value" => "this.safeNumber (liquidation, 'session_bankrupcy')" }, %{ "comment" => nil, "key" => "quoteValue", "value" => "undefined" }, %{ "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 // \"type\": \"bankruptcy\",\n // \"timestamp\": 1696579200041,\n // \"funded\": 1,\n // \"session_bankrupcy\": 0.001,\n // \"session_profit_loss\": 0.001,\n // \"session_tax\": 0.0015,\n // \"session_tax_rate\": 0.0015,\n // \"socialized\": 0.001,\n // }\n //\n const timestamp = this.safeInteger (liquidation, 'timestamp');\n return this.safeLiquidation ({\n 'info': liquidation,\n 'symbol': this.safeSymbol (undefined, market),\n 'contracts': undefined,\n 'contractSize': this.safeNumber (market, 'contractSize'),\n 'price': undefined,\n 'baseValue': this.safeNumber (liquidation, 'session_bankrupcy'),\n 'quoteValue': undefined,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n });\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"high\": 93099.5,\n \"low\": 81773.0,\n \"last\": 87197.0,\n \"instrument_name\": \"BTC-PERPETUAL\",\n \"bid_price\": 87083.0,\n \"ask_price\": 87149.5,\n \"open_interest\": 9978911260,\n \"mark_price\": 87102.01,\n \"creation_timestamp\": 1763674177068,\n \"price_change\": -3.2032,\n \"volume\": 7377.18657991,\n \"estimated_delivery_price\": 87047.2,\n \"base_currency\": \"BTC\",\n \"quote_currency\": \"USD\",\n \"volume_usd\": 661040250.0,\n \"volume_notional\": 661040250.0,\n \"current_funding\": 1.2966e-4,\n \"funding_8h\": -8.1069e-4,\n \"mid_price\": 87116.25\n }" ], "line_end" => 3874, "line_start" => 3831, "mappings" => [ %{ "comment" => nil, "key" => "symbol", "value" => "this.safeSymbol (marketId, market)" }, %{ "comment" => nil, "key" => "openInterestAmount", "value" => "openInterestAmount" }, %{ "comment" => nil, "key" => "openInterestValue", "value" => "openInterestValue" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "info", "value" => "interest" } ], "name" => "parseOpenInterest", "signature" => "parseOpenInterest (interest, market: Market = undefined)", "source" => "parseOpenInterest (interest, market: Market = undefined) {\n //\n // {\n // \"high\": 93099.5,\n // \"low\": 81773.0,\n // \"last\": 87197.0,\n // \"instrument_name\": \"BTC-PERPETUAL\",\n // \"bid_price\": 87083.0,\n // \"ask_price\": 87149.5,\n // \"open_interest\": 9978911260,\n // \"mark_price\": 87102.01,\n // \"creation_timestamp\": 1763674177068,\n // \"price_change\": -3.2032,\n // \"volume\": 7377.18657991,\n // \"estimated_delivery_price\": 87047.2,\n // \"base_currency\": \"BTC\",\n // \"quote_currency\": \"USD\",\n // \"volume_usd\": 661040250.0,\n // \"volume_notional\": 661040250.0,\n // \"current_funding\": 1.2966e-4,\n // \"funding_8h\": -8.1069e-4,\n // \"mid_price\": 87116.25\n // }\n //\n const timestamp = this.safeInteger (interest, 'creation_timestamp');\n const marketId = this.safeString (interest, 'instrument_name');\n market = this.safeMarket (marketId, market);\n const openInterest = this.safeNumber (interest, 'open_interest');\n let openInterestAmount = undefined;\n let openInterestValue = undefined;\n if (market['option'] || (market['future'] && market['linear'])) {\n openInterestAmount = openInterest;\n } else {\n openInterestValue = openInterest;\n }\n return this.safeOpenInterest ({\n 'symbol': this.safeSymbol (marketId, market),\n 'openInterestAmount': openInterestAmount,\n 'openInterestValue': openInterestValue,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'info': interest,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"mid_price\": 0.04025,\n \"volume_usd\": 11045.12,\n \"quote_currency\": \"BTC\",\n \"estimated_delivery_price\": 65444.72,\n \"creation_timestamp\": 1711100949273,\n \"base_currency\": \"BTC\",\n \"underlying_index\": \"BTC-27DEC24\",\n \"underlying_price\": 73742.14,\n \"volume\": 4.0,\n \"interest_rate\": 0.0,\n \"price_change\": -6.9767,\n \"open_interest\": 274.2,\n \"ask_price\": 0.042,\n \"bid_price\": 0.0385,\n \"instrument_name\": \"BTC-27DEC24-240000-C\",\n \"mark_price\": 0.04007735,\n \"last\": 0.04,\n \"low\": 0.04,\n \"high\": 0.043\n }" ], "line_end" => 3773, "line_start" => 3725, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "chain" }, %{ "comment" => nil, "key" => "currency", "value" => "code" }, %{ "comment" => nil, "key" => "symbol", "value" => "market['symbol']" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "impliedVolatility", "value" => "undefined" }, %{ "comment" => nil, "key" => "openInterest", "value" => "this.safeNumber (chain, 'open_interest')" }, %{ "comment" => nil, "key" => "bidPrice", "value" => "this.safeNumber (chain, 'bid_price')" }, %{ "comment" => nil, "key" => "askPrice", "value" => "this.safeNumber (chain, 'ask_price')" }, %{ "comment" => nil, "key" => "midPrice", "value" => "this.safeNumber (chain, 'mid_price')" }, %{ "comment" => nil, "key" => "markPrice", "value" => "this.safeNumber (chain, 'mark_price')" }, %{ "comment" => nil, "key" => "lastPrice", "value" => "this.safeNumber (chain, 'last')" }, %{ "comment" => nil, "key" => "underlyingPrice", "value" => "this.safeNumber (chain, 'underlying_price')" }, %{ "comment" => nil, "key" => "change", "value" => "undefined" }, %{ "comment" => nil, "key" => "percentage", "value" => "this.safeNumber (chain, 'price_change')" }, %{ "comment" => nil, "key" => "baseVolume", "value" => "this.safeNumber (chain, 'volume')" }, %{ "comment" => nil, "key" => "quoteVolume", "value" => "this.safeNumber (chain, 'volume_usd')" } ], "name" => "parseOption", "signature" => "parseOption (chain: Dict, currency: Currency = undefined, market: Market = undefined): Option", "source" => "parseOption (chain: Dict, currency: Currency = undefined, market: Market = undefined): Option {\n //\n // {\n // \"mid_price\": 0.04025,\n // \"volume_usd\": 11045.12,\n // \"quote_currency\": \"BTC\",\n // \"estimated_delivery_price\": 65444.72,\n // \"creation_timestamp\": 1711100949273,\n // \"base_currency\": \"BTC\",\n // \"underlying_index\": \"BTC-27DEC24\",\n // \"underlying_price\": 73742.14,\n // \"volume\": 4.0,\n // \"interest_rate\": 0.0,\n // \"price_change\": -6.9767,\n // \"open_interest\": 274.2,\n // \"ask_price\": 0.042,\n // \"bid_price\": 0.0385,\n // \"instrument_name\": \"BTC-27DEC24-240000-C\",\n // \"mark_price\": 0.04007735,\n // \"last\": 0.04,\n // \"low\": 0.04,\n // \"high\": 0.043\n // }\n //\n const marketId = this.safeString (chain, 'instrument_name');\n market = this.safeMarket (marketId, market);\n const currencyId = this.safeString (chain, 'base_currency');\n const code = this.safeCurrencyCode (currencyId, currency);\n const timestamp = this.safeInteger (chain, 'timestamp');\n return {\n 'info': chain,\n 'currency': code,\n 'symbol': market['symbol'],\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'impliedVolatility': undefined,\n 'openInterest': this.safeNumber (chain, 'open_interest'),\n 'bidPrice': this.safeNumber (chain, 'bid_price'),\n 'askPrice': this.safeNumber (chain, 'ask_price'),\n 'midPrice': this.safeNumber (chain, 'mid_price'),\n 'markPrice': this.safeNumber (chain, 'mark_price'),\n 'lastPrice': this.safeNumber (chain, 'last'),\n 'underlyingPrice': this.safeNumber (chain, 'underlying_price'),\n 'change': undefined,\n 'percentage': this.safeNumber (chain, 'price_change'),\n 'baseVolume': this.safeNumber (chain, 'volume'),\n 'quoteVolume': this.safeNumber (chain, 'volume_usd'),\n };\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"time_in_force\": \"good_til_cancelled\",\n \"reduce_only\": false,\n \"profit_loss\": 0,\n \"price\": \"market_price\",\n \"post_only\": false,\n \"order_type\": \"market\",\n \"order_state\": \"filled\",\n \"order_id\": \"ETH-349249\",\n \"max_show\": 40,\n \"last_update_timestamp\": 1550657341322,\n \"label\": \"market0000234\",\n \"is_liquidation\": false,\n \"instrument_name\": \"ETH-PERPETUAL\",\n \"filled_amount\": 40,\n \"direction\": \"buy\",\n \"creation_timestamp\": 1550657341322,\n \"commission\": 0.000139,\n \"average_price\": 143.81,\n \"api\": true,\n \"amount\": 40,\n \"trades\": [], // injected by createOrder\n }" ], "line_end" => 1966, "line_start" => 1871, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "order" }, %{ "comment" => nil, "key" => "id", "value" => "id" }, %{ "comment" => nil, "key" => "clientOrderId", "value" => "undefined" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "lastTradeTimestamp", "value" => "lastTradeTimestamp" }, %{ "comment" => nil, "key" => "symbol", "value" => "market['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" => "priceString" }, %{ "comment" => nil, "key" => "triggerPrice", "value" => "this.safeValue (order, 'stop_price')" }, %{ "comment" => nil, "key" => "amount", "value" => "amount" }, %{ "comment" => nil, "key" => "cost", "value" => "cost" }, %{ "comment" => nil, "key" => "average", "value" => "averageString" }, %{ "comment" => nil, "key" => "filled", "value" => "filledString" }, %{ "comment" => nil, "key" => "remaining", "value" => "undefined" }, %{ "comment" => nil, "key" => "status", "value" => "status" }, %{ "comment" => nil, "key" => "fee", "value" => "fee" }, %{ "comment" => nil, "key" => "trades", "value" => "trades" } ], "name" => "parseOrder", "signature" => "parseOrder (order: Dict, market: Market = undefined): Order", "source" => "parseOrder (order: Dict, market: Market = undefined): Order {\n //\n // createOrder\n //\n // {\n // \"time_in_force\": \"good_til_cancelled\",\n // \"reduce_only\": false,\n // \"profit_loss\": 0,\n // \"price\": \"market_price\",\n // \"post_only\": false,\n // \"order_type\": \"market\",\n // \"order_state\": \"filled\",\n // \"order_id\": \"ETH-349249\",\n // \"max_show\": 40,\n // \"last_update_timestamp\": 1550657341322,\n // \"label\": \"market0000234\",\n // \"is_liquidation\": false,\n // \"instrument_name\": \"ETH-PERPETUAL\",\n // \"filled_amount\": 40,\n // \"direction\": \"buy\",\n // \"creation_timestamp\": 1550657341322,\n // \"commission\": 0.000139,\n // \"average_price\": 143.81,\n // \"api\": true,\n // \"amount\": 40,\n // \"trades\": [], // injected by createOrder\n // }\n //\n const marketId = this.safeString (order, 'instrument_name');\n market = this.safeMarket (marketId, market);\n const timestamp = this.safeInteger (order, 'creation_timestamp');\n const lastUpdate = this.safeInteger (order, 'last_update_timestamp');\n const id = this.safeString (order, 'order_id');\n let priceString = this.safeString (order, 'price');\n if (priceString === 'market_price') {\n priceString = undefined;\n }\n const averageString = this.safeString (order, 'average_price');\n // Inverse contracts amount is in USD which in ccxt is the cost\n // For options and Linear contracts amount is in corresponding cryptocurrency, e.g., BTC or ETH\n const filledString = this.safeString (order, 'filled_amount');\n const amount = this.safeString (order, 'amount');\n let cost = Precise.stringMul (filledString, averageString);\n if (this.safeBool (market, 'inverse')) {\n if (averageString !== '0') {\n cost = Precise.stringDiv (amount, averageString);\n }\n }\n let lastTradeTimestamp = undefined;\n if (filledString !== undefined) {\n const isFilledPositive = Precise.stringGt (filledString, '0');\n if (isFilledPositive) {\n lastTradeTimestamp = lastUpdate;\n }\n }\n const status = this.parseOrderStatus (this.safeString (order, 'order_state'));\n const side = this.safeStringLower (order, 'direction');\n let feeCostString = this.safeString (order, 'commission');\n let fee = undefined;\n if (feeCostString !== undefined) {\n feeCostString = Precise.stringAbs (feeCostString);\n fee = {\n 'cost': feeCostString,\n 'currency': market['base'],\n };\n }\n const rawType = this.safeString (order, 'order_type');\n const type = this.parseOrderType (rawType);\n // injected in createOrder\n const trades = this.safeValue (order, 'trades');\n const timeInForce = this.parseTimeInForce (this.safeString (order, 'time_in_force'));\n const postOnly = this.safeValue (order, 'post_only');\n return this.safeOrder ({\n 'info': order,\n 'id': id,\n 'clientOrderId': undefined,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'lastTradeTimestamp': lastTradeTimestamp,\n 'symbol': market['symbol'],\n 'type': type,\n 'timeInForce': timeInForce,\n 'postOnly': postOnly,\n 'side': side,\n 'price': priceString,\n 'triggerPrice': this.safeValue (order, 'stop_price'),\n 'amount': amount,\n 'cost': cost,\n 'average': averageString,\n 'filled': filledString,\n 'remaining': undefined,\n 'status': status,\n 'fee': fee,\n 'trades': trades,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 1850, "line_start" => 1841, "mappings" => [], "name" => "parseOrderStatus", "signature" => "parseOrderStatus (status: Str)", "source" => "parseOrderStatus (status: Str) {\n const statuses: Dict = {\n 'open': 'open',\n 'cancelled': 'canceled',\n 'filled': 'closed',\n 'rejected': 'rejected',\n 'untriggered': 'open',\n };\n return this.safeString (statuses, status, status);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 1869, "line_start" => 1861, "mappings" => [], "name" => "parseOrderType", "signature" => "parseOrderType (orderType)", "source" => "parseOrderType (orderType) {\n const orderTypes: Dict = {\n 'stop_limit': 'limit',\n 'take_limit': 'limit',\n 'stop_market': 'market',\n 'take_market': 'market',\n };\n return this.safeString (orderTypes, orderType, orderType);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"jsonrpc\": \"2.0\",\n \"id\": 404,\n \"result\": {\n \"average_price\": 0,\n \"delta\": 0,\n \"direction\": \"buy\",\n \"estimated_liquidation_price\": 0,\n \"floating_profit_loss\": 0,\n \"index_price\": 3555.86,\n \"initial_margin\": 0,\n \"instrument_name\": \"BTC-PERPETUAL\",\n \"leverage\": 100,\n \"kind\": \"future\",\n \"maintenance_margin\": 0,\n \"mark_price\": 3556.62,\n \"open_orders_margin\": 0.000165889,\n \"realized_profit_loss\": 0,\n \"settlement_price\": 3555.44,\n \"size\": 0,\n \"size_currency\": 0,\n \"total_profit_loss\": 0\n }\n }" ], "line_end" => 2747, "line_start" => 2681, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "position" }, %{ "comment" => nil, "key" => "id", "value" => "undefined" }, %{ "comment" => nil, "key" => "symbol", "value" => "this.safeString (market, 'symbol')" }, %{ "comment" => nil, "key" => "timestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "datetime", "value" => "undefined" }, %{ "comment" => nil, "key" => "lastUpdateTimestamp", "value" => "undefined" }, %{ "comment" => nil, "key" => "initialMargin", "value" => "this.parseNumber (initialMarginString)" }, %{ "comment" => nil, "key" => "initialMarginPercentage", "value" => "this.parseNumber (Precise.stringMul (Precise.stringDiv (initialMarginString, notionalStringAbs), '100'))" }, %{ "comment" => nil, "key" => "maintenanceMargin", "value" => "this.parseNumber (maintenanceMarginString)" }, %{ "comment" => nil, "key" => "maintenanceMarginPercentage", "value" => "this.parseNumber (Precise.stringMul (Precise.stringDiv (maintenanceMarginString, notionalStringAbs), '100'))" }, %{ "comment" => nil, "key" => "entryPrice", "value" => "this.safeNumber (position, 'average_price')" }, %{ "comment" => nil, "key" => "notional", "value" => "this.parseNumber (notionalStringAbs)" }, %{ "comment" => nil, "key" => "leverage", "value" => "this.safeInteger (position, 'leverage')" }, %{ "comment" => nil, "key" => "unrealizedPnl", "value" => "this.parseNumber (unrealizedPnl)" }, %{ "comment" => nil, "key" => "realizedPnl", "value" => "this.safeNumber (position, 'realized_profit_loss')" }, %{ "comment" => nil, "key" => "contracts", "value" => "this.safeNumber (position, 'size')" }, %{ "comment" => nil, "key" => "contractSize", "value" => "this.safeNumber (position, 'contractSize')" }, %{ "comment" => nil, "key" => "marginRatio", "value" => "undefined" }, %{ "comment" => nil, "key" => "liquidationPrice", "value" => "this.safeNumber (position, 'estimated_liquidation_price')" }, %{ "comment" => nil, "key" => "markPrice", "value" => "this.safeNumber (position, 'mark_price')" }, %{ "comment" => nil, "key" => "lastPrice", "value" => "undefined" }, %{ "comment" => nil, "key" => "collateral", "value" => "undefined" }, %{ "comment" => nil, "key" => "marginMode", "value" => "undefined" }, %{ "comment" => nil, "key" => "side", "value" => "side" }, %{ "comment" => nil, "key" => "percentage", "value" => "undefined" }, %{ "comment" => nil, "key" => "hedged", "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 // \"jsonrpc\": \"2.0\",\n // \"id\": 404,\n // \"result\": {\n // \"average_price\": 0,\n // \"delta\": 0,\n // \"direction\": \"buy\",\n // \"estimated_liquidation_price\": 0,\n // \"floating_profit_loss\": 0,\n // \"index_price\": 3555.86,\n // \"initial_margin\": 0,\n // \"instrument_name\": \"BTC-PERPETUAL\",\n // \"leverage\": 100,\n // \"kind\": \"future\",\n // \"maintenance_margin\": 0,\n // \"mark_price\": 3556.62,\n // \"open_orders_margin\": 0.000165889,\n // \"realized_profit_loss\": 0,\n // \"settlement_price\": 3555.44,\n // \"size\": 0,\n // \"size_currency\": 0,\n // \"total_profit_loss\": 0\n // }\n // }\n //\n const contract = this.safeString (position, 'instrument_name');\n market = this.safeMarket (contract, market);\n let side = this.safeString (position, 'direction');\n side = (side === 'buy') ? 'long' : 'short';\n const unrealizedPnl = this.safeString (position, 'floating_profit_loss');\n const initialMarginString = this.safeString (position, 'initial_margin');\n const notionalString = this.safeString (position, 'size_currency');\n const notionalStringAbs = Precise.stringAbs (notionalString);\n const maintenanceMarginString = this.safeString (position, 'maintenance_margin');\n return this.safePosition ({\n 'info': position,\n 'id': undefined,\n 'symbol': this.safeString (market, 'symbol'),\n 'timestamp': undefined,\n 'datetime': undefined,\n 'lastUpdateTimestamp': undefined,\n 'initialMargin': this.parseNumber (initialMarginString),\n 'initialMarginPercentage': this.parseNumber (Precise.stringMul (Precise.stringDiv (initialMarginString, notionalStringAbs), '100')),\n 'maintenanceMargin': this.parseNumber (maintenanceMarginString),\n 'maintenanceMarginPercentage': this.parseNumber (Precise.stringMul (Precise.stringDiv (maintenanceMarginString, notionalStringAbs), '100')),\n 'entryPrice': this.safeNumber (position, 'average_price'),\n 'notional': this.parseNumber (notionalStringAbs),\n 'leverage': this.safeInteger (position, 'leverage'),\n 'unrealizedPnl': this.parseNumber (unrealizedPnl),\n 'realizedPnl': this.safeNumber (position, 'realized_profit_loss'),\n 'contracts': this.safeNumber (position, 'size'),\n 'contractSize': this.safeNumber (position, 'contractSize'),\n 'marginRatio': undefined,\n 'liquidationPrice': this.safeNumber (position, 'estimated_liquidation_price'),\n 'markPrice': this.safeNumber (position, 'mark_price'),\n 'lastPrice': undefined,\n 'collateral': undefined,\n 'marginMode': undefined,\n 'side': side,\n 'percentage': undefined,\n 'hedged': undefined,\n 'stopLossPrice': undefined,\n 'takeProfitPrice': undefined,\n });\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"timestamp\": 1583778859480,\n \"stats\": { volume: 60627.57263769, low: 7631.5, high: 8311.5 },\n \"state\": \"open\",\n \"settlement_price\": 7903.21,\n \"open_interest\": 111543850,\n \"min_price\": 7634,\n \"max_price\": 7866.51,\n \"mark_price\": 7750.02,\n \"last_price\": 7750.5,\n \"instrument_name\": \"BTC-PERPETUAL\",\n \"index_price\": 7748.01,\n \"funding_8h\": 0.0000026,\n \"current_funding\": 0,\n \"best_bid_price\": 7750,\n \"best_bid_amount\": 19470,\n \"best_ask_price\": 7750.5,\n \"best_ask_amount\": 343280\n }", "{\n \"volume\": 124.1,\n \"underlying_price\": 7856.445926872601,\n \"underlying_index\": \"SYN.BTC-10MAR20\",\n \"quote_currency\": \"USD\",\n \"open_interest\": 121.8,\n \"mid_price\": 0.01975,\n \"mark_price\": 0.01984559,\n \"low\": 0.0095,\n \"last\": 0.0205,\n \"interest_rate\": 0,\n \"instrument_name\": \"BTC-10MAR20-7750-C\",\n \"high\": 0.0295,\n \"estimated_delivery_price\": 7856.29,\n \"creation_timestamp\": 1583783678366,\n \"bid_price\": 0.0185,\n \"base_currency\": \"BTC\",\n \"ask_price\": 0.021\n }," ], "line_end" => 1287, "line_start" => 1211, "mappings" => [ %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "high", "value" => "this.safeString2 (stats, 'high', 'max_price')" }, %{ "comment" => nil, "key" => "low", "value" => "this.safeString2 (stats, 'low', 'min_price')" }, %{ "comment" => nil, "key" => "bid", "value" => "this.safeString2 (ticker, 'best_bid_price', 'bid_price')" }, %{ "comment" => nil, "key" => "bidVolume", "value" => "this.safeString (ticker, 'best_bid_amount')" }, %{ "comment" => nil, "key" => "ask", "value" => "this.safeString2 (ticker, 'best_ask_price', 'ask_price')" }, %{ "comment" => nil, "key" => "askVolume", "value" => "this.safeString (ticker, 'best_ask_amount')" }, %{ "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" => "undefined" }, %{ "comment" => nil, "key" => "percentage", "value" => "undefined" }, %{ "comment" => nil, "key" => "average", "value" => "undefined" }, %{ "comment" => nil, "key" => "baseVolume", "value" => "undefined" }, %{ "comment" => nil, "key" => "quoteVolume", "value" => "this.safeString (stats, 'volume')" }, %{ "comment" => nil, "key" => "markPrice", "value" => "this.safeString (ticker, 'mark_price')" }, %{ "comment" => nil, "key" => "indexPrice", "value" => "this.safeString (ticker, 'index_price')" }, %{ "comment" => nil, "key" => "info", "value" => "ticker" } ], "name" => "parseTicker", "signature" => "parseTicker (ticker: Dict, market: Market = undefined): Ticker", "source" => "parseTicker (ticker: Dict, market: Market = undefined): Ticker {\n //\n // fetchTicker /public/ticker\n //\n // {\n // \"timestamp\": 1583778859480,\n // \"stats\": { volume: 60627.57263769, low: 7631.5, high: 8311.5 },\n // \"state\": \"open\",\n // \"settlement_price\": 7903.21,\n // \"open_interest\": 111543850,\n // \"min_price\": 7634,\n // \"max_price\": 7866.51,\n // \"mark_price\": 7750.02,\n // \"last_price\": 7750.5,\n // \"instrument_name\": \"BTC-PERPETUAL\",\n // \"index_price\": 7748.01,\n // \"funding_8h\": 0.0000026,\n // \"current_funding\": 0,\n // \"best_bid_price\": 7750,\n // \"best_bid_amount\": 19470,\n // \"best_ask_price\": 7750.5,\n // \"best_ask_amount\": 343280\n // }\n //\n // fetchTicker /public/get_book_summary_by_instrument\n // fetchTickers /public/get_book_summary_by_currency\n //\n // {\n // \"volume\": 124.1,\n // \"underlying_price\": 7856.445926872601,\n // \"underlying_index\": \"SYN.BTC-10MAR20\",\n // \"quote_currency\": \"USD\",\n // \"open_interest\": 121.8,\n // \"mid_price\": 0.01975,\n // \"mark_price\": 0.01984559,\n // \"low\": 0.0095,\n // \"last\": 0.0205,\n // \"interest_rate\": 0,\n // \"instrument_name\": \"BTC-10MAR20-7750-C\",\n // \"high\": 0.0295,\n // \"estimated_delivery_price\": 7856.29,\n // \"creation_timestamp\": 1583783678366,\n // \"bid_price\": 0.0185,\n // \"base_currency\": \"BTC\",\n // \"ask_price\": 0.021\n // },\n //\n const timestamp = this.safeInteger2 (ticker, 'timestamp', 'creation_timestamp');\n const marketId = this.safeString (ticker, 'instrument_name');\n const symbol = this.safeSymbol (marketId, market);\n const last = this.safeString2 (ticker, 'last_price', 'last');\n const stats = this.safeValue (ticker, 'stats', ticker);\n return this.safeTicker ({\n 'symbol': symbol,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'high': this.safeString2 (stats, 'high', 'max_price'),\n 'low': this.safeString2 (stats, 'low', 'min_price'),\n 'bid': this.safeString2 (ticker, 'best_bid_price', 'bid_price'),\n 'bidVolume': this.safeString (ticker, 'best_bid_amount'),\n 'ask': this.safeString2 (ticker, 'best_ask_price', 'ask_price'),\n 'askVolume': this.safeString (ticker, 'best_ask_amount'),\n 'vwap': undefined,\n 'open': undefined,\n 'close': last,\n 'last': last,\n 'previousClose': undefined,\n 'change': undefined,\n 'percentage': undefined,\n 'average': undefined,\n 'baseVolume': undefined,\n 'quoteVolume': this.safeString (stats, 'volume'),\n 'markPrice': this.safeString (ticker, 'mark_price'),\n 'indexPrice': this.safeString (ticker, 'index_price'),\n 'info': ticker,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 1859, "line_start" => 1852, "mappings" => [], "name" => "parseTimeInForce", "signature" => "parseTimeInForce (timeInForce: Str)", "source" => "parseTimeInForce (timeInForce: Str) {\n const timeInForces: Dict = {\n 'good_til_cancelled': 'GTC',\n 'fill_or_kill': 'FOK',\n 'immediate_or_cancel': 'IOC',\n };\n return this.safeString (timeInForces, timeInForce, timeInForce);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"trade_seq\":132564271,\n \"trade_id\":\"195402220\",\n \"timestamp\":1639684927932,\n \"tick_direction\":0,\n \"price\":47946.5,\n \"mark_price\":47944.13,\n \"instrument_name\":\"BTC-PERPETUAL\",\n \"index_price\":47925.45,\n \"direction\":\"buy\",\n \"amount\":580.0\n }", "{\n \"trade_seq\": 3,\n \"trade_id\": \"ETH-34066\",\n \"timestamp\": 1550219814585,\n \"tick_direction\": 1,\n \"state\": \"open\",\n \"self_trade\": false,\n \"reduce_only\": false,\n \"price\": 0.04,\n \"post_only\": false,\n \"order_type\": \"limit\",\n \"order_id\": \"ETH-334607\",\n \"matching_id\": null,\n \"liquidity\": \"M\",\n \"iv\": 56.83,\n \"instrument_name\": \"ETH-22FEB19-120-C\",\n \"index_price\": 121.37,\n \"fee_currency\": \"ETH\",\n \"fee\": 0.0011,\n \"direction\": \"buy\",\n \"amount\": 11\n }" ], "line_end" => 1587, "line_start" => 1499, "mappings" => [ %{ "comment" => nil, "key" => "id", "value" => "id" }, %{ "comment" => nil, "key" => "info", "value" => "trade" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "symbol", "value" => "symbol" }, %{ "comment" => nil, "key" => "order", "value" => "this.safeString (trade, 'order_id')" }, %{ "comment" => nil, "key" => "type", "value" => "this.safeString (trade, 'order_type')" }, %{ "comment" => nil, "key" => "side", "value" => "side" }, %{ "comment" => nil, "key" => "takerOrMaker", "value" => "takerOrMaker" }, %{ "comment" => nil, "key" => "price", "value" => "priceString" }, %{ "comment" => nil, "key" => "amount", "value" => "amount" }, %{ "comment" => nil, "key" => "cost", "value" => "cost" }, %{ "comment" => nil, "key" => "fee", "value" => "fee" }, %{ "comment" => nil, "key" => "cost", "value" => "feeCostString" }, %{ "comment" => nil, "key" => "currency", "value" => "feeCurrencyCode" } ], "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 // \"trade_seq\":132564271,\n // \"trade_id\":\"195402220\",\n // \"timestamp\":1639684927932,\n // \"tick_direction\":0,\n // \"price\":47946.5,\n // \"mark_price\":47944.13,\n // \"instrument_name\":\"BTC-PERPETUAL\",\n // \"index_price\":47925.45,\n // \"direction\":\"buy\",\n // \"amount\":580.0\n // }\n //\n //\n // fetchMyTrades, fetchOrderTrades (private)\n //\n // {\n // \"trade_seq\": 3,\n // \"trade_id\": \"ETH-34066\",\n // \"timestamp\": 1550219814585,\n // \"tick_direction\": 1,\n // \"state\": \"open\",\n // \"self_trade\": false,\n // \"reduce_only\": false,\n // \"price\": 0.04,\n // \"post_only\": false,\n // \"order_type\": \"limit\",\n // \"order_id\": \"ETH-334607\",\n // \"matching_id\": null,\n // \"liquidity\": \"M\",\n // \"iv\": 56.83,\n // \"instrument_name\": \"ETH-22FEB19-120-C\",\n // \"index_price\": 121.37,\n // \"fee_currency\": \"ETH\",\n // \"fee\": 0.0011,\n // \"direction\": \"buy\",\n // \"amount\": 11\n // }\n //\n const id = this.safeString (trade, 'trade_id');\n const marketId = this.safeString (trade, 'instrument_name');\n const symbol = this.safeSymbol (marketId, market);\n const timestamp = this.safeInteger (trade, 'timestamp');\n const side = this.safeString (trade, 'direction');\n const priceString = this.safeString (trade, 'price');\n market = this.safeMarket (marketId, market);\n // Amount for inverse perpetual and futures is in USD which in ccxt is the cost\n // For options amount and linear is in corresponding cryptocurrency contracts, e.g., BTC or ETH\n const amount = this.safeString (trade, 'amount');\n let cost = Precise.stringMul (amount, priceString);\n if (market['inverse']) {\n cost = Precise.stringDiv (amount, priceString);\n }\n const liquidity = this.safeString (trade, 'liquidity');\n let takerOrMaker = undefined;\n if (liquidity !== undefined) {\n // M = maker, T = taker, MT = both\n takerOrMaker = (liquidity === 'M') ? 'maker' : 'taker';\n }\n const feeCostString = this.safeString (trade, 'fee');\n let fee = undefined;\n if (feeCostString !== undefined) {\n const feeCurrencyId = this.safeString (trade, 'fee_currency');\n const feeCurrencyCode = this.safeCurrencyCode (feeCurrencyId);\n fee = {\n 'cost': feeCostString,\n 'currency': feeCurrencyCode,\n };\n }\n return this.safeTrade ({\n 'id': id,\n 'info': trade,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'symbol': symbol,\n 'order': this.safeString (trade, 'order_id'),\n 'type': this.safeString (trade, 'order_type'),\n 'side': side,\n 'takerOrMaker': takerOrMaker,\n 'price': priceString,\n 'amount': amount,\n 'cost': cost,\n 'fee': fee,\n }, market);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"address\": \"2NBqqD5GRJ8wHy1PYyCXTe9ke5226FhavBz\",\n \"amount\": 0.5,\n \"confirmed_timestamp\": null,\n \"created_timestamp\": 1550571443070,\n \"currency\": \"BTC\",\n \"fee\": 0.0001,\n \"id\": 1,\n \"priority\": 0.15,\n \"state\": \"unconfirmed\",\n \"transaction_id\": null,\n \"updated_timestamp\": 1550571443070\n }", "{\n \"address\": \"2N35qDKDY22zmJq9eSyiAerMD4enJ1xx6ax\",\n \"amount\": 5,\n \"currency\": \"BTC\",\n \"received_timestamp\": 1549295017670,\n \"state\": \"completed\",\n \"transaction_id\": \"230669110fdaf0a0dbcdc079b6b8b43d5af29cc73683835b9bc6b3406c065fda\",\n \"updated_timestamp\": 1549295130159\n }" ], "line_end" => 2679, "line_start" => 2611, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "transaction" }, %{ "comment" => nil, "key" => "id", "value" => "this.safeString (transaction, 'id')" }, %{ "comment" => nil, "key" => "txid", "value" => "this.safeString (transaction, 'transaction_id')" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "address", "value" => "address" }, %{ "comment" => nil, "key" => "addressTo", "value" => "address" }, %{ "comment" => nil, "key" => "addressFrom", "value" => "undefined" }, %{ "comment" => nil, "key" => "tag", "value" => "undefined" }, %{ "comment" => nil, "key" => "tagTo", "value" => "undefined" }, %{ "comment" => nil, "key" => "tagFrom", "value" => "undefined" }, %{ "comment" => nil, "key" => "type", "value" => "type" }, %{ "comment" => nil, "key" => "amount", "value" => "this.safeNumber (transaction, 'amount')" }, %{ "comment" => nil, "key" => "currency", "value" => "code" }, %{ "comment" => nil, "key" => "status", "value" => "status" }, %{ "comment" => nil, "key" => "updated", "value" => "updated" }, %{ "comment" => nil, "key" => "network", "value" => "undefined" }, %{ "comment" => nil, "key" => "internal", "value" => "undefined" }, %{ "comment" => nil, "key" => "comment", "value" => "undefined" }, %{ "comment" => nil, "key" => "fee", "value" => "fee" } ], "name" => "parseTransaction", "signature" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction", "source" => "parseTransaction (transaction: Dict, currency: Currency = undefined): Transaction {\n //\n // fetchWithdrawals\n //\n // {\n // \"address\": \"2NBqqD5GRJ8wHy1PYyCXTe9ke5226FhavBz\",\n // \"amount\": 0.5,\n // \"confirmed_timestamp\": null,\n // \"created_timestamp\": 1550571443070,\n // \"currency\": \"BTC\",\n // \"fee\": 0.0001,\n // \"id\": 1,\n // \"priority\": 0.15,\n // \"state\": \"unconfirmed\",\n // \"transaction_id\": null,\n // \"updated_timestamp\": 1550571443070\n // }\n //\n // fetchDeposits\n //\n // {\n // \"address\": \"2N35qDKDY22zmJq9eSyiAerMD4enJ1xx6ax\",\n // \"amount\": 5,\n // \"currency\": \"BTC\",\n // \"received_timestamp\": 1549295017670,\n // \"state\": \"completed\",\n // \"transaction_id\": \"230669110fdaf0a0dbcdc079b6b8b43d5af29cc73683835b9bc6b3406c065fda\",\n // \"updated_timestamp\": 1549295130159\n // }\n //\n const currencyId = this.safeString (transaction, 'currency');\n const code = this.safeCurrencyCode (currencyId, currency);\n const timestamp = this.safeInteger2 (transaction, 'created_timestamp', 'received_timestamp');\n const updated = this.safeInteger (transaction, 'updated_timestamp');\n const status = this.parseTransactionStatus (this.safeString (transaction, 'state'));\n const address = this.safeString (transaction, 'address');\n const feeCost = this.safeNumber (transaction, 'fee');\n let type = 'deposit';\n let fee = undefined;\n if (feeCost !== undefined) {\n type = 'withdrawal';\n fee = {\n 'cost': feeCost,\n 'currency': code,\n };\n }\n return {\n 'info': transaction,\n 'id': this.safeString (transaction, 'id'),\n 'txid': this.safeString (transaction, 'transaction_id'),\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'address': address,\n 'addressTo': address,\n 'addressFrom': undefined,\n 'tag': undefined,\n 'tagTo': undefined,\n 'tagFrom': undefined,\n 'type': type,\n 'amount': this.safeNumber (transaction, 'amount'),\n 'currency': code,\n 'status': status,\n 'updated': updated,\n 'network': undefined,\n 'internal': undefined,\n 'comment': undefined,\n 'fee': fee,\n } as Transaction;\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 2609, "line_start" => 2603, "mappings" => [], "name" => "parseTransactionStatus", "signature" => "parseTransactionStatus (status: Str)", "source" => "parseTransactionStatus (status: Str) {\n const statuses: Dict = {\n 'completed': 'ok',\n 'unconfirmed': 'pending',\n };\n return this.safeString (statuses, status, status);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"updated_timestamp\": 1550232862350,\n \"type\": \"user\",\n \"state\": \"prepared\",\n \"other_side\": \"0x4aa0753d798d668056920094d65321a8e8913e26\",\n \"id\": 3,\n \"direction\": \"payment\",\n \"currency\": \"ETH\",\n \"created_timestamp\": 1550232862350,\n \"amount\": 13.456\n }" ], "line_end" => 3059, "line_start" => 3029, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "transfer" }, %{ "comment" => nil, "key" => "id", "value" => "this.safeString (transfer, 'id')" }, %{ "comment" => nil, "key" => "status", "value" => "this.parseTransferStatus (status)" }, %{ "comment" => nil, "key" => "amount", "value" => "this.safeNumber (transfer, 'amount')" }, %{ "comment" => nil, "key" => "currency", "value" => "this.safeCurrencyCode (currencyId, currency)" }, %{ "comment" => nil, "key" => "fromAccount", "value" => "direction !== 'payment' ? account : undefined" }, %{ "comment" => nil, "key" => "toAccount", "value" => "direction === 'payment' ? account : undefined" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" } ], "name" => "parseTransfer", "signature" => "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry", "source" => "parseTransfer (transfer: Dict, currency: Currency = undefined): TransferEntry {\n //\n // {\n // \"updated_timestamp\": 1550232862350,\n // \"type\": \"user\",\n // \"state\": \"prepared\",\n // \"other_side\": \"0x4aa0753d798d668056920094d65321a8e8913e26\",\n // \"id\": 3,\n // \"direction\": \"payment\",\n // \"currency\": \"ETH\",\n // \"created_timestamp\": 1550232862350,\n // \"amount\": 13.456\n // }\n //\n const timestamp = this.safeTimestamp (transfer, 'created_timestamp');\n const status = this.safeString (transfer, 'state');\n const account = this.safeString (transfer, 'other_side');\n const direction = this.safeString (transfer, 'direction');\n const currencyId = this.safeString (transfer, 'currency');\n return {\n 'info': transfer,\n 'id': this.safeString (transfer, 'id'),\n 'status': this.parseTransferStatus (status),\n 'amount': this.safeNumber (transfer, 'amount'),\n 'currency': this.safeCurrencyCode (currencyId, currency),\n 'fromAccount': direction !== 'payment' ? account : undefined,\n 'toAccount': direction === 'payment' ? account : undefined,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n };\n }" }, %{ "comment" => nil, "examples" => [], "line_end" => 3069, "line_start" => 3061, "mappings" => [], "name" => "parseTransferStatus", "signature" => "parseTransferStatus (status: Str): Str", "source" => "parseTransferStatus (status: Str): Str {\n const statuses: Dict = {\n 'prepared': 'pending',\n 'confirmed': 'ok',\n 'cancelled': 'cancelled',\n 'waiting_for_admin': 'pending',\n };\n return this.safeString (statuses, status, status);\n }" }, %{ "comment" => nil, "examples" => [ "{\n \"jsonrpc\": \"2.0\",\n \"result\": [\n [1640142000000,63.828320460740585],\n [1640142000000,63.828320460740585],\n [1640145600000,64.03821964123213]\n ],\n \"usIn\": 1641515379467734,\n \"usOut\": 1641515379468095,\n \"usDiff\": 361,\n \"testnet\": false\n }" ], "line_end" => 2911, "line_start" => 2883, "mappings" => [ %{ "comment" => nil, "key" => "info", "value" => "volatilityObj" }, %{ "comment" => nil, "key" => "timestamp", "value" => "timestamp" }, %{ "comment" => nil, "key" => "datetime", "value" => "this.iso8601 (timestamp)" }, %{ "comment" => nil, "key" => "volatility", "value" => "volatilityObj" } ], "name" => "parseVolatilityHistory", "signature" => "parseVolatilityHistory (volatility)", "source" => "parseVolatilityHistory (volatility) {\n //\n // {\n // \"jsonrpc\": \"2.0\",\n // \"result\": [\n // [1640142000000,63.828320460740585],\n // [1640142000000,63.828320460740585],\n // [1640145600000,64.03821964123213]\n // ],\n // \"usIn\": 1641515379467734,\n // \"usOut\": 1641515379468095,\n // \"usDiff\": 361,\n // \"testnet\": false\n // }\n //\n const volatilityResult = this.safeValue (volatility, 'result', []);\n const result = [];\n for (let i = 0; i < volatilityResult.length; i++) {\n const timestamp = this.safeInteger (volatilityResult[i], 0);\n const volatilityObj = this.safeNumber (volatilityResult[i], 1);\n result.push ({\n 'info': volatilityObj,\n 'timestamp': timestamp,\n 'datetime': this.iso8601 (timestamp),\n 'volatility': volatilityObj,\n });\n }\n return result;\n }" } ], path_prefix: "/api/v2/", pro: true, quote_json_numbers: nil, rate_limits: %{ interval_ms: 50, period: 1000, requests: 20, rolling_window_size: 60000 }, raw_endpoints: %{ private: [ %{ auth: false, cost: 4, method: :get, path: "/cancel_by_label" }, %{ auth: false, cost: 1, method: :get, path: "/get_mmp_config" }, %{ auth: false, cost: 1, method: :get, path: "/reset_mmp" }, %{ auth: false, cost: 1, method: :get, path: "/enable_cancel_on_disconnect" }, %{ auth: false, cost: 1, method: :get, path: "/change_api_key_name" }, %{ auth: false, cost: 1, method: :get, path: "/get_user_trades_by_instrument_and_time" }, %{ auth: false, cost: 4, method: :get, path: "/cancel_all_by_currency" }, %{ auth: false, cost: 1, method: :get, path: "/remove_subaccount" }, %{ auth: false, cost: 1, method: :get, path: "/get_email_language" }, %{ auth: false, cost: 1, method: :get, path: "/change_subaccount_name" }, %{ auth: false, cost: 1, method: :get, path: "/get_access_log" }, %{ auth: false, cost: 4, method: :get, path: "/edit" }, %{ auth: false, cost: 1, method: :get, path: "/cancel_withdrawal" }, %{ auth: false, cost: 1, method: :get, path: "/get_open_orders_by_instrument" }, %{ auth: false, cost: 1, method: :get, path: "/set_email_language" }, %{ auth: false, cost: 1, method: :get, path: "/set_password_for_subaccount" }, %{ auth: false, cost: 4, method: :get, path: "/cancel_all_by_instrument" }, %{ auth: false, cost: 1, method: :get, path: "/get_deposits" }, %{ auth: false, cost: 1, method: :get, path: "/get_cancel_on_disconnect" }, %{ auth: false, cost: 1, method: :get, path: "/get_user_trades_by_instrument" }, %{ auth: false, cost: 1, method: :get, path: "/get_account_summary" }, %{ auth: false, cost: 1, method: :get, path: "/get_order_history_by_instrument" }, %{ auth: false, cost: 4, method: :get, path: "/edit_by_label" }, %{ auth: false, cost: 1, method: :get, path: "/create_api_key" }, %{ auth: false, cost: 1, method: :get, path: "/get_positions" }, %{ auth: false, cost: 1, method: :get, path: "/get_transaction_log" }, %{ auth: false, cost: 1, method: :get, path: "/submit_transfer_to_subaccount" }, %{ auth: false, cost: 4, method: :get, path: "/close_position" }, %{ auth: false, cost: 1, method: :get, path: "/cancel_transfer_by_id" }, %{ auth: false, cost: 1, method: :get, path: "/unsubscribe" }, %{ auth: false, cost: 1, method: :get, path: "/withdraw" }, %{ auth: false, cost: 1, method: :get, path: "/toggle_subaccount_login" }, %{ auth: false, cost: 1, method: :get, path: "/get_current_deposit_address" }, %{ auth: false, cost: 1, method: :get, path: "/reset_api_key" }, %{ auth: false, cost: 1, method: :get, path: "/get_transfers" }, %{ auth: false, cost: 1, method: :get, path: "/get_order_state" }, %{ auth: false, cost: 1, method: :get, path: "/disable_cancel_on_disconnect" }, %{ auth: false, cost: 1, method: :get, path: "/disable_tfa_for_subaccount" }, %{ auth: false, cost: 1, method: :get, path: "/list_api_keys" }, %{ auth: false, cost: 4, method: :get, path: "/execute_block_trade" }, %{ auth: false, cost: 1, method: :get, path: "/get_order_margin_by_ids" }, %{ auth: false, cost: 1, method: :get, path: "/get_trigger_order_history" }, %{ auth: false, cost: 1, method: :get, path: "/set_api_key_as_default" }, %{ auth: false, cost: 1, method: :get, path: "/change_scope_in_api_key" }, %{ auth: false, cost: 4, method: :get, path: "/verify_block_trade" }, %{ auth: false, cost: 1, method: :get, path: "/get_user_trades_by_order" }, %{ auth: false, cost: 1, method: :get, path: "/get_new_announcements" }, %{ auth: false, cost: 1, method: :get, path: "/toggle_notifications_from_subaccount" }, %{ auth: false, cost: 1, method: :get, path: "/get_subaccounts_details" }, %{ auth: false, cost: 4, method: :get, path: "/cancel_all" }, %{ auth: false, cost: 1, method: :get, path: "/logout" }, %{ auth: false, cost: 1, method: :get, path: "/set_email_for_subaccount" }, %{ auth: false, cost: 1, method: :get, path: "/get_position" }, %{ auth: false, cost: 1, method: :get, path: "/create_subaccount" }, %{ auth: false, cost: 1, method: :get, path: "/get_settlement_history_by_instrument" }, %{ auth: false, cost: 1, method: :get, path: "/get_stop_order_history" }, %{ auth: false, cost: 1, method: :get, path: "/create_deposit_address" }, %{ auth: false, cost: 1, method: :get, path: "/unsubscribe_all" }, %{ auth: false, cost: 1, method: :get, path: "/get_user_trades_by_currency" }, %{ auth: false, cost: 4, method: :get, path: "/buy" }, %{ auth: false, cost: 1, method: :get, path: "/get_open_orders_by_currency" }, %{ auth: false, cost: 1, method: :get, path: "/get_account_summaries" }, %{ auth: false, cost: 1, method: :get, path: "/get_withdrawals" }, %{ auth: false, cost: 1, method: :get, path: "/get_block_trade" }, %{ auth: false, cost: 1, method: :get, path: "/get_subaccounts" }, %{ auth: false, cost: 1, method: :get, path: "/enable_affiliate_program" }, %{ auth: false, cost: 1, method: :get, path: "/remove_api_key" }, %{ auth: false, cost: 1, method: :get, path: "/disable_api_key" }, %{ auth: false, cost: 1, method: :get, path: "/get_user_trades_by_currency_and_time" }, %{ auth: false, cost: 4, method: :get, path: "/cancel" }, %{ auth: false, cost: 1, method: :get, path: "/get_last_block_trades_by_currency" }, %{ auth: false, cost: 1, method: :get, path: "/get_order_history_by_currency" }, %{ auth: false, cost: 1, method: :get, path: "/get_margins" }, %{ auth: false, cost: 1, method: :get, path: "/submit_transfer_to_user" }, %{ auth: false, cost: 1, method: :get, path: "/enable_api_key" }, %{ auth: false, cost: 1, method: :get, path: "/set_mmp_config" }, %{ auth: false, cost: 1, method: :get, path: "/get_portfolio_margins" }, %{ auth: false, cost: 1, method: :get, path: "/get_affiliate_program_info" }, %{ auth: false, cost: 1, method: :get, path: "/get_settlement_history_by_currency" }, %{ auth: false, cost: 4, method: :get, path: "/sell" }, %{ auth: false, cost: 1, method: :get, path: "/set_announcement_as_read" }, %{ auth: false, cost: 1, method: :get, path: "/invalidate_block_trade_signature" }, %{ auth: false, cost: 1, method: :get, path: "/subscribe" } ], public: [ %{ auth: false, cost: 1, method: :get, path: "/get_currencies" }, %{ auth: false, cost: 1, method: :get, path: "/exchange_token" }, %{ auth: false, cost: 1, method: :get, path: "/get_last_trades_by_instrument" }, %{ auth: false, cost: 1, method: :get, path: "/get_index" }, %{ auth: false, cost: 1, method: :get, path: "/set_heartbeat" }, %{ auth: false, cost: 1, method: :get, path: "/get_index_price_names" }, %{ auth: false, cost: 1, method: :get, path: "/auth" }, %{ auth: false, cost: 1, method: :get, path: "/get_mark_price_history" }, %{ auth: false, cost: 1, method: :get, path: "/get_funding_chart_data" }, %{ auth: false, cost: 1, method: :get, path: "/unsubscribe" }, %{ auth: false, cost: 1, method: :get, path: "/get_tradingview_chart_data" }, %{ auth: false, cost: 1, method: :get, path: "/get_book_summary_by_instrument" }, %{ auth: false, cost: 1, method: :get, path: "/fork_token" }, %{ auth: false, cost: 1, method: :get, path: "/get_funding_rate_history" }, %{ auth: false, cost: 1, method: :get, path: "/get_instruments" }, %{ auth: false, cost: 1, method: :get, path: "/get_funding_rate_value" }, %{ auth: false, cost: 1, method: :get, path: "/get_historical_volatility" }, %{ auth: false, cost: 1, method: :get, path: "/unsubscribe_all" }, %{ auth: false, cost: 1, method: :get, path: "/get_last_trades_by_instrument_and_time" }, %{ auth: false, cost: 1, method: :get, path: "/get_contract_size" }, %{ auth: false, cost: 1, method: :get, path: "/status" }, %{ auth: false, cost: 1, method: :get, path: "/get_time" }, %{ auth: false, cost: 1, method: :get, path: "/get_last_settlements_by_currency" }, %{ auth: false, cost: 1, method: :get, path: "/get_trade_volumes" }, %{ auth: false, cost: 1, method: :get, path: "/get_announcements" }, %{ auth: false, cost: 1, method: :get, path: "/disable_heartbeat" }, %{ auth: false, cost: 1, method: :get, path: "/ticker" }, %{ auth: false, cost: 1, method: :get, path: "/get_last_trades_by_currency_and_time" }, %{ auth: false, cost: 1, method: :get, path: "/hello" }, %{ auth: false, cost: 1, method: :get, path: "/get_order_book" }, %{ auth: false, cost: 1, method: :get, path: "/get_instrument" }, %{ auth: false, cost: 1, method: :get, path: "/get_volatility_index_data" }, %{ auth: false, cost: 1, method: :get, path: "/get_book_summary_by_currency" }, %{ auth: false, cost: 1, method: :get, path: "/test" }, %{ auth: false, cost: 1, method: :get, path: "/get_index_price" }, %{ auth: false, cost: 1, method: :get, path: "/get_last_trades_by_currency" }, %{ auth: false, cost: 1, method: :get, path: "/get_delivery_prices" }, %{ auth: false, cost: 1, method: :get, path: "/get_last_settlements_by_instrument" }, %{ auth: false, cost: 1, method: :get, path: "/subscribe" } ] }, required_credentials: %{ api_key: true, password: false, secret: true, uid: false }, requires_eddsa: false, response_error: %{ code_field: [ "error", "code" ], field: "error", message_field: [ "error", "message" ], success_values: nil, type: :error_present }, signing: %{ confidence: :high, pattern: :deribit }, spec_format_version: 1, status: %{ "eta" => nil, "status" => "ok", "updated" => nil, "url" => nil }, symbol_format: nil, symbol_formats: %{ future: %{ base: "BTCDVOL", base_id: "BTCDVOL", case: :upper, contract: true, contract_size: 0.1, expiry: 1772006400000, expiry_datetime: "2026-02-25T08:00:00.000Z", id: "BTCDVOL_USDC-25FEB26", inverse: false, limits: %{ "amount" => %{ "min" => 0.1 }, "cost" => %{}, "leverage" => %{}, "price" => %{ "min" => 0.1 } }, linear: true, maker: 0, precision: %{ "amount" => 0.1, "price" => 0.1 }, quote: "USDC", quote_id: "USDC", separator: "-", settle: "USDC", settle_id: "USDC", symbol: "BTCDVOL/USDC:USDC-260225", taker: 0.0005 }, option: %{ base: "AVAX", base_id: "AVAX", case: :upper, contract: true, contract_size: 100, expiry: 1772006400000, expiry_datetime: "2026-02-25T08:00:00.000Z", id: "AVAX_USDC-25FEB26-7-C", inverse: false, limits: %{ "amount" => %{ "min" => 100 }, "cost" => %{}, "leverage" => %{}, "price" => %{ "min" => 0.0005 } }, linear: true, maker: 0.0003, precision: %{ "amount" => 100, "price" => 0.0005 }, quote: "USDC", quote_id: "USDC", separator: "-", settle: "USDC", settle_id: "USDC", symbol: "AVAX/USDC:USDC-260225-7-C", taker: 0.0003 }, precision_mode: 4, sample_limits: %{ "amount" => %{ "min" => 0.01 }, "cost" => %{}, "price" => %{ "min" => 0.05 } }, sample_precision: %{ "amount" => 0.01, "price" => 0.05 }, spot: %{ base: "BNB", base_id: "BNB", case: :upper, contract: false, contract_size: 0.01, expiry: 32503708800000, expiry_datetime: "3000-01-01T08:00:00.000Z", id: "BNB_USDC", limits: %{ "amount" => %{ "min" => 0.01 }, "cost" => %{}, "leverage" => %{}, "price" => %{ "min" => 0.05 } }, maker: 0, precision: %{ "amount" => 0.01, "price" => 0.05 }, quote: "USDC", quote_id: "USDC", separator: "_", symbol: "BNB/USDC", taker: 0 }, swap: %{ base: "ADA", base_id: "ADA", case: :upper, contract: true, contract_size: 10, expiry: 32503708800000, expiry_datetime: "3000-01-01T08:00:00.000Z", id: "ADA_USDC-PERPETUAL", inverse: false, limits: %{ "amount" => %{ "min" => 10 }, "cost" => %{}, "leverage" => %{}, "price" => %{ "min" => 0.0001 } }, linear: true, maker: 0, precision: %{ "amount" => 10, "price" => 0.0001 }, quote: "USDC", quote_id: "USDC", separator: "-", settle: "USDC", settle_id: "USDC", symbol: "ADA/USDC:USDC", taker: 0.0005 } }, symbol_patterns: %{ future: %{ case: :upper, component_order: [ :base, :quote, :date ], date_format: :ddmmmyy, pattern: :future_ddmmmyy, separator: "-", suffix: nil }, option: %{ case: :upper, component_order: [ :base, :date, :strike, :type ], date_format: :ddmmmyy, pattern: :option_ddmmmyy, separator: "-", suffix: nil }, spot: %{ case: :upper, component_order: nil, date_format: nil, pattern: :underscore_upper, separator: "_", suffix: nil }, swap: %{ case: :upper, component_order: nil, date_format: nil, pattern: :suffix_perpetual, separator: "_", suffix: "-PERPETUAL" } }, timeframes: %{ "10m" => "10", "12h" => "720", "15m" => "15", "1d" => "1D", "1h" => "60", "1m" => "1", "2h" => "120", "30m" => "30", "3h" => "180", "3m" => "3", "5m" => "5", "6h" => "360" }, url_strategy: %{ detected_from: "sign_method", note: "api_type_in_path", pattern: :api_version_api_type, prefix: "/api/v2/" }, urls: %{ api: "https://www.deribit.com", api_sections: %{ "rest" => "https://www.deribit.com" }, doc: [ "https://docs.deribit.com/v2", "https://github.com/deribit" ], other: nil, sandbox: %{ "rest" => "https://test.deribit.com" }, www: "https://www.deribit.com" }, version: "v2", ws: %{ auth: %{ algorithm: :sha256, encoding: :hex, market_specific: false, message_format: :jsonrpc, method_value: "public/auth", op_field: "method", params_field: "params", pattern: :jsonrpc_linebreak, payload_format: "timestamp\\nnonce\\n", requires_passphrase: false, timestamp_unit: :milliseconds }, channel_templates: %{ watch_balance: %{ auth_required: true, channel_name: "user.portfolio", market_id_format: :native, params: [], pattern: :jsonrpc, separator: "." }, watch_bids_asks: %{ channel_name: "quote", market_id_format: :native, params: [], pattern: :jsonrpc, separator: "." }, watch_my_trades: %{ auth_required: true, channel_name: "user", market_id_format: :native, params: [ %{ "default" => "raw", "name" => "interval" }, %{ "default" => nil, "name" => "limit" } ], pattern: :jsonrpc, separator: "." }, watch_ohlcv: %{ channel_name: "chart.trades", market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :jsonrpc, separator: "." }, watch_ohlcv_for_symbols: %{ channel_name: "chart.trades", market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" } ], pattern: :jsonrpc, separator: "." }, watch_order_book: %{ auth_required: true, channel_name: "book", market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" }, %{ "default" => "100ms", "name" => "interval" } ], pattern: :jsonrpc, separator: "." }, watch_order_book_for_symbols: %{ auth_required: true, channel_name: "book", market_id_format: :native, params: [ %{ "default" => "100ms", "name" => "interval" }, %{ "default" => nil, "name" => "limit" } ], pattern: :jsonrpc, separator: "." }, watch_orders: %{ auth_required: true, channel_name: "user", market_id_format: :native, params: [ %{ "default" => "any", "name" => "currency" }, %{ "default" => "raw", "name" => "interval" }, %{ "default" => "any", "name" => "kind" }, %{ "default" => nil, "name" => "limit" } ], pattern: :jsonrpc, separator: "." }, watch_ticker: %{ auth_required: true, channel_name: "ticker", market_id_format: :native, params: [ %{ "default" => "100ms", "name" => "interval" } ], pattern: :jsonrpc, separator: "." }, watch_tickers: %{ auth_required: true, channel_name: "ticker", market_id_format: :native, params: [ %{ "default" => "100ms", "name" => "interval" } ], pattern: :jsonrpc, separator: "." }, watch_trades: %{ auth_required: true, channel_name: "trades", market_id_format: :native, params: [ %{ "default" => nil, "name" => "limit" }, %{ "default" => "100ms", "name" => "interval" } ], pattern: :jsonrpc, separator: "." }, watch_trades_for_symbols: %{ auth_required: true, channel_name: "trades", market_id_format: :native, params: [ %{ "default" => "100ms", "name" => "interval" }, %{ "default" => nil, "name" => "limit" } ], pattern: :jsonrpc, separator: "." } }, has: %{ watch_balance: true, watch_bids_asks: true, watch_liquidations: nil, watch_liquidations_for_symbols: nil, watch_my_liquidations: nil, watch_my_liquidations_for_symbols: nil, watch_my_trades: true, watch_ohlcv: true, watch_ohlcv_for_symbols: true, watch_order_book: true, watch_order_book_for_symbols: true, watch_orders: true, watch_orders_for_symbols: nil, watch_position: nil, watch_positions: nil, watch_status: nil, watch_ticker: true, watch_tickers: true, watch_trades: true, watch_trades_for_symbols: true }, message_patterns: [ %{ args_field: "params", format: :jsonrpc, id_field: "id", keys: [ "id", "jsonrpc", "method", "params" ], kind_field: "method", kind_value: "private/subscribe", sources: [ :send, :watch ] }, %{ args_field: "params", format: :jsonrpc, id_field: "id", keys: [ "id", "jsonrpc", "method", "params" ], kind_field: "method", kind_value: "public/auth", sources: [ :send, :watch ] }, %{ args_field: "params", format: :jsonrpc, id_field: "id", keys: [ "id", "jsonrpc", "method", "params" ], kind_field: "method", kind_value: "public/subscribe", sources: [ :send, :watch, :watch_multiple ] } ], options: %{ "ws" => %{ "timeframes" => %{ "12h" => "720", "15m" => "15", "1d" => "1D", "1h" => "60", "1m" => "1", "2h" => "120", "30m" => "30", "3m" => "3", "4h" => "180", "5m" => "5", "6h" => "360" }, "watchOrderBookForSymbols" => %{ "depth" => "20", "group" => "none", "interval" => "100ms", "useDepthEndpoint" => false }, "watchTradesForSymbols" => %{ "interval" => "100ms" } } }, subscription_config: %{ args_field: "params.channels", args_format: :string_list, market_id_format: :native, op_field: "method" }, subscription_pattern: :jsonrpc_subscribe, test_urls: "wss://test.deribit.com/ws/api/v2", urls: "wss://www.deribit.com/ws/api/v2", watch_methods: [ "watchBalance", "watchBidsAsks", "watchMyTrades", "watchOHLCV", "watchOHLCVForSymbols", "watchOrderBook", "watchOrderBookForSymbols", "watchOrders", "watchTicker", "watchTickers", "watchTrades", "watchTradesForSymbols" ] } }