CINXE.COM
Manual · ccxt/ccxt Wiki · GitHub
<!DOCTYPE html> <html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark" data-a11y-animated-images="system" data-a11y-link-underlines="true" > <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com"> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light-74231a1f3bbb.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/dark-8a995f0bacd4.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-f37fb7684b1f.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-9ac301c3ebe5.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-cd826e8636dc.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-f91b0f603451.css" /><link data-color-theme="light_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_high_contrast-83beb16e0ecf.css" /><link data-color-theme="light_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia-6e122dab64fc.css" /><link data-color-theme="dark_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia-18119e682df0.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-primitives-225433424a87.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-aaa714e5674d.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-0a3c53b9d1c2.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-ea73c9cb5377.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/repository-4fce88777fa8.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/wiki-0f9a446f06a3.css" /> <script type="application/json" id="client-env">{"locale":"en","featureFlags":["copilot_immersive_issue_preview","copilot_new_references_ui","copilot_chat_repo_custom_instructions_preview","copilot_no_floating_button","copilot_topics_as_references","copilot_read_shared_conversation","copilot_duplicate_thread","copilot_buffered_streaming","dotcom_chat_client_side_skills","experimentation_azure_variant_endpoint","failbot_handle_non_errors","geojson_azure_maps","ghost_pilot_confidence_truncation_25","ghost_pilot_confidence_truncation_40","github_models_gateway_parse_params","github_models_o3_mini_streaming","insert_before_patch","issues_react_remove_placeholders","issues_react_blur_item_picker_on_close","marketing_pages_search_explore_provider","primer_react_css_modules_ga","react_data_router_pull_requests","react_override_default_key","remove_child_patch","sample_network_conn_type","swp_enterprise_contact_form","site_proxima_australia_update","viewscreen_sandbox","issues_react_create_milestone","issues_react_cache_fix_workaround","lifecycle_label_name_updates","copilot_task_oriented_assistive_prompts","issue_types_prevent_private_type_creation","refresh_image_video_src","react_router_dispose_on_disconnect","codespaces_prebuild_region_target_update","turbo_app_id_restore","copilot_code_review_sign_up_closed"]}</script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/wp-runtime-42bf55717c0c.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_oddbird_popover-polyfill_dist_popover_js-9da652f58479.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_arianotify-polyfill_ariaNotify-polyfill_js-node_modules_github_mi-3abb8f-46b9f4874d95.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_failbot_failbot_ts-75968cfb5298.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/environment-f04cb2a9fc8c.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_index_mjs-0dbb79f97f8f.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_selector-observer_dist_index_esm_js-f690fd9ae3d5.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_relative-time-element_dist_index_js-62d275b7ddd9.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_text-expander-element_dist_index_js-78748950cb0c.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_auto-complete-element_dist_index_js-node_modules_github_catalyst_-8e9f78-a90ac05d2469.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-b5f1d7-a1760ffda83d.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_markdown-toolbar-element_dist_index_js-ceef33f593fa.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_primer_view-co-c44a69-efa32db3a345.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/github-elements-394f8eb34f19.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/element-registry-25113a65b77f.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_braintree_browser-detection_dist_browser-detection_js-node_modules_githu-2906d7-2a07a295af40.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_lit-html_lit-html_js-be8cb88f481b.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_morphdom_dist_morphdom-e-7c534c-a4a1922eb55f.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_turbo_dist_turbo_es2017-esm_js-a03ee12d659a.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-893f9f-b6294cf703b7.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_color-convert_index_js-e3180fe3bcb3.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_quote-selection_dist_index_js-node_modules_github_session-resume_-947061-e7a6c4a19f98.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_updatable-content_updatable-content_ts-eb3147a21e96.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_task-list_ts-app_assets_modules_github_sso_ts-ui_packages-900dde-768abe60b1f8.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_sticky-scroll-into-view_ts-3e000c5d31a9.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_ajax-error_ts-app_assets_modules_github_behaviors_include-87a4ae-4c160a67a3f8.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235-e429cff6ceb1.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-124f4ce2c2c0.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-f6223d90c7ba.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-global-01e85cd1be94.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_virtualized-list_es_index_js-node_modules_github_template-parts_lib_index_js-94dc7a2157c1.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_github_catalyst_lib_index_-280e4f-e58a68a800fd.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_decorators_js-node_modules_delegated-events_di-e161aa-9d41fb1b6c9e.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_scroll-anchoring_dist_scroll-anchoring_esm_js-node_modules_github_hydro--09cdca-c8338d3c4dc8.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_ref-selector_ts-3e9d848bab5f.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_diffs_blob-lines_ts-app_assets_modules_github_diffs_linkable-line-n-b8c0ea-812ffaaafc3e.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/diffs-669487d627a0.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/primer-react-602097a4b0db.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/react-core-0bc17999cb79.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/react-lib-f1bca44e0926.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/octicons-react-cf2f2ab8dab4.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_emotion_is-prop-valid_dist_emotion-is-prop-valid_esm_js-node_modules_emo-62da9f-2df2f32ec596.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_stacktrace-parser_dist_s-e7dcdd-9a233856b02c.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_oddbird_popover-polyfill_dist_popover-fn_js-55fea94174bf.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-subscriptions-menu-57956eade845.js"></script> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-react.8157a56b30ae88a1b356.module.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/notifications-subscriptions-menu.1bcff9205c241e99cff2.module.css" /> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/wiki-4c37cc033baf.js"></script> <title>Manual · ccxt/ccxt Wiki · GitHub</title> <meta name="route-pattern" content="/:user_id/:repository/wiki/:id(.:format)" data-turbo-transient> <meta name="route-controller" content="wiki" data-turbo-transient> <meta name="route-action" content="show" data-turbo-transient> <meta name="current-catalog-service-hash" content="27690012a2eb28b75d0bacab0f2c11870266e8db9e019fa71fea812b82397bd6"> <meta name="request-id" content="93E0:383E5:2084CA:26AA56:67EB57CE" data-pjax-transient="true"/><meta name="html-safe-nonce" content="7a270cfa1768ae31559cb8561a72e119417729a4747e5b10c9f338eef163bdce" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5M0UwOjM4M0U1OjIwODRDQToyNkFBNTY6NjdFQjU3Q0UiLCJ2aXNpdG9yX2lkIjoiODUxMjQ5Nzc4NTA5NTU0MjczNCIsInJlZ2lvbl9lZGdlIjoic291dGhlYXN0YXNpYSIsInJlZ2lvbl9yZW5kZXIiOiJzb3V0aGVhc3Rhc2lhIn0=" data-pjax-transient="true"/><meta name="visitor-hmac" content="fd8b0dce7a8394e903f59d4f1d642761006c5826b68c5fb6450af97e3c1dc0fd" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:91253698" data-turbo-transient> <meta name="github-keyboard-shortcuts" content="repository,copilot" data-turbo-transient="true" /> <meta name="selected-link" value="repo_wiki" data-turbo-transient> <link rel="assets" href="https://github.githubassets.com/"> <meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I"> <meta name="octolytics-url" content="https://collector.github.com/github/collect" /> <meta name="analytics-location" content="/<user-name>/<repo-name>/wiki/show" data-turbo-transient="true" /> <meta name="user-login" content=""> <meta name="viewport" content="width=device-width"> <meta name="description" content="A JavaScript / TypeScript / Python / C# / PHP / Go cryptocurrency trading API with support for more than 100 bitcoin/altcoin exchanges - Manual · ccxt/ccxt Wiki"> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905, app-argument=https://github.com/ccxt/ccxt/wiki/Manual" /> <meta name="twitter:image" content="https://repository-images.githubusercontent.com/91253698/ea8e3c00-171a-11ea-9a81-e79b426fe455" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="Manual" /><meta name="twitter:description" content="A JavaScript / TypeScript / Python / C# / PHP / Go cryptocurrency trading API with support for more than 100 bitcoin/altcoin exchanges - ccxt/ccxt" /> <meta property="og:image" content="https://repository-images.githubusercontent.com/91253698/ea8e3c00-171a-11ea-9a81-e79b426fe455" /><meta property="og:image:alt" content="A JavaScript / TypeScript / Python / C# / PHP / Go cryptocurrency trading API with support for more than 100 bitcoin/altcoin exchanges - ccxt/ccxt" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="Manual" /><meta property="og:url" content="https://github.com/ccxt/ccxt/wiki/Manual" /><meta property="og:description" content="A JavaScript / TypeScript / Python / C# / PHP / Go cryptocurrency trading API with support for more than 100 bitcoin/altcoin exchanges - ccxt/ccxt" /> <meta name="hostname" content="github.com"> <meta name="expected-hostname" content="github.com"> <meta http-equiv="x-pjax-version" content="fdacc214ab06f2b16bbda8409a06b74ee2890906eebb262b86ec1d832caf890a" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="e26f9f0ba624ee85cc7ac057d8faa8618a4f25a85eab052c33d018ac0f6b1a46" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="159e03504eed5183f9787c72780a7d8c1460af30746ab09d728b048c41719efa" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="0d9cd8178e36edfd373079ae98b19a2cf08a342e128df8f1653aa24bc094e9cf" data-turbo-track="reload"> <meta name="turbo-cache-control" content="no-preview" data-turbo-transient=""> <meta name="go-import" content="github.com/ccxt/ccxt git https://github.com/ccxt/ccxt.git"> <meta name="octolytics-dimension-user_id" content="31901609" /><meta name="octolytics-dimension-user_login" content="ccxt" /><meta name="octolytics-dimension-repository_id" content="91253698" /><meta name="octolytics-dimension-repository_nwo" content="ccxt/ccxt" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="91253698" /><meta name="octolytics-dimension-repository_network_root_nwo" content="ccxt/ccxt" /> <meta name="turbo-body-classes" content="logged-out env-production page-responsive"> <meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats"> <meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors"> <meta name="release" content="c3cd59ee4c64472a7258f20e3ff4e528431c37f5"> <link rel="mask-icon" href="https://github.githubassets.com/assets/pinned-octocat-093da3e6fa40.svg" color="#000000"> <link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://github.githubassets.com/favicons/favicon.png"> <link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://github.githubassets.com/favicons/favicon.svg" data-base-href="https://github.githubassets.com/favicons/favicon"> <meta name="theme-color" content="#1e2327"> <meta name="color-scheme" content="light dark" /> <link rel="manifest" href="/manifest.json" crossOrigin="use-credentials"> </head> <body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div data-turbo-body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div class="position-relative header-wrapper js-header-wrapper "> <a href="#start-of-content" data-skip-target-assigned="false" class="px-2 py-4 color-bg-accent-emphasis color-fg-on-emphasis show-on-focus js-skip-to-content">Skip to content</a> <span data-view-component="true" class="progress-pjax-loader Progress position-fixed width-full"> <span style="width: 0%;" data-view-component="true" class="Progress-item progress-pjax-loader-bar left-0 top-0 color-bg-accent-emphasis"></span> </span> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_ui-commands_ui-commands_ts-2ea4e93613c0.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/keyboard-shortcuts-dialog-79d6a754ebf9.js"></script> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-react.8157a56b30ae88a1b356.module.css" /> <react-partial partial-name="keyboard-shortcuts-dialog" data-ssr="false" data-attempted-ssr="false" > <script type="application/json" data-target="react-partial.embeddedData">{"props":{"docsUrl":"https://docs.github.com/get-started/accessibility/keyboard-shortcuts"}}</script> <div data-target="react-partial.reactRoot"></div> </react-partial> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-94fd67-4898d1bf4b51.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/sessions-730dca81d0a2.js"></script> <header class="HeaderMktg header-logged-out js-details-container js-header Details f4 py-3" role="banner" data-is-top="true" data-color-mode=light data-light-theme=light data-dark-theme=dark> <h2 class="sr-only">Navigation Menu</h2> <button type="button" class="HeaderMktg-backdrop d-lg-none border-0 position-fixed top-0 left-0 width-full height-full js-details-target" aria-label="Toggle navigation"> <span class="d-none">Toggle navigation</span> </button> <div class="d-flex flex-column flex-lg-row flex-items-center px-3 px-md-4 px-lg-5 height-full position-relative z-1"> <div class="d-flex flex-justify-between flex-items-center width-full width-lg-auto"> <div class="flex-1"> <button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="js-details-target js-nav-padding-recalculate js-header-menu-toggle Button--link Button--medium Button d-lg-none color-fg-inherit p-1"> <span class="Button-content"> <span class="Button-label"><div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div></span> </span> </button> </div> <a class="mr-lg-3 color-fg-inherit flex-order-2 js-prevent-focus-on-mobile-nav" href="/" aria-label="Homepage" data-analytics-event="{"category":"Marketing nav","action":"click to go to homepage","label":"ref_page:Marketing;ref_cta:Logomark;ref_loc:Header"}"> <svg height="32" aria-hidden="true" viewBox="0 0 24 24" version="1.1" width="32" data-view-component="true" class="octicon octicon-mark-github"> <path d="M12 1C5.9225 1 1 5.9225 1 12C1 16.8675 4.14875 20.9787 8.52125 22.4362C9.07125 22.5325 9.2775 22.2025 9.2775 21.9137C9.2775 21.6525 9.26375 20.7862 9.26375 19.865C6.5 20.3737 5.785 19.1912 5.565 18.5725C5.44125 18.2562 4.905 17.28 4.4375 17.0187C4.0525 16.8125 3.5025 16.3037 4.42375 16.29C5.29 16.2762 5.90875 17.0875 6.115 17.4175C7.105 19.0812 8.68625 18.6137 9.31875 18.325C9.415 17.61 9.70375 17.1287 10.02 16.8537C7.5725 16.5787 5.015 15.63 5.015 11.4225C5.015 10.2262 5.44125 9.23625 6.1425 8.46625C6.0325 8.19125 5.6475 7.06375 6.2525 5.55125C6.2525 5.55125 7.17375 5.2625 9.2775 6.67875C10.1575 6.43125 11.0925 6.3075 12.0275 6.3075C12.9625 6.3075 13.8975 6.43125 14.7775 6.67875C16.8813 5.24875 17.8025 5.55125 17.8025 5.55125C18.4075 7.06375 18.0225 8.19125 17.9125 8.46625C18.6138 9.23625 19.04 10.2125 19.04 11.4225C19.04 15.6437 16.4688 16.5787 14.0213 16.8537C14.42 17.1975 14.7638 17.8575 14.7638 18.8887C14.7638 20.36 14.75 21.5425 14.75 21.9137C14.75 22.2025 14.9563 22.5462 15.5063 22.4362C19.8513 20.9787 23 16.8537 23 12C23 5.9225 18.0775 1 12 1Z"></path> </svg> </a> <div class="flex-1 flex-order-2 text-right"> <a href="/login?return_to=https%3A%2F%2Fgithub.com%2Fccxt%2Fccxt%2Fwiki%2FManual" class="HeaderMenu-link HeaderMenu-button d-inline-flex d-lg-none flex-order-1 f5 no-underline border color-border-default rounded-2 px-2 py-1 color-fg-inherit js-prevent-focus-on-mobile-nav" data-hydro-click="{"event_type":"authentication.click","payload":{"location_in_page":"site header menu","repository_id":null,"auth_type":"SIGN_UP","originating_url":"https://github.com/ccxt/ccxt/wiki/Manual","user_id":null}}" data-hydro-click-hmac="52263623024966d430f80235dd819c65ff2c470ee21b5990f4bec014a89d07f2" data-analytics-event="{"category":"Marketing nav","action":"click to Sign in","label":"ref_page:Marketing;ref_cta:Sign in;ref_loc:Header"}" > Sign in </a> </div> </div> <div class="HeaderMenu js-header-menu height-fit position-lg-relative d-lg-flex flex-column flex-auto top-0"> <div class="HeaderMenu-wrapper d-flex flex-column flex-self-start flex-lg-row flex-auto rounded rounded-lg-0"> <nav class="HeaderMenu-nav" aria-label="Global"> <ul class="d-lg-flex list-style-none"> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Product <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 pt-2 pt-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 pb-2 pb-lg-4 d-lg-flex flex-wrap dropdown-menu-wide"> <div class="HeaderMenu-column px-lg-4 border-lg-right mb-4 mb-lg-0 pr-lg-7"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0"> <ul class="list-style-none f5" > <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{"location":"navbar","action":"github_copilot","context":"product","tag":"link","label":"github_copilot_link_product_navbar"}" href="https://github.com/features/copilot"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-copilot color-fg-subtle mr-3"> <path d="M23.922 16.992c-.861 1.495-5.859 5.023-11.922 5.023-6.063 0-11.061-3.528-11.922-5.023A.641.641 0 0 1 0 16.736v-2.869a.841.841 0 0 1 .053-.22c.372-.935 1.347-2.292 2.605-2.656.167-.429.414-1.055.644-1.517a10.195 10.195 0 0 1-.052-1.086c0-1.331.282-2.499 1.132-3.368.397-.406.89-.717 1.474-.952 1.399-1.136 3.392-2.093 6.122-2.093 2.731 0 4.767.957 6.166 2.093.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086.23.462.477 1.088.644 1.517 1.258.364 2.233 1.721 2.605 2.656a.832.832 0 0 1 .053.22v2.869a.641.641 0 0 1-.078.256ZM12.172 11h-.344a4.323 4.323 0 0 1-.355.508C10.703 12.455 9.555 13 7.965 13c-1.725 0-2.989-.359-3.782-1.259a2.005 2.005 0 0 1-.085-.104L4 11.741v6.585c1.435.779 4.514 2.179 8 2.179 3.486 0 6.565-1.4 8-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.545-3.508-1.492a4.323 4.323 0 0 1-.355-.508h-.016.016Zm.641-2.935c.136 1.057.403 1.913.878 2.497.442.544 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.15.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438 1.578v.021c0 .265.021.562.063.893Zm-1.626 0c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824 1.025-.462.472-.705 1.179-.705 2.319 0 1.211.175 1.926.558 2.361.365.414 1.084.751 2.657.751 1.21 0 1.902-.394 2.344-.938.475-.584.742-1.44.878-2.497Z"></path><path d="M14.5 14.25a1 1 0 0 1 1 1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 1-1Zm-5 0a1 1 0 0 1 1 1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 1-1Z"></path> </svg> <div> <div class="color-fg-default h4">GitHub Copilot</div> Write better code with AI </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{"location":"navbar","action":"security","context":"product","tag":"link","label":"security_link_product_navbar"}" href="https://github.com/features/security"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-shield-check color-fg-subtle mr-3"> <path d="M16.53 9.78a.75.75 0 0 0-1.06-1.06L11 13.19l-1.97-1.97a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l5-5Z"></path><path d="m12.54.637 8.25 2.675A1.75 1.75 0 0 1 22 4.976V10c0 6.19-3.771 10.704-9.401 12.83a1.704 1.704 0 0 1-1.198 0C5.77 20.705 2 16.19 2 10V4.976c0-.758.489-1.43 1.21-1.664L11.46.637a1.748 1.748 0 0 1 1.08 0Zm-.617 1.426-8.25 2.676a.249.249 0 0 0-.173.237V10c0 5.46 3.28 9.483 8.43 11.426a.199.199 0 0 0 .14 0C17.22 19.483 20.5 15.461 20.5 10V4.976a.25.25 0 0 0-.173-.237l-8.25-2.676a.253.253 0 0 0-.154 0Z"></path> </svg> <div> <div class="color-fg-default h4">Security</div> Find and fix vulnerabilities </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{"location":"navbar","action":"actions","context":"product","tag":"link","label":"actions_link_product_navbar"}" href="https://github.com/features/actions"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-workflow color-fg-subtle mr-3"> <path d="M1 3a2 2 0 0 1 2-2h6.5a2 2 0 0 1 2 2v6.5a2 2 0 0 1-2 2H7v4.063C7 16.355 7.644 17 8.438 17H12.5v-2.5a2 2 0 0 1 2-2H21a2 2 0 0 1 2 2V21a2 2 0 0 1-2 2h-6.5a2 2 0 0 1-2-2v-2.5H8.437A2.939 2.939 0 0 1 5.5 15.562V11.5H3a2 2 0 0 1-2-2Zm2-.5a.5.5 0 0 0-.5.5v6.5a.5.5 0 0 0 .5.5h6.5a.5.5 0 0 0 .5-.5V3a.5.5 0 0 0-.5-.5ZM14.5 14a.5.5 0 0 0-.5.5V21a.5.5 0 0 0 .5.5H21a.5.5 0 0 0 .5-.5v-6.5a.5.5 0 0 0-.5-.5Z"></path> </svg> <div> <div class="color-fg-default h4">Actions</div> Automate any workflow </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{"location":"navbar","action":"codespaces","context":"product","tag":"link","label":"codespaces_link_product_navbar"}" href="https://github.com/features/codespaces"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-codespaces color-fg-subtle mr-3"> <path d="M3.5 3.75C3.5 2.784 4.284 2 5.25 2h13.5c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 18.75 13H5.25a1.75 1.75 0 0 1-1.75-1.75Zm-2 12c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v4a1.75 1.75 0 0 1-1.75 1.75H3.25a1.75 1.75 0 0 1-1.75-1.75ZM5.25 3.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h13.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Zm-2 12a.25.25 0 0 0-.25.25v4c0 .138.112.25.25.25h17.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25Z"></path><path d="M10 17.75a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Zm-4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75Z"></path> </svg> <div> <div class="color-fg-default h4">Codespaces</div> Instant dev environments </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{"location":"navbar","action":"issues","context":"product","tag":"link","label":"issues_link_product_navbar"}" href="https://github.com/features/issues"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-issue-opened color-fg-subtle mr-3"> <path d="M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Zm9.5 2a2 2 0 1 1-.001-3.999A2 2 0 0 1 12 14Z"></path> </svg> <div> <div class="color-fg-default h4">Issues</div> Plan and track work </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{"location":"navbar","action":"code_review","context":"product","tag":"link","label":"code_review_link_product_navbar"}" href="https://github.com/features/code-review"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-code-review color-fg-subtle mr-3"> <path d="M10.3 6.74a.75.75 0 0 1-.04 1.06l-2.908 2.7 2.908 2.7a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 0 1 1.06.04Zm3.44 1.06a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.908-2.7-2.908-2.7Z"></path><path d="M1.5 4.25c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v12.5a1.75 1.75 0 0 1-1.75 1.75h-9.69l-3.573 3.573A1.458 1.458 0 0 1 5 21.043V18.5H3.25a1.75 1.75 0 0 1-1.75-1.75ZM3.25 4a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h2.5a.75.75 0 0 1 .75.75v3.19l3.72-3.72a.749.749 0 0 1 .53-.22h10a.25.25 0 0 0 .25-.25V4.25a.25.25 0 0 0-.25-.25Z"></path> </svg> <div> <div class="color-fg-default h4">Code Review</div> Manage code changes </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{"location":"navbar","action":"discussions","context":"product","tag":"link","label":"discussions_link_product_navbar"}" href="https://github.com/features/discussions"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-comment-discussion color-fg-subtle mr-3"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 14.25 14H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 15.543V14H1.75A1.75 1.75 0 0 1 0 12.25v-9.5C0 1.784.784 1 1.75 1ZM1.5 2.75v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z"></path><path d="M22.5 8.75a.25.25 0 0 0-.25-.25h-3.5a.75.75 0 0 1 0-1.5h3.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 22.25 20H21v1.543a1.457 1.457 0 0 1-2.487 1.03L15.939 20H10.75A1.75 1.75 0 0 1 9 18.25v-1.465a.75.75 0 0 1 1.5 0v1.465c0 .138.112.25.25.25h5.5a.75.75 0 0 1 .53.22l2.72 2.72v-2.19a.75.75 0 0 1 .75-.75h2a.25.25 0 0 0 .25-.25v-9.5Z"></path> </svg> <div> <div class="color-fg-default h4">Discussions</div> Collaborate outside of code </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description" data-analytics-event="{"location":"navbar","action":"code_search","context":"product","tag":"link","label":"code_search_link_product_navbar"}" href="https://github.com/features/code-search"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-code-square color-fg-subtle mr-3"> <path d="M10.3 8.24a.75.75 0 0 1-.04 1.06L7.352 12l2.908 2.7a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 0 1 1.06.04Zm3.44 1.06a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.908-2.7-2.908-2.7Z"></path><path d="M2 3.75C2 2.784 2.784 2 3.75 2h16.5c.966 0 1.75.784 1.75 1.75v16.5A1.75 1.75 0 0 1 20.25 22H3.75A1.75 1.75 0 0 1 2 20.25Zm1.75-.25a.25.25 0 0 0-.25.25v16.5c0 .138.112.25.25.25h16.5a.25.25 0 0 0 .25-.25V3.75a.25.25 0 0 0-.25-.25Z"></path> </svg> <div> <div class="color-fg-default h4">Code Search</div> Find more, search less </div> </a></li> </ul> </div> </div> <div class="HeaderMenu-column px-lg-4"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0 border-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="product-explore-heading">Explore</span> <ul class="list-style-none f5" aria-labelledby="product-explore-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"all_features","context":"product","tag":"link","label":"all_features_link_product_navbar"}" href="https://github.com/features"> All features </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{"location":"navbar","action":"documentation","context":"product","tag":"link","label":"documentation_link_product_navbar"}" href="https://docs.github.com"> Documentation <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{"location":"navbar","action":"github_skills","context":"product","tag":"link","label":"github_skills_link_product_navbar"}" href="https://skills.github.com"> GitHub Skills <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{"location":"navbar","action":"blog","context":"product","tag":"link","label":"blog_link_product_navbar"}" href="https://github.blog"> Blog <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> </ul> </div> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Solutions <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 pt-2 pt-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 d-lg-flex flex-wrap dropdown-menu-wide"> <div class="HeaderMenu-column px-lg-4 border-lg-right mb-4 mb-lg-0 pr-lg-7"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0 pb-lg-3 mb-3 mb-lg-0"> <span class="d-block h4 color-fg-default my-1" id="solutions-by-company-size-heading">By company size</span> <ul class="list-style-none f5" aria-labelledby="solutions-by-company-size-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"enterprises","context":"solutions","tag":"link","label":"enterprises_link_solutions_navbar"}" href="https://github.com/enterprise"> Enterprises </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"small_and_medium_teams","context":"solutions","tag":"link","label":"small_and_medium_teams_link_solutions_navbar"}" href="https://github.com/team"> Small and medium teams </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"startups","context":"solutions","tag":"link","label":"startups_link_solutions_navbar"}" href="https://github.com/enterprise/startups"> Startups </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"nonprofits","context":"solutions","tag":"link","label":"nonprofits_link_solutions_navbar"}" href="/solutions/industry/nonprofits"> Nonprofits </a></li> </ul> </div> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="solutions-by-use-case-heading">By use case</span> <ul class="list-style-none f5" aria-labelledby="solutions-by-use-case-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"devsecops","context":"solutions","tag":"link","label":"devsecops_link_solutions_navbar"}" href="/solutions/use-case/devsecops"> DevSecOps </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"devops","context":"solutions","tag":"link","label":"devops_link_solutions_navbar"}" href="/solutions/use-case/devops"> DevOps </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"ci_cd","context":"solutions","tag":"link","label":"ci_cd_link_solutions_navbar"}" href="/solutions/use-case/ci-cd"> CI/CD </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"view_all_use_cases","context":"solutions","tag":"link","label":"view_all_use_cases_link_solutions_navbar"}" href="/solutions/use-case"> View all use cases </a></li> </ul> </div> </div> <div class="HeaderMenu-column px-lg-4"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="solutions-by-industry-heading">By industry</span> <ul class="list-style-none f5" aria-labelledby="solutions-by-industry-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"healthcare","context":"solutions","tag":"link","label":"healthcare_link_solutions_navbar"}" href="/solutions/industry/healthcare"> Healthcare </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"financial_services","context":"solutions","tag":"link","label":"financial_services_link_solutions_navbar"}" href="/solutions/industry/financial-services"> Financial services </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"manufacturing","context":"solutions","tag":"link","label":"manufacturing_link_solutions_navbar"}" href="/solutions/industry/manufacturing"> Manufacturing </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"government","context":"solutions","tag":"link","label":"government_link_solutions_navbar"}" href="/solutions/industry/government"> Government </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"view_all_industries","context":"solutions","tag":"link","label":"view_all_industries_link_solutions_navbar"}" href="/solutions/industry"> View all industries </a></li> </ul> </div> </div> <div class="HeaderMenu-trailing-link rounded-bottom-2 flex-shrink-0 mt-lg-4 px-lg-4 py-4 py-lg-3 f5 text-semibold"> <a href="/solutions"> View all solutions <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-right HeaderMenu-trailing-link-icon"> <path d="M6.22 3.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L9.94 8 6.22 4.28a.75.75 0 0 1 0-1.06Z"></path> </svg> </a> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Resources <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 pt-2 pt-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 pb-2 pb-lg-4 d-lg-flex flex-wrap dropdown-menu-wide"> <div class="HeaderMenu-column px-lg-4 border-lg-right mb-4 mb-lg-0 pr-lg-7"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="resources-topics-heading">Topics</span> <ul class="list-style-none f5" aria-labelledby="resources-topics-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"ai","context":"resources","tag":"link","label":"ai_link_resources_navbar"}" href="/resources/articles/ai"> AI </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"devops","context":"resources","tag":"link","label":"devops_link_resources_navbar"}" href="/resources/articles/devops"> DevOps </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"security","context":"resources","tag":"link","label":"security_link_resources_navbar"}" href="/resources/articles/security"> Security </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"software_development","context":"resources","tag":"link","label":"software_development_link_resources_navbar"}" href="/resources/articles/software-development"> Software Development </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"view_all","context":"resources","tag":"link","label":"view_all_link_resources_navbar"}" href="/resources/articles"> View all </a></li> </ul> </div> </div> <div class="HeaderMenu-column px-lg-4"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0 border-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="resources-explore-heading">Explore</span> <ul class="list-style-none f5" aria-labelledby="resources-explore-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{"location":"navbar","action":"learning_pathways","context":"resources","tag":"link","label":"learning_pathways_link_resources_navbar"}" href="https://resources.github.com/learn/pathways"> Learning Pathways <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{"location":"navbar","action":"events_amp_webinars","context":"resources","tag":"link","label":"events_amp_webinars_link_resources_navbar"}" href="https://resources.github.com"> Events & Webinars <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"ebooks_amp_whitepapers","context":"resources","tag":"link","label":"ebooks_amp_whitepapers_link_resources_navbar"}" href="https://github.com/resources/whitepapers"> Ebooks & Whitepapers </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"customer_stories","context":"resources","tag":"link","label":"customer_stories_link_resources_navbar"}" href="https://github.com/customer-stories"> Customer Stories </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{"location":"navbar","action":"partners","context":"resources","tag":"link","label":"partners_link_resources_navbar"}" href="https://partner.github.com"> Partners <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"executive_insights","context":"resources","tag":"link","label":"executive_insights_link_resources_navbar"}" href="https://github.com/solutions/executive-insights"> Executive Insights </a></li> </ul> </div> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Open Source <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 pt-2 pt-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 pb-2 pb-lg-4 px-lg-4"> <div class="HeaderMenu-column"> <div class="border-bottom pb-3 pb-lg-0 pb-lg-3 mb-3 mb-lg-0 mb-lg-3"> <ul class="list-style-none f5" > <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description" data-analytics-event="{"location":"navbar","action":"github_sponsors","context":"open_source","tag":"link","label":"github_sponsors_link_open_source_navbar"}" href="/sponsors"> <div> <div class="color-fg-default h4">GitHub Sponsors</div> Fund open source developers </div> </a></li> </ul> </div> <div class="border-bottom pb-3 pb-lg-0 pb-lg-3 mb-3 mb-lg-0 mb-lg-3"> <ul class="list-style-none f5" > <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description" data-analytics-event="{"location":"navbar","action":"the_readme_project","context":"open_source","tag":"link","label":"the_readme_project_link_open_source_navbar"}" href="https://github.com/readme"> <div> <div class="color-fg-default h4">The ReadME Project</div> GitHub community articles </div> </a></li> </ul> </div> <div class="border-bottom pb-3 pb-lg-0 border-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="open-source-repositories-heading">Repositories</span> <ul class="list-style-none f5" aria-labelledby="open-source-repositories-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"topics","context":"open_source","tag":"link","label":"topics_link_open_source_navbar"}" href="https://github.com/topics"> Topics </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"trending","context":"open_source","tag":"link","label":"trending_link_open_source_navbar"}" href="https://github.com/trending"> Trending </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"collections","context":"open_source","tag":"link","label":"collections_link_open_source_navbar"}" href="https://github.com/collections"> Collections </a></li> </ul> </div> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Enterprise <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 pt-2 pt-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 pb-2 pb-lg-4 px-lg-4"> <div class="HeaderMenu-column"> <div class="border-bottom pb-3 pb-lg-0 pb-lg-3 mb-3 mb-lg-0 mb-lg-3"> <ul class="list-style-none f5" > <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description" data-analytics-event="{"location":"navbar","action":"enterprise_platform","context":"enterprise","tag":"link","label":"enterprise_platform_link_enterprise_navbar"}" href="/enterprise"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-stack color-fg-subtle mr-3"> <path d="M11.063 1.456a1.749 1.749 0 0 1 1.874 0l8.383 5.316a1.751 1.751 0 0 1 0 2.956l-8.383 5.316a1.749 1.749 0 0 1-1.874 0L2.68 9.728a1.751 1.751 0 0 1 0-2.956Zm1.071 1.267a.25.25 0 0 0-.268 0L3.483 8.039a.25.25 0 0 0 0 .422l8.383 5.316a.25.25 0 0 0 .268 0l8.383-5.316a.25.25 0 0 0 0-.422Z"></path><path d="M1.867 12.324a.75.75 0 0 1 1.035-.232l8.964 5.685a.25.25 0 0 0 .268 0l8.964-5.685a.75.75 0 0 1 .804 1.267l-8.965 5.685a1.749 1.749 0 0 1-1.874 0l-8.965-5.685a.75.75 0 0 1-.231-1.035Z"></path><path d="M1.867 16.324a.75.75 0 0 1 1.035-.232l8.964 5.685a.25.25 0 0 0 .268 0l8.964-5.685a.75.75 0 0 1 .804 1.267l-8.965 5.685a1.749 1.749 0 0 1-1.874 0l-8.965-5.685a.75.75 0 0 1-.231-1.035Z"></path> </svg> <div> <div class="color-fg-default h4">Enterprise platform</div> AI-powered developer platform </div> </a></li> </ul> </div> <div class="border-bottom pb-3 pb-lg-0 border-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="enterprise-available-add-ons-heading">Available add-ons</span> <ul class="list-style-none f5" aria-labelledby="enterprise-available-add-ons-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{"location":"navbar","action":"advanced_security","context":"enterprise","tag":"link","label":"advanced_security_link_enterprise_navbar"}" href="https://github.com/enterprise/advanced-security"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-shield-check color-fg-subtle mr-3"> <path d="M16.53 9.78a.75.75 0 0 0-1.06-1.06L11 13.19l-1.97-1.97a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l5-5Z"></path><path d="m12.54.637 8.25 2.675A1.75 1.75 0 0 1 22 4.976V10c0 6.19-3.771 10.704-9.401 12.83a1.704 1.704 0 0 1-1.198 0C5.77 20.705 2 16.19 2 10V4.976c0-.758.489-1.43 1.21-1.664L11.46.637a1.748 1.748 0 0 1 1.08 0Zm-.617 1.426-8.25 2.676a.249.249 0 0 0-.173.237V10c0 5.46 3.28 9.483 8.43 11.426a.199.199 0 0 0 .14 0C17.22 19.483 20.5 15.461 20.5 10V4.976a.25.25 0 0 0-.173-.237l-8.25-2.676a.253.253 0 0 0-.154 0Z"></path> </svg> <div> <div class="color-fg-default h4">Advanced Security</div> Enterprise-grade security features </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{"location":"navbar","action":"copilot_for_business","context":"enterprise","tag":"link","label":"copilot_for_business_link_enterprise_navbar"}" href="/features/copilot/copilot-business"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-copilot color-fg-subtle mr-3"> <path d="M23.922 16.992c-.861 1.495-5.859 5.023-11.922 5.023-6.063 0-11.061-3.528-11.922-5.023A.641.641 0 0 1 0 16.736v-2.869a.841.841 0 0 1 .053-.22c.372-.935 1.347-2.292 2.605-2.656.167-.429.414-1.055.644-1.517a10.195 10.195 0 0 1-.052-1.086c0-1.331.282-2.499 1.132-3.368.397-.406.89-.717 1.474-.952 1.399-1.136 3.392-2.093 6.122-2.093 2.731 0 4.767.957 6.166 2.093.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086.23.462.477 1.088.644 1.517 1.258.364 2.233 1.721 2.605 2.656a.832.832 0 0 1 .053.22v2.869a.641.641 0 0 1-.078.256ZM12.172 11h-.344a4.323 4.323 0 0 1-.355.508C10.703 12.455 9.555 13 7.965 13c-1.725 0-2.989-.359-3.782-1.259a2.005 2.005 0 0 1-.085-.104L4 11.741v6.585c1.435.779 4.514 2.179 8 2.179 3.486 0 6.565-1.4 8-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.545-3.508-1.492a4.323 4.323 0 0 1-.355-.508h-.016.016Zm.641-2.935c.136 1.057.403 1.913.878 2.497.442.544 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.15.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438 1.578v.021c0 .265.021.562.063.893Zm-1.626 0c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824 1.025-.462.472-.705 1.179-.705 2.319 0 1.211.175 1.926.558 2.361.365.414 1.084.751 2.657.751 1.21 0 1.902-.394 2.344-.938.475-.584.742-1.44.878-2.497Z"></path><path d="M14.5 14.25a1 1 0 0 1 1 1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 1-1Zm-5 0a1 1 0 0 1 1 1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 1-1Z"></path> </svg> <div> <div class="color-fg-default h4">Copilot for business</div> Enterprise-grade AI features </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description" data-analytics-event="{"location":"navbar","action":"premium_support","context":"enterprise","tag":"link","label":"premium_support_link_enterprise_navbar"}" href="/premium-support"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-comment-discussion color-fg-subtle mr-3"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 14.25 14H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 15.543V14H1.75A1.75 1.75 0 0 1 0 12.25v-9.5C0 1.784.784 1 1.75 1ZM1.5 2.75v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z"></path><path d="M22.5 8.75a.25.25 0 0 0-.25-.25h-3.5a.75.75 0 0 1 0-1.5h3.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 22.25 20H21v1.543a1.457 1.457 0 0 1-2.487 1.03L15.939 20H10.75A1.75 1.75 0 0 1 9 18.25v-1.465a.75.75 0 0 1 1.5 0v1.465c0 .138.112.25.25.25h5.5a.75.75 0 0 1 .53.22l2.72 2.72v-2.19a.75.75 0 0 1 .75-.75h2a.25.25 0 0 0 .25-.25v-9.5Z"></path> </svg> <div> <div class="color-fg-default h4">Premium Support</div> Enterprise-grade 24/7 support </div> </a></li> </ul> </div> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <a class="HeaderMenu-link no-underline px-0 px-lg-2 py-3 py-lg-2 d-block d-lg-inline-block" data-analytics-event="{"location":"navbar","action":"pricing","context":"global","tag":"link","label":"pricing_link_global_navbar"}" href="https://github.com/pricing">Pricing</a> </li> </ul> </nav> <div class="d-flex flex-column flex-lg-row width-full flex-justify-end flex-lg-items-center text-center mt-3 mt-lg-0 text-lg-left ml-lg-3"> <qbsearch-input class="search-input" data-scope="repo:ccxt/ccxt" data-custom-scopes-path="/search/custom_scopes" data-delete-custom-scopes-csrf="OqSXtRowEFBcgkevzWNRTEhQEzXjMjhH9yQsSHcxJ2pFgieByyALA3vhpjvhf6XI-bsZST51L1bJ4wA7f9ldFA" data-max-custom-scopes="10" data-header-redesign-enabled="false" data-initial-value="" data-blackbird-suggestions-path="/search/suggestions" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" data-current-repository="ccxt/ccxt" data-current-org="ccxt" data-current-owner="" data-logged-in="false" data-copilot-chat-enabled="false" data-nl-search-enabled="false" data-retain-scroll-position="true"> <div class="search-input-container search-with-dialog position-relative d-flex flex-row flex-items-center mr-4 rounded" data-action="click:qbsearch-input#searchInputContainerClicked" > <button type="button" class="header-search-button placeholder input-button form-control d-flex flex-1 flex-self-stretch flex-items-center no-wrap width-full py-0 pl-2 pr-0 text-left border-0 box-shadow-none" data-target="qbsearch-input.inputButton" aria-label="Search or jump to…" aria-haspopup="dialog" placeholder="Search or jump to..." data-hotkey=s,/ autocapitalize="off" data-analytics-event="{"location":"navbar","action":"searchbar","context":"global","tag":"input","label":"searchbar_input_global_navbar"}" data-action="click:qbsearch-input#handleExpand" > <div class="mr-2 color-fg-muted"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path> </svg> </div> <span class="flex-1" data-target="qbsearch-input.inputButtonText">Search or jump to...</span> <div class="d-flex" data-target="qbsearch-input.hotkeyIndicator"> <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" aria-hidden="true" class="mr-1"><path fill="none" stroke="#979A9C" opacity=".4" d="M3.5.5h12c1.7 0 3 1.3 3 3v13c0 1.7-1.3 3-3 3h-12c-1.7 0-3-1.3-3-3v-13c0-1.7 1.3-3 3-3z"></path><path fill="#979A9C" d="M11.8 6L8 15.1h-.9L10.8 6h1z"></path></svg> </div> </button> <input type="hidden" name="type" class="js-site-search-type-field"> <div class="Overlay--hidden " data-modal-dialog-overlay> <modal-dialog data-action="close:qbsearch-input#handleClose cancel:qbsearch-input#handleClose" data-target="qbsearch-input.searchSuggestionsDialog" role="dialog" id="search-suggestions-dialog" aria-modal="true" aria-labelledby="search-suggestions-dialog-header" data-view-component="true" class="Overlay Overlay--width-large Overlay--height-auto"> <h1 id="search-suggestions-dialog-header" class="sr-only">Search code, repositories, users, issues, pull requests...</h1> <div class="Overlay-body Overlay-body--paddingNone"> <div data-view-component="true"> <div class="search-suggestions position-fixed width-full color-shadow-large border color-fg-default color-bg-default overflow-hidden d-flex flex-column query-builder-container" style="border-radius: 12px;" data-target="qbsearch-input.queryBuilderContainer" hidden > <!-- '"` --><!-- </textarea></xmp> --></option></form><form id="query-builder-test-form" action="" accept-charset="UTF-8" method="get"> <query-builder data-target="qbsearch-input.queryBuilder" id="query-builder-query-builder-test" data-filter-key=":" data-view-component="true" class="QueryBuilder search-query-builder"> <div class="FormControl FormControl--fullWidth"> <label id="query-builder-test-label" for="query-builder-test" class="FormControl-label sr-only"> Search </label> <div class="QueryBuilder-StyledInput width-fit " data-target="query-builder.styledInput" > <span id="query-builder-test-leadingvisual-wrap" class="FormControl-input-leadingVisualWrap QueryBuilder-leadingVisualWrap"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search FormControl-input-leadingVisual"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path> </svg> </span> <div data-target="query-builder.styledInputContainer" class="QueryBuilder-StyledInputContainer"> <div aria-hidden="true" class="QueryBuilder-StyledInputContent" data-target="query-builder.styledInputContent" ></div> <div class="QueryBuilder-InputWrapper"> <div aria-hidden="true" class="QueryBuilder-Sizer" data-target="query-builder.sizer"></div> <input id="query-builder-test" name="query-builder-test" value="" autocomplete="off" type="text" role="combobox" spellcheck="false" aria-expanded="false" aria-describedby="validation-d3ce1c70-2d43-423c-93c5-dfc44c8c1c84" data-target="query-builder.input" data-action=" input:query-builder#inputChange blur:query-builder#inputBlur keydown:query-builder#inputKeydown focus:query-builder#inputFocus " data-view-component="true" class="FormControl-input QueryBuilder-Input FormControl-medium" /> </div> </div> <span class="sr-only" id="query-builder-test-clear">Clear</span> <button role="button" id="query-builder-test-clear-button" aria-labelledby="query-builder-test-clear query-builder-test-label" data-target="query-builder.clearButton" data-action=" click:query-builder#clear focus:query-builder#clearButtonFocus blur:query-builder#clearButtonBlur " variant="small" hidden="hidden" type="button" data-view-component="true" class="Button Button--iconOnly Button--invisible Button--medium mr-1 px-2 py-0 d-flex flex-items-center rounded-1 color-fg-muted"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x-circle-fill Button-visual"> <path d="M2.343 13.657A8 8 0 1 1 13.658 2.343 8 8 0 0 1 2.343 13.657ZM6.03 4.97a.751.751 0 0 0-1.042.018.751.751 0 0 0-.018 1.042L6.94 8 4.97 9.97a.749.749 0 0 0 .326 1.275.749.749 0 0 0 .734-.215L8 9.06l1.97 1.97a.749.749 0 0 0 1.275-.326.749.749 0 0 0-.215-.734L9.06 8l1.97-1.97a.749.749 0 0 0-.326-1.275.749.749 0 0 0-.734.215L8 6.94Z"></path> </svg> </button> </div> <template id="search-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path> </svg> </template> <template id="code-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path> </svg> </template> <template id="file-code-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file-code"> <path d="M4 1.75C4 .784 4.784 0 5.75 0h5.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v8.586A1.75 1.75 0 0 1 14.25 15h-9a.75.75 0 0 1 0-1.5h9a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 10 4.25V1.5H5.75a.25.25 0 0 0-.25.25v2.5a.75.75 0 0 1-1.5 0Zm1.72 4.97a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734l1.47-1.47-1.47-1.47a.75.75 0 0 1 0-1.06ZM3.28 7.78 1.81 9.25l1.47 1.47a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-2-2a.75.75 0 0 1 0-1.06l2-2a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Zm8.22-6.218V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path> </svg> </template> <template id="history-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-history"> <path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path> </svg> </template> <template id="repo-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path> </svg> </template> <template id="bookmark-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bookmark"> <path d="M3 2.75C3 1.784 3.784 1 4.75 1h6.5c.966 0 1.75.784 1.75 1.75v11.5a.75.75 0 0 1-1.227.579L8 11.722l-3.773 3.107A.751.751 0 0 1 3 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.91l3.023-2.489a.75.75 0 0 1 .954 0l3.023 2.49V2.75a.25.25 0 0 0-.25-.25Z"></path> </svg> </template> <template id="plus-circle-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-plus-circle"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm7.25-3.25v2.5h2.5a.75.75 0 0 1 0 1.5h-2.5v2.5a.75.75 0 0 1-1.5 0v-2.5h-2.5a.75.75 0 0 1 0-1.5h2.5v-2.5a.75.75 0 0 1 1.5 0Z"></path> </svg> </template> <template id="circle-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-dot-fill"> <path d="M8 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8Z"></path> </svg> </template> <template id="trash-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-trash"> <path d="M11 1.75V3h2.25a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5H5V1.75C5 .784 5.784 0 6.75 0h2.5C10.216 0 11 .784 11 1.75ZM4.496 6.675l.66 6.6a.25.25 0 0 0 .249.225h5.19a.25.25 0 0 0 .249-.225l.66-6.6a.75.75 0 0 1 1.492.149l-.66 6.6A1.748 1.748 0 0 1 10.595 15h-5.19a1.75 1.75 0 0 1-1.741-1.575l-.66-6.6a.75.75 0 1 1 1.492-.15ZM6.5 1.75V3h3V1.75a.25.25 0 0 0-.25-.25h-2.5a.25.25 0 0 0-.25.25Z"></path> </svg> </template> <template id="team-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-people"> <path d="M2 5.5a3.5 3.5 0 1 1 5.898 2.549 5.508 5.508 0 0 1 3.034 4.084.75.75 0 1 1-1.482.235 4 4 0 0 0-7.9 0 .75.75 0 0 1-1.482-.236A5.507 5.507 0 0 1 3.102 8.05 3.493 3.493 0 0 1 2 5.5ZM11 4a3.001 3.001 0 0 1 2.22 5.018 5.01 5.01 0 0 1 2.56 3.012.749.749 0 0 1-.885.954.752.752 0 0 1-.549-.514 3.507 3.507 0 0 0-2.522-2.372.75.75 0 0 1-.574-.73v-.352a.75.75 0 0 1 .416-.672A1.5 1.5 0 0 0 11 5.5.75.75 0 0 1 11 4Zm-5.5-.5a2 2 0 1 0-.001 3.999A2 2 0 0 0 5.5 3.5Z"></path> </svg> </template> <template id="project-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path> </svg> </template> <template id="pencil-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-pencil"> <path d="M11.013 1.427a1.75 1.75 0 0 1 2.474 0l1.086 1.086a1.75 1.75 0 0 1 0 2.474l-8.61 8.61c-.21.21-.47.364-.756.445l-3.251.93a.75.75 0 0 1-.927-.928l.929-3.25c.081-.286.235-.547.445-.758l8.61-8.61Zm.176 4.823L9.75 4.81l-6.286 6.287a.253.253 0 0 0-.064.108l-.558 1.953 1.953-.558a.253.253 0 0 0 .108-.064Zm1.238-3.763a.25.25 0 0 0-.354 0L10.811 3.75l1.439 1.44 1.263-1.263a.25.25 0 0 0 0-.354Z"></path> </svg> </template> <template id="copilot-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copilot"> <path d="M7.998 15.035c-4.562 0-7.873-2.914-7.998-3.749V9.338c.085-.628.677-1.686 1.588-2.065.013-.07.024-.143.036-.218.029-.183.06-.384.126-.612-.201-.508-.254-1.084-.254-1.656 0-.87.128-1.769.693-2.484.579-.733 1.494-1.124 2.724-1.261 1.206-.134 2.262.034 2.944.765.05.053.096.108.139.165.044-.057.094-.112.143-.165.682-.731 1.738-.899 2.944-.765 1.23.137 2.145.528 2.724 1.261.566.715.693 1.614.693 2.484 0 .572-.053 1.148-.254 1.656.066.228.098.429.126.612.012.076.024.148.037.218.924.385 1.522 1.471 1.591 2.095v1.872c0 .766-3.351 3.795-8.002 3.795Zm0-1.485c2.28 0 4.584-1.11 5.002-1.433V7.862l-.023-.116c-.49.21-1.075.291-1.727.291-1.146 0-2.059-.327-2.71-.991A3.222 3.222 0 0 1 8 6.303a3.24 3.24 0 0 1-.544.743c-.65.664-1.563.991-2.71.991-.652 0-1.236-.081-1.727-.291l-.023.116v4.255c.419.323 2.722 1.433 5.002 1.433ZM6.762 2.83c-.193-.206-.637-.413-1.682-.297-1.019.113-1.479.404-1.713.7-.247.312-.369.789-.369 1.554 0 .793.129 1.171.308 1.371.162.181.519.379 1.442.379.853 0 1.339-.235 1.638-.54.315-.322.527-.827.617-1.553.117-.935-.037-1.395-.241-1.614Zm4.155-.297c-1.044-.116-1.488.091-1.681.297-.204.219-.359.679-.242 1.614.091.726.303 1.231.618 1.553.299.305.784.54 1.638.54.922 0 1.28-.198 1.442-.379.179-.2.308-.578.308-1.371 0-.765-.123-1.242-.37-1.554-.233-.296-.693-.587-1.713-.7Z"></path><path d="M6.25 9.037a.75.75 0 0 1 .75.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 .75-.75Zm4.25.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 1.5 0Z"></path> </svg> </template> <template id="copilot-error-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copilot-error"> <path d="M16 11.24c0 .112-.072.274-.21.467L13 9.688V7.862l-.023-.116c-.49.21-1.075.291-1.727.291-.198 0-.388-.009-.571-.029L6.833 5.226a4.01 4.01 0 0 0 .17-.782c.117-.935-.037-1.395-.241-1.614-.193-.206-.637-.413-1.682-.297-.683.076-1.115.231-1.395.415l-1.257-.91c.579-.564 1.413-.877 2.485-.996 1.206-.134 2.262.034 2.944.765.05.053.096.108.139.165.044-.057.094-.112.143-.165.682-.731 1.738-.899 2.944-.765 1.23.137 2.145.528 2.724 1.261.566.715.693 1.614.693 2.484 0 .572-.053 1.148-.254 1.656.066.228.098.429.126.612.012.076.024.148.037.218.924.385 1.522 1.471 1.591 2.095Zm-5.083-8.707c-1.044-.116-1.488.091-1.681.297-.204.219-.359.679-.242 1.614.091.726.303 1.231.618 1.553.299.305.784.54 1.638.54.922 0 1.28-.198 1.442-.379.179-.2.308-.578.308-1.371 0-.765-.123-1.242-.37-1.554-.233-.296-.693-.587-1.713-.7Zm2.511 11.074c-1.393.776-3.272 1.428-5.43 1.428-4.562 0-7.873-2.914-7.998-3.749V9.338c.085-.628.677-1.686 1.588-2.065.013-.07.024-.143.036-.218.029-.183.06-.384.126-.612-.18-.455-.241-.963-.252-1.475L.31 4.107A.747.747 0 0 1 0 3.509V3.49a.748.748 0 0 1 .625-.73c.156-.026.306.047.435.139l14.667 10.578a.592.592 0 0 1 .227.264.752.752 0 0 1 .046.249v.022a.75.75 0 0 1-1.19.596Zm-1.367-.991L5.635 7.964a5.128 5.128 0 0 1-.889.073c-.652 0-1.236-.081-1.727-.291l-.023.116v4.255c.419.323 2.722 1.433 5.002 1.433 1.539 0 3.089-.505 4.063-.934Z"></path> </svg> </template> <template id="workflow-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-workflow"> <path d="M0 1.75C0 .784.784 0 1.75 0h3.5C6.216 0 7 .784 7 1.75v3.5A1.75 1.75 0 0 1 5.25 7H4v4a1 1 0 0 0 1 1h4v-1.25C9 9.784 9.784 9 10.75 9h3.5c.966 0 1.75.784 1.75 1.75v3.5A1.75 1.75 0 0 1 14.25 16h-3.5A1.75 1.75 0 0 1 9 14.25v-.75H5A2.5 2.5 0 0 1 2.5 11V7h-.75A1.75 1.75 0 0 1 0 5.25Zm1.75-.25a.25.25 0 0 0-.25.25v3.5c0 .138.112.25.25.25h3.5a.25.25 0 0 0 .25-.25v-3.5a.25.25 0 0 0-.25-.25Zm9 9a.25.25 0 0 0-.25.25v3.5c0 .138.112.25.25.25h3.5a.25.25 0 0 0 .25-.25v-3.5a.25.25 0 0 0-.25-.25Z"></path> </svg> </template> <template id="book-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-book"> <path d="M0 1.75A.75.75 0 0 1 .75 1h4.253c1.227 0 2.317.59 3 1.501A3.743 3.743 0 0 1 11.006 1h4.245a.75.75 0 0 1 .75.75v10.5a.75.75 0 0 1-.75.75h-4.507a2.25 2.25 0 0 0-1.591.659l-.622.621a.75.75 0 0 1-1.06 0l-.622-.621A2.25 2.25 0 0 0 5.258 13H.75a.75.75 0 0 1-.75-.75Zm7.251 10.324.004-5.073-.002-2.253A2.25 2.25 0 0 0 5.003 2.5H1.5v9h3.757a3.75 3.75 0 0 1 1.994.574ZM8.755 4.75l-.004 7.322a3.752 3.752 0 0 1 1.992-.572H14.5v-9h-3.495a2.25 2.25 0 0 0-2.25 2.25Z"></path> </svg> </template> <template id="code-review-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code-review"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 14.25 13H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25v-8.5C0 1.784.784 1 1.75 1ZM1.5 2.75v8.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-8.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Zm5.28 1.72a.75.75 0 0 1 0 1.06L5.31 7l1.47 1.47a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-2-2a.75.75 0 0 1 0-1.06l2-2a.75.75 0 0 1 1.06 0Zm2.44 0a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L10.69 7 9.22 5.53a.75.75 0 0 1 0-1.06Z"></path> </svg> </template> <template id="codespaces-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-codespaces"> <path d="M0 11.25c0-.966.784-1.75 1.75-1.75h12.5c.966 0 1.75.784 1.75 1.75v3A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25Zm2-9.5C2 .784 2.784 0 3.75 0h8.5C13.216 0 14 .784 14 1.75v5a1.75 1.75 0 0 1-1.75 1.75h-8.5A1.75 1.75 0 0 1 2 6.75Zm1.75-.25a.25.25 0 0 0-.25.25v5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-5a.25.25 0 0 0-.25-.25Zm-2 9.5a.25.25 0 0 0-.25.25v3c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-3a.25.25 0 0 0-.25-.25Z"></path><path d="M7 12.75a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75Zm-4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75Z"></path> </svg> </template> <template id="comment-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-comment"> <path d="M1 2.75C1 1.784 1.784 1 2.75 1h10.5c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 13.25 12H9.06l-2.573 2.573A1.458 1.458 0 0 1 4 13.543V12H2.75A1.75 1.75 0 0 1 1 10.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h4.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path> </svg> </template> <template id="comment-discussion-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-comment-discussion"> <path d="M1.75 1h8.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 10.25 10H7.061l-2.574 2.573A1.458 1.458 0 0 1 2 11.543V10h-.25A1.75 1.75 0 0 1 0 8.25v-5.5C0 1.784.784 1 1.75 1ZM1.5 2.75v5.5c0 .138.112.25.25.25h1a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h3.5a.25.25 0 0 0 .25-.25v-5.5a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25Zm13 2a.25.25 0 0 0-.25-.25h-.5a.75.75 0 0 1 0-1.5h.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 14.25 12H14v1.543a1.458 1.458 0 0 1-2.487 1.03L9.22 12.28a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l2.22 2.22v-2.19a.75.75 0 0 1 .75-.75h1a.25.25 0 0 0 .25-.25Z"></path> </svg> </template> <template id="organization-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-organization"> <path d="M1.75 16A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0h8.5C11.216 0 12 .784 12 1.75v12.5c0 .085-.006.168-.018.25h2.268a.25.25 0 0 0 .25-.25V8.285a.25.25 0 0 0-.111-.208l-1.055-.703a.749.749 0 1 1 .832-1.248l1.055.703c.487.325.779.871.779 1.456v5.965A1.75 1.75 0 0 1 14.25 16h-3.5a.766.766 0 0 1-.197-.026c-.099.017-.2.026-.303.026h-3a.75.75 0 0 1-.75-.75V14h-1v1.25a.75.75 0 0 1-.75.75Zm-.25-1.75c0 .138.112.25.25.25H4v-1.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 .75.75v1.25h2.25a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25ZM3.75 6h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5ZM3 3.75A.75.75 0 0 1 3.75 3h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 3 3.75Zm4 3A.75.75 0 0 1 7.75 6h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 7 6.75ZM7.75 3h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5ZM3 9.75A.75.75 0 0 1 3.75 9h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 3 9.75ZM7.75 9h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5Z"></path> </svg> </template> <template id="rocket-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-rocket"> <path d="M14.064 0h.186C15.216 0 16 .784 16 1.75v.186a8.752 8.752 0 0 1-2.564 6.186l-.458.459c-.314.314-.641.616-.979.904v3.207c0 .608-.315 1.172-.833 1.49l-2.774 1.707a.749.749 0 0 1-1.11-.418l-.954-3.102a1.214 1.214 0 0 1-.145-.125L3.754 9.816a1.218 1.218 0 0 1-.124-.145L.528 8.717a.749.749 0 0 1-.418-1.11l1.71-2.774A1.748 1.748 0 0 1 3.31 4h3.204c.288-.338.59-.665.904-.979l.459-.458A8.749 8.749 0 0 1 14.064 0ZM8.938 3.623h-.002l-.458.458c-.76.76-1.437 1.598-2.02 2.5l-1.5 2.317 2.143 2.143 2.317-1.5c.902-.583 1.74-1.26 2.499-2.02l.459-.458a7.25 7.25 0 0 0 2.123-5.127V1.75a.25.25 0 0 0-.25-.25h-.186a7.249 7.249 0 0 0-5.125 2.123ZM3.56 14.56c-.732.732-2.334 1.045-3.005 1.148a.234.234 0 0 1-.201-.064.234.234 0 0 1-.064-.201c.103-.671.416-2.273 1.15-3.003a1.502 1.502 0 1 1 2.12 2.12Zm6.94-3.935c-.088.06-.177.118-.266.175l-2.35 1.521.548 1.783 1.949-1.2a.25.25 0 0 0 .119-.213ZM3.678 8.116 5.2 5.766c.058-.09.117-.178.176-.266H3.309a.25.25 0 0 0-.213.119l-1.2 1.95ZM12 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> </template> <template id="shield-check-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield-check"> <path d="m8.533.133 5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667l5.25-1.68a1.748 1.748 0 0 1 1.066 0Zm-.61 1.429.001.001-5.25 1.68a.251.251 0 0 0-.174.237V7c0 1.36.275 2.666 1.057 3.859.784 1.194 2.121 2.342 4.366 3.298a.196.196 0 0 0 .154 0c2.245-.957 3.582-2.103 4.366-3.297C13.225 9.666 13.5 8.358 13.5 7V3.48a.25.25 0 0 0-.174-.238l-5.25-1.68a.25.25 0 0 0-.153 0ZM11.28 6.28l-3.5 3.5a.75.75 0 0 1-1.06 0l-1.5-1.5a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l.97.97 2.97-2.97a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path> </svg> </template> <template id="heart-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-heart"> <path d="m8 14.25.345.666a.75.75 0 0 1-.69 0l-.008-.004-.018-.01a7.152 7.152 0 0 1-.31-.17 22.055 22.055 0 0 1-3.434-2.414C2.045 10.731 0 8.35 0 5.5 0 2.836 2.086 1 4.25 1 5.797 1 7.153 1.802 8 3.02 8.847 1.802 10.203 1 11.75 1 13.914 1 16 2.836 16 5.5c0 2.85-2.045 5.231-3.885 6.818a22.066 22.066 0 0 1-3.744 2.584l-.018.01-.006.003h-.002ZM4.25 2.5c-1.336 0-2.75 1.164-2.75 3 0 2.15 1.58 4.144 3.365 5.682A20.58 20.58 0 0 0 8 13.393a20.58 20.58 0 0 0 3.135-2.211C12.92 9.644 14.5 7.65 14.5 5.5c0-1.836-1.414-3-2.75-3-1.373 0-2.609.986-3.029 2.456a.749.749 0 0 1-1.442 0C6.859 3.486 5.623 2.5 4.25 2.5Z"></path> </svg> </template> <template id="server-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-server"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v4c0 .372-.116.717-.314 1 .198.283.314.628.314 1v4a1.75 1.75 0 0 1-1.75 1.75H1.75A1.75 1.75 0 0 1 0 12.75v-4c0-.358.109-.707.314-1a1.739 1.739 0 0 1-.314-1v-4C0 1.784.784 1 1.75 1ZM1.5 2.75v4c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Zm.25 5.75a.25.25 0 0 0-.25.25v4c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25ZM7 4.75A.75.75 0 0 1 7.75 4h4.5a.75.75 0 0 1 0 1.5h-4.5A.75.75 0 0 1 7 4.75ZM7.75 10h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM3 4.75A.75.75 0 0 1 3.75 4h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 3 4.75ZM3.75 10h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5Z"></path> </svg> </template> <template id="globe-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-globe"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM5.78 8.75a9.64 9.64 0 0 0 1.363 4.177c.255.426.542.832.857 1.215.245-.296.551-.705.857-1.215A9.64 9.64 0 0 0 10.22 8.75Zm4.44-1.5a9.64 9.64 0 0 0-1.363-4.177c-.307-.51-.612-.919-.857-1.215a9.927 9.927 0 0 0-.857 1.215A9.64 9.64 0 0 0 5.78 7.25Zm-5.944 1.5H1.543a6.507 6.507 0 0 0 4.666 5.5c-.123-.181-.24-.365-.352-.552-.715-1.192-1.437-2.874-1.581-4.948Zm-2.733-1.5h2.733c.144-2.074.866-3.756 1.58-4.948.12-.197.237-.381.353-.552a6.507 6.507 0 0 0-4.666 5.5Zm10.181 1.5c-.144 2.074-.866 3.756-1.58 4.948-.12.197-.237.381-.353.552a6.507 6.507 0 0 0 4.666-5.5Zm2.733-1.5a6.507 6.507 0 0 0-4.666-5.5c.123.181.24.365.353.552.714 1.192 1.436 2.874 1.58 4.948Z"></path> </svg> </template> <template id="issue-opened-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path> </svg> </template> <template id="device-mobile-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-device-mobile"> <path d="M3.75 0h8.5C13.216 0 14 .784 14 1.75v12.5A1.75 1.75 0 0 1 12.25 16h-8.5A1.75 1.75 0 0 1 2 14.25V1.75C2 .784 2.784 0 3.75 0ZM3.5 1.75v12.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25ZM8 13a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path> </svg> </template> <template id="package-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-package"> <path d="m8.878.392 5.25 3.045c.54.314.872.89.872 1.514v6.098a1.75 1.75 0 0 1-.872 1.514l-5.25 3.045a1.75 1.75 0 0 1-1.756 0l-5.25-3.045A1.75 1.75 0 0 1 1 11.049V4.951c0-.624.332-1.201.872-1.514L7.122.392a1.75 1.75 0 0 1 1.756 0ZM7.875 1.69l-4.63 2.685L8 7.133l4.755-2.758-4.63-2.685a.248.248 0 0 0-.25 0ZM2.5 5.677v5.372c0 .09.047.171.125.216l4.625 2.683V8.432Zm6.25 8.271 4.625-2.683a.25.25 0 0 0 .125-.216V5.677L8.75 8.432Z"></path> </svg> </template> <template id="credit-card-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-credit-card"> <path d="M10.75 9a.75.75 0 0 0 0 1.5h1.5a.75.75 0 0 0 0-1.5h-1.5Z"></path><path d="M0 3.75C0 2.784.784 2 1.75 2h12.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 14.25 14H1.75A1.75 1.75 0 0 1 0 12.25ZM14.5 6.5h-13v5.75c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25Zm0-2.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25V5h13Z"></path> </svg> </template> <template id="play-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path> </svg> </template> <template id="gift-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-gift"> <path d="M2 2.75A2.75 2.75 0 0 1 4.75 0c.983 0 1.873.42 2.57 1.232.268.318.497.668.68 1.042.183-.375.411-.725.68-1.044C9.376.42 10.266 0 11.25 0a2.75 2.75 0 0 1 2.45 4h.55c.966 0 1.75.784 1.75 1.75v2c0 .698-.409 1.301-1 1.582v4.918A1.75 1.75 0 0 1 13.25 16H2.75A1.75 1.75 0 0 1 1 14.25V9.332C.409 9.05 0 8.448 0 7.75v-2C0 4.784.784 4 1.75 4h.55c-.192-.375-.3-.8-.3-1.25ZM7.25 9.5H2.5v4.75c0 .138.112.25.25.25h4.5Zm1.5 0v5h4.5a.25.25 0 0 0 .25-.25V9.5Zm0-4V8h5.5a.25.25 0 0 0 .25-.25v-2a.25.25 0 0 0-.25-.25Zm-7 0a.25.25 0 0 0-.25.25v2c0 .138.112.25.25.25h5.5V5.5h-5.5Zm3-4a1.25 1.25 0 0 0 0 2.5h2.309c-.233-.818-.542-1.401-.878-1.793-.43-.502-.915-.707-1.431-.707ZM8.941 4h2.309a1.25 1.25 0 0 0 0-2.5c-.516 0-1 .205-1.43.707-.337.392-.646.975-.879 1.793Z"></path> </svg> </template> <template id="code-square-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code-square"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25Zm7.47 3.97a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L10.69 8 9.22 6.53a.75.75 0 0 1 0-1.06ZM6.78 6.53 5.31 8l1.47 1.47a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215l-2-2a.75.75 0 0 1 0-1.06l2-2a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path> </svg> </template> <template id="device-desktop-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-device-desktop"> <path d="M14.25 1c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 14.25 12h-3.727c.099 1.041.52 1.872 1.292 2.757A.752.752 0 0 1 11.25 16h-6.5a.75.75 0 0 1-.565-1.243c.772-.885 1.192-1.716 1.292-2.757H1.75A1.75 1.75 0 0 1 0 10.25v-7.5C0 1.784.784 1 1.75 1ZM1.75 2.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25ZM9.018 12H6.982a5.72 5.72 0 0 1-.765 2.5h3.566a5.72 5.72 0 0 1-.765-2.5Z"></path> </svg> </template> <div class="position-relative"> <ul role="listbox" class="ActionListWrap QueryBuilder-ListWrap" aria-label="Suggestions" data-action=" combobox-commit:query-builder#comboboxCommit mousedown:query-builder#resultsMousedown " data-target="query-builder.resultsList" data-persist-list=false id="query-builder-test-results" ></ul> </div> <div class="FormControl-inlineValidation" id="validation-d3ce1c70-2d43-423c-93c5-dfc44c8c1c84" hidden="hidden"> <span class="FormControl-inlineValidation--visual"> <svg aria-hidden="true" height="12" viewBox="0 0 12 12" version="1.1" width="12" data-view-component="true" class="octicon octicon-alert-fill"> <path d="M4.855.708c.5-.896 1.79-.896 2.29 0l4.675 8.351a1.312 1.312 0 0 1-1.146 1.954H1.33A1.313 1.313 0 0 1 .183 9.058ZM7 7V3H5v4Zm-1 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"></path> </svg> </span> <span></span> </div> </div> <div data-target="query-builder.screenReaderFeedback" aria-live="polite" aria-atomic="true" class="sr-only"></div> </query-builder></form> <div class="d-flex flex-row color-fg-muted px-3 text-small color-bg-default search-feedback-prompt"> <a target="_blank" href="https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax" data-view-component="true" class="Link color-fg-accent text-normal ml-2">Search syntax tips</a> <div class="d-flex flex-1"></div> </div> </div> </div> </div> </modal-dialog></div> </div> <div data-action="click:qbsearch-input#retract" class="dark-backdrop position-fixed" hidden data-target="qbsearch-input.darkBackdrop"></div> <div class="color-fg-default"> <dialog-helper> <dialog data-target="qbsearch-input.feedbackDialog" data-action="close:qbsearch-input#handleDialogClose cancel:qbsearch-input#handleDialogClose" id="feedback-dialog" aria-modal="true" aria-labelledby="feedback-dialog-title" aria-describedby="feedback-dialog-description" data-view-component="true" class="Overlay Overlay-whenNarrow Overlay--size-medium Overlay--motion-scaleFade Overlay--disableScroll"> <div data-view-component="true" class="Overlay-header"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 class="Overlay-title " id="feedback-dialog-title"> Provide feedback </h1> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="feedback-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg></button> </div> </div> </div> <scrollable-region data-labelled-by="feedback-dialog-title"> <div data-view-component="true" class="Overlay-body"> <!-- '"` --><!-- </textarea></xmp> --></option></form><form id="code-search-feedback-form" data-turbo="false" action="/search/feedback" accept-charset="UTF-8" method="post"><input type="hidden" data-csrf="true" name="authenticity_token" value="i1Z8r4I6uuAaDUrwSG1kYRlhXkZez867TPjzIfWeKWe77ArAtsjrjGvamyY0RJGf+GQiM890bdXZ1cwXWrngfA==" /> <p>We read every piece of feedback, and take your input very seriously.</p> <textarea name="feedback" class="form-control width-full mb-2" style="height: 120px" id="feedback"></textarea> <input name="include_email" id="include_email" aria-label="Include my email address so I can be contacted" class="form-control mr-2" type="checkbox"> <label for="include_email" style="font-weight: normal">Include my email address so I can be contacted</label> </form></div> </scrollable-region> <div data-view-component="true" class="Overlay-footer Overlay-footer--alignEnd"> <button data-close-dialog-id="feedback-dialog" type="button" data-view-component="true" class="btn"> Cancel </button> <button form="code-search-feedback-form" data-action="click:qbsearch-input#submitFeedback" type="submit" data-view-component="true" class="btn-primary btn"> Submit feedback </button> </div> </dialog></dialog-helper> <custom-scopes data-target="qbsearch-input.customScopesManager"> <dialog-helper> <dialog data-target="custom-scopes.customScopesModalDialog" data-action="close:qbsearch-input#handleDialogClose cancel:qbsearch-input#handleDialogClose" id="custom-scopes-dialog" aria-modal="true" aria-labelledby="custom-scopes-dialog-title" aria-describedby="custom-scopes-dialog-description" data-view-component="true" class="Overlay Overlay-whenNarrow Overlay--size-medium Overlay--motion-scaleFade Overlay--disableScroll"> <div data-view-component="true" class="Overlay-header Overlay-header--divided"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 class="Overlay-title " id="custom-scopes-dialog-title"> Saved searches </h1> <h2 id="custom-scopes-dialog-description" class="Overlay-description">Use saved searches to filter your results more quickly</h2> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="custom-scopes-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg></button> </div> </div> </div> <scrollable-region data-labelled-by="custom-scopes-dialog-title"> <div data-view-component="true" class="Overlay-body"> <div data-target="custom-scopes.customScopesModalDialogFlash"></div> <div hidden class="create-custom-scope-form" data-target="custom-scopes.createCustomScopeForm"> <!-- '"` --><!-- </textarea></xmp> --></option></form><form id="custom-scopes-dialog-form" data-turbo="false" action="/search/custom_scopes" accept-charset="UTF-8" method="post"><input type="hidden" data-csrf="true" name="authenticity_token" value="USv1tO5Xmznhmtu/4dsJW6omoBX3aj8/kVpzcumb5/Tz+809kYhN6ojDlq4bK48VzGus73Wl6tGMK7Vu5zlYAw==" /> <div data-target="custom-scopes.customScopesModalDialogFlash"></div> <input type="hidden" id="custom_scope_id" name="custom_scope_id" data-target="custom-scopes.customScopesIdField"> <div class="form-group"> <label for="custom_scope_name">Name</label> <auto-check src="/search/custom_scopes/check_name" required only-validate-on-blur="false"> <input type="text" name="custom_scope_name" id="custom_scope_name" data-target="custom-scopes.customScopesNameField" class="form-control" autocomplete="off" placeholder="github-ruby" required maxlength="50"> <input type="hidden" data-csrf="true" value="sr5vRFeoItF6lLUwf8EdfSUMkdpQArCE/a7RjABEGr8UqAm8Y5wKSSwh9kZptQaYSFKAPQBkyV6Px25nbru0OA==" /> </auto-check> </div> <div class="form-group"> <label for="custom_scope_query">Query</label> <input type="text" name="custom_scope_query" id="custom_scope_query" data-target="custom-scopes.customScopesQueryField" class="form-control" autocomplete="off" placeholder="(repo:mona/a OR repo:mona/b) AND lang:python" required maxlength="500"> </div> <p class="text-small color-fg-muted"> To see all available qualifiers, see our <a class="Link--inTextBlock" href="https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax">documentation</a>. </p> </form> </div> <div data-target="custom-scopes.manageCustomScopesForm"> <div data-target="custom-scopes.list"></div> </div> </div> </scrollable-region> <div data-view-component="true" class="Overlay-footer Overlay-footer--alignEnd Overlay-footer--divided"> <button data-action="click:custom-scopes#customScopesCancel" type="button" data-view-component="true" class="btn"> Cancel </button> <button form="custom-scopes-dialog-form" data-action="click:custom-scopes#customScopesSubmit" data-target="custom-scopes.customScopesSubmitButton" type="submit" data-view-component="true" class="btn-primary btn"> Create saved search </button> </div> </dialog></dialog-helper> </custom-scopes> </div> </qbsearch-input> <div class="position-relative HeaderMenu-link-wrap d-lg-inline-block"> <a href="/login?return_to=https%3A%2F%2Fgithub.com%2Fccxt%2Fccxt%2Fwiki%2FManual" class="HeaderMenu-link HeaderMenu-link--sign-in HeaderMenu-button flex-shrink-0 no-underline d-none d-lg-inline-flex border border-lg-0 rounded rounded-lg-0 px-2 py-1" style="margin-left: 12px;" data-hydro-click="{"event_type":"authentication.click","payload":{"location_in_page":"site header menu","repository_id":null,"auth_type":"SIGN_UP","originating_url":"https://github.com/ccxt/ccxt/wiki/Manual","user_id":null}}" data-hydro-click-hmac="52263623024966d430f80235dd819c65ff2c470ee21b5990f4bec014a89d07f2" data-analytics-event="{"category":"Marketing nav","action":"click to go to homepage","label":"ref_page:Marketing;ref_cta:Sign in;ref_loc:Header"}" > Sign in </a> </div> <a href="/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fwiki%2Fshow&source=header-repo&source_repo=ccxt%2Fccxt" class="HeaderMenu-link HeaderMenu-link--sign-up HeaderMenu-button flex-shrink-0 d-flex d-lg-inline-flex no-underline border color-border-default rounded px-2 py-1" data-hydro-click="{"event_type":"authentication.click","payload":{"location_in_page":"site header menu","repository_id":null,"auth_type":"SIGN_UP","originating_url":"https://github.com/ccxt/ccxt/wiki/Manual","user_id":null}}" data-hydro-click-hmac="52263623024966d430f80235dd819c65ff2c470ee21b5990f4bec014a89d07f2" data-analytics-event="{"category":"Sign up","action":"click to sign up for account","label":"ref_page:/<user-name>/<repo-name>/wiki/show;ref_cta:Sign up;ref_loc:header logged out"}" > Sign up </a> <button type="button" class="sr-only js-header-menu-focus-trap d-block d-lg-none">Reseting focus</button> </div> </div> </div> </div> </header> <div hidden="hidden" data-view-component="true" class="js-stale-session-flash stale-session-flash flash flash-warn flash-full"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> <span class="js-stale-session-flash-signed-in" hidden>You signed in with another tab or window. <a class="Link--inTextBlock" href="">Reload</a> to refresh your session.</span> <span class="js-stale-session-flash-signed-out" hidden>You signed out in another tab or window. <a class="Link--inTextBlock" href="">Reload</a> to refresh your session.</span> <span class="js-stale-session-flash-switched" hidden>You switched accounts on another tab or window. <a class="Link--inTextBlock" href="">Reload</a> to refresh your session.</span> <button id="icon-button-9a64e26b-9256-4c53-bdce-88f09c1ca4f7" aria-labelledby="tooltip-ee1f2369-4539-4833-83fa-5ed1b628d9e2" type="button" data-view-component="true" class="Button Button--iconOnly Button--invisible Button--medium flash-close js-flash-close"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x Button-visual"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button><tool-tip id="tooltip-ee1f2369-4539-4833-83fa-5ed1b628d9e2" for="icon-button-9a64e26b-9256-4c53-bdce-88f09c1ca4f7" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">Dismiss alert</tool-tip> </div> </div> <div id="start-of-content" class="show-on-focus"></div> <div id="js-flash-container" class="flash-container" data-turbo-replace> <template class="js-flash-template"> <div class="flash flash-full {{ className }}"> <div > <button autofocus class="flash-close js-flash-close" type="button" aria-label="Dismiss this message"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button> <div aria-atomic="true" role="alert" class="js-flash-alert"> <div>{{ message }}</div> </div> </div> </div> </template> </div> <div class="application-main " data-commit-hovercards-enabled data-discussion-hovercards-enabled data-issue-and-pr-hovercards-enabled data-project-hovercards-enabled > <div itemscope itemtype="http://schema.org/SoftwareSourceCode" class=""> <main id="js-repo-pjax-container" > <div id="repository-container-header" class="pt-3 hide-full-screen" style="background-color: var(--page-header-bgColor, var(--color-page-header-bg));" data-turbo-replace> <div class="d-flex flex-nowrap flex-justify-end mb-3 px-3 px-lg-5" style="gap: 1rem;"> <div class="flex-auto min-width-0 width-fit"> <div class=" d-flex flex-wrap flex-items-center wb-break-word f3 text-normal"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo color-fg-muted mr-2"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path> </svg> <span class="author flex-self-stretch" itemprop="author"> <a class="url fn" rel="author" data-hovercard-type="organization" data-hovercard-url="/orgs/ccxt/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="/ccxt"> ccxt </a> </span> <span class="mx-1 flex-self-stretch color-fg-muted">/</span> <strong itemprop="name" class="mr-2 flex-self-stretch"> <a data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" href="/ccxt/ccxt">ccxt</a> </strong> <span></span><span class="Label Label--secondary v-align-middle mr-1">Public</span> </div> </div> <div id="repository-details-container" class="flex-shrink-0" data-turbo-replace style="max-width: 70%;"> <ul class="pagehead-actions flex-shrink-0 d-none d-md-inline" style="padding: 2px 0;"> <li> <include-fragment src="/ccxt/ccxt/sponsor_button"></include-fragment> </li> <li> <a href="/login?return_to=%2Fccxt%2Fccxt" rel="nofollow" id="repository-details-watch-button" data-hydro-click="{"event_type":"authentication.click","payload":{"location_in_page":"notification subscription menu watch","repository_id":null,"auth_type":"LOG_IN","originating_url":"https://github.com/ccxt/ccxt/wiki/Manual","user_id":null}}" data-hydro-click-hmac="5aaf16f518dbb80358fea1edad7f79a81d491379cbf65706a579d2e088cca0e2" aria-label="You must be signed in to change notification settings" data-view-component="true" class="btn-sm btn"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path> </svg>Notifications </a> <tool-tip id="tooltip-6a23de1f-c195-4063-b65c-fd211ffe0f16" for="repository-details-watch-button" popover="manual" data-direction="s" data-type="description" data-view-component="true" class="sr-only position-absolute">You must be signed in to change notification settings</tool-tip> </li> <li> <a icon="repo-forked" id="fork-button" href="/login?return_to=%2Fccxt%2Fccxt" rel="nofollow" data-hydro-click="{"event_type":"authentication.click","payload":{"location_in_page":"repo details fork button","repository_id":91253698,"auth_type":"LOG_IN","originating_url":"https://github.com/ccxt/ccxt/wiki/Manual","user_id":null}}" data-hydro-click-hmac="cc440f1e81d43e99297163c8064bd9e593d6b18e52473004d2353718184eff54" data-view-component="true" class="btn-sm btn"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path> </svg>Fork <span id="repo-network-counter" data-pjax-replace="true" data-turbo-replace="true" title="7,778" data-view-component="true" class="Counter">7.8k</span> </a> </li> <li> <div data-view-component="true" class="BtnGroup d-flex"> <a href="/login?return_to=%2Fccxt%2Fccxt" rel="nofollow" data-hydro-click="{"event_type":"authentication.click","payload":{"location_in_page":"star button","repository_id":91253698,"auth_type":"LOG_IN","originating_url":"https://github.com/ccxt/ccxt/wiki/Manual","user_id":null}}" data-hydro-click-hmac="027924c0a08601ac345383ab2a6ee3cec89d5a82a147bd29949dbbf480e1af2e" aria-label="You must be signed in to star a repository" data-view-component="true" class="tooltipped tooltipped-sw btn-sm btn"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path> </svg><span data-view-component="true" class="d-inline"> Star </span> <span id="repo-stars-counter-star" aria-label="35363 users starred this repository" data-singular-suffix="user starred this repository" data-plural-suffix="users starred this repository" data-turbo-replace="true" title="35,363" data-view-component="true" class="Counter js-social-count">35.4k</span> </a></div> </li> </ul> </div> </div> <div id="responsive-meta-container" data-turbo-replace> </div> <nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5"> <ul data-view-component="true" class="UnderlineNav-body list-style-none"> <li data-view-component="true" class="d-inline-flex"> <a id="code-tab" href="/ccxt/ccxt" data-tab-item="i0code-tab" data-selected-links="repo_source repo_downloads repo_commits repo_releases repo_tags repo_branches repo_packages repo_deployments repo_attestations /ccxt/ccxt" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g c" data-analytics-event="{"category":"Underline navbar","action":"Click tab","label":"Code","target":"UNDERLINE_NAV.TAB"}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path> </svg> <span data-content="Code">Code</span> <span id="code-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="Not available" data-view-component="true" class="Counter"></span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="issues-tab" href="/ccxt/ccxt/issues" data-tab-item="i1issues-tab" data-selected-links="repo_issues repo_labels repo_milestones /ccxt/ccxt/issues" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g i" data-analytics-event="{"category":"Underline navbar","action":"Click tab","label":"Issues","target":"UNDERLINE_NAV.TAB"}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path> </svg> <span data-content="Issues">Issues</span> <span id="issues-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="952" data-view-component="true" class="Counter">952</span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="pull-requests-tab" href="/ccxt/ccxt/pulls" data-tab-item="i2pull-requests-tab" data-selected-links="repo_pulls checks /ccxt/ccxt/pulls" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g p" data-analytics-event="{"category":"Underline navbar","action":"Click tab","label":"Pull requests","target":"UNDERLINE_NAV.TAB"}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path> </svg> <span data-content="Pull requests">Pull requests</span> <span id="pull-requests-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="488" data-view-component="true" class="Counter">488</span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="actions-tab" href="/ccxt/ccxt/actions" data-tab-item="i3actions-tab" data-selected-links="repo_actions /ccxt/ccxt/actions" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g a" data-analytics-event="{"category":"Underline navbar","action":"Click tab","label":"Actions","target":"UNDERLINE_NAV.TAB"}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path> </svg> <span data-content="Actions">Actions</span> <span id="actions-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="Not available" data-view-component="true" class="Counter"></span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="projects-tab" href="/ccxt/ccxt/projects" data-tab-item="i4projects-tab" data-selected-links="repo_projects new_repo_project repo_project /ccxt/ccxt/projects" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g b" data-analytics-event="{"category":"Underline navbar","action":"Click tab","label":"Projects","target":"UNDERLINE_NAV.TAB"}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path> </svg> <span data-content="Projects">Projects</span> <span id="projects-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="17" data-view-component="true" class="Counter">17</span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="wiki-tab" href="/ccxt/ccxt/wiki" data-tab-item="i5wiki-tab" data-selected-links="repo_wiki /ccxt/ccxt/wiki" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g w" data-analytics-event="{"category":"Underline navbar","action":"Click tab","label":"Wiki","target":"UNDERLINE_NAV.TAB"}" aria-current="page" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item selected"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-book UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75A.75.75 0 0 1 .75 1h4.253c1.227 0 2.317.59 3 1.501A3.743 3.743 0 0 1 11.006 1h4.245a.75.75 0 0 1 .75.75v10.5a.75.75 0 0 1-.75.75h-4.507a2.25 2.25 0 0 0-1.591.659l-.622.621a.75.75 0 0 1-1.06 0l-.622-.621A2.25 2.25 0 0 0 5.258 13H.75a.75.75 0 0 1-.75-.75Zm7.251 10.324.004-5.073-.002-2.253A2.25 2.25 0 0 0 5.003 2.5H1.5v9h3.757a3.75 3.75 0 0 1 1.994.574ZM8.755 4.75l-.004 7.322a3.752 3.752 0 0 1 1.992-.572H14.5v-9h-3.495a2.25 2.25 0 0 0-2.25 2.25Z"></path> </svg> <span data-content="Wiki">Wiki</span> <span id="wiki-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="Not available" data-view-component="true" class="Counter"></span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="security-tab" href="/ccxt/ccxt/security" data-tab-item="i6security-tab" data-selected-links="security overview alerts policy token_scanning code_scanning /ccxt/ccxt/security" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g s" data-analytics-event="{"category":"Underline navbar","action":"Click tab","label":"Security","target":"UNDERLINE_NAV.TAB"}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> <span data-content="Security">Security</span> <include-fragment src="/ccxt/ccxt/security/overall-count" accept="text/fragment+html"></include-fragment> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="insights-tab" href="/ccxt/ccxt/pulse" data-tab-item="i7insights-tab" data-selected-links="repo_graphs repo_contributors dependency_graph dependabot_updates pulse people community /ccxt/ccxt/pulse" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-analytics-event="{"category":"Underline navbar","action":"Click tab","label":"Insights","target":"UNDERLINE_NAV.TAB"}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path> </svg> <span data-content="Insights">Insights</span> <span id="insights-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="Not available" data-view-component="true" class="Counter"></span> </a></li> </ul> <div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <action-menu data-select-variant="none" data-view-component="true"> <focus-group direction="vertical" mnemonics retain> <button id="action-menu-8768758a-d298-41d1-a67a-9903540a2d87-button" popovertarget="action-menu-8768758a-d298-41d1-a67a-9903540a2d87-overlay" aria-controls="action-menu-8768758a-d298-41d1-a67a-9903540a2d87-list" aria-haspopup="true" aria-labelledby="tooltip-ce019025-7294-4aa7-9e3a-2a0f4180eacf" type="button" data-view-component="true" class="Button Button--iconOnly Button--secondary Button--medium UnderlineNav-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal Button-visual"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path> </svg> </button><tool-tip id="tooltip-ce019025-7294-4aa7-9e3a-2a0f4180eacf" for="action-menu-8768758a-d298-41d1-a67a-9903540a2d87-button" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">Additional navigation options</tool-tip> <anchored-position data-target="action-menu.overlay" id="action-menu-8768758a-d298-41d1-a67a-9903540a2d87-overlay" anchor="action-menu-8768758a-d298-41d1-a67a-9903540a2d87-button" align="start" side="outside-bottom" anchor-offset="normal" popover="auto" data-view-component="true"> <div data-view-component="true" class="Overlay Overlay--size-auto"> <div data-view-component="true" class="Overlay-body Overlay-body--paddingNone"> <action-list> <div data-view-component="true"> <ul aria-labelledby="action-menu-8768758a-d298-41d1-a67a-9903540a2d87-button" id="action-menu-8768758a-d298-41d1-a67a-9903540a2d87-list" role="menu" data-view-component="true" class="ActionListWrap--inset ActionListWrap"> <li hidden="hidden" data-menu-item="i0code-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-8ab42521-a6f8-48b6-9dd8-2aaae1750420" href="/ccxt/ccxt" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Code </span> </a> </li> <li hidden="hidden" data-menu-item="i1issues-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-78c5f925-3294-40eb-80c9-5a159db747de" href="/ccxt/ccxt/issues" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Issues </span> </a> </li> <li hidden="hidden" data-menu-item="i2pull-requests-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-7304131b-07e6-4e1f-bafd-34fea44eab2d" href="/ccxt/ccxt/pulls" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Pull requests </span> </a> </li> <li hidden="hidden" data-menu-item="i3actions-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-9d3f357e-d416-489f-9e69-4a2eea6c733f" href="/ccxt/ccxt/actions" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Actions </span> </a> </li> <li hidden="hidden" data-menu-item="i4projects-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-74db356d-0e68-482d-89f7-2d854b818acf" href="/ccxt/ccxt/projects" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Projects </span> </a> </li> <li hidden="hidden" data-menu-item="i5wiki-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-cce48f55-a721-4312-bb4d-ccc55c552db2" href="/ccxt/ccxt/wiki" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-book"> <path d="M0 1.75A.75.75 0 0 1 .75 1h4.253c1.227 0 2.317.59 3 1.501A3.743 3.743 0 0 1 11.006 1h4.245a.75.75 0 0 1 .75.75v10.5a.75.75 0 0 1-.75.75h-4.507a2.25 2.25 0 0 0-1.591.659l-.622.621a.75.75 0 0 1-1.06 0l-.622-.621A2.25 2.25 0 0 0 5.258 13H.75a.75.75 0 0 1-.75-.75Zm7.251 10.324.004-5.073-.002-2.253A2.25 2.25 0 0 0 5.003 2.5H1.5v9h3.757a3.75 3.75 0 0 1 1.994.574ZM8.755 4.75l-.004 7.322a3.752 3.752 0 0 1 1.992-.572H14.5v-9h-3.495a2.25 2.25 0 0 0-2.25 2.25Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Wiki </span> </a> </li> <li hidden="hidden" data-menu-item="i6security-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-17ab5555-1271-44e9-9fe0-0e9eabafac3e" href="/ccxt/ccxt/security" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Security </span> </a> </li> <li hidden="hidden" data-menu-item="i7insights-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-a7504c93-8d46-4b8d-8404-6e4aa59c1a3b" href="/ccxt/ccxt/pulse" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Insights </span> </a> </li> </ul> </div></action-list> </div> </div></anchored-position> </focus-group> </action-menu></div> </nav> </div> <turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class=""> <div id="repo-content-pjax-container" class="repository-content " > <div class="clearfix container-xl px-3 px-md-4 px-lg-5 mt-4 page" data-hpc="true" id="wiki-wrapper"> <div class="d-flex flex-column flex-md-row gh-header"> <h1 class="flex-auto min-width-0 mb-2 mb-md-0 mr-0 mr-md-2 gh-header-title">Manual</h1> <div class="mt-0 mt-lg-1 flex-shrink-0 gh-header-actions"> <a href="#wiki-pages-box" class="d-md-none ">Jump to bottom</a> </div> </div> <div class="mt-2 mt-md-1 pb-3 gh-header-meta"> github-actions[bot] edited this page <relative-time datetime="2025-03-14T12:09:09Z" class="no-wrap">Mar 14, 2025</relative-time> · <a href="/ccxt/ccxt/wiki/Manual/_history" data-view-component="true" class="Link Link--underline">1693 revisions</a> </div> <div id="wiki-content" class="mt-4"> <div data-view-component="true" class="Layout Layout--flowRow-until-md Layout--sidebarPosition-end Layout--sidebarPosition-flowRow-end"> <div data-view-component="true" class="Layout-main"> <div id="wiki-body" class="gollum-markdown-content"> <div class="markdown-body"> <div class="markdown-heading"><h1 class="heading-element">Overview</h1><a id="user-content-overview" class="anchor" aria-label="Permalink: Overview" href="#overview"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The ccxt library is a collection of available crypto <em>exchanges</em> or exchange classes. Each class implements the public and private API for a particular crypto exchange. All exchanges are derived from the base Exchange class and share a set of common methods. To access a particular exchange from ccxt library you need to create an instance of corresponding exchange class. Supported exchanges are updated frequently and new exchanges are added regularly.</p> <p>The structure of the library can be outlined as follows:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" User +-------------------------------------------------------------+ | CCXT | +------------------------------+------------------------------+ | Public | Private | +=============================================================+ │ . | │ The Unified CCXT API | │ . | | loadMarkets . fetchBalance | | fetchMarkets . createOrder | | fetchCurrencies . cancelOrder | | fetchTicker . fetchOrder | | fetchTickers . fetchOrders | | fetchOrderBook . fetchOpenOrders | | fetchOHLCV . fetchClosedOrders | | fetchStatus . fetchMyTrades | | fetchTrades . deposit | | . withdraw | │ . | +=============================================================+ │ . | | Custom Exchange API | | (Derived Classes And Their Implicit Methods) | │ . | | publicGet... . privateGet... | | publicPost... . privatePost... | | . privatePut... | | . privateDelete... | | . sign | │ . | +=============================================================+ │ . | | Base Exchange Class | │ . | +=============================================================+"><pre lang="text" class="notranslate"><code> User +-------------------------------------------------------------+ | CCXT | +------------------------------+------------------------------+ | Public | Private | +=============================================================+ │ . | │ The Unified CCXT API | │ . | | loadMarkets . fetchBalance | | fetchMarkets . createOrder | | fetchCurrencies . cancelOrder | | fetchTicker . fetchOrder | | fetchTickers . fetchOrders | | fetchOrderBook . fetchOpenOrders | | fetchOHLCV . fetchClosedOrders | | fetchStatus . fetchMyTrades | | fetchTrades . deposit | | . withdraw | │ . | +=============================================================+ │ . | | Custom Exchange API | | (Derived Classes And Their Implicit Methods) | │ . | | publicGet... . privateGet... | | publicPost... . privatePost... | | . privatePut... | | . privateDelete... | | . sign | │ . | +=============================================================+ │ . | | Base Exchange Class | │ . | +=============================================================+ </code></pre></div> <p>Full public and private HTTP REST APIs for all exchanges are implemented. WebSocket implementations in JavaScript, PHP, Python are available in <a href="https://ccxt.pro" rel="nofollow">CCXT Pro</a>, which is a professional addon to CCXT with support for WebSocket streams.</p> <ul> <li><a href="#exchanges"><strong>Exchanges</strong></a></li> <li><a href="#markets"><strong>Markets</strong></a></li> <li><a href="#implicit-api"><strong>Implicit API</strong></a></li> <li><a href="#unified-api"><strong>Unified API</strong></a></li> <li><a href="#public-api"><strong>Public API</strong></a></li> <li><a href="#private-api"><strong>Private API</strong></a></li> <li><a href="#error-handling"><strong>Error Handling</strong></a></li> <li><a href="#troubleshooting"><strong>Troubleshooting</strong></a></li> <li><a href="#ccxt-pro"><strong>CCXT Pro</strong></a></li> </ul> <div class="markdown-heading"><h2 class="heading-element">Social</h2><a id="user-content-social" class="anchor" aria-label="Permalink: Social" href="#social"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <ul> <li> <sub><a href="https://twitter.com/ccxt_official" rel="nofollow"><img src="https://camo.githubusercontent.com/9af384856bbbeac2d615f4e1208aa556f094a3378fabfc722b0e04560ff59aa0/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f636378745f6f6666696369616c3f7374796c653d736f6369616c" alt="Twitter" data-canonical-src="https://img.shields.io/twitter/follow/ccxt_official?style=social"></a></sub> Follow us on Twitter</li> <li> <sub><a href="https://medium.com/@ccxt" rel="nofollow"><img src="https://camo.githubusercontent.com/bffc061f07bbacba8912fdbb6f0f652e5f7d8eca462f0f0754a2213fcf880f4c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f726561642d6f7572253230626c6f672d626c61636b3f6c6f676f3d6d656469756d" alt="Medium" data-canonical-src="https://img.shields.io/badge/read-our%20blog-black?logo=medium"></a></sub> Read our blog on Medium</li> <li> <sub><a href="https://discord.gg/dhzSKYU" rel="nofollow"><img src="https://camo.githubusercontent.com/bfe21db6b86eea77196936df6a05f407e8c75f39bff80dc4c46123addc94569b/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f3639303230333238343131393631373630323f6c6f676f3d646973636f7264266c6f676f436f6c6f723d7768697465" alt="Discord" data-canonical-src="https://img.shields.io/discord/690203284119617602?logo=discord&logoColor=white"></a></sub> Join our Discord</li> <li> <sub><a href="https://t.me/ccxt_chat" rel="nofollow"><img src="https://camo.githubusercontent.com/3712c950dd58d452f9ef8722e89bafa749799735a596c117c534e5d77a10d17d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d436861742d626c75653f6c6f676f3d74656c656772616d" alt="Telegram Chat" data-canonical-src="https://img.shields.io/badge/CCXT-Chat-blue?logo=telegram"></a></sub> CCXT Chat on Telegram (technical support) <a name="user-content-announcements" id="user-content-announcements"></a> </li> <li>Announcement channels:</li> <li> <ul> <li><sub><a href="https://t.me/ccxt_announcements" rel="nofollow"><img src="https://camo.githubusercontent.com/0391b68198e3e9cb2e05adbf7f0b529d7cb2087c3c9530533f471053b5e5f082/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d4368616e6e656c2d626c75653f6c6f676f3d74656c656772616d" alt="Telegram" data-canonical-src="https://img.shields.io/badge/CCXT-Channel-blue?logo=telegram"></a></sub></li> </ul> </li> <li> <ul> <li><sub><a href="https://discord.com/channels/690203284119617602/1057748769690619984" rel="nofollow"><img src="https://camo.githubusercontent.com/6b52934fb3c77a2636f583952ce39a78ae8ac07290ffad0fe1e0e25d74f560f7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d4368616e6e656c2d626c75653f6c6f676f3d646973636f7264" alt="Discord" data-canonical-src="https://img.shields.io/badge/CCXT-Channel-blue?logo=discord"></a></sub></li> </ul> </li> </ul> <div class="markdown-heading"><h1 class="heading-element">Exchanges</h1><a id="user-content-exchanges" class="anchor" aria-label="Permalink: Exchanges" href="#exchanges"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <ul> <li><a href="#instantiation">Instantiation</a></li> <li><a href="#exchange-structure">Exchange Structure</a></li> <li><a href="#rate-limit">Rate Limit</a></li> </ul> <p>The CCXT library currently supports the following 106 cryptocurrency exchange markets and trading APIs:</p> <table role="table"> <thead> <tr> <th>logo</th> <th>id</th> <th>name</th> <th align="center">ver</th> <th>type</th> <th>certified</th> <th>pro</th> </tr> </thead> <tbody> <tr> <td><a href="https://ace.io/" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382496399-115f1e4a-0fd0-4b76-85d5-a49ebf64d1c8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTYzOTktMTE1ZjFlNGEtMGZkMC00Yjc2LTg1ZDUtYTQ5ZWJmNjRkMWM4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU3MGIyYWQ4MTYzN2FhZWIzZDUzMjlkOTc0ZjgyOGQxNjA0YzAwZDAzZDRkMDIyZGM2Y2QxYzhlZWFlOTJkZGUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Q03D5Fc1rlsM82wG1GQtXH45Gtglcv4NRoYOgADANQw" alt="ace" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>ace</td> <td><a href="https://ace.io/" rel="nofollow">ACE</a></td> <td align="center"><a href="https://github.com/ace-exchange/ace-offical-api-docs"><img src="https://camo.githubusercontent.com/f33a5f90251eb59a73e8d1061b112f3e9b407d68cd1ba2202131f3a5056cfb10/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f322d6c6967687467726179" alt="API Version 2" data-canonical-src="https://img.shields.io/badge/2-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://alpaca.markets" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382496588-e9476df8-a450-4c3e-ab9a-1a7794219e1b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTY1ODgtZTk0NzZkZjgtYTQ1MC00YzNlLWFiOWEtMWE3Nzk0MjE5ZTFiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTEyZDQyNDU2MTFkZWNhZDc2NTQ0MmU5ZjY3Nzc5MWI0M2I5Y2EwYWI4OWY1YzNlMTdlYTE0YzA0YTc1MjgzYjMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.hAJRESxX1EvGHdF4S7Z_ExHYIS5Kp5tcuy7zdAnBvw4" alt="alpaca" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>alpaca</td> <td><a href="https://alpaca.markets" rel="nofollow">Alpaca</a></td> <td align="center"><a href="https://alpaca.markets/docs/" rel="nofollow"><img src="https://camo.githubusercontent.com/22767d51b392e003803295f53eb96dd99db8a148e272cdd938bbd7e193e6c430/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2a2d6c6967687467726179" alt="API Version *" data-canonical-src="https://img.shields.io/badge/*-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://ascendex.com/en-us/register?inviteCode=EL6BXBQM" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382496675-55bab6b9-d4ca-42a8-a0e6-fac81ae557f1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTY2NzUtNTViYWI2YjktZDRjYS00MmE4LWEwZTYtZmFjODFhZTU1N2YxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJmNTcxZTQ1N2E4ODM4Y2M0NWUyOWIxMTM2MjEwYzlkNzlhMWNiMmZiMTlmMTBiOTVlMWJlNzNkMTQyYzA3ZDEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.y5g_hKxwqETMn91dDBTaW4J4GtSHNHaW3GApqCvpOTI" alt="ascendex" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>ascendex</td> <td><a href="https://ascendex.com/en-us/register?inviteCode=EL6BXBQM" rel="nofollow">AscendEX</a></td> <td align="center"><a href="https://ascendex.github.io/ascendex-pro-api/#ascendex-pro-api-documentation" rel="nofollow"><img src="https://camo.githubusercontent.com/f33a5f90251eb59a73e8d1061b112f3e9b407d68cd1ba2202131f3a5056cfb10/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f322d6c6967687467726179" alt="API Version 2" data-canonical-src="https://img.shields.io/badge/2-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://bequant.io/referral/dd104e3bee7634ec" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382496791-0583ef1f-29fe-4b7c-8189-63565a0e2867.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTY3OTEtMDU4M2VmMWYtMjlmZS00YjdjLTgxODktNjM1NjVhMGUyODY3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZlMWNjOTY4YTE5MDNiMzZhZGQ5NGE1MjU1Yzg0ZmE2OWEzY2ZkOTYxZThlZDdkOWZlOWI0NGQwNjM4NmY3OWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.-CushjP8cmaPnruzA_0NGlsI8A7TZOsRy2mQGva3LHs" alt="bequant" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>bequant</td> <td><a href="https://bequant.io/referral/dd104e3bee7634ec" rel="nofollow">Bequant</a></td> <td align="center"><a href="https://api.bequant.io/" rel="nofollow"><img src="https://camo.githubusercontent.com/ab5762dba57d798f201277030667318c53379e2cc598f5e0a79fc942dbb12fe0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f332d6c6967687467726179" alt="API Version 3" data-canonical-src="https://img.shields.io/badge/3-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://b1.run/users/new?code=D3LLBVFT" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382496918-4e5cfd53-98cc-4b90-92cd-0d7b512653d1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTY5MTgtNGU1Y2ZkNTMtOThjYy00YjkwLTkyY2QtMGQ3YjUxMjY1M2QxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM2NzM2M2I4NzY3YjhlOGVjZDEwZjlkNmY5Mjc3NTAyOWNlYmFkNGRlMjFlYWUyYzExYTdlMTMxZTQzYjIzNTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.QJPX_lkl-EKeU2svAQjgjBsH3SeO5Kr1L7Ty-q0cAus" alt="bigone" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>bigone</td> <td><a href="https://b1.run/users/new?code=D3LLBVFT" rel="nofollow">BigONE</a></td> <td align="center"><a href="https://open.big.one/docs/api.html" rel="nofollow"><img src="https://camo.githubusercontent.com/ab5762dba57d798f201277030667318c53379e2cc598f5e0a79fc942dbb12fe0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f332d6c6967687467726179" alt="API Version 3" data-canonical-src="https://img.shields.io/badge/3-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://accounts.binance.com/en/register?ref=D7YA7CLY" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382497068-e9419b93-ccb0-46aa-9bff-c883f096274b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTcwNjgtZTk0MTliOTMtY2NiMC00NmFhLTliZmYtYzg4M2YwOTYyNzRiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTViZjg5OWE1NWJkZjgyMWNkODk3NTZiNjA2ZGI0MjQ1YWFjOWJiYzIyYmMyZTM3NmMyMzdlYzBhMDk4MDIyZjAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.7TQX5We8Hq7D0JoXwOIhvC80TQNYz8wQ78bTr0eDC-w" alt="binance" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>binance</td> <td><a href="https://accounts.binance.com/en/register?ref=D7YA7CLY" rel="nofollow">Binance</a></td> <td align="center"><a href="https://developers.binance.com/en" rel="nofollow"><img src="https://camo.githubusercontent.com/22767d51b392e003803295f53eb96dd99db8a148e272cdd938bbd7e193e6c430/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2a2d6c6967687467726179" alt="API Version *" data-canonical-src="https://img.shields.io/badge/*-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td><a href="https://github.com/ccxt/ccxt/wiki/Certification"><img src="https://camo.githubusercontent.com/65b4587fbcd05dcd2eb91e160600db5012cccd066127bda64bd61f0e4eb9afca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d4365727469666965642d677265656e2e737667" alt="CCXT Certified" data-canonical-src="https://img.shields.io/badge/CCXT-Certified-green.svg"></a></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://accounts.binance.com/en/register?ref=D7YA7CLY" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382497172-387cfc4e-5f33-48cd-8f5c-cd4854dabf0c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTcxNzItMzg3Y2ZjNGUtNWYzMy00OGNkLThmNWMtY2Q0ODU0ZGFiZjBjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI1Y2FmZTRiZGVlOTIzNjE0YjY1NzZiMGQxZWIwNDRhZTE0MzNlNjgzYjAxMjJmYmZiYzA3Y2RhMzFhY2RjOGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.xeYL5bdJTnH6pJ4tcbdIUR9CWThVaf96gzZtetyUVN0" alt="binancecoinm" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>binancecoinm</td> <td><a href="https://accounts.binance.com/en/register?ref=D7YA7CLY" rel="nofollow">Binance COIN-M</a></td> <td align="center"><a href="https://binance-docs.github.io/apidocs/delivery/en/" rel="nofollow"><img src="https://camo.githubusercontent.com/22767d51b392e003803295f53eb96dd99db8a148e272cdd938bbd7e193e6c430/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2a2d6c6967687467726179" alt="API Version *" data-canonical-src="https://img.shields.io/badge/*-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td><a href="https://github.com/ccxt/ccxt/wiki/Certification"><img src="https://camo.githubusercontent.com/65b4587fbcd05dcd2eb91e160600db5012cccd066127bda64bd61f0e4eb9afca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d4365727469666965642d677265656e2e737667" alt="CCXT Certified" data-canonical-src="https://img.shields.io/badge/CCXT-Certified-green.svg"></a></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://www.binance.us/?ref=35005074" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382497232-a9667919-b632-4d52-a832-df89f8a35e8c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTcyMzItYTk2Njc5MTktYjYzMi00ZDUyLWE4MzItZGY4OWY4YTM1ZThjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQyM2IwMWUwNjI4YmZiNzMxNDY5YjU3NzUxY2ExYzA3YWYwMmZiMDQ2Y2NkNDAzOWQ3YTgwYjIzOTMyNWFmY2ImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.3VZtKMvxySvzbSwsSx4zLt4IzpmjO-PTlgFSZmFLJpw" alt="binanceus" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>binanceus</td> <td><a href="https://www.binance.us/?ref=35005074" rel="nofollow">Binance US</a></td> <td align="center"><a href="https://github.com/binance-us/binance-official-api-docs"><img src="https://camo.githubusercontent.com/22767d51b392e003803295f53eb96dd99db8a148e272cdd938bbd7e193e6c430/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2a2d6c6967687467726179" alt="API Version *" data-canonical-src="https://img.shields.io/badge/*-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://accounts.binance.com/en/register?ref=D7YA7CLY" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382497303-871cbea7-eebb-4b28-b260-c1c91df0487a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTczMDMtODcxY2JlYTctZWViYi00YjI4LWIyNjAtYzFjOTFkZjA0ODdhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdhMjUxMTU5NWMxY2QzZDE1MTBmYmM4MTg2MTBjYmUzOTkzYTNiMTdmMjU5YWIxMjBiMDg2YTU4Y2JlMGNkZmUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.D_rpo5LY6F8zjs59isUEI5FNf53aJ5hxxmPtE6p6Mvk" alt="binanceusdm" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>binanceusdm</td> <td><a href="https://accounts.binance.com/en/register?ref=D7YA7CLY" rel="nofollow">Binance USDⓈ-M</a></td> <td align="center"><a href="https://binance-docs.github.io/apidocs/futures/en/" rel="nofollow"><img src="https://camo.githubusercontent.com/22767d51b392e003803295f53eb96dd99db8a148e272cdd938bbd7e193e6c430/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2a2d6c6967687467726179" alt="API Version *" data-canonical-src="https://img.shields.io/badge/*-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td><a href="https://github.com/ccxt/ccxt/wiki/Certification"><img src="https://camo.githubusercontent.com/65b4587fbcd05dcd2eb91e160600db5012cccd066127bda64bd61f0e4eb9afca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d4365727469666965642d677265656e2e737667" alt="CCXT Certified" data-canonical-src="https://img.shields.io/badge/CCXT-Certified-green.svg"></a></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://bingx.com/invite/OHETOM" rel="nofollow"><img src="https://camo.githubusercontent.com/341f45f5afe391a3862bb7bd180f9d88a1ec03375b5d79467b94f6188c30272c/68747470733a2f2f6769746875622d70726f64756374696f6e2d757365722d61737365742d3632313064662e73332e616d617a6f6e6177732e636f6d2f313239343435342f3235333637353337362d36393833623732652d343939392d343534392d623137372d3333623337346331393565332e6a7067" alt="bingx" data-canonical-src="https://github-production-user-asset-6210df.s3.amazonaws.com/1294454/253675376-6983b72e-4999-4549-b177-33b374c195e3.jpg"></a></td> <td>bingx</td> <td><a href="https://bingx.com/invite/OHETOM" rel="nofollow">BingX</a></td> <td align="center"><a href="https://bingx-api.github.io/docs/" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td><a href="https://github.com/ccxt/ccxt/wiki/Certification"><img src="https://camo.githubusercontent.com/65b4587fbcd05dcd2eb91e160600db5012cccd066127bda64bd61f0e4eb9afca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d4365727469666965642d677265656e2e737667" alt="CCXT Certified" data-canonical-src="https://img.shields.io/badge/CCXT-Certified-green.svg"></a></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://bit2c.co.il/Aff/63bfed10-e359-420c-ab5a-ad368dab0baf" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382497425-db0bce50-6842-4c09-a1d5-0c87d22118aa.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTc0MjUtZGIwYmNlNTAtNjg0Mi00YzA5LWExZDUtMGM4N2QyMjExOGFhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNiMzkzYTM2ZTdjOWYzMmEwNDJiNmZjZjNmYTVlMTEzMDQ1MGE0ODQ3Y2MyMDY3YzZmMzA0MTAzNGY2NjdmNTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.TUjPE3_sG77kMYyK2eWgmPH1e0K1fbMIQDwCsPeE0f0" alt="bit2c" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>bit2c</td> <td><a href="https://bit2c.co.il/Aff/63bfed10-e359-420c-ab5a-ad368dab0baf" rel="nofollow">Bit2C</a></td> <td align="center"><a href="https://www.bit2c.co.il/home/api" rel="nofollow"><img src="https://camo.githubusercontent.com/22767d51b392e003803295f53eb96dd99db8a148e272cdd938bbd7e193e6c430/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2a2d6c6967687467726179" alt="API Version *" data-canonical-src="https://img.shields.io/badge/*-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://bitbank.cc/" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382497476-9d616de0-8a88-4468-8e38-d269acab0348.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTc0NzYtOWQ2MTZkZTAtOGE4OC00NDY4LThlMzgtZDI2OWFjYWIwMzQ4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTYzN2JlNmY4NzQwOTBlZGIzNGNiYjgyNzVlMTAxODEyZDI5NDA2NzEyZjEzOGZiZWYxOTQ4MDFiYzcwMTUwNDYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.eHSoF31g1GNEaezCLu_yfvu0shqJTc6QrY4k2VhqeCU" alt="bitbank" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>bitbank</td> <td><a href="https://bitbank.cc/" rel="nofollow">bitbank</a></td> <td align="center"><a href="https://docs.bitbank.cc/" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://ref.bitbns.com/1090961" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382499720-a5b9a562-cdd8-4bea-9fa7-fd24c1dad3d9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTk3MjAtYTViOWE1NjItY2RkOC00YmVhLTlmYTctZmQyNGMxZGFkM2Q5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWUxYmU3MDhmMTQwOGY0ZjhmOGJlNzE1MThkMGFjNTU4ODFjMmYwMmEwNmEzZWZlODYxMmMzMDUwMmEwOTkxZDkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.0yxzzg7rR0zdrHUprcIzTeB4M0OYyCJuKk-mAMLWqFc" alt="bitbns" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>bitbns</td> <td><a href="https://ref.bitbns.com/1090961" rel="nofollow">Bitbns</a></td> <td align="center"><a href="https://bitbns.com/trade/#/api-trading/" rel="nofollow"><img src="https://camo.githubusercontent.com/f33a5f90251eb59a73e8d1061b112f3e9b407d68cd1ba2202131f3a5056cfb10/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f322d6c6967687467726179" alt="API Version 2" data-canonical-src="https://img.shields.io/badge/2-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://www.bitfinex.com" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382497667-4a8e947f-ab46-481a-a8ae-8b20e9b03178.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTc2NjctNGE4ZTk0N2YtYWI0Ni00ODFhLWE4YWUtOGIyMGU5YjAzMTc4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVmMjU1ZTFiZTAxZGZmZjM1OTFiMGI5ODdmZTgzMDI3ZDViNWYwMzY5NWZhM2NhOTNhNGU2MWUxZmNlNDBiNmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.9rj7cw-TLaYldiTnuTdPtZ1rcBU23IoL3otIY_x46gc" alt="bitfinex" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>bitfinex</td> <td><a href="https://www.bitfinex.com" rel="nofollow">Bitfinex</a></td> <td align="center"><a href="https://docs.bitfinex.com/v2/docs/" rel="nofollow"><img src="https://camo.githubusercontent.com/f33a5f90251eb59a73e8d1061b112f3e9b407d68cd1ba2202131f3a5056cfb10/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f322d6c6967687467726179" alt="API Version 2" data-canonical-src="https://img.shields.io/badge/2-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://www.bitfinex.com/?refcode=P61eYxFL" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382497542-9147c6c5-7197-481e-827b-7483672bb0e9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTc1NDItOTE0N2M2YzUtNzE5Ny00ODFlLTgyN2ItNzQ4MzY3MmJiMGU5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTgyMmY4MDdkNzcwNTEyODhhZWNlMTQyZTMwNzI5MmI3ZjViYTcxMmM3NmQ2YzA5OTdhYTlmMjAyMWVmYTQ4MmEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.j7BvQkbV2DTtQ-EsNW0eqFP4IsGLACLHY_WwKhAj0Ck" alt="bitfinex1" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>bitfinex1</td> <td><a href="https://www.bitfinex.com/?refcode=P61eYxFL" rel="nofollow">Bitfinex</a></td> <td align="center"><a href="https://docs.bitfinex.com/v1/docs" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://bitflyer.com" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382498217-d0217747-e54d-4533-8416-0d553dca74bb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTgyMTctZDAyMTc3NDctZTU0ZC00NTMzLTg0MTYtMGQ1NTNkY2E3NGJiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI1OTRhZWQ0MjEwNzg0Yjg5M2QwMWFlYmQ1NDcyNjNhZjc4MzcwMzg2YjZlODZkZDY2N2Y4ZDU5ZWU3ZDk1MjImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.IEF2H4-oB-4GTZuvLP_M6W_OnRxcgb0CyktdJltJiw4" alt="bitflyer" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>bitflyer</td> <td><a href="https://bitflyer.com" rel="nofollow">bitFlyer</a></td> <td align="center"><a href="https://lightning.bitflyer.com/docs?lang=en" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://www.bitget.com/expressly?languageType=0&channelCode=ccxt&vipCode=tg9j" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382498300-fbaa10cc-a277-441d-a5b7-997dd9a87658.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTgzMDAtZmJhYTEwY2MtYTI3Ny00NDFkLWE1YjctOTk3ZGQ5YTg3NjU4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTEwZjM1NTkyMGI1Y2U2MDJkMzMyMGFiNWJhZjcwNDNiZTJjZDg0NTFiZTlmMTQ1NWM0YjA1OTA1YzBmMDk2YWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.i_c5gzQoYeoetjyItbrPmWEd1b9qIJapVIpjjsdy8_g" alt="bitget" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>bitget</td> <td><a href="https://www.bitget.com/expressly?languageType=0&channelCode=ccxt&vipCode=tg9j" rel="nofollow">Bitget</a></td> <td align="center"><a href="https://www.bitget.com/api-doc/common/intro" rel="nofollow"><img src="https://camo.githubusercontent.com/f33a5f90251eb59a73e8d1061b112f3e9b407d68cd1ba2202131f3a5056cfb10/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f322d6c6967687467726179" alt="API Version 2" data-canonical-src="https://img.shields.io/badge/2-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td><a href="https://github.com/ccxt/ccxt/wiki/Certification"><img src="https://camo.githubusercontent.com/65b4587fbcd05dcd2eb91e160600db5012cccd066127bda64bd61f0e4eb9afca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d4365727469666965642d677265656e2e737667" alt="CCXT Certified" data-canonical-src="https://img.shields.io/badge/CCXT-Certified-green.svg"></a></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://www.bithumb.com" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382498394-c9e0eefb-4777-46b9-8f09-9d7f7c4af82d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTgzOTQtYzllMGVlZmItNDc3Ny00NmI5LThmMDktOWQ3ZjdjNGFmODJkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk0Mjc5ZjY1ZjFmMWUxNjk4ZjkxOGU5ZjhkNDA2ZDdlYjVlNDVlZDRhNzM1Yzc3YjMyZTE2MGVhMDFjM2MyMzQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.pt3OUnrdpNC9qqjBDS9wsOTrdycTx3Z3VyOiEkJBrjI" alt="bithumb" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>bithumb</td> <td><a href="https://www.bithumb.com" rel="nofollow">Bithumb</a></td> <td align="center"><a href="https://apidocs.bithumb.com" rel="nofollow"><img src="https://camo.githubusercontent.com/22767d51b392e003803295f53eb96dd99db8a148e272cdd938bbd7e193e6c430/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2a2d6c6967687467726179" alt="API Version *" data-canonical-src="https://img.shields.io/badge/*-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="http://www.bitmart.com/?r=rQCFLh" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382498536-0623e9c4-f50e-48c9-82bd-65c3908c3a14.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTg1MzYtMDYyM2U5YzQtZjUwZS00OGM5LTgyYmQtNjVjMzkwOGMzYTE0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdlODgxMmFiZDdjN2I0OGQ1Y2IzZjY5NDM4ZGNkNDY3YWFkYTk4YTI2YjM3NDQwYTI4ODFjYjEwYWM4NjliNWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.7xRM1iK5H6QXWk8Y6qRhY96jrVHzaq9Wpb8Ef_0-T38" alt="bitmart" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>bitmart</td> <td><a href="http://www.bitmart.com/?r=rQCFLh" rel="nofollow">BitMart</a></td> <td align="center"><a href="https://developer-pro.bitmart.com/" rel="nofollow"><img src="https://camo.githubusercontent.com/f33a5f90251eb59a73e8d1061b112f3e9b407d68cd1ba2202131f3a5056cfb10/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f322d6c6967687467726179" alt="API Version 2" data-canonical-src="https://img.shields.io/badge/2-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td><a href="https://github.com/ccxt/ccxt/wiki/Certification"><img src="https://camo.githubusercontent.com/65b4587fbcd05dcd2eb91e160600db5012cccd066127bda64bd61f0e4eb9afca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d4365727469666965642d677265656e2e737667" alt="CCXT Certified" data-canonical-src="https://img.shields.io/badge/CCXT-Certified-green.svg"></a></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://www.bitmex.com/app/register/NZTR1q" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382498581-c78425ab-78d5-49d6-bd14-db7734798f04.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTg1ODEtYzc4NDI1YWItNzhkNS00OWQ2LWJkMTQtZGI3NzM0Nzk4ZjA0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM4NGYwNGI2NTQxNTlkMTk0ZmE1NzgzNDYwMWY4NWU0MDc5MGM1ZDRlYWM3NmVkNWQwNjk4NDMzOGZhMmZiNGMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.iaiObUDzMMmbBbWTGdplGPnizOCe2X6deEPARJpPopM" alt="bitmex" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>bitmex</td> <td><a href="https://www.bitmex.com/app/register/NZTR1q" rel="nofollow">BitMEX</a></td> <td align="center"><a href="https://www.bitmex.com/app/apiOverview" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td><a href="https://github.com/ccxt/ccxt/wiki/Certification"><img src="https://camo.githubusercontent.com/65b4587fbcd05dcd2eb91e160600db5012cccd066127bda64bd61f0e4eb9afca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d4365727469666965642d677265656e2e737667" alt="CCXT Certified" data-canonical-src="https://img.shields.io/badge/CCXT-Certified-green.svg"></a></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://www.bitopro.com" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382498683-affc6337-b95a-44bf-aacd-04f9722364f6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTg2ODMtYWZmYzYzMzctYjk1YS00NGJmLWFhY2QtMDRmOTcyMjM2NGY2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk4MjY4NDA5YTQ5MWYzNWVjY2M2ODVkOTMzMGVmZDY2YTc0MDdjOGY3NGQxNmY3MGViZDA5OTE1ZDJhM2FjOGImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.QCfM9r452xnHPWkM9PXG1BxhZaPK9xGqoKo3K_w_Xvs" alt="bitopro" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>bitopro</td> <td><a href="https://www.bitopro.com" rel="nofollow">BitoPro</a></td> <td align="center"><a href="https://github.com/bitoex/bitopro-offical-api-docs/blob/master/v3-1/rest-1/rest.md"><img src="https://camo.githubusercontent.com/ab5762dba57d798f201277030667318c53379e2cc598f5e0a79fc942dbb12fe0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f332d6c6967687467726179" alt="API Version 3" data-canonical-src="https://img.shields.io/badge/3-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://www.bitrue.com/affiliate/landing?cn=600000&inviteCode=EZWETQE" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382498806-67abe346-1273-461a-bd7c-42fa32907c8e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTg4MDYtNjdhYmUzNDYtMTI3My00NjFhLWJkN2MtNDJmYTMyOTA3YzhlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTEwOTdmOTU5OGYyMGU4MjdkNjM1Y2U5ZGFhMDk5MDNjMjg2Y2Y1NGY0OTA5MjM4YWExOWY1M2Y5ZTE2NzhiMDUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.cNyFAOpdDqwD-Y2XElygjks8aRBGEBgjYtm1YyfMCLY" alt="bitrue" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>bitrue</td> <td><a href="https://www.bitrue.com/affiliate/landing?cn=600000&inviteCode=EZWETQE" rel="nofollow">Bitrue</a></td> <td align="center"><a href="https://github.com/Bitrue-exchange/bitrue-official-api-docs"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://bitso.com/?ref=itej" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382498918-178c8e56-9054-4107-b192-5e5053d4f975.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTg5MTgtMTc4YzhlNTYtOTA1NC00MTA3LWIxOTItNWU1MDUzZDRmOTc1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM0Nzk2MWFkMmRjYWRkMTkwOGQ5NDY0MTIyNGFjZWRhNTlmYmE3NzViYTc3Y2ExYWUwOGI2NTQ1YTI4YzJkYWEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.K5cArGzXy9HZpFLVe1YMJi4m5HUKGm5EMkzXcWydAsI" alt="bitso" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>bitso</td> <td><a href="https://bitso.com/?ref=itej" rel="nofollow">Bitso</a></td> <td align="center"><a href="https://bitso.com/api_info" rel="nofollow"><img src="https://camo.githubusercontent.com/ab5762dba57d798f201277030667318c53379e2cc598f5e0a79fc942dbb12fe0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f332d6c6967687467726179" alt="API Version 3" data-canonical-src="https://img.shields.io/badge/3-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://www.bitstamp.net" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382586145-d5480572-1fee-43cb-b900-d38c522d0024.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI1ODYxNDUtZDU0ODA1NzItMWZlZS00M2NiLWI5MDAtZDM4YzUyMmQwMDI0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE5ODgxYTAwNjRiOTM2ZTY2ZGI5MmNkNTk0OTc4MDE0ZGFiM2VkMmM2NjgwNDhiOGE0ZTBjOTJlNDU0ZDM0MTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.DYDt_vk-C1fksKsnGmKqubLkgyXXS3JIV96qt9HbCMc" alt="bitstamp" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>bitstamp</td> <td><a href="https://www.bitstamp.net" rel="nofollow">Bitstamp</a></td> <td align="center"><a href="https://www.bitstamp.net/api" rel="nofollow"><img src="https://camo.githubusercontent.com/f33a5f90251eb59a73e8d1061b112f3e9b407d68cd1ba2202131f3a5056cfb10/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f322d6c6967687467726179" alt="API Version 2" data-canonical-src="https://img.shields.io/badge/2-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://bit.team/auth/sign-up?ref=bitboy2023" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382499188-b41b5e0d-98e5-4bd3-8a6e-aeb230a4a135.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTkxODgtYjQxYjVlMGQtOThlNS00YmQzLThhNmUtYWViMjMwYTRhMTM1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRkN2NmNDdlNjlhZThjMjM2Zjk2YTVmM2Y0OWM5ZjBlNGQxYWZmNzhiZTNiYjMwNTM5YjEwMTNiNmM5YTRlNTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.bVVfFJvRVFRYDUCBDO3zdx1L5GB8is9a56q7-aDeIJs" alt="bitteam" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>bitteam</td> <td><a href="https://bit.team/auth/sign-up?ref=bitboy2023" rel="nofollow">BIT.TEAM</a></td> <td align="center"><a href="https://bit.team/trade/api/documentation" rel="nofollow"><img src="https://camo.githubusercontent.com/d5fd0d25f988a480212bf3d4628373c9f3cd187a51ed5d6fcf99c9e4033004e6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f322e302e362d6c6967687467726179" alt="API Version 2.0.6" data-canonical-src="https://img.shields.io/badge/2.0.6-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://bitvavo.com/?a=24F34952F7" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382499302-d213155c-8c71-4701-9bd5-45351febc2a8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTkzMDItZDIxMzE1NWMtOGM3MS00NzAxLTliZDUtNDUzNTFmZWJjMmE4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRhN2IzNDkyY2Q0M2Q2NmVkNzI0Y2M1ZTNhN2VhYjA2ZDA2ZWM4YmQ0NzJhMDk1N2EyYzdiNmZmZjQzNWU3NzcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.3pBIMj6WrZbgog1fa65Yd-FVfbKLohJtPt8ZmotRduY" alt="bitvavo" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>bitvavo</td> <td><a href="https://bitvavo.com/?a=24F34952F7" rel="nofollow">Bitvavo</a></td> <td align="center"><a href="https://docs.bitvavo.com/" rel="nofollow"><img src="https://camo.githubusercontent.com/f33a5f90251eb59a73e8d1061b112f3e9b407d68cd1ba2202131f3a5056cfb10/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f322d6c6967687467726179" alt="API Version 2" data-canonical-src="https://img.shields.io/badge/2-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://bl3p.eu" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382499430-75aeb14e-cd48-43c8-8492-dff002dea0be.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTk0MzAtNzVhZWIxNGUtY2Q0OC00M2M4LTg0OTItZGZmMDAyZGVhMGJlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZlMDBlN2FmYmUwYzQ5NTU5ZTJjN2MwN2UyMzFlNGNkYjY0N2ExNTA4NjE3MzY3NDdkMzgyM2ZjZmM3YmVmMmQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.YrF_cNdiPo1hgSmb3J3jT-SpdkrKp0qeJJGMJ7sPuJs" alt="bl3p" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>bl3p</td> <td><a href="https://bl3p.eu" rel="nofollow">BL3P</a></td> <td align="center"><a href="https://github.com/BitonicNL/bl3p-api/tree/master/docs"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://blockchain.com" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382499561-975e3054-3399-4363-bcee-ec3c6d63d4e8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTk1NjEtOTc1ZTMwNTQtMzM5OS00MzYzLWJjZWUtZWMzYzZkNjNkNGU4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI1NTIzNWRhMWM4ZTU5YmZlNmY4ODU0NDc0YTBlM2MzZWE4YjJlMDE5ZjU0NjAzNWM4OGM0Yjc1MTMyMDcwMTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.SJnRUkOJgHgopT-c7qrysVtwa1lL1Qja2jXvaOjIln4" alt="blockchaincom" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>blockchaincom</td> <td><a href="https://blockchain.com" rel="nofollow">Blockchain.com</a></td> <td align="center"><a href="https://api.blockchain.com/v3" rel="nofollow"><img src="https://camo.githubusercontent.com/ab5762dba57d798f201277030667318c53379e2cc598f5e0a79fc942dbb12fe0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f332d6c6967687467726179" alt="API Version 3" data-canonical-src="https://img.shields.io/badge/3-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://blofin.com/register?referral_code=f79EsS" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382499638-518cdf80-f05d-4821-a3e3-d48ceb41d73b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTk2MzgtNTE4Y2RmODAtZjA1ZC00ODIxLWEzZTMtZDQ4Y2ViNDFkNzNiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI4ZjYxODI1YTQxMzA4MjU5YzkxYjIxZDk2ZDY5ZWFiM2U5NjYzNzJmMDU3MDE0ZGUyZjQ2MTNkYjlhMDIyMTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.bP6R6EDwnTwWki8lwyJk35s5hdJj1U9Vz_nAIPmCuKg" alt="blofin" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>blofin</td> <td><a href="https://blofin.com/register?referral_code=f79EsS" rel="nofollow">BloFin</a></td> <td align="center"><a href="https://blofin.com/docs" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://btc-alpha.com/?r=123788" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382499815-dce49f3a-61e5-4ba0-a2fe-41d192fd0e5d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTk4MTUtZGNlNDlmM2EtNjFlNS00YmEwLWEyZmUtNDFkMTkyZmQwZTVkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTkzY2MzMWY0ZDYxYzNkYWMwODM5NzYxMTQ5MTAyYWU3NzU4YzQxMzNmYzVmODYyMTJhMDBlZDA0Nzg0MTdjZmQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.1X1isMy5O36R8KN08JVi5OnR9fPhv8TOWbBhxsKOPew" alt="btcalpha" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>btcalpha</td> <td><a href="https://btc-alpha.com/?r=123788" rel="nofollow">BTC-Alpha</a></td> <td align="center"><a href="https://btc-alpha.github.io/api-docs" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://www.btcbox.co.jp/" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382499896-1e2cb499-8d0f-4f8f-9464-3c015cfbc76b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTk4OTYtMWUyY2I0OTktOGQwZi00ZjhmLTk0NjQtM2MwMTVjZmJjNzZiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFjZDVhNjEzNWExMDU1NWJkYzlmZjFjMGM3OGZlZjM0NDE0MzFiYjQ4N2MxMmM2Y2Y3OWRiZjFkYjRhN2ZkOGImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.fcQjT9IM2-n8jb3ZfbSSf4sXRUqiFoniIWihHW6bpRQ" alt="btcbox" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>btcbox</td> <td><a href="https://www.btcbox.co.jp/" rel="nofollow">BtcBox</a></td> <td align="center"><a href="https://blog.btcbox.jp/en/archives/8762" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://btcmarkets.net" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382499988-8c8d6907-3873-4cc4-ad20-e22fba28247e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI0OTk5ODgtOGM4ZDY5MDctMzg3My00Y2M0LWFkMjAtZTIyZmJhMjgyNDdlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM2MmQwODNjYjU2OGJmODI0M2U3ZTAyMDYxNTcwYjNmODhmZTFlZjZjMTU1YzQ4NmIxNTE1YWVhOTdhNjhjNmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.5NSyRoCN2pLX_9fDcV0Oy8XKY-FgwZDMoVZFF4apFks" alt="btcmarkets" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>btcmarkets</td> <td><a href="https://btcmarkets.net" rel="nofollow">BTC Markets</a></td> <td align="center"><a href="https://api.btcmarkets.net/doc/v3" rel="nofollow"><img src="https://camo.githubusercontent.com/ab5762dba57d798f201277030667318c53379e2cc598f5e0a79fc942dbb12fe0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f332d6c6967687467726179" alt="API Version 3" data-canonical-src="https://img.shields.io/badge/3-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://www.btcturk.com" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382500084-10e0a238-9f60-4b06-9dda-edfc7602f1d6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI1MDAwODQtMTBlMGEyMzgtOWY2MC00YjA2LTlkZGEtZWRmYzc2MDJmMWQ2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTc3ZWEwMDk2MjkyZjhkYzliYzQ5MjU2YTIzMDVmMjU2ZjEwZjdkOWU4MWMxMWQ0ZTRhZjgyNjRmYzE0Mzg1MDEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.CX3cIsyGp7U88pLKp_p_i_CNwtfbOAQsu_MORap99fo" alt="btcturk" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>btcturk</td> <td><a href="https://www.btcturk.com" rel="nofollow">BTCTurk</a></td> <td align="center"><a href="https://github.com/BTCTrader/broker-api-docs"><img src="https://camo.githubusercontent.com/22767d51b392e003803295f53eb96dd99db8a148e272cdd938bbd7e193e6c430/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2a2d6c6967687467726179" alt="API Version *" data-canonical-src="https://img.shields.io/badge/*-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://www.bybit.com/register?affiliate_id=35953" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/81727607/382500134-97a5d0b3-de10-423d-90e1-6620960025ed.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii84MTcyNzYwNy8zODI1MDAxMzQtOTdhNWQwYjMtZGUxMC00MjNkLTkwZTEtNjYyMDk2MDAyNWVkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWYwNzQ5NDVkNGRhN2I2OTZlN2RjMjYxODRiOWI5YmM4YjhhNjllZGMyYTVlOTUwYzBjNWJkMmZkZmJkNWNiMGMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.5gFMChSvalzuxoCk793FGg1i4APDoS4l3Ljgb4cRBdY" alt="bybit" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>bybit</td> <td><a href="https://www.bybit.com/register?affiliate_id=35953" rel="nofollow">Bybit</a></td> <td align="center"><a href="https://bybit-exchange.github.io/docs/inverse/" rel="nofollow"><img src="https://camo.githubusercontent.com/8ffbf75ee732f59d94c8dec8ebee9ce3ae30c458b1506c69a34e24504d802fc5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f352d6c6967687467726179" alt="API Version 5" data-canonical-src="https://img.shields.io/badge/5-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td><a href="https://github.com/ccxt/ccxt/wiki/Certification"><img src="https://camo.githubusercontent.com/65b4587fbcd05dcd2eb91e160600db5012cccd066127bda64bd61f0e4eb9afca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d4365727469666965642d677265656e2e737667" alt="CCXT Certified" data-canonical-src="https://img.shields.io/badge/CCXT-Certified-green.svg"></a></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://cex.io/r/0/up105393824/0/" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/27766442-8ddc33b0-5ed8-11e7-8b98-f786aef0f3c9.jpg" alt="cex"></a></td> <td>cex</td> <td><a href="https://cex.io/r/0/up105393824/0/" rel="nofollow">CEX.IO</a></td> <td align="center"><a href="https://trade.cex.io/docs/" rel="nofollow"><img src="https://camo.githubusercontent.com/22767d51b392e003803295f53eb96dd99db8a148e272cdd938bbd7e193e6c430/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2a2d6c6967687467726179" alt="API Version *" data-canonical-src="https://img.shields.io/badge/*-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://www.coinbase.com/join/58cbe25a355148797479dbd2" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/40811661-b6eceae2-653a-11e8-829e-10bfadb078cf.jpg" alt="coinbase"></a></td> <td>coinbase</td> <td><a href="https://www.coinbase.com/join/58cbe25a355148797479dbd2" rel="nofollow">Coinbase Advanced</a></td> <td align="center"><a href="https://developers.coinbase.com/api/v2" rel="nofollow"><img src="https://camo.githubusercontent.com/f33a5f90251eb59a73e8d1061b112f3e9b407d68cd1ba2202131f3a5056cfb10/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f322d6c6967687467726179" alt="API Version 2" data-canonical-src="https://img.shields.io/badge/2-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://coinbase.com/" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/43336371/330795095-34a65553-88aa-4a38-a714-064bd228b97e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii80MzMzNjM3MS8zMzA3OTUwOTUtMzRhNjU1NTMtODhhYS00YTM4LWE3MTQtMDY0YmQyMjhiOTdlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTYwYzI0MTg1ZDMwZjcxMjkzOGE2NjQ0MGQyMzU1OTUxZjgyMGJhMGY4NjZmOWUwMjIyNmU5ODI1ZTcyZTJjZDMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.NP4lTbJj6a2l8T8xEtk85rkc2NlhpM39csDWfpUCUzE" alt="coinbaseexchange" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>coinbaseexchange</td> <td><a href="https://coinbase.com/" rel="nofollow">Coinbase Exchange</a></td> <td align="center"><a href="https://docs.cloud.coinbase.com/exchange/docs/" rel="nofollow"><img src="https://camo.githubusercontent.com/22767d51b392e003803295f53eb96dd99db8a148e272cdd938bbd7e193e6c430/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2a2d6c6967687467726179" alt="API Version *" data-canonical-src="https://img.shields.io/badge/*-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://international.coinbase.com" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/43336371/312945242-866ae638-6ab5-4ebf-ab2c-cdcce9545625.jpeg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii80MzMzNjM3MS8zMTI5NDUyNDItODY2YWU2MzgtNmFiNS00ZWJmLWFiMmMtY2RjY2U5NTQ1NjI1LmpwZWc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwNDAxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDQwMVQwMzA0NDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kZDQ4MjU5NjU5MWZmMDlmOTg1YTYwYWRiZDk5NTU4ZmE5ODc3OWI0ZjVkMzg5OTcwZDJmNDgxY2IyOGVjYTIxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.599HfWpjkS3BYMLNiX8e13W-8RFUXM5RLM8_URmbIK8" alt="coinbaseinternational" content-type-secured-asset="image/jpeg" secured-asset-link=""></a></td> <td>coinbaseinternational</td> <td><a href="https://international.coinbase.com" rel="nofollow">Coinbase International</a></td> <td align="center"><a href="https://docs.cloud.coinbase.com/intx/docs" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://partner.coincatch.cc/bg/92hy70391729607848548" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/43336371/379680384-3d49065f-f05d-4573-88a2-1b5201ec6ff3.jpeg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODYsIm5iZiI6MTc0MzQ3NjY4NiwicGF0aCI6Ii80MzMzNjM3MS8zNzk2ODAzODQtM2Q0OTA2NWYtZjA1ZC00NTczLTg4YTItMWI1MjAxZWM2ZmYzLmpwZWc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwNDAxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDQwMVQwMzA0NDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02MDM5ZGFmZjE0YTQxYzFjNGNlZDVmNGIzY2ZlZDJmMjM1M2NlYzBlZGRjYjE4ZDUxYTExNWFiOTc2ZTI4YjJhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.0yi1uBopG42wPRLHbKhjFCJ80Uj6RjBo-GLzXT6w_KA" alt="coincatch" content-type-secured-asset="image/jpeg" secured-asset-link=""></a></td> <td>coincatch</td> <td><a href="https://partner.coincatch.cc/bg/92hy70391729607848548" rel="nofollow">CoinCatch</a></td> <td align="center"><a href="https://coincatch.github.io/github.io/en/" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://coincheck.com" rel="nofollow"><img src="https://user-images.githubusercontent.com/51840849/87182088-1d6d6380-c2ec-11ea-9c64-8ab9f9b289f5.jpg" alt="coincheck"></a></td> <td>coincheck</td> <td><a href="https://coincheck.com" rel="nofollow">coincheck</a></td> <td align="center"><a href="https://coincheck.com/documents/exchange/api" rel="nofollow"><img src="https://camo.githubusercontent.com/22767d51b392e003803295f53eb96dd99db8a148e272cdd938bbd7e193e6c430/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2a2d6c6967687467726179" alt="API Version *" data-canonical-src="https://img.shields.io/badge/*-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://www.coinex.com/register?refer_code=yw5fz" rel="nofollow"><img src="https://user-images.githubusercontent.com/51840849/87182089-1e05fa00-c2ec-11ea-8da9-cc73b45abbbc.jpg" alt="coinex"></a></td> <td>coinex</td> <td><a href="https://www.coinex.com/register?refer_code=yw5fz" rel="nofollow">CoinEx</a></td> <td align="center"><a href="https://docs.coinex.com/api/v2" rel="nofollow"><img src="https://camo.githubusercontent.com/f33a5f90251eb59a73e8d1061b112f3e9b407d68cd1ba2202131f3a5056cfb10/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f322d6c6967687467726179" alt="API Version 2" data-canonical-src="https://img.shields.io/badge/2-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td><a href="https://github.com/ccxt/ccxt/wiki/Certification"><img src="https://camo.githubusercontent.com/65b4587fbcd05dcd2eb91e160600db5012cccd066127bda64bd61f0e4eb9afca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d4365727469666965642d677265656e2e737667" alt="CCXT Certified" data-canonical-src="https://img.shields.io/badge/CCXT-Certified-green.svg"></a></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://coinlist.co" rel="nofollow"><img src="https://camo.githubusercontent.com/cba8553606b1613114b6ba0d35670032716e57c64b6dd4eea74ee21d9d96431a/68747470733a2f2f6769746875622d70726f64756374696f6e2d757365722d61737365742d3632313064662e73332e616d617a6f6e6177732e636f6d2f313239343435342f3238313130383931372d65666632616531642d636538612d346232612d393530642d3836373862313264613936352e6a7067" alt="coinlist" data-canonical-src="https://github-production-user-asset-6210df.s3.amazonaws.com/1294454/281108917-eff2ae1d-ce8a-4b2a-950d-8678b12da965.jpg"></a></td> <td>coinlist</td> <td><a href="https://coinlist.co" rel="nofollow">Coinlist</a></td> <td align="center"><a href="https://trade-docs.coinlist.co" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://coinmate.io?referral=YTFkM1RsOWFObVpmY1ZjMGREQmpTRnBsWjJJNVp3PT0" rel="nofollow"><img src="https://user-images.githubusercontent.com/51840849/87460806-1c9f3f00-c616-11ea-8c46-a77018a8f3f4.jpg" alt="coinmate"></a></td> <td>coinmate</td> <td><a href="https://coinmate.io?referral=YTFkM1RsOWFObVpmY1ZjMGREQmpTRnBsWjJJNVp3PT0" rel="nofollow">CoinMate</a></td> <td align="center"><a href="https://coinmate.docs.apiary.io" rel="nofollow"><img src="https://camo.githubusercontent.com/22767d51b392e003803295f53eb96dd99db8a148e272cdd938bbd7e193e6c430/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2a2d6c6967687467726179" alt="API Version *" data-canonical-src="https://img.shields.io/badge/*-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://go.coinmetro.com/?ref=crypto24" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/43336371/297745288-e86f87ec-6ba3-4410-962b-f7988c5db539.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODcsIm5iZiI6MTc0MzQ3NjY4NywicGF0aCI6Ii80MzMzNjM3MS8yOTc3NDUyODgtZTg2Zjg3ZWMtNmJhMy00NDEwLTk2MmItZjc5ODhjNWRiNTM5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTllOGY0NjY2MTFhMzY4MDgyZjg5NzdmMDQ2MjI1NjNkMDRkYmJjY2YxMTAzNGE2YWVkZjIzMzk4MDFiNDk2YjAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.gHEztNwnZfNnbf7n8ebIemk72CXCKgUqmX2fC3IT9FA" alt="coinmetro" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>coinmetro</td> <td><a href="https://go.coinmetro.com/?ref=crypto24" rel="nofollow">Coinmetro</a></td> <td align="center"><a href="https://documenter.getpostman.com/view/3653795/SVfWN6KS" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://coinone.co.kr" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/38003300-adc12fba-323f-11e8-8525-725f53c4a659.jpg" alt="coinone"></a></td> <td>coinone</td> <td><a href="https://coinone.co.kr" rel="nofollow">CoinOne</a></td> <td align="center"><a href="https://doc.coinone.co.kr" rel="nofollow"><img src="https://camo.githubusercontent.com/f33a5f90251eb59a73e8d1061b112f3e9b407d68cd1ba2202131f3a5056cfb10/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f322d6c6967687467726179" alt="API Version 2" data-canonical-src="https://img.shields.io/badge/2-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://coins.ph/" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/225719995-48ab2026-4ddb-496c-9da7-0d7566617c9b.jpg" alt="coinsph"></a></td> <td>coinsph</td> <td><a href="https://coins.ph/" rel="nofollow">Coins.ph</a></td> <td align="center"><a href="https://coins-docs.github.io/rest-api" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://www.coinspot.com.au/register?code=PJURCU" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/28208429-3cacdf9a-6896-11e7-854e-4c79a772a30f.jpg" alt="coinspot"></a></td> <td>coinspot</td> <td><a href="https://www.coinspot.com.au/register?code=PJURCU" rel="nofollow">CoinSpot</a></td> <td align="center"><a href="https://www.coinspot.com.au/api" rel="nofollow"><img src="https://camo.githubusercontent.com/22767d51b392e003803295f53eb96dd99db8a148e272cdd938bbd7e193e6c430/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2a2d6c6967687467726179" alt="API Version *" data-canonical-src="https://img.shields.io/badge/*-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://crypto.com/exch/kdacthrnxt" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/147792121-38ed5e36-c229-48d6-b49a-48d05fc19ed4.jpeg" alt="cryptocom"></a></td> <td>cryptocom</td> <td><a href="https://crypto.com/exch/kdacthrnxt" rel="nofollow">Crypto.com</a></td> <td align="center"><a href="https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html" rel="nofollow"><img src="https://camo.githubusercontent.com/f33a5f90251eb59a73e8d1061b112f3e9b407d68cd1ba2202131f3a5056cfb10/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f322d6c6967687467726179" alt="API Version 2" data-canonical-src="https://img.shields.io/badge/2-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td><a href="https://github.com/ccxt/ccxt/wiki/Certification"><img src="https://camo.githubusercontent.com/65b4587fbcd05dcd2eb91e160600db5012cccd066127bda64bd61f0e4eb9afca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d4365727469666965642d677265656e2e737667" alt="CCXT Certified" data-canonical-src="https://img.shields.io/badge/CCXT-Certified-green.svg"></a></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://app.cryptomus.com/signup/?ref=JRP4yj" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/43336371/419851316-8e0b1c48-7c01-4177-9224-f1b01d89d7e7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODcsIm5iZiI6MTc0MzQ3NjY4NywicGF0aCI6Ii80MzMzNjM3MS80MTk4NTEzMTYtOGUwYjFjNDgtN2MwMS00MTc3LTkyMjQtZjFiMDFkODlkN2U3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM1OTlmY2ZmZmExMzI2MjE3ODhjZjBmYzA3OGFkMTUzNmIzNzc4ZjU3MjkyNTRhZDkyNWMxYmM4ODNiZTVkZjUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.TYZVzIMceiWjxU6wN4mK1obeA0pG8trH0Yjxe9verU4" alt="cryptomus" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>cryptomus</td> <td><a href="https://app.cryptomus.com/signup/?ref=JRP4yj" rel="nofollow">Cryptomus</a></td> <td align="center"><a href="https://doc.cryptomus.com/personal" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://app.defx.com/join/6I2CZ7" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/43336371/391535025-4e92bace-d7a9-45ea-92be-122168dc87e4.jpeg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODcsIm5iZiI6MTc0MzQ3NjY4NywicGF0aCI6Ii80MzMzNjM3MS8zOTE1MzUwMjUtNGU5MmJhY2UtZDdhOS00NWVhLTkyYmUtMTIyMTY4ZGM4N2U0LmpwZWc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwNDAxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDQwMVQwMzA0NDdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0xYzgxMmY0NDQxZDEyZDA0YmUxZGM2ZWJjNDdiZTEwMmI0YTEyOWZkY2QwMWY0NWM4NzIxM2YxZDA2OTQ3ODYyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.HWSnT4Uk0gD300b7rKNkEpfv95pRb0JPcOyTYBpzeZ4" alt="defx" content-type-secured-asset="image/jpeg" secured-asset-link=""></a></td> <td>defx</td> <td><a href="https://app.defx.com/join/6I2CZ7" rel="nofollow">Defx X</a></td> <td align="center"><a href="https://docs.defx.com/docs" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/2dd537cbd67a580617ee9ef4507619ef063000030442046474cfa791766860c8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4445582d626c75652e737667" alt="DEX - Distributed EXchange" title="DEX - Distributed EXchange" data-canonical-src="https://img.shields.io/badge/DEX-blue.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://www.delta.exchange/app/signup/?code=IULYNB" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/99450025-3be60a00-2931-11eb-9302-f4fd8d8589aa.jpg" alt="delta"></a></td> <td>delta</td> <td><a href="https://www.delta.exchange/app/signup/?code=IULYNB" rel="nofollow">Delta Exchange</a></td> <td align="center"><a href="https://docs.delta.exchange" rel="nofollow"><img src="https://camo.githubusercontent.com/f33a5f90251eb59a73e8d1061b112f3e9b407d68cd1ba2202131f3a5056cfb10/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f322d6c6967687467726179" alt="API Version 2" data-canonical-src="https://img.shields.io/badge/2-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://www.deribit.com/reg-1189.4038" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/41933112-9e2dd65a-798b-11e8-8440-5bab2959fcb8.jpg" alt="deribit"></a></td> <td>deribit</td> <td><a href="https://www.deribit.com/reg-1189.4038" rel="nofollow">Deribit</a></td> <td align="center"><a href="https://docs.deribit.com/v2" rel="nofollow"><img src="https://camo.githubusercontent.com/f33a5f90251eb59a73e8d1061b112f3e9b407d68cd1ba2202131f3a5056cfb10/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f322d6c6967687467726179" alt="API Version 2" data-canonical-src="https://img.shields.io/badge/2-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://www.derive.xyz/invite/3VB0B" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/43336371/419011753-f835b95f-033a-43dd-b6bb-24e698fc498c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODcsIm5iZiI6MTc0MzQ3NjY4NywicGF0aCI6Ii80MzMzNjM3MS80MTkwMTE3NTMtZjgzNWI5NWYtMDMzYS00M2RkLWI2YmItMjRlNjk4ZmM0OThjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE3NGVkOGRlZjc1NzFhOGJkNjE0YWMxYjMyYzA2ZGIxOTkyYTJkYWE0YmNhY2NhMDBiY2U0MmZlMmU4NjI4MTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.U-gYkrPfNFD5pSvnfLbLNKY0mRAUi_hPfYLEc4-PPGA" alt="derive" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>derive</td> <td><a href="https://www.derive.xyz/invite/3VB0B" rel="nofollow">derive</a></td> <td align="center"><a href="https://docs.derive.xyz/docs/" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/2dd537cbd67a580617ee9ef4507619ef063000030442046474cfa791766860c8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4445582d626c75652e737667" alt="DEX - Distributed EXchange" title="DEX - Distributed EXchange" data-canonical-src="https://img.shields.io/badge/DEX-blue.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://www.digifinex.com/en-ww/from/DhOzBg?channelCode=ljaUPp" rel="nofollow"><img src="https://user-images.githubusercontent.com/51840849/87443315-01283a00-c5fe-11ea-8628-c2a0feaf07ac.jpg" alt="digifinex"></a></td> <td>digifinex</td> <td><a href="https://www.digifinex.com/en-ww/from/DhOzBg?channelCode=ljaUPp" rel="nofollow">DigiFinex</a></td> <td align="center"><a href="https://docs.digifinex.com" rel="nofollow"><img src="https://camo.githubusercontent.com/ab5762dba57d798f201277030667318c53379e2cc598f5e0a79fc942dbb12fe0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f332d6c6967687467726179" alt="API Version 3" data-canonical-src="https://img.shields.io/badge/3-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://www.ellipx.com" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/43336371/390004592-e07c3f40-281c-4cdf-bacf-fa1c58218a2c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODcsIm5iZiI6MTc0MzQ3NjY4NywicGF0aCI6Ii80MzMzNjM3MS8zOTAwMDQ1OTItZTA3YzNmNDAtMjgxYy00Y2RmLWJhY2YtZmExYzU4MjE4YTJjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI5ODkzOTJhZTRhZTM0YzJhN2FhZGIwOGYxM2RiYzM1ODg0ZTQ1Yzg1NTQ4NWRjM2U5ZGVlNDE2MTA1ZDVlY2MmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.2XCWl9JeL6tOCX0atcMqjqPfQcT1bXkn10ITVFssImg" alt="ellipx" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>ellipx</td> <td><a href="https://www.ellipx.com" rel="nofollow">Ellipx</a></td> <td align="center"><a href="https://docs.google.com/document/d/1ZXzTQYffKE_EglTaKptxGQERRnunuLHEMmar7VC9syM" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://exmo.me/?ref=131685" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/27766491-1b0ea956-5eda-11e7-9225-40d67b481b8d.jpg" alt="exmo"></a></td> <td>exmo</td> <td><a href="https://exmo.me/?ref=131685" rel="nofollow">EXMO</a></td> <td align="center"><a href="https://exmo.me/en/api_doc?ref=131685" rel="nofollow"><img src="https://camo.githubusercontent.com/eb82b24329647669fb1228b5eb62562e7ffc22977ba81f15572397d713d120b3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312e312d6c6967687467726179" alt="API Version 1.1" data-canonical-src="https://img.shields.io/badge/1.1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://fmfw.io/referral/da948b21d6c92d69" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/159177712-b685b40c-5269-4cea-ac83-f7894c49525d.jpg" alt="fmfwio"></a></td> <td>fmfwio</td> <td><a href="https://fmfw.io/referral/da948b21d6c92d69" rel="nofollow">FMFW.io</a></td> <td align="center"><a href="https://api.fmfw.io/" rel="nofollow"><img src="https://camo.githubusercontent.com/ab5762dba57d798f201277030667318c53379e2cc598f5e0a79fc942dbb12fe0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f332d6c6967687467726179" alt="API Version 3" data-canonical-src="https://img.shields.io/badge/3-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://www.gate.io/signup/2436035" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/43336371/392775744-64f988c5-07b6-4652-b5c1-679a6bf67c85.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODcsIm5iZiI6MTc0MzQ3NjY4NywicGF0aCI6Ii80MzMzNjM3MS8zOTI3NzU3NDQtNjRmOTg4YzUtMDdiNi00NjUyLWI1YzEtNjc5YTZiZjY3Yzg1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWYwZDRkMzA3NmIzYmExMzc4ZmRhYzRkODYwNTYxMDJlODU2YWVjNWVjYTYwMDQ1MGE5ZTFhMzU1NWViM2YyYmUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.jpi6yPJNB2HpMNammliGb5n33C8UDzB9i-KDmge64M0" alt="gate" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>gate</td> <td><a href="https://www.gate.io/signup/2436035" rel="nofollow">Gate.io</a></td> <td align="center"><a href="https://www.gate.io/docs/developers/apiv4/en/" rel="nofollow"><img src="https://camo.githubusercontent.com/6caa9fc39451a854df11155cf7000d57e5002d1bc29169a1e3a3d9c74020d529/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f342d6c6967687467726179" alt="API Version 4" data-canonical-src="https://img.shields.io/badge/4-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td><a href="https://github.com/ccxt/ccxt/wiki/Certification"><img src="https://camo.githubusercontent.com/65b4587fbcd05dcd2eb91e160600db5012cccd066127bda64bd61f0e4eb9afca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d4365727469666965642d677265656e2e737667" alt="CCXT Certified" data-canonical-src="https://img.shields.io/badge/CCXT-Certified-green.svg"></a></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://gemini.com/" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/27816857-ce7be644-6096-11e7-82d6-3c257263229c.jpg" alt="gemini"></a></td> <td>gemini</td> <td><a href="https://gemini.com/" rel="nofollow">Gemini</a></td> <td align="center"><a href="https://docs.gemini.com/rest-api" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://global.hashkey.com/en-US/register/invite?invite_code=82FQUN" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/43336371/359082433-6dd6127b-cc19-4a13-9b29-a98d81f80e98.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODcsIm5iZiI6MTc0MzQ3NjY4NywicGF0aCI6Ii80MzMzNjM3MS8zNTkwODI0MzMtNmRkNjEyN2ItY2MxOS00YTEzLTliMjktYTk4ZDgxZjgwZTk4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWMwZmMzMTI4ZDJiYzk2M2ZlNTZmMjk2ZGM0NmVmZDBiYmJjNDEwZWY3NDM1ODBkODE1NWExOTBlMDNkNjJiMjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.wkw0nluxyECrx82mb7ViS0lFZdDIqa1UxDO_9Nw_rik" alt="hashkey" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>hashkey</td> <td><a href="https://global.hashkey.com/en-US/register/invite?invite_code=82FQUN" rel="nofollow">HashKey Global</a></td> <td align="center"><a href="https://hashkeyglobal-apidoc.readme.io/" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td><a href="https://github.com/ccxt/ccxt/wiki/Certification"><img src="https://camo.githubusercontent.com/65b4587fbcd05dcd2eb91e160600db5012cccd066127bda64bd61f0e4eb9afca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d4365727469666965642d677265656e2e737667" alt="CCXT Certified" data-canonical-src="https://img.shields.io/badge/CCXT-Certified-green.svg"></a></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://hitbtc.com/?ref_id=5a5d39a65d466" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/27766555-8eaec20e-5edc-11e7-9c5b-6dc69fc42f5e.jpg" alt="hitbtc"></a></td> <td>hitbtc</td> <td><a href="https://hitbtc.com/?ref_id=5a5d39a65d466" rel="nofollow">HitBTC</a></td> <td align="center"><a href="https://api.hitbtc.com" rel="nofollow"><img src="https://camo.githubusercontent.com/ab5762dba57d798f201277030667318c53379e2cc598f5e0a79fc942dbb12fe0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f332d6c6967687467726179" alt="API Version 3" data-canonical-src="https://img.shields.io/badge/3-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://pro.hollaex.com/signup?affiliation_code=QSWA6G" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/75841031-ca375180-5ddd-11ea-8417-b975674c23cb.jpg" alt="hollaex"></a></td> <td>hollaex</td> <td><a href="https://pro.hollaex.com/signup?affiliation_code=QSWA6G" rel="nofollow">HollaEx</a></td> <td align="center"><a href="https://apidocs.hollaex.com" rel="nofollow"><img src="https://camo.githubusercontent.com/f33a5f90251eb59a73e8d1061b112f3e9b407d68cd1ba2202131f3a5056cfb10/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f322d6c6967687467726179" alt="API Version 2" data-canonical-src="https://img.shields.io/badge/2-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://www.htx.com.vc/invite/en-us/1h?invite_code=6rmm2223" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/76137448-22748a80-604e-11ea-8069-6e389271911d.jpg" alt="htx"></a></td> <td>htx</td> <td><a href="https://www.htx.com.vc/invite/en-us/1h?invite_code=6rmm2223" rel="nofollow">HTX</a></td> <td align="center"><a href="https://huobiapi.github.io/docs/spot/v1/en/" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td><a href="https://github.com/ccxt/ccxt/wiki/Certification"><img src="https://camo.githubusercontent.com/65b4587fbcd05dcd2eb91e160600db5012cccd066127bda64bd61f0e4eb9afca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d4365727469666965642d677265656e2e737667" alt="CCXT Certified" data-canonical-src="https://img.shields.io/badge/CCXT-Certified-green.svg"></a></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://www.huobi.co.jp/register/?invite_code=znnq3" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/85734211-85755480-b705-11ea-8b35-0b7f1db33a2f.jpg" alt="huobijp"></a></td> <td>huobijp</td> <td><a href="https://www.huobi.co.jp/register/?invite_code=znnq3" rel="nofollow">Huobi Japan</a></td> <td align="center"><a href="https://api-doc.huobi.co.jp" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://app.hyperliquid.xyz/" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/43336371/310540064-b371bc6c-4a8c-489f-87f4-20a913dd8d4b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODcsIm5iZiI6MTc0MzQ3NjY4NywicGF0aCI6Ii80MzMzNjM3MS8zMTA1NDAwNjQtYjM3MWJjNmMtNGE4Yy00ODlmLTg3ZjQtMjBhOTEzZGQ4ZDRiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA4Zjc4ZmZmMDRjOGE3ZTMxNzZjODY3ODJmYzY0MTQ2NGRlZjBmMzAwYTFhYTllNDAwODEzN2RhNTk1NTdjYjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.C5X44OBItOVAyHE8Iv41dG8o9YQXUMAJp-R8LlTSgxE" alt="hyperliquid" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>hyperliquid</td> <td><a href="https://app.hyperliquid.xyz/" rel="nofollow">Hyperliquid</a></td> <td align="center"><a href="https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/2dd537cbd67a580617ee9ef4507619ef063000030442046474cfa791766860c8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4445582d626c75652e737667" alt="DEX - Distributed EXchange" title="DEX - Distributed EXchange" data-canonical-src="https://img.shields.io/badge/DEX-blue.svg"></td> <td><a href="https://github.com/ccxt/ccxt/wiki/Certification"><img src="https://camo.githubusercontent.com/65b4587fbcd05dcd2eb91e160600db5012cccd066127bda64bd61f0e4eb9afca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d4365727469666965642d677265656e2e737667" alt="CCXT Certified" data-canonical-src="https://img.shields.io/badge/CCXT-Certified-green.svg"></a></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://idex.io" rel="nofollow"><img src="https://user-images.githubusercontent.com/51840849/94481303-2f222100-01e0-11eb-97dd-bc14c5943a86.jpg" alt="idex"></a></td> <td>idex</td> <td><a href="https://idex.io" rel="nofollow">IDEX</a></td> <td align="center"><a href="https://api-docs-v3.idex.io/" rel="nofollow"><img src="https://camo.githubusercontent.com/ab5762dba57d798f201277030667318c53379e2cc598f5e0a79fc942dbb12fe0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f332d6c6967687467726179" alt="API Version 3" data-canonical-src="https://img.shields.io/badge/3-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/2dd537cbd67a580617ee9ef4507619ef063000030442046474cfa791766860c8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4445582d626c75652e737667" alt="DEX - Distributed EXchange" title="DEX - Distributed EXchange" data-canonical-src="https://img.shields.io/badge/DEX-blue.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://www.independentreserve.com" rel="nofollow"><img src="https://user-images.githubusercontent.com/51840849/87182090-1e9e9080-c2ec-11ea-8e49-563db9a38f37.jpg" alt="independentreserve"></a></td> <td>independentreserve</td> <td><a href="https://www.independentreserve.com" rel="nofollow">Independent Reserve</a></td> <td align="center"><a href="https://www.independentreserve.com/API" rel="nofollow"><img src="https://camo.githubusercontent.com/22767d51b392e003803295f53eb96dd99db8a148e272cdd938bbd7e193e6c430/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2a2d6c6967687467726179" alt="API Version *" data-canonical-src="https://img.shields.io/badge/*-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://indodax.com/ref/testbitcoincoid/1" rel="nofollow"><img src="https://user-images.githubusercontent.com/51840849/87070508-9358c880-c221-11ea-8dc5-5391afbbb422.jpg" alt="indodax"></a></td> <td>indodax</td> <td><a href="https://indodax.com/ref/testbitcoincoid/1" rel="nofollow">INDODAX</a></td> <td align="center"><a href="https://github.com/btcid/indodax-official-api-docs"><img src="https://camo.githubusercontent.com/d439801b04e779c5a2356aa4c014838fe6fdb089acd3a48768f38487dc318389/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f322e302d6c6967687467726179" alt="API Version 2.0" data-canonical-src="https://img.shields.io/badge/2.0-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://www.kraken.com" rel="nofollow"><img src="https://user-images.githubusercontent.com/51840849/76173629-fc67fb00-61b1-11ea-84fe-f2de582f58a3.jpg" alt="kraken"></a></td> <td>kraken</td> <td><a href="https://www.kraken.com" rel="nofollow">Kraken</a></td> <td align="center"><a href="https://docs.kraken.com/rest/" rel="nofollow"><img src="https://camo.githubusercontent.com/7e33f2c4c44f0287600f6243376592eba66c9505d364090bf45482c3988871aa/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f302d6c6967687467726179" alt="API Version 0" data-canonical-src="https://img.shields.io/badge/0-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://futures.kraken.com/" rel="nofollow"><img src="https://user-images.githubusercontent.com/24300605/81436764-b22fd580-9172-11ea-9703-742783e6376d.jpg" alt="krakenfutures"></a></td> <td>krakenfutures</td> <td><a href="https://futures.kraken.com/" rel="nofollow">Kraken Futures</a></td> <td align="center"><a href="https://docs.futures.kraken.com/#introduction" rel="nofollow"><img src="https://camo.githubusercontent.com/ab5762dba57d798f201277030667318c53379e2cc598f5e0a79fc942dbb12fe0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f332d6c6967687467726179" alt="API Version 3" data-canonical-src="https://img.shields.io/badge/3-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://www.kucoin.com/ucenter/signup?rcode=E5wkqe" rel="nofollow"><img src="https://user-images.githubusercontent.com/51840849/87295558-132aaf80-c50e-11ea-9801-a2fb0c57c799.jpg" alt="kucoin"></a></td> <td>kucoin</td> <td><a href="https://www.kucoin.com/ucenter/signup?rcode=E5wkqe" rel="nofollow">KuCoin</a></td> <td align="center"><a href="https://docs.kucoin.com" rel="nofollow"><img src="https://camo.githubusercontent.com/f33a5f90251eb59a73e8d1061b112f3e9b407d68cd1ba2202131f3a5056cfb10/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f322d6c6967687467726179" alt="API Version 2" data-canonical-src="https://img.shields.io/badge/2-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td><a href="https://github.com/ccxt/ccxt/wiki/Certification"><img src="https://camo.githubusercontent.com/65b4587fbcd05dcd2eb91e160600db5012cccd066127bda64bd61f0e4eb9afca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d4365727469666965642d677265656e2e737667" alt="CCXT Certified" data-canonical-src="https://img.shields.io/badge/CCXT-Certified-green.svg"></a></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://futures.kucoin.com/?rcode=E5wkqe" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/147508995-9e35030a-d046-43a1-a006-6fabd981b554.jpg" alt="kucoinfutures"></a></td> <td>kucoinfutures</td> <td><a href="https://futures.kucoin.com/?rcode=E5wkqe" rel="nofollow">KuCoin Futures</a></td> <td align="center"><a href="https://docs.kucoin.com/futures" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td><a href="https://github.com/ccxt/ccxt/wiki/Certification"><img src="https://camo.githubusercontent.com/65b4587fbcd05dcd2eb91e160600db5012cccd066127bda64bd61f0e4eb9afca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d4365727469666965642d677265656e2e737667" alt="CCXT Certified" data-canonical-src="https://img.shields.io/badge/CCXT-Certified-green.svg"></a></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://kuna.io?r=kunaid-gvfihe8az7o4" rel="nofollow"><img src="https://user-images.githubusercontent.com/51840849/87153927-f0578b80-c2c0-11ea-84b6-74612568e9e1.jpg" alt="kuna"></a></td> <td>kuna</td> <td><a href="https://kuna.io?r=kunaid-gvfihe8az7o4" rel="nofollow">Kuna</a></td> <td align="center"><a href="https://kuna.io/documents/api" rel="nofollow"><img src="https://camo.githubusercontent.com/6caa9fc39451a854df11155cf7000d57e5002d1bc29169a1e3a3d9c74020d529/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f342d6c6967687467726179" alt="API Version 4" data-canonical-src="https://img.shields.io/badge/4-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://latoken.com/invite?r=mvgp2djk" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/61511972-24c39f00-aa01-11e9-9f7c-471f1d6e5214.jpg" alt="latoken"></a></td> <td>latoken</td> <td><a href="https://latoken.com/invite?r=mvgp2djk" rel="nofollow">Latoken</a></td> <td align="center"><a href="https://api.latoken.com" rel="nofollow"><img src="https://camo.githubusercontent.com/f33a5f90251eb59a73e8d1061b112f3e9b407d68cd1ba2202131f3a5056cfb10/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f322d6c6967687467726179" alt="API Version 2" data-canonical-src="https://img.shields.io/badge/2-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://www.lbank.com/login/?icode=7QCY" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/38063602-9605e28a-3302-11e8-81be-64b1e53c4cfb.jpg" alt="lbank"></a></td> <td>lbank</td> <td><a href="https://www.lbank.com/login/?icode=7QCY" rel="nofollow">LBank</a></td> <td align="center"><a href="https://www.lbank.com/en-US/docs/index.html" rel="nofollow"><img src="https://camo.githubusercontent.com/f33a5f90251eb59a73e8d1061b112f3e9b407d68cd1ba2202131f3a5056cfb10/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f322d6c6967687467726179" alt="API Version 2" data-canonical-src="https://img.shields.io/badge/2-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://www.luno.com/invite/44893A" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/27766607-8c1a69d8-5ede-11e7-930c-540b5eb9be24.jpg" alt="luno"></a></td> <td>luno</td> <td><a href="https://www.luno.com/invite/44893A" rel="nofollow">luno</a></td> <td align="center"><a href="https://www.luno.com/en/api" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://www.mercadobitcoin.com.br" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/27837060-e7c58714-60ea-11e7-9192-f05e86adb83f.jpg" alt="mercado"></a></td> <td>mercado</td> <td><a href="https://www.mercadobitcoin.com.br" rel="nofollow">Mercado Bitcoin</a></td> <td align="center"><a href="https://www.mercadobitcoin.com.br/api-doc" rel="nofollow"><img src="https://camo.githubusercontent.com/ab5762dba57d798f201277030667318c53379e2cc598f5e0a79fc942dbb12fe0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f332d6c6967687467726179" alt="API Version 3" data-canonical-src="https://img.shields.io/badge/3-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://www.mexc.com/register?inviteCode=mexc-1FQ1GNu1" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/137283979-8b2a818d-8633-461b-bfca-de89e8c446b2.jpg" alt="mexc"></a></td> <td>mexc</td> <td><a href="https://www.mexc.com/register?inviteCode=mexc-1FQ1GNu1" rel="nofollow">MEXC Global</a></td> <td align="center"><a href="https://mexcdevelop.github.io/apidocs/" rel="nofollow"><img src="https://camo.githubusercontent.com/ab5762dba57d798f201277030667318c53379e2cc598f5e0a79fc942dbb12fe0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f332d6c6967687467726179" alt="API Version 3" data-canonical-src="https://img.shields.io/badge/3-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td><a href="https://github.com/ccxt/ccxt/wiki/Certification"><img src="https://camo.githubusercontent.com/65b4587fbcd05dcd2eb91e160600db5012cccd066127bda64bd61f0e4eb9afca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d4365727469666965642d677265656e2e737667" alt="CCXT Certified" data-canonical-src="https://img.shields.io/badge/CCXT-Certified-green.svg"></a></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://www.my.okx.com/join/CCXT2023" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/152485636-38b19e4a-bece-4dec-979a-5982859ffc04.jpg" alt="myokx"></a></td> <td>myokx</td> <td><a href="https://www.my.okx.com/join/CCXT2023" rel="nofollow">MyOKX (EEA)</a></td> <td align="center"><a href="https://my.okx.com/docs-v5/en/#overview" rel="nofollow"><img src="https://camo.githubusercontent.com/8ffbf75ee732f59d94c8dec8ebee9ce3ae30c458b1506c69a34e24504d802fc5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f352d6c6967687467726179" alt="API Version 5" data-canonical-src="https://img.shields.io/badge/5-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://one.ndax.io/bfQiSL" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/108623144-67a3ef00-744e-11eb-8140-75c6b851e945.jpg" alt="ndax"></a></td> <td>ndax</td> <td><a href="https://one.ndax.io/bfQiSL" rel="nofollow">NDAX</a></td> <td align="center"><a href="https://apidoc.ndax.io/" rel="nofollow"><img src="https://camo.githubusercontent.com/22767d51b392e003803295f53eb96dd99db8a148e272cdd938bbd7e193e6c430/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2a2d6c6967687467726179" alt="API Version *" data-canonical-src="https://img.shields.io/badge/*-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://www.novadax.com.br/?s=ccxt" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/92337550-2b085500-f0b3-11ea-98e7-5794fb07dd3b.jpg" alt="novadax"></a></td> <td>novadax</td> <td><a href="https://www.novadax.com.br/?s=ccxt" rel="nofollow">NovaDAX</a></td> <td align="center"><a href="https://doc.novadax.com/pt-BR/" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://oceanex.pro/signup?referral=VE24QX" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/58385970-794e2d80-8001-11e9-889c-0567cd79b78e.jpg" alt="oceanex"></a></td> <td>oceanex</td> <td><a href="https://oceanex.pro/signup?referral=VE24QX" rel="nofollow">OceanEx</a></td> <td align="center"><a href="https://api.oceanex.pro/doc/v1" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://www.okcoin.com/account/register?flag=activity&channelId=600001513" rel="nofollow"><img src="https://user-images.githubusercontent.com/51840849/87295551-102fbf00-c50e-11ea-90a9-462eebba5829.jpg" alt="okcoin"></a></td> <td>okcoin</td> <td><a href="https://www.okcoin.com/account/register?flag=activity&channelId=600001513" rel="nofollow">OKCoin</a></td> <td align="center"><a href="https://www.okcoin.com/docs/en/" rel="nofollow"><img src="https://camo.githubusercontent.com/8ffbf75ee732f59d94c8dec8ebee9ce3ae30c458b1506c69a34e24504d802fc5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f352d6c6967687467726179" alt="API Version 5" data-canonical-src="https://img.shields.io/badge/5-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://www.okx.com/join/CCXT2023" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/152485636-38b19e4a-bece-4dec-979a-5982859ffc04.jpg" alt="okx"></a></td> <td>okx</td> <td><a href="https://www.okx.com/join/CCXT2023" rel="nofollow">OKX</a></td> <td align="center"><a href="https://www.okx.com/docs-v5/en/" rel="nofollow"><img src="https://camo.githubusercontent.com/8ffbf75ee732f59d94c8dec8ebee9ce3ae30c458b1506c69a34e24504d802fc5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f352d6c6967687467726179" alt="API Version 5" data-canonical-src="https://img.shields.io/badge/5-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td><a href="https://github.com/ccxt/ccxt/wiki/Certification"><img src="https://camo.githubusercontent.com/65b4587fbcd05dcd2eb91e160600db5012cccd066127bda64bd61f0e4eb9afca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d4365727469666965642d677265656e2e737667" alt="CCXT Certified" data-canonical-src="https://img.shields.io/badge/CCXT-Certified-green.svg"></a></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://onetrading.com/" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/43336371/295266153-bdbc26fd-02f2-4ca7-9f1e-17333690bb1c.jpeg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODcsIm5iZiI6MTc0MzQ3NjY4NywicGF0aCI6Ii80MzMzNjM3MS8yOTUyNjYxNTMtYmRiYzI2ZmQtMDJmMi00Y2E3LTlmMWUtMTczMzM2OTBiYjFjLmpwZWc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwNDAxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDQwMVQwMzA0NDdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04MDQ4YTczYjBlN2I2YjdkZWEyNmQzMmFkYmQxYTRjOWVlZDE2ZGI3YjY0ZGFhZmFjMWM5MTNkZTI3OTM3MWYyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.Q_wp6WLagHO-eTbsp_m_gyf-kzprcR198Jb0GnUggXk" alt="onetrading" content-type-secured-asset="image/jpeg" secured-asset-link=""></a></td> <td>onetrading</td> <td><a href="https://onetrading.com/" rel="nofollow">One Trading</a></td> <td align="center"><a href="https://docs.onetrading.com" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://ox.fun/register?shareAccountId=5ZUD4a7G" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/43336371/339741572-6a196124-c1ee-4fae-8573-962071b61a85.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODcsIm5iZiI6MTc0MzQ3NjY4NywicGF0aCI6Ii80MzMzNjM3MS8zMzk3NDE1NzItNmExOTYxMjQtYzFlZS00ZmFlLTg1NzMtOTYyMDcxYjYxYTg1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTkyMjA3NjQ2OGUyZTEyMTA0ZjMzOTc5OGI1YTNiYzc2MjQwMTBkMTBhNTM4YTc4YTk4ZWU3YTczMTVhZTM3ZTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.lmRcG7xHYV0KCJbiS-AtyeGwVWxSNHUGh7rJUEUnL6o" alt="oxfun" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>oxfun</td> <td><a href="https://ox.fun/register?shareAccountId=5ZUD4a7G" rel="nofollow">OXFUN</a></td> <td align="center"><a href="https://docs.ox.fun/" rel="nofollow"><img src="https://camo.githubusercontent.com/ab5762dba57d798f201277030667318c53379e2cc598f5e0a79fc942dbb12fe0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f332d6c6967687467726179" alt="API Version 3" data-canonical-src="https://img.shields.io/badge/3-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://p2pb2b.com?referral=ee784c53" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/43336371/283743704-8da13a80-1f0a-49be-bb90-ff8b25164755.svg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODcsIm5iZiI6MTc0MzQ3NjY4NywicGF0aCI6Ii80MzMzNjM3MS8yODM3NDM3MDQtOGRhMTNhODAtMWYwYS00OWJlLWJiOTAtZmY4YjI1MTY0NzU1LnN2Zz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTMzZTIwMmJkMTU5NWY5ZWQyNjg5ZmY1ZDQwZTJmMzk1YmNkMWU2Yjk3YjA2N2E3ZDdiZjY2N2FiNTkzNGFmOWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.wT7pynlY0MarG53UaqbB9y_ZI8m-qOzFbz4pPMkD0xE" alt="p2b" content-type-secured-asset="image/svg+xml" secured-asset-link=""></a></td> <td>p2b</td> <td><a href="https://p2pb2b.com?referral=ee784c53" rel="nofollow">p2b</a></td> <td align="center"><a href="https://github.com/P2B-team/p2b-api-docs/blob/master/api-doc.md"><img src="https://camo.githubusercontent.com/f33a5f90251eb59a73e8d1061b112f3e9b407d68cd1ba2202131f3a5056cfb10/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f322d6c6967687467726179" alt="API Version 2" data-canonical-src="https://img.shields.io/badge/2-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://app.paradex.trade/r/ccxt24" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/43336371/354280698-84628770-784e-4ec4-a759-ec2fbb2244ea.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODcsIm5iZiI6MTc0MzQ3NjY4NywicGF0aCI6Ii80MzMzNjM3MS8zNTQyODA2OTgtODQ2Mjg3NzAtNzg0ZS00ZWM0LWE3NTktZWMyZmJiMjI0NGVhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFiYzMxMzA3ZWI1ZDA5YTkxYWJhMzc1MmZhYTU0MDRjY2I2NTgxMGViMGMxYTljMjc5YTRhMzU2MDQxNGMyZmQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.JGxpeUz6WC8s07FF8rsShkJgewo2JP-kYxpWgkapAnY" alt="paradex" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>paradex</td> <td><a href="https://app.paradex.trade/r/ccxt24" rel="nofollow">Paradex</a></td> <td align="center"><a href="https://docs.api.testnet.paradex.trade/" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/2dd537cbd67a580617ee9ef4507619ef063000030442046474cfa791766860c8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4445582d626c75652e737667" alt="DEX - Distributed EXchange" title="DEX - Distributed EXchange" data-canonical-src="https://img.shields.io/badge/DEX-blue.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://www.paymium.com/page/sign-up?referral=eDAzPoRQFMvaAB8sf-qj" rel="nofollow"><img src="https://user-images.githubusercontent.com/51840849/87153930-f0f02200-c2c0-11ea-9c0a-40337375ae89.jpg" alt="paymium"></a></td> <td>paymium</td> <td><a href="https://www.paymium.com/page/sign-up?referral=eDAzPoRQFMvaAB8sf-qj" rel="nofollow">Paymium</a></td> <td align="center"><a href="https://github.com/Paymium/api-documentation"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://phemex.com/register?referralCode=EDNVJ" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/85225056-221eb600-b3d7-11ea-930d-564d2690e3f6.jpg" alt="phemex"></a></td> <td>phemex</td> <td><a href="https://phemex.com/register?referralCode=EDNVJ" rel="nofollow">Phemex</a></td> <td align="center"><a href="https://phemex-docs.github.io/#overview" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://poloniex.com/signup?c=UBFZJRPJ" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/27766817-e9456312-5ee6-11e7-9b3c-b628ca5626a5.jpg" alt="poloniex"></a></td> <td>poloniex</td> <td><a href="https://poloniex.com/signup?c=UBFZJRPJ" rel="nofollow">Poloniex</a></td> <td align="center"><a href="https://api-docs.poloniex.com/spot/" rel="nofollow"><img src="https://camo.githubusercontent.com/22767d51b392e003803295f53eb96dd99db8a148e272cdd938bbd7e193e6c430/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2a2d6c6967687467726179" alt="API Version *" data-canonical-src="https://img.shields.io/badge/*-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://poloniex.com/signup?c=UBFZJRPJ" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/27766817-e9456312-5ee6-11e7-9b3c-b628ca5626a5.jpg" alt="poloniexfutures"></a></td> <td>poloniexfutures</td> <td><a href="https://poloniex.com/signup?c=UBFZJRPJ" rel="nofollow">Poloniex Futures</a></td> <td align="center"><a href="https://api-docs.poloniex.com/futures/" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://www.probit.com/r/34608773" rel="nofollow"><img src="https://user-images.githubusercontent.com/51840849/79268032-c4379480-7ea2-11ea-80b3-dd96bb29fd0d.jpg" alt="probit"></a></td> <td>probit</td> <td><a href="https://www.probit.com/r/34608773" rel="nofollow">ProBit</a></td> <td align="center"><a href="https://docs-en.probit.com" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://timex.io/?refcode=1x27vNkTbP1uwkCck" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/70423869-6839ab00-1a7f-11ea-8f94-13ae72c31115.jpg" alt="timex"></a></td> <td>timex</td> <td><a href="https://timex.io/?refcode=1x27vNkTbP1uwkCck" rel="nofollow">TimeX</a></td> <td align="center"><a href="https://plasma-relay-backend.timex.io/swagger-ui/index.html" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://tokocrypto.com" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/183870484-d3398d0c-f6a1-4cce-91b8-d58792308716.jpg" alt="tokocrypto"></a></td> <td>tokocrypto</td> <td><a href="https://tokocrypto.com" rel="nofollow">Tokocrypto</a></td> <td align="center"><a href="https://www.tokocrypto.com/apidocs/" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://tradeogre.com" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/43336371/313488014-3aa748b7-ea44-45e9-a9e7-b1d207a2578a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODcsIm5iZiI6MTc0MzQ3NjY4NywicGF0aCI6Ii80MzMzNjM3MS8zMTM0ODgwMTQtM2FhNzQ4YjctZWE0NC00NWU5LWE5ZTctYjFkMjA3YTI1NzhhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTgwYTlkNzk4NDc1OTBkZjM5NTc2M2JhMjVhNjU5N2Q1NmYzZTlhMDA0NTljZTMyYzNjYWU2ZDgwNGRjMmUzYzkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.V3W1VIrpJ6YCtH5P-rk1oWVsNjvpof76dHIXTCAyFHI" alt="tradeogre" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>tradeogre</td> <td><a href="https://tradeogre.com" rel="nofollow">tradeogre</a></td> <td align="center"><a href="https://tradeogre.com/help/api" rel="nofollow"><img src="https://camo.githubusercontent.com/f33a5f90251eb59a73e8d1061b112f3e9b407d68cd1ba2202131f3a5056cfb10/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f322d6c6967687467726179" alt="API Version 2" data-canonical-src="https://img.shields.io/badge/2-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://upbit.com" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/49245610-eeaabe00-f423-11e8-9cba-4b0aed794799.jpg" alt="upbit"></a></td> <td>upbit</td> <td><a href="https://upbit.com" rel="nofollow">Upbit</a></td> <td align="center"><a href="https://docs.upbit.com/docs/%EC%9A%94%EC%B2%AD-%EC%88%98-%EC%A0%9C%ED%95%9C" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://app.vertexprotocol.com?referrer=0xCfC9BaB96a2eA3d3c3F031c005e82E1D9F295aC1" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/43336371/336476697-bd04a0fa-3b48-47b6-9d8b-124954d520a8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODcsIm5iZiI6MTc0MzQ3NjY4NywicGF0aCI6Ii80MzMzNjM3MS8zMzY0NzY2OTctYmQwNGEwZmEtM2I0OC00N2I2LTlkOGItMTI0OTU0ZDUyMGE4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDAxVDAzMDQ0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWMyMjAzOTdkMjQyOTA3MDc2NTRhNWMwNjJlOTQ4MzJkNmFkYjc2MmMxNzQ4MGY4YTZlMTRjNzk4MTg1MTAwOTMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.VXoBG1ajl1Yjew61u2uW71TwLm9zaT8feN4TSCP2j_8" alt="vertex" content-type-secured-asset="image/png" secured-asset-link=""></a></td> <td>vertex</td> <td><a href="https://app.vertexprotocol.com?referrer=0xCfC9BaB96a2eA3d3c3F031c005e82E1D9F295aC1" rel="nofollow">Vertex</a></td> <td align="center"><a href="https://docs.vertexprotocol.com/" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/2dd537cbd67a580617ee9ef4507619ef063000030442046474cfa791766860c8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4445582d626c75652e737667" alt="DEX - Distributed EXchange" title="DEX - Distributed EXchange" data-canonical-src="https://img.shields.io/badge/DEX-blue.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://wx.network" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/84547058-5fb27d80-ad0b-11ea-8711-78ac8b3c7f31.jpg" alt="wavesexchange"></a></td> <td>wavesexchange</td> <td><a href="https://wx.network" rel="nofollow">Waves.Exchange</a></td> <td align="center"><a href="https://docs.wx.network" rel="nofollow"><img src="https://camo.githubusercontent.com/22767d51b392e003803295f53eb96dd99db8a148e272cdd938bbd7e193e6c430/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2a2d6c6967687467726179" alt="API Version *" data-canonical-src="https://img.shields.io/badge/*-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/2dd537cbd67a580617ee9ef4507619ef063000030442046474cfa791766860c8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4445582d626c75652e737667" alt="DEX - Distributed EXchange" title="DEX - Distributed EXchange" data-canonical-src="https://img.shields.io/badge/DEX-blue.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://whitebit.com/referral/d9bdf40e-28f2-4b52-b2f9-cd1415d82963" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/66732963-8eb7dd00-ee66-11e9-849b-10d9282bb9e0.jpg" alt="whitebit"></a></td> <td>whitebit</td> <td><a href="https://whitebit.com/referral/d9bdf40e-28f2-4b52-b2f9-cd1415d82963" rel="nofollow">WhiteBit</a></td> <td align="center"><a href="https://github.com/whitebit-exchange/api-docs"><img src="https://camo.githubusercontent.com/6caa9fc39451a854df11155cf7000d57e5002d1bc29169a1e3a3d9c74020d529/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f342d6c6967687467726179" alt="API Version 4" data-canonical-src="https://img.shields.io/badge/4-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://woox.io/register?ref=DIJT0CNL" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/150730761-1a00e5e0-d28c-480f-9e65-089ce3e6ef3b.jpg" alt="woo"></a></td> <td>woo</td> <td><a href="https://woox.io/register?ref=DIJT0CNL" rel="nofollow">WOO X</a></td> <td align="center"><a href="https://docs.woox.io/" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td><a href="https://github.com/ccxt/ccxt/wiki/Certification"><img src="https://camo.githubusercontent.com/65b4587fbcd05dcd2eb91e160600db5012cccd066127bda64bd61f0e4eb9afca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d4365727469666965642d677265656e2e737667" alt="CCXT Certified" data-canonical-src="https://img.shields.io/badge/CCXT-Certified-green.svg"></a></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://dex.woo.org/en/trade?ref=CCXT" rel="nofollow"><img src="https://private-user-images.githubusercontent.com/1294454/380449844-9ba21b8a-a9c7-4770-b7f1-ce3bcbde68c1.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0NzY5ODcsIm5iZiI6MTc0MzQ3NjY4NywicGF0aCI6Ii8xMjk0NDU0LzM4MDQ0OTg0NC05YmEyMWI4YS1hOWM3LTQ3NzAtYjdmMS1jZTNiY2JkZTY4YzEuanBnP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDQwMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTA0MDFUMDMwNDQ3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YzZhNGQ1MWI4MzMzZDY3OWNhZTA2YzBhNDQ1NDM4NzFmYWZmMmY3NjM3NGNhYmFjMDA2NjI4OThhNDgyMTNlNyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.ggsmRuEyXG7f9Gej3GMaL2_4xDBcHunh_G9cP1V1mV8" alt="woofipro" content-type-secured-asset="image/jpeg" secured-asset-link=""></a></td> <td>woofipro</td> <td><a href="https://dex.woo.org/en/trade?ref=CCXT" rel="nofollow">WOOFI PRO</a></td> <td align="center"><a href="https://orderly.network/docs/build-on-evm/building-on-evm" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/2dd537cbd67a580617ee9ef4507619ef063000030442046474cfa791766860c8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4445582d626c75652e737667" alt="DEX - Distributed EXchange" title="DEX - Distributed EXchange" data-canonical-src="https://img.shields.io/badge/DEX-blue.svg"></td> <td><a href="https://github.com/ccxt/ccxt/wiki/Certification"><img src="https://camo.githubusercontent.com/65b4587fbcd05dcd2eb91e160600db5012cccd066127bda64bd61f0e4eb9afca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d4365727469666965642d677265656e2e737667" alt="CCXT Certified" data-canonical-src="https://img.shields.io/badge/CCXT-Certified-green.svg"></a></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://www.xt.com/en/accounts/register?ref=9PTM9VW" rel="nofollow"><img src="https://user-images.githubusercontent.com/14319357/232636712-466df2fc-560a-4ca4-aab2-b1d954a58e24.jpg" alt="xt"></a></td> <td>xt</td> <td><a href="https://www.xt.com/en/accounts/register?ref=9PTM9VW" rel="nofollow">XT</a></td> <td align="center"><a href="https://doc.xt.com/" rel="nofollow"><img src="https://camo.githubusercontent.com/6caa9fc39451a854df11155cf7000d57e5002d1bc29169a1e3a3d9c74020d529/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f342d6c6967687467726179" alt="API Version 4" data-canonical-src="https://img.shields.io/badge/4-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td><a href="https://ccxt.pro" rel="nofollow"><img src="https://camo.githubusercontent.com/6862b01b6f4d7dfb34463291931fc5a6a23b6e551fe9d404f5b96552f677add8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434358542d50726f2d626c61636b" alt="CCXT Pro" data-canonical-src="https://img.shields.io/badge/CCXT-Pro-black"></a></td> </tr> <tr> <td><a href="https://www.yobit.net" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/27766910-cdcbfdae-5eea-11e7-9859-03fea873272d.jpg" alt="yobit"></a></td> <td>yobit</td> <td><a href="https://www.yobit.net" rel="nofollow">YoBit</a></td> <td align="center"><a href="https://www.yobit.net/en/api/" rel="nofollow"><img src="https://camo.githubusercontent.com/ab5762dba57d798f201277030667318c53379e2cc598f5e0a79fc942dbb12fe0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f332d6c6967687467726179" alt="API Version 3" data-canonical-src="https://img.shields.io/badge/3-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://zaif.jp" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/27766927-39ca2ada-5eeb-11e7-972f-1b4199518ca6.jpg" alt="zaif"></a></td> <td>zaif</td> <td><a href="https://zaif.jp" rel="nofollow">Zaif</a></td> <td align="center"><a href="https://techbureau-api-document.readthedocs.io/ja/latest/index.html" rel="nofollow"><img src="https://camo.githubusercontent.com/9245fb6dcb3c8f53c669202550b20c3d13c2350d0b0a300e444b664a3b0b8e04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f312d6c6967687467726179" alt="API Version 1" data-canonical-src="https://img.shields.io/badge/1-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> <tr> <td><a href="https://auth.zondaglobal.com/ref/jHlbB4mIkdS1" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/159202310-a0e38007-5e7c-4ba9-a32f-c8263a0291fe.jpg" alt="zonda"></a></td> <td>zonda</td> <td><a href="https://auth.zondaglobal.com/ref/jHlbB4mIkdS1" rel="nofollow">Zonda</a></td> <td align="center"><a href="https://docs.zondacrypto.exchange/" rel="nofollow"><img src="https://camo.githubusercontent.com/22767d51b392e003803295f53eb96dd99db8a148e272cdd938bbd7e193e6c430/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2a2d6c6967687467726179" alt="API Version *" data-canonical-src="https://img.shields.io/badge/*-lightgray"></a></td> <td><img src="https://camo.githubusercontent.com/cc129dcd7ac4b8bf85b428c38f4776300a876f72aa89b0770a5d27959373aa27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4345582d677265656e2e737667" alt="CEX – Centralized EXchange" title="CEX – Centralized EXchange" data-canonical-src="https://img.shields.io/badge/CEX-green.svg"></td> <td></td> <td></td> </tr> </tbody> </table> <p>Besides making basic market and limit orders, some exchanges offer margin trading (leverage), various derivatives (like futures contracts and options) and also have <a href="https://en.wikipedia.org/wiki/Dark_pool" rel="nofollow">dark pools</a>, <a href="https://en.wikipedia.org/wiki/Over-the-counter_(finance)" rel="nofollow">OTC</a> (over-the-counter trading), merchant APIs and much more.</p> <div class="markdown-heading"><h2 class="heading-element">Instantiation</h2><a id="user-content-instantiation" class="anchor" aria-label="Permalink: Instantiation" href="#instantiation"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>To connect to an exchange and start trading you need to instantiate an exchange class from ccxt library.</p> <p>To get the full list of ids of supported exchanges programmatically:</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript" class="anchor" aria-label="Permalink: Javascript" href="#javascript"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const ccxt = require ('ccxt') console.log (ccxt.exchanges)"><pre><span class="pl-k">const</span> <span class="pl-s1">ccxt</span> <span class="pl-c1">=</span> <span class="pl-en">require</span> <span class="pl-kos">(</span><span class="pl-s">'ccxt'</span><span class="pl-kos">)</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">exchanges</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python" class="anchor" aria-label="Permalink: Python" href="#python"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import ccxt print (ccxt.exchanges)"><pre><span class="pl-k">import</span> <span class="pl-s1">ccxt</span> <span class="pl-en">print</span> (<span class="pl-s1">ccxt</span>.<span class="pl-c1">exchanges</span>)</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php" class="anchor" aria-label="Permalink: PHP" href="#php"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="include 'ccxt.php'; var_dump (\ccxt\Exchange::$exchanges);"><pre><span class="pl-k">include</span> <span class="pl-s">'<span class="pl-s">ccxt.php</span>'</span>; <span class="pl-en">var_dump</span> (\<span class="pl-v">ccxt</span>\Exchange::<span class="pl-s1"><span class="pl-c1">$</span>exchanges</span>);</pre></div> <p>An exchange can be instantiated like shown in the examples below:</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-1" class="anchor" aria-label="Permalink: Javascript" href="#javascript-1"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const ccxt = require ('ccxt') let exchange = new ccxt.kraken () // default id let kraken1 = new ccxt.kraken ({ id: 'kraken1' }) let kraken2 = new ccxt.kraken ({ id: 'kraken2' }) let id = 'coinbasepro' let coinbasepro = new ccxt[id] (); // from variable id const exchangeId = 'binance' , exchangeClass = ccxt[exchangeId] , exchange = new exchangeClass ({ 'apiKey': 'YOUR_API_KEY', 'secret': 'YOUR_SECRET', })"><pre><span class="pl-k">const</span> <span class="pl-s1">ccxt</span> <span class="pl-c1">=</span> <span class="pl-en">require</span> <span class="pl-kos">(</span><span class="pl-s">'ccxt'</span><span class="pl-kos">)</span> <span class="pl-k">let</span> <span class="pl-s1">exchange</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">kraken</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c">// default id</span> <span class="pl-k">let</span> <span class="pl-s1">kraken1</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">kraken</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">id</span>: <span class="pl-s">'kraken1'</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-k">let</span> <span class="pl-s1">kraken2</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">kraken</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">id</span>: <span class="pl-s">'kraken2'</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-k">let</span> <span class="pl-s1">id</span> <span class="pl-c1">=</span> <span class="pl-s">'coinbasepro'</span> <span class="pl-k">let</span> <span class="pl-s1">coinbasepro</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">[</span><span class="pl-s1">id</span><span class="pl-kos">]</span> <span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// from variable id</span> <span class="pl-k">const</span> <span class="pl-s1">exchangeId</span> <span class="pl-c1">=</span> <span class="pl-s">'binance'</span> <span class="pl-kos">,</span> <span class="pl-s1">exchangeClass</span> <span class="pl-c1">=</span> <span class="pl-s1">ccxt</span><span class="pl-kos">[</span><span class="pl-s1">exchangeId</span><span class="pl-kos">]</span> <span class="pl-kos">,</span> <span class="pl-s1">exchange</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">exchangeClass</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-s">'apiKey'</span>: <span class="pl-s">'YOUR_API_KEY'</span><span class="pl-kos">,</span> <span class="pl-s">'secret'</span>: <span class="pl-s">'YOUR_SECRET'</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-1" class="anchor" aria-label="Permalink: Python" href="#python-1"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import ccxt exchange = ccxt.okcoin () # default id okcoin1 = ccxt.okcoin ({ 'id': 'okcoin1' }) okcoin2 = ccxt.okcoin ({ 'id': 'okcoin2' }) id = 'btcchina' btcchina = eval ('ccxt.%s ()' % id) coinbasepro = getattr (ccxt, 'coinbasepro') () # from variable id exchange_id = 'binance' exchange_class = getattr(ccxt, exchange_id) exchange = exchange_class({ 'apiKey': 'YOUR_API_KEY', 'secret': 'YOUR_SECRET', })"><pre><span class="pl-k">import</span> <span class="pl-s1">ccxt</span> <span class="pl-s1">exchange</span> <span class="pl-c1">=</span> <span class="pl-s1">ccxt</span>.<span class="pl-c1">okcoin</span> () <span class="pl-c"># default id</span> <span class="pl-s1">okcoin1</span> <span class="pl-c1">=</span> <span class="pl-s1">ccxt</span>.<span class="pl-c1">okcoin</span> ({ <span class="pl-s">'id'</span>: <span class="pl-s">'okcoin1'</span> }) <span class="pl-s1">okcoin2</span> <span class="pl-c1">=</span> <span class="pl-s1">ccxt</span>.<span class="pl-c1">okcoin</span> ({ <span class="pl-s">'id'</span>: <span class="pl-s">'okcoin2'</span> }) <span class="pl-s1">id</span> <span class="pl-c1">=</span> <span class="pl-s">'btcchina'</span> <span class="pl-s1">btcchina</span> <span class="pl-c1">=</span> <span class="pl-en">eval</span> (<span class="pl-s">'ccxt.%s ()'</span> <span class="pl-c1">%</span> <span class="pl-s1">id</span>) <span class="pl-s1">coinbasepro</span> <span class="pl-c1">=</span> <span class="pl-en">getattr</span> (<span class="pl-s1">ccxt</span>, <span class="pl-s">'coinbasepro'</span>) () <span class="pl-c"># from variable id</span> <span class="pl-s1">exchange_id</span> <span class="pl-c1">=</span> <span class="pl-s">'binance'</span> <span class="pl-s1">exchange_class</span> <span class="pl-c1">=</span> <span class="pl-en">getattr</span>(<span class="pl-s1">ccxt</span>, <span class="pl-s1">exchange_id</span>) <span class="pl-s1">exchange</span> <span class="pl-c1">=</span> <span class="pl-en">exchange_class</span>({ <span class="pl-s">'apiKey'</span>: <span class="pl-s">'YOUR_API_KEY'</span>, <span class="pl-s">'secret'</span>: <span class="pl-s">'YOUR_SECRET'</span>, })</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-1" class="anchor" aria-label="Permalink: PHP" href="#php-1"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The ccxt library in PHP uses builtin UTC/GMT time functions, therefore you are required to set date.timezone in your php.ini or call <a href="http://php.net/manual/en/function.date-default-timezone-set.php" rel="nofollow">date_default_timezone_set()</a> function before using the PHP version of the library. The recommended timezone setting is <code>"UTC"</code>.</p> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// PHP date_default_timezone_set('UTC'); include 'ccxt.php'; $bitfinex = new \ccxt\bitfinex(); // default id $bitfinex1 = new \ccxt\bitfinex(array('id' => 'bitfinex1')); $bitfinex2 = new \ccxt\bitfinex(array('id' => 'bitfinex2')); $id = 'kraken'; $exchange = '\\ccxt\\' . $id; $kraken = new $exchange(); // from variable id $exchange_id = 'binance'; $exchange_class = "\\ccxt\\$exchange_id"; $exchange = new $exchange_class(array( 'apiKey' => 'YOUR_API_KEY', 'secret' => 'YOUR_SECRET', ));"><pre><span class="pl-c">// PHP</span> <span class="pl-en">date_default_timezone_set</span>(<span class="pl-s">'<span class="pl-s">UTC</span>'</span>); <span class="pl-k">include</span> <span class="pl-s">'<span class="pl-s">ccxt.php</span>'</span>; <span class="pl-s1"><span class="pl-c1">$</span>bitfinex</span> = <span class="pl-k">new</span> \<span class="pl-v">ccxt</span>\<span class="pl-v">bitfinex</span>(); <span class="pl-c">// default id</span> <span class="pl-s1"><span class="pl-c1">$</span>bitfinex1</span> = <span class="pl-k">new</span> \<span class="pl-v">ccxt</span>\<span class="pl-v">bitfinex</span>(<span class="pl-en">array</span>(<span class="pl-s">'<span class="pl-s">id</span>'</span> => <span class="pl-s">'<span class="pl-s">bitfinex1</span>'</span>)); <span class="pl-s1"><span class="pl-c1">$</span>bitfinex2</span> = <span class="pl-k">new</span> \<span class="pl-v">ccxt</span>\<span class="pl-v">bitfinex</span>(<span class="pl-en">array</span>(<span class="pl-s">'<span class="pl-s">id</span>'</span> => <span class="pl-s">'<span class="pl-s">bitfinex2</span>'</span>)); <span class="pl-s1"><span class="pl-c1">$</span>id</span> = <span class="pl-s">'<span class="pl-s">kraken</span>'</span>; <span class="pl-s1"><span class="pl-c1">$</span>exchange</span> = <span class="pl-s">'\\<span class="pl-s">ccxt</span>\\'</span> . <span class="pl-s1"><span class="pl-c1">$</span>id</span>; <span class="pl-s1"><span class="pl-c1">$</span>kraken</span> = <span class="pl-k">new</span> <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>(); <span class="pl-c">// from variable id</span> <span class="pl-s1"><span class="pl-c1">$</span>exchange_id</span> = <span class="pl-s">'<span class="pl-s">binance</span>'</span>; <span class="pl-s1"><span class="pl-c1">$</span>exchange_class</span> = <span class="pl-s">"\\<span class="pl-s">ccxt</span>\\<span class="pl-s1"><span class="pl-c1">$</span>exchange_id</span>"</span>; <span class="pl-s1"><span class="pl-c1">$</span>exchange</span> = <span class="pl-k">new</span> <span class="pl-s1"><span class="pl-c1">$</span>exchange_class</span>(<span class="pl-en">array</span>( <span class="pl-s">'<span class="pl-s">apiKey</span>'</span> => <span class="pl-s">'<span class="pl-s">YOUR_API_KEY</span>'</span>, <span class="pl-s">'<span class="pl-s">secret</span>'</span> => <span class="pl-s">'<span class="pl-s">YOUR_SECRET</span>'</span>, ));</pre></div> <div class="markdown-heading"><h3 class="heading-element">Features</h3><a id="user-content-features" class="anchor" aria-label="Permalink: Features" href="#features"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Major exchanges have the <code>.features</code> property available, where you can see what methods and functionalities are supported for each market-type (if any method is set to <code>null/undefined</code> it means method is "not supported" by the exchange)</p> <p><em>this feature is currently a work in progress and might be incomplete, feel free to report any issues you find in it</em></p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const exchange = new ccxt.binance() console.log(exchange.features); // outputs like: { spot: { sandbox: true, // whether testnet is supported createOrder: { triggerPrice: true, // if trigger order is supported triggerPriceType: undefined, // if trigger price type is supported (last, mark, index) triggerDirection: false, // if trigger direction is supported (up, down) stopLossPrice: true, // if stop-loss order is supported (read "Stop Loss Orders" paragraph) takeProfitPrice: true, // if take-profit order is supported attachedStopLossTakeProfit: { triggerPriceType: { last: true, mark: true, index: true, }, price: true, // whether 'limit' price can be used (instead of market order) }, marginMode: true, // if `marginMode` param is supported (cross, isolated) timeInForce: { // supported TIF types GTC: true, IOC: true, FOK: true, PO: true, GTD: false }, hedged: false, // if `hedged` param is supported (true, false) leverage: false, // if `leverage` param is supported (true, false) selfTradePrevention: true, // if `selfTradePrevention` param is supported (true, false) trailing: true, // if trailing order is supported iceberg: true, // if iceberg order is supported marketBuyByCost: true, // if creating market buy order is possible with `cost` param marketBuyRequiresPrice: true,// if creating market buy order (if 'cost' not used) requires `price` param to be set }, createOrders: { 'max': 50, // if batch order creation is supported }, fetchMyTrades: { limit: 1000, // max limit per call daysBack: undefined, // max historical period that can be accessed untilDays: 1 // if `until` param is supported, then this is permitted distance from `since` }, fetchOrder: { marginMode: true, // when supported, margin order should be fetched with this flag trigger: false, // similar as above trailing: false // similar as above }, // other methods have similar properties fetchOpenOrders: { limit: undefined, marginMode: true, trigger: false, trailing: false }, fetchOrders: { limit: 1000, daysBack: undefined, untilDays: 10000, marginMode: true, trigger: false, trailing: false }, fetchClosedOrders: { limit: 1000, daysBackClosed: undefined, // max days-back for closed orders daysBackCanceled: undefined, // max days-back for canceled orders untilDays: 10000, marginMode: true, trigger: false, trailing: false }, fetchOHLCV: { paginate: true, limit: 1000 } }, swap: { linear: { ... }, // similar to above dict inverse: { ... }, // similar to above dict } future: { linear: { ... }, // similar to above dict inverse: { ... }, // similar to above dict } }"><pre><span class="pl-k">const</span> <span class="pl-s1">exchange</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">binance</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">features</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// outputs like:</span> <span class="pl-kos">{</span> <span class="pl-c1">spot</span>: <span class="pl-kos">{</span> <span class="pl-c1">sandbox</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c">// whether testnet is supported</span> <span class="pl-c1">createOrder</span>: <span class="pl-kos">{</span> <span class="pl-c1">triggerPrice</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c">// if trigger order is supported</span> <span class="pl-c1">triggerPriceType</span>: <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-c">// if trigger price type is supported (last, mark, index)</span> <span class="pl-c1">triggerDirection</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c">// if trigger direction is supported (up, down)</span> <span class="pl-c1">stopLossPrice</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c">// if stop-loss order is supported (read "Stop Loss Orders" paragraph) </span> <span class="pl-c1">takeProfitPrice</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c">// if take-profit order is supported</span> <span class="pl-c1">attachedStopLossTakeProfit</span>: <span class="pl-kos">{</span> <span class="pl-c1">triggerPriceType</span>: <span class="pl-kos">{</span> <span class="pl-c1">last</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">mark</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">index</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">price</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c">// whether 'limit' price can be used (instead of market order)</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">marginMode</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c">// if `marginMode` param is supported (cross, isolated)</span> <span class="pl-c1">timeInForce</span>: <span class="pl-kos">{</span> <span class="pl-c">// supported TIF types</span> <span class="pl-c1">GTC</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">IOC</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">FOK</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">PO</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">GTD</span>: <span class="pl-c1">false</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">hedged</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c">// if `hedged` param is supported (true, false)</span> <span class="pl-c1">leverage</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c">// if `leverage` param is supported (true, false)</span> <span class="pl-c1">selfTradePrevention</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c">// if `selfTradePrevention` param is supported (true, false)</span> <span class="pl-c1">trailing</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c">// if trailing order is supported</span> <span class="pl-c1">iceberg</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c">// if iceberg order is supported</span> <span class="pl-c1">marketBuyByCost</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c">// if creating market buy order is possible with `cost` param</span> <span class="pl-c1">marketBuyRequiresPrice</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span><span class="pl-c">// if creating market buy order (if 'cost' not used) requires `price` param to be set</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">createOrders</span>: <span class="pl-kos">{</span> <span class="pl-s">'max'</span>: <span class="pl-c1">50</span><span class="pl-kos">,</span> <span class="pl-c">// if batch order creation is supported</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">fetchMyTrades</span>: <span class="pl-kos">{</span> <span class="pl-c1">limit</span>: <span class="pl-c1">1000</span><span class="pl-kos">,</span> <span class="pl-c">// max limit per call</span> <span class="pl-c1">daysBack</span>: <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-c">// max historical period that can be accessed</span> <span class="pl-c1">untilDays</span>: <span class="pl-c1">1</span> <span class="pl-c">// if `until` param is supported, then this is permitted distance from `since`</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">fetchOrder</span>: <span class="pl-kos">{</span> <span class="pl-c1">marginMode</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c">// when supported, margin order should be fetched with this flag</span> <span class="pl-c1">trigger</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c">// similar as above</span> <span class="pl-c1">trailing</span>: <span class="pl-c1">false</span> <span class="pl-c">// similar as above</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// other methods have similar properties</span> <span class="pl-c1">fetchOpenOrders</span>: <span class="pl-kos">{</span> <span class="pl-c1">limit</span>: <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-c1">marginMode</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">trigger</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c1">trailing</span>: <span class="pl-c1">false</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">fetchOrders</span>: <span class="pl-kos">{</span> <span class="pl-c1">limit</span>: <span class="pl-c1">1000</span><span class="pl-kos">,</span> <span class="pl-c1">daysBack</span>: <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-c1">untilDays</span>: <span class="pl-c1">10000</span><span class="pl-kos">,</span> <span class="pl-c1">marginMode</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">trigger</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c1">trailing</span>: <span class="pl-c1">false</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">fetchClosedOrders</span>: <span class="pl-kos">{</span> <span class="pl-c1">limit</span>: <span class="pl-c1">1000</span><span class="pl-kos">,</span> <span class="pl-c1">daysBackClosed</span>: <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-c">// max days-back for closed orders</span> <span class="pl-c1">daysBackCanceled</span>: <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-c">// max days-back for canceled orders</span> <span class="pl-c1">untilDays</span>: <span class="pl-c1">10000</span><span class="pl-kos">,</span> <span class="pl-c1">marginMode</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">trigger</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c1">trailing</span>: <span class="pl-c1">false</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">fetchOHLCV</span>: <span class="pl-kos">{</span> <span class="pl-c1">paginate</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">limit</span>: <span class="pl-c1">1000</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">swap</span>: <span class="pl-kos">{</span> <span class="pl-c1">linear</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// similar to above dict</span> <span class="pl-c1">inverse</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// similar to above dict</span> <span class="pl-kos">}</span> <span class="pl-s1">future</span>: <span class="pl-kos">{</span> <span class="pl-s1">linear</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// similar to above dict</span> <span class="pl-s1">inverse</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// similar to above dict</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Overriding Exchange Properties Upon Instantiation</h3><a id="user-content-overriding-exchange-properties-upon-instantiation" class="anchor" aria-label="Permalink: Overriding Exchange Properties Upon Instantiation" href="#overriding-exchange-properties-upon-instantiation"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Most of exchange properties as well as specific options can be overrided upon exchange class instantiation or afterwards, like shown below:</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-2" class="anchor" aria-label="Permalink: Javascript" href="#javascript-2"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" const exchange = new ccxt.binance ({ 'rateLimit': 10000, // unified exchange property 'headers': { 'YOUR_CUSTOM_HTTP_HEADER': 'YOUR_CUSTOM_VALUE', }, 'options': { 'adjustForTimeDifference': true, // exchange-specific option } }) exchange.options['adjustForTimeDifference'] = false"><pre><span class="pl-k">const</span> <span class="pl-s1">exchange</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">binance</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-s">'rateLimit'</span>: <span class="pl-c1">10000</span><span class="pl-kos">,</span> <span class="pl-c">// unified exchange property</span> <span class="pl-s">'headers'</span>: <span class="pl-kos">{</span> <span class="pl-s">'YOUR_CUSTOM_HTTP_HEADER'</span>: <span class="pl-s">'YOUR_CUSTOM_VALUE'</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'options'</span>: <span class="pl-kos">{</span> <span class="pl-s">'adjustForTimeDifference'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c">// exchange-specific option</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">options</span><span class="pl-kos">[</span><span class="pl-s">'adjustForTimeDifference'</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-c1">false</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-2" class="anchor" aria-label="Permalink: Python" href="#python-2"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="exchange = ccxt.binance ({ 'rateLimit': 10000, # unified exchange property 'headers': { 'YOUR_CUSTOM_HTTP_HEADER': 'YOUR_CUSTOM_VALUE', }, 'options': { 'adjustForTimeDifference': True, # exchange-specific option } }) exchange.options['adjustForTimeDifference'] = False"><pre><span class="pl-s1">exchange</span> <span class="pl-c1">=</span> <span class="pl-s1">ccxt</span>.<span class="pl-c1">binance</span> ({ <span class="pl-s">'rateLimit'</span>: <span class="pl-c1">10000</span>, <span class="pl-c"># unified exchange property</span> <span class="pl-s">'headers'</span>: { <span class="pl-s">'YOUR_CUSTOM_HTTP_HEADER'</span>: <span class="pl-s">'YOUR_CUSTOM_VALUE'</span>, }, <span class="pl-s">'options'</span>: { <span class="pl-s">'adjustForTimeDifference'</span>: <span class="pl-c1">True</span>, <span class="pl-c"># exchange-specific option</span> } }) <span class="pl-s1">exchange</span>.<span class="pl-c1">options</span>[<span class="pl-s">'adjustForTimeDifference'</span>] <span class="pl-c1">=</span> <span class="pl-c1">False</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-2" class="anchor" aria-label="Permalink: PHP" href="#php-2"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$exchange_id = 'binance'; $exchange_class = "\\ccxt\\$exchange_id"; $exchange = new $exchange_class(array( 'rateLimit' => 10000, // unified exchange property 'headers' => array( 'YOUR_CUSTOM_HTTP_HEADER' => 'YOUR_CUSTOM_VALUE', ), 'options' => array( 'adjustForTimeDifference' => true, // exchange-specific option ), )); $exchange->options['adjustForTimeDifference'] = false;"><pre><span class="pl-s1"><span class="pl-c1">$</span>exchange_id</span> = <span class="pl-s">'<span class="pl-s">binance</span>'</span>; <span class="pl-s1"><span class="pl-c1">$</span>exchange_class</span> = <span class="pl-s">"\\<span class="pl-s">ccxt</span>\\<span class="pl-s1"><span class="pl-c1">$</span>exchange_id</span>"</span>; <span class="pl-s1"><span class="pl-c1">$</span>exchange</span> = <span class="pl-k">new</span> <span class="pl-s1"><span class="pl-c1">$</span>exchange_class</span>(<span class="pl-en">array</span>( <span class="pl-s">'<span class="pl-s">rateLimit</span>'</span> => <span class="pl-c1">10000</span>, <span class="pl-c">// unified exchange property</span> <span class="pl-s">'<span class="pl-s">headers</span>'</span> => <span class="pl-en">array</span>( <span class="pl-s">'<span class="pl-s">YOUR_CUSTOM_HTTP_HEADER</span>'</span> => <span class="pl-s">'<span class="pl-s">YOUR_CUSTOM_VALUE</span>'</span>, ), <span class="pl-s">'<span class="pl-s">options</span>'</span> => <span class="pl-en">array</span>( <span class="pl-s">'<span class="pl-s">adjustForTimeDifference</span>'</span> => <span class="pl-c1">true</span>, <span class="pl-c">// exchange-specific option</span> ), )); <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">options</span>[<span class="pl-s">'<span class="pl-s">adjustForTimeDifference</span>'</span>] = <span class="pl-c1">false</span>;</pre></div> <div class="markdown-heading"><h3 class="heading-element">Overriding Exchange Methods</h3><a id="user-content-overriding-exchange-methods" class="anchor" aria-label="Permalink: Overriding Exchange Methods" href="#overriding-exchange-methods"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>In all CCXT-supported languages, you can override instance methods during runtime:</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-3" class="anchor" aria-label="Permalink: Javascript" href="#javascript-3"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" const ex = new ccxt.binance (); ex.fetch_ticker = function (symbol, params = {}) { // your codes go here }; console.log (ex.fetch_ticker('BTC/USDT'));"><pre><span class="pl-k">const</span> <span class="pl-s1">ex</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">binance</span> <span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">ex</span><span class="pl-kos">.</span><span class="pl-en">fetch_ticker</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-c">// your codes go here</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">ex</span><span class="pl-kos">.</span><span class="pl-en">fetch_ticker</span><span class="pl-kos">(</span><span class="pl-s">'BTC/USDT'</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-3" class="anchor" aria-label="Permalink: Python" href="#python-3"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ex = ccxt.binance() def my_overload(symbol, params = {}): # your codes go here ex.fetch_ticker = my_overload print(ex.fetch_ticker('BTC/USDT'))"><pre><span class="pl-s1">ex</span> <span class="pl-c1">=</span> <span class="pl-s1">ccxt</span>.<span class="pl-c1">binance</span>() <span class="pl-k">def</span> <span class="pl-en">my_overload</span>(<span class="pl-s1">symbol</span>, <span class="pl-s1">params</span> <span class="pl-c1">=</span> {}): <span class="pl-c"># your codes go here</span> <span class="pl-s1">ex</span>.<span class="pl-c1">fetch_ticker</span> <span class="pl-c1">=</span> <span class="pl-s1">my_overload</span> <span class="pl-en">print</span>(<span class="pl-s1">ex</span>.<span class="pl-c1">fetch_ticker</span>(<span class="pl-s">'BTC/USDT'</span>))</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-3" class="anchor" aria-label="Permalink: PHP" href="#php-3"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ex = new \ccxt\binance(); $ex->add_method('fetch_ticker', function($symbol, $params = []) { // your codes go here }); var_dump($ex->call_method('fetch_ticker', ['BTC/USDT']));"><pre><span class="pl-s1"><span class="pl-c1">$</span>ex</span> = <span class="pl-k">new</span> \<span class="pl-v">ccxt</span>\<span class="pl-v">binance</span>(); <span class="pl-s1"><span class="pl-c1">$</span>ex</span>-><span class="pl-en">add_method</span>(<span class="pl-s">'<span class="pl-s">fetch_ticker</span>'</span>, <span class="pl-k">function</span>(<span class="pl-s1"><span class="pl-c1">$</span>symbol</span>, <span class="pl-s1"><span class="pl-c1">$</span>params</span> = []) { <span class="pl-c">// your codes go here</span> }); <span class="pl-en">var_dump</span>(<span class="pl-s1"><span class="pl-c1">$</span>ex</span>-><span class="pl-en">call_method</span>(<span class="pl-s">'<span class="pl-s">fetch_ticker</span>'</span>, [<span class="pl-s">'<span class="pl-s">BTC/USDT</span>'</span>]));</pre></div> <div class="markdown-heading"><h3 class="heading-element">Testnets And Sandbox Environments</h3><a id="user-content-testnets-and-sandbox-environments" class="anchor" aria-label="Permalink: Testnets And Sandbox Environments" href="#testnets-and-sandbox-environments"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Some exchanges also offer separate APIs for testing purposes that allows developers to trade virtual money for free and test out their ideas. Those APIs are called <em>"testnets", "sandboxes" or "staging environments"</em> (with virtual testing assets) as opposed to <em>"mainnets" and "production environments"</em> (with real assets). Most often a sandboxed API is a clone of a production API, so, it's literally the same API, except for the URL to the exchange server.</p> <p>CCXT unifies that aspect and allows the user to switch to the exchange's sandbox (if supported by the underlying exchange). To switch to the sandbox one has to call the <code>exchange.setSandboxMode (true)</code> or <code>exchange.set_sandbox_mode(true)</code> <strong>immediately after creating the exchange before any other call</strong>!</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-4" class="anchor" aria-label="Permalink: Javascript" href="#javascript-4"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const exchange = new ccxt.binance (config) exchange.setSandboxMode (true) // enable sandbox mode"><pre><span class="pl-k">const</span> <span class="pl-s1">exchange</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">binance</span> <span class="pl-kos">(</span><span class="pl-s1">config</span><span class="pl-kos">)</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">setSandboxMode</span> <span class="pl-kos">(</span><span class="pl-c1">true</span><span class="pl-kos">)</span> <span class="pl-c">// enable sandbox mode</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-4" class="anchor" aria-label="Permalink: Python" href="#python-4"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="exchange = ccxt.binance(config) exchange.set_sandbox_mode(True) # enable sandbox mode"><pre><span class="pl-s1">exchange</span> <span class="pl-c1">=</span> <span class="pl-s1">ccxt</span>.<span class="pl-c1">binance</span>(<span class="pl-s1">config</span>) <span class="pl-s1">exchange</span>.<span class="pl-c1">set_sandbox_mode</span>(<span class="pl-c1">True</span>) <span class="pl-c"># enable sandbox mode</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-4" class="anchor" aria-label="Permalink: PHP" href="#php-4"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$exchange = new \ccxt\binance($config); $exchange->set_sandbox_mode(true); // enable sandbox mode"><pre><span class="pl-s1"><span class="pl-c1">$</span>exchange</span> = <span class="pl-k">new</span> \<span class="pl-v">ccxt</span>\<span class="pl-v">binance</span>(<span class="pl-s1"><span class="pl-c1">$</span>config</span>); <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">set_sandbox_mode</span>(<span class="pl-c1">true</span>); <span class="pl-c">// enable sandbox mode</span></pre></div> <ul> <li>The <code>exchange.setSandboxMode (true) / exchange.set_sandbox_mode (True)</code> has to be your first call immediately after creating the exchange (before any other calls)</li> <li>To obtain the <a href="#authentication">API keys</a> to the sandbox the user has to register with the sandbox website of the exchange in question and create a sandbox keypair</li> <li><strong>Sandbox keys are not interchangeable with production keys!</strong></li> </ul> <div class="markdown-heading"><h2 class="heading-element">Exchange Structure</h2><a id="user-content-exchange-structure" class="anchor" aria-label="Permalink: Exchange Structure" href="#exchange-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Every exchange has a set of properties and methods, most of which you can override by passing an associative array of params to an exchange constructor. You can also make a subclass and override everything.</p> <p>Here's an overview of generic exchange properties with values added for example:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ 'id': 'exchange' // lowercase string exchange id 'name': 'Exchange' // human-readable string 'countries': [ 'US', 'CN', 'EU' ], // array of ISO country codes 'urls': { 'api': 'https://api.example.com/data', // string or dictionary of base API URLs 'www': 'https://www.example.com' // string website URL 'doc': 'https://docs.example.com/api', // string URL or array of URLs }, 'version': 'v1', // string ending with digits 'api': { ... }, // dictionary of api endpoints 'has': { // exchange capabilities 'CORS': false, 'cancelOrder': true, 'createDepositAddress': false, 'createOrder': true, 'fetchBalance': true, 'fetchCanceledOrders': false, 'fetchClosedOrder': false, 'fetchClosedOrders': false, 'fetchCurrencies': false, 'fetchDepositAddress': false, 'fetchMarkets': true, 'fetchMyTrades': false, 'fetchOHLCV': false, 'fetchOpenOrder': false, 'fetchOpenOrders': false, 'fetchOrder': false, 'fetchOrderBook': true, 'fetchOrders': false, 'fetchStatus': 'emulated', 'fetchTicker': true, 'fetchTickers': false, 'fetchBidsAsks': false, 'fetchTrades': true, 'withdraw': false, }, 'timeframes': { // empty if the exchange.has['fetchOHLCV'] !== true '1m': '1minute', '1h': '1hour', '1d': '1day', '1M': '1month', '1y': '1year', }, 'timeout': 10000, // number in milliseconds 'rateLimit': 2000, // number in milliseconds 'userAgent': 'ccxt/1.1.1 ...' // string, HTTP User-Agent header 'verbose': false, // boolean, output error details 'markets': { ... } // dictionary of markets/pairs by symbol 'symbols': [ ... ] // sorted list of string symbols (traded pairs) 'currencies': { ... } // dictionary of currencies by currency code 'markets_by_id': { ... }, // dictionary of array of dictionaries (markets) by id 'currencies_by_id': { ... }, // dictionary of dictionaries (markets) by id 'apiKey': '92560ffae9b8a0421...', // string public apiKey (ASCII, hex, Base64, ...) 'secret': '9aHjPmW+EtRRKN/Oi...' // string private secret key 'password': '6kszf4aci8r', // string password 'uid': '123456', // string user id 'options': { ... }, // exchange-specific options // ... other properties here ... }"><pre><span class="pl-kos">{</span> <span class="pl-s">'id'</span>: <span class="pl-s">'exchange'</span> <span class="pl-c">// lowercase string exchange id</span> <span class="pl-s">'name'</span>: <span class="pl-s">'Exchange'</span> <span class="pl-c">// human-readable string</span> <span class="pl-s">'countries'</span>: <span class="pl-kos">[</span> <span class="pl-s">'US'</span><span class="pl-kos">,</span> <span class="pl-s">'CN'</span><span class="pl-kos">,</span> <span class="pl-s">'EU'</span> <span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-c">// array of ISO country codes</span> <span class="pl-s">'urls'</span>: <span class="pl-kos">{</span> <span class="pl-s">'api'</span>: <span class="pl-s">'https://api.example.com/data'</span><span class="pl-kos">,</span> <span class="pl-c">// string or dictionary of base API URLs</span> <span class="pl-s">'www'</span>: <span class="pl-s">'https://www.example.com'</span> <span class="pl-c">// string website URL</span> <span class="pl-s">'doc'</span>: <span class="pl-s">'https://docs.example.com/api'</span><span class="pl-kos">,</span> <span class="pl-c">// string URL or array of URLs</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'version'</span>: <span class="pl-s">'v1'</span><span class="pl-kos">,</span> <span class="pl-c">// string ending with digits</span> <span class="pl-s">'api'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// dictionary of api endpoints</span> <span class="pl-s">'has'</span>: <span class="pl-kos">{</span> <span class="pl-c">// exchange capabilities</span> <span class="pl-s">'CORS'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'cancelOrder'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-s">'createDepositAddress'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'createOrder'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-s">'fetchBalance'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-s">'fetchCanceledOrders'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'fetchClosedOrder'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'fetchClosedOrders'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'fetchCurrencies'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'fetchDepositAddress'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'fetchMarkets'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-s">'fetchMyTrades'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'fetchOHLCV'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'fetchOpenOrder'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'fetchOpenOrders'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'fetchOrder'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'fetchOrderBook'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-s">'fetchOrders'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'fetchStatus'</span>: <span class="pl-s">'emulated'</span><span class="pl-kos">,</span> <span class="pl-s">'fetchTicker'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-s">'fetchTickers'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'fetchBidsAsks'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'fetchTrades'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-s">'withdraw'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'timeframes'</span>: <span class="pl-kos">{</span> <span class="pl-c">// empty if the exchange.has['fetchOHLCV'] !== true</span> <span class="pl-s">'1m'</span>: <span class="pl-s">'1minute'</span><span class="pl-kos">,</span> <span class="pl-s">'1h'</span>: <span class="pl-s">'1hour'</span><span class="pl-kos">,</span> <span class="pl-s">'1d'</span>: <span class="pl-s">'1day'</span><span class="pl-kos">,</span> <span class="pl-s">'1M'</span>: <span class="pl-s">'1month'</span><span class="pl-kos">,</span> <span class="pl-s">'1y'</span>: <span class="pl-s">'1year'</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'timeout'</span>: <span class="pl-c1">10000</span><span class="pl-kos">,</span> <span class="pl-c">// number in milliseconds</span> <span class="pl-s">'rateLimit'</span>: <span class="pl-c1">2000</span><span class="pl-kos">,</span> <span class="pl-c">// number in milliseconds</span> <span class="pl-s">'userAgent'</span>: <span class="pl-s">'ccxt/1.1.1 ...'</span> <span class="pl-c">// string, HTTP User-Agent header</span> <span class="pl-s">'verbose'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c">// boolean, output error details</span> <span class="pl-s">'markets'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span> <span class="pl-c">// dictionary of markets/pairs by symbol</span> <span class="pl-s">'symbols'</span>: <span class="pl-kos">[</span> ... <span class="pl-kos">]</span> <span class="pl-c">// sorted list of string symbols (traded pairs)</span> <span class="pl-s">'currencies'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span> <span class="pl-c">// dictionary of currencies by currency code</span> <span class="pl-s">'markets_by_id'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// dictionary of array of dictionaries (markets) by id</span> <span class="pl-s">'currencies_by_id'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// dictionary of dictionaries (markets) by id</span> <span class="pl-s">'apiKey'</span>: <span class="pl-s">'92560ffae9b8a0421...'</span><span class="pl-kos">,</span> <span class="pl-c">// string public apiKey (ASCII, hex, Base64, ...)</span> <span class="pl-s">'secret'</span>: <span class="pl-s">'9aHjPmW+EtRRKN/Oi...'</span> <span class="pl-c">// string private secret key</span> <span class="pl-s">'password'</span>: <span class="pl-s">'6kszf4aci8r'</span><span class="pl-kos">,</span> <span class="pl-c">// string password</span> <span class="pl-s">'uid'</span>: <span class="pl-s">'123456'</span><span class="pl-kos">,</span> <span class="pl-c">// string user id</span> <span class="pl-s">'options'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// exchange-specific options</span> <span class="pl-c">// ... other properties here ...</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Exchange Properties</h3><a id="user-content-exchange-properties" class="anchor" aria-label="Permalink: Exchange Properties" href="#exchange-properties"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Below is a detailed description of each of the base exchange properties:</p> <ul> <li> <p><code>id</code>: Each exchange has a default id. The id is not used for anything, it's a string literal for user-land exchange instance identification purposes. You can have multiple links to the same exchange and differentiate them by ids. Default ids are all lowercase and correspond to exchange names.</p> </li> <li> <p><code>name</code>: This is a string literal containing the human-readable exchange name.</p> </li> <li> <p><code>countries</code>: An array of string literals of 2-symbol ISO country codes, where the exchange is operating from.</p> </li> <li> <p><code>urls['api']</code>: The single string literal base URL for API calls or an associative array of separate URLs for private and public APIs.</p> </li> <li> <p><code>urls['www']</code>: The main HTTP website URL.</p> </li> <li> <p><code>urls['doc']</code>: A single string URL link to original documentation for exchange API on their website or an array of links to docs.</p> </li> <li> <p><code>version</code>: A string literal containing version identifier for current exchange API. The ccxt library will append this version string to the API Base URL upon each request. You don't have to modify it, unless you are implementing a new exchange API. The version identifier is a usually a numeric string starting with a letter 'v' in some cases, like v1.1. Do not override it unless you are implementing your own new crypto exchange class.</p> </li> <li> <p><code>api</code>: An associative array containing a definition of all API endpoints exposed by a crypto exchange. The API definition is used by ccxt to automatically construct callable instance methods for each available endpoint.</p> </li> <li> <p><code>has</code>: This is an associative array of exchange capabilities (e.g <code>fetchTickers</code>, <code>fetchOHLCV</code> or <code>CORS</code>).</p> </li> <li> <p><code>timeframes</code>: An associative array of timeframes, supported by the fetchOHLCV method of the exchange. This is only populated when <code>has['fetchOHLCV']</code> property is true.</p> </li> <li> <p><code>timeout</code>: A timeout in milliseconds for a request-response roundtrip (default timeout is 10000 ms = 10 seconds). If the response is not received in that time, the library will throw an <code>RequestTimeout</code> exception. You can leave the default timeout value or set it to a reasonable value. Hanging forever with no timeout is not your option, for sure. You don't have to override this option in general case.</p> </li> <li> <p><code>rateLimit</code>: A request rate limit in milliseconds. Specifies the required minimal delay between two consequent HTTP requests to the same exchange. The built-in rate-limiter is enabled by default and can be turned off by setting the <code>enableRateLimit</code> property to false.</p> </li> <li> <p><code>enableRateLimit</code>: A boolean (true/false) value that enables the built-in rate limiter and throttles consecutive requests. This setting is <code>true</code> (enabled) by default. <strong>The user is required to implement own <a href="#rate-limit">rate limiting</a> or leave the built-in rate limiter enabled to avoid being banned from the exchange</strong>.</p> </li> <li> <p><code>userAgent</code>: An object to set HTTP User-Agent header to. The ccxt library will set its User-Agent by default. Some exchanges may not like it. If you are having difficulties getting a reply from an exchange and want to turn User-Agent off or use the default one, set this value to false, undefined, or an empty string. The value of <code>userAgent</code> may be overrided by HTTP <code>headers</code> property below.</p> </li> <li> <p><code>headers</code>: An associative array of HTTP headers and their values. Default value is empty <code>{}</code>. All headers will be prepended to all requests. If the <code>User-Agent</code> header is set within <code>headers</code>, it will override whatever value is set in the <code>userAgent</code> property above.</p> </li> <li> <p><code>verbose</code>: A boolean flag indicating whether to log HTTP requests to stdout (verbose flag is false by default). Python people have an alternative way of DEBUG logging with a standard pythonic logger, which is enabled by adding these two lines to the beginning of their code:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import logging logging.basicConfig(level=logging.DEBUG)"><pre><span class="pl-k">import</span> <span class="pl-s1">logging</span> <span class="pl-s1">logging</span>.<span class="pl-c1">basicConfig</span>(<span class="pl-s1">level</span><span class="pl-c1">=</span><span class="pl-s1">logging</span>.<span class="pl-c1">DEBUG</span>)</pre></div> </li> <li> <p><code>markets</code>: An associative array of markets indexed by common trading pairs or symbols. Markets should be loaded prior to accessing this property. Markets are unavailable until you call the <code>loadMarkets() / load_markets()</code> method on exchange instance.</p> </li> <li> <p><code>symbols</code>: A non-associative array (a list) of symbols available with an exchange, sorted in alphabetical order. These are the keys of the <code>markets</code> property. Symbols are loaded and reloaded from markets. This property is a convenient shorthand for all market keys.</p> </li> <li> <p><code>currencies</code>: An associative array (a dict) of currencies by codes (usually 3 or 4 letters) available with an exchange. Currencies are loaded and reloaded from markets.</p> </li> <li> <p><code>markets_by_id</code>: An associative array of arrays of markets indexed by exchange-specific ids. Typically a length one array unless there are multiple markets with the same marketId. Markets should be loaded prior to accessing this property.</p> </li> <li> <p><code>apiKey</code>: This is your public API key string literal. Most exchanges require <a href="#api-keys-setup">API keys setup</a>.</p> </li> <li> <p><code>secret</code>: Your private secret API key string literal. Most exchanges require this as well together with the apiKey.</p> </li> <li> <p><code>password</code>: A string literal with your password/phrase. Some exchanges require this parameter for trading, but most of them don't.</p> </li> <li> <p><code>uid</code>: A unique id of your account. This can be a string literal or a number. Some exchanges also require this for trading, but most of them don't.</p> </li> <li> <p><code>requiredCredentials</code>: A unified associative dictionary that shows which of the above API credentials are required for sending private API calls to the underlying exchange (an exchange may require a specific set of keys).</p> </li> <li> <p><code>options</code>: An exchange-specific associative dictionary containing special keys and options that are accepted by the underlying exchange and supported in CCXT.</p> </li> <li> <p><code>precisionMode</code>: The exchange decimal precision counting mode, read more about <a href="#precision-and-limits">Precision And Limits</a></p> </li> <li> <p>For proxies - <code>proxyUrl</code>, <code>httpUrl</code>, <code>httpsUrl</code>, <code>socksProxy</code>, <code>wsProxy</code>, <code>wssProxy</code>, <code>wsSocksProxy</code> : An url of specific proxy. Read details in <a href="#proxy">Proxy</a> section.</p> </li> </ul> <p>See this section on <a href="#overriding-exchange-properties-upon-instantiation">Overriding exchange properties</a>.</p> <div class="markdown-heading"><h4 class="heading-element">Exchange Metadata</h4><a id="user-content-exchange-metadata" class="anchor" aria-label="Permalink: Exchange Metadata" href="#exchange-metadata"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <ul> <li> <p><code>has</code>: An assoc-array containing flags for exchange capabilities, including the following:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="'has': { 'CORS': false, // has Cross-Origin Resource Sharing enabled (works from browser) or not // unified methods availability flags (can be true, false, or 'emulated'): 'cancelOrder': true, 'createDepositAddress': false, 'createOrder': true, 'fetchBalance': true, 'fetchCanceledOrders': false, 'fetchClosedOrder': false, 'fetchClosedOrders': false, 'fetchCurrencies': false, 'fetchDepositAddress': false, 'fetchMarkets': true, 'fetchMyTrades': false, 'fetchOHLCV': false, 'fetchOpenOrder': false, 'fetchOpenOrders': false, 'fetchOrder': false, 'fetchOrderBook': true, 'fetchOrders': false, 'fetchStatus': 'emulated', 'fetchTicker': true, 'fetchTickers': false, 'fetchBidsAsks': false, 'fetchTrades': true, 'withdraw': false, ... }"><pre><span class="pl-s">'has'</span>: <span class="pl-kos">{</span> <span class="pl-s">'CORS'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c">// has Cross-Origin Resource Sharing enabled (works from browser) or not</span> <span class="pl-c">// unified methods availability flags (can be true, false, or 'emulated'):</span> <span class="pl-s">'cancelOrder'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-s">'createDepositAddress'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'createOrder'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-s">'fetchBalance'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-s">'fetchCanceledOrders'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'fetchClosedOrder'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'fetchClosedOrders'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'fetchCurrencies'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'fetchDepositAddress'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'fetchMarkets'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-s">'fetchMyTrades'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'fetchOHLCV'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'fetchOpenOrder'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'fetchOpenOrders'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'fetchOrder'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'fetchOrderBook'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-s">'fetchOrders'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'fetchStatus'</span>: <span class="pl-s">'emulated'</span><span class="pl-kos">,</span> <span class="pl-s">'fetchTicker'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-s">'fetchTickers'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'fetchBidsAsks'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s">'fetchTrades'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-s">'withdraw'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> ... <span class="pl-kos">}</span></pre></div> <p>The meaning of each flag showing availability of this or that method is:</p> <ul> <li>a value of <code>undefined</code> / <code>None</code> / <code>null</code> means the method is not currently implemented in ccxt (either ccxt has not unified it yet or the method isn't natively available from the exchange API)</li> <li>boolean <code>false</code> specifically means that the endpoint isn't natively available from the exchange API</li> <li>boolean <code>true</code> means the endpoint is natively available from the exchange API and unified in the ccxt library</li> <li> <code>'emulated'</code> string means the endpoint isn't natively available from the exchange API but reconstructed (as much as possible) by the ccxt library from other available true-methods</li> </ul> <p>For a complete list of all exchages and their supported methods, please, refer to this example: <a href="https://github.com/ccxt/ccxt/blob/master/examples/js/exchange-capabilities.js">https://github.com/ccxt/ccxt/blob/master/examples/js/exchange-capabilities.js</a></p> </li> </ul> <div class="markdown-heading"><h2 class="heading-element">Rate Limit</h2><a id="user-content-rate-limit" class="anchor" aria-label="Permalink: Rate Limit" href="#rate-limit"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Exchanges usually impose what is called a <em>rate limit</em>. Exchanges will remember and track your user credentials and your IP address and will not allow you to query the API too frequently. They balance their load and control traffic congestion to protect API servers from (D)DoS and misuse.</p> <p><strong>WARNING: Stay under the rate limit to avoid ban!</strong></p> <p>Most exchanges allow <strong>up to 1 or 2 requests per second</strong>. Exchanges may temporarily restrict your access to their API or ban you for some period of time if you are too aggressive with your requests.</p> <p><strong>The <code>exchange.rateLimit</code> property is set to a safe default which is sub-optimal. Some exchanges may have varying rate limits for different endpoints. It is up to the user to tweak <code>rateLimit</code> according to application-specific purposes.</strong></p> <p>The CCXT library has a built-in experimental rate-limiter that will do the necessary throttling in background transparently to the user. <strong>WARNING: users are responsible for at least some type of rate-limiting: either by implementing a custom algorithm or by doing it with the built-in rate-limiter.</strong>.</p> <p>You can turn on/off the built-in rate-limiter with <code>.enableRateLimit</code> property, like so:</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-5" class="anchor" aria-label="Permalink: Javascript" href="#javascript-5"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// enable built-in rate limiting upon instantiation of the exchange const exchange = new ccxt.bitfinex ({ // 'enableRateLimit': true, // enabled by default }) // or switch the built-in rate-limiter on or off later after instantiation exchange.enableRateLimit = true // enable exchange.enableRateLimit = false // disable"><pre><span class="pl-c">// enable built-in rate limiting upon instantiation of the exchange</span> <span class="pl-k">const</span> <span class="pl-s1">exchange</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">bitfinex</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c">// 'enableRateLimit': true, // enabled by default</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c">// or switch the built-in rate-limiter on or off later after instantiation</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">enableRateLimit</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span> <span class="pl-c">// enable</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">enableRateLimit</span> <span class="pl-c1">=</span> <span class="pl-c1">false</span> <span class="pl-c">// disable</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-5" class="anchor" aria-label="Permalink: Python" href="#python-5"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" # enable built-in rate limiting upon instantiation of the exchange exchange = ccxt.bitfinex({ # 'enableRateLimit': True, # enabled by default }) # or switch the built-in rate-limiter on or off later after instantiation exchange.enableRateLimit = True # enable exchange.enableRateLimit = False # disable"><pre><span class="pl-c"># enable built-in rate limiting upon instantiation of the exchange</span> <span class="pl-s1">exchange</span> <span class="pl-c1">=</span> <span class="pl-s1">ccxt</span>.<span class="pl-c1">bitfinex</span>({ <span class="pl-c"># 'enableRateLimit': True, # enabled by default</span> }) <span class="pl-c"># or switch the built-in rate-limiter on or off later after instantiation</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">enableRateLimit</span> <span class="pl-c1">=</span> <span class="pl-c1">True</span> <span class="pl-c"># enable</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">enableRateLimit</span> <span class="pl-c1">=</span> <span class="pl-c1">False</span> <span class="pl-c"># disable</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-5" class="anchor" aria-label="Permalink: PHP" href="#php-5"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" // enable built-in rate limiting upon instantiation of the exchange $exchange = new \ccxt\bitfinex (array ( // 'enableRateLimit' => true, // enabled by default )); // or switch the built-in rate-limiter on or off later after instantiation $exchange->enableRateLimit = true; // enable $exchange->enableRateLimit = false; // disable"><pre><span class="pl-c">// enable built-in rate limiting upon instantiation of the exchange</span> <span class="pl-s1"><span class="pl-c1">$</span>exchange</span> = <span class="pl-k">new</span> \<span class="pl-v">ccxt</span>\<span class="pl-v">bitfinex</span> (<span class="pl-en">array</span> ( <span class="pl-c">// 'enableRateLimit' => true, // enabled by default</span> )); <span class="pl-c">// or switch the built-in rate-limiter on or off later after instantiation</span> <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">enableRateLimit</span> = <span class="pl-c1">true</span>; <span class="pl-c">// enable</span> <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">enableRateLimit</span> = <span class="pl-c1">false</span>; <span class="pl-c">// disable</span></pre></div> <p>In case your calls hit a rate limit or get nonce errors, the ccxt library will throw an <code>InvalidNonce</code> exception, or, in some cases, one of the following types:</p> <ul> <li><code>DDoSProtection</code></li> <li><code>ExchangeNotAvailable</code></li> <li><code>ExchangeError</code></li> <li><code>InvalidNonce</code></li> </ul> <p>A later retry is usually enough to handle that.</p> <div class="markdown-heading"><h3 class="heading-element">Notes On Rate Limiter</h3><a id="user-content-notes-on-rate-limiter" class="anchor" aria-label="Permalink: Notes On Rate Limiter" href="#notes-on-rate-limiter"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="markdown-heading"><h4 class="heading-element">One Rate Limiter Per Each Exchange Instance</h4><a id="user-content-one-rate-limiter-per-each-exchange-instance" class="anchor" aria-label="Permalink: One Rate Limiter Per Each Exchange Instance" href="#one-rate-limiter-per-each-exchange-instance"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The rate limiter is a property of the exchange instance, in other words, each exchange instance has its own rate limiter that is not aware of the other instances. In many cases the user should reuse the same exchange instance throughout the program. Do not use multiple instances of the same exchange with the same API keypair from the same IP address.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// DO NOT DO THIS! const binance1 = new ccxt.binance () const binance2 = new ccxt.binance () const binance3 = new ccxt.binance () while (true) { const result = await Promise.all ([ binance1.fetchOrderBook ('BTC/USDT'), binance2.fetchOrderBook ('ETH/USDT'), binance3.fetchOrderBook ('ETH/BTC'), ]) console.log (result) }"><pre><span class="pl-c">// DO NOT DO THIS!</span> <span class="pl-k">const</span> <span class="pl-s1">binance1</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">binance</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-k">const</span> <span class="pl-s1">binance2</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">binance</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-k">const</span> <span class="pl-s1">binance3</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">binance</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-k">while</span> <span class="pl-kos">(</span><span class="pl-c1">true</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-v">Promise</span><span class="pl-kos">.</span><span class="pl-en">all</span> <span class="pl-kos">(</span><span class="pl-kos">[</span> <span class="pl-s1">binance1</span><span class="pl-kos">.</span><span class="pl-en">fetchOrderBook</span> <span class="pl-kos">(</span><span class="pl-s">'BTC/USDT'</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s1">binance2</span><span class="pl-kos">.</span><span class="pl-en">fetchOrderBook</span> <span class="pl-kos">(</span><span class="pl-s">'ETH/USDT'</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s1">binance3</span><span class="pl-kos">.</span><span class="pl-en">fetchOrderBook</span> <span class="pl-kos">(</span><span class="pl-s">'ETH/BTC'</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">result</span><span class="pl-kos">)</span> <span class="pl-kos">}</span></pre></div> <p>Reuse the exchange instance as much as possible as shown below:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// DO THIS INSTEAD: const binance = new ccxt.binance () while (true) { const result = await Promise.all ([ binance.fetchOrderBook ('BTC/USDT'), binance.fetchOrderBook ('ETH/USDT'), binance.fetchOrderBook ('ETH/BTC'), ]) console.log (result) }"><pre><span class="pl-c">// DO THIS INSTEAD:</span> <span class="pl-k">const</span> <span class="pl-s1">binance</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">binance</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-k">while</span> <span class="pl-kos">(</span><span class="pl-c1">true</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-v">Promise</span><span class="pl-kos">.</span><span class="pl-en">all</span> <span class="pl-kos">(</span><span class="pl-kos">[</span> <span class="pl-s1">binance</span><span class="pl-kos">.</span><span class="pl-en">fetchOrderBook</span> <span class="pl-kos">(</span><span class="pl-s">'BTC/USDT'</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s1">binance</span><span class="pl-kos">.</span><span class="pl-en">fetchOrderBook</span> <span class="pl-kos">(</span><span class="pl-s">'ETH/USDT'</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s1">binance</span><span class="pl-kos">.</span><span class="pl-en">fetchOrderBook</span> <span class="pl-kos">(</span><span class="pl-s">'ETH/BTC'</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">result</span><span class="pl-kos">)</span> <span class="pl-kos">}</span></pre></div> <p>Since the rate limiter belongs to the exchange instance, destroying the exchange instance will destroy the rate limiter as well. Among the most common pitfalls with the rate limiting is creating and dropping the exchange instance over and over again. If in your program you are creating and destroying the exchange instance (say, inside a function that is called multiple times), then you are effectively resetting the rate limiter over and over and that will eventually break the rate limits. If you are recreating the exchange instance every time instead of reusing it, CCXT will try to load the markets every time. Therefore, you will force-load the markets over and over as explained in the <a href="#loading-markets">Loading Markets</a> section. Abusing the markets endpoint will eventually break the rate limiter as well.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// DO NOT DO THIS! async function tick () { const exchange = new ccxt.binance () const response = await exchange.fetchOrderBook ('BTC/USDT') // ... some processing here ... return response } while (true) { const result = await tick () console.log (result) }"><pre><span class="pl-c">// DO NOT DO THIS!</span> <span class="pl-k">async</span> <span class="pl-k">function</span> <span class="pl-en">tick</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-s1">exchange</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">binance</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-k">const</span> <span class="pl-s1">response</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchOrderBook</span> <span class="pl-kos">(</span><span class="pl-s">'BTC/USDT'</span><span class="pl-kos">)</span> <span class="pl-c">// ... some processing here ...</span> <span class="pl-k">return</span> <span class="pl-s1">response</span> <span class="pl-kos">}</span> <span class="pl-k">while</span> <span class="pl-kos">(</span><span class="pl-c1">true</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-en">tick</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">result</span><span class="pl-kos">)</span> <span class="pl-kos">}</span></pre></div> <p>Do not break this rule unless you really understand the inner workings of the rate-limiter and you are 100% sure you know what you're doing. In order to stay safe always reuse the exchange instance throughout your functions and methods callchain like shown below:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// DO THIS INSTEAD: async function tick (exchange) { const response = await exchange.fetchOrderBook ('BTC/USDT') // ... some processing here ... return response } const exchange = new ccxt.binance () while (true) { const result = await tick (exchange) console.log (result) }"><pre><span class="pl-c">// DO THIS INSTEAD:</span> <span class="pl-k">async</span> <span class="pl-k">function</span> <span class="pl-en">tick</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-s1">response</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchOrderBook</span> <span class="pl-kos">(</span><span class="pl-s">'BTC/USDT'</span><span class="pl-kos">)</span> <span class="pl-c">// ... some processing here ...</span> <span class="pl-k">return</span> <span class="pl-s1">response</span> <span class="pl-kos">}</span> <span class="pl-k">const</span> <span class="pl-s1">exchange</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">binance</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-k">while</span> <span class="pl-kos">(</span><span class="pl-c1">true</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-en">tick</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">)</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">result</span><span class="pl-kos">)</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">DDoS Protection By Cloudflare / Incapsula</h3><a id="user-content-ddos-protection-by-cloudflare--incapsula" class="anchor" aria-label="Permalink: DDoS Protection By Cloudflare / Incapsula" href="#ddos-protection-by-cloudflare--incapsula"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Some exchanges are <a href="https://en.wikipedia.org/wiki/Denial-of-service_attack" rel="nofollow">DDoS</a>-protected by <a href="https://www.cloudflare.com" rel="nofollow">Cloudflare</a> or <a href="https://www.incapsula.com" rel="nofollow">Incapsula</a>. Your IP can get temporarily blocked during periods of high load. Sometimes they even restrict whole countries and regions. In that case their servers usually return a page that states a HTTP 40x error or runs an AJAX test of your browser / captcha test and delays the reload of the page for several seconds. Then your browser/fingerprint is granted access temporarily and gets added to a whitelist or receives a HTTP cookie for further use.</p> <p>The most common symptoms for a DDoS protection problem, rate-limiting problem or for a location-based filtering issue:</p> <ul> <li>Getting <code>RequestTimeout</code> exceptions with all types of exchange methods</li> <li>Catching <code>ExchangeError</code> or <code>ExchangeNotAvailable</code> with HTTP error codes 400, 403, 404, 429, 500, 501, 503, etc..</li> <li>Having DNS resolving issues, SSL certificate issues and low-level connectivity issues</li> <li>Getting a template HTML page instead of JSON from the exchange</li> </ul> <p>If you encounter DDoS protection errors and cannot reach a particular exchange then:</p> <ul> <li>use a <a href="#proxy">proxy</a> (this is less responsive, though)</li> <li>ask the exchange support to add you to a whitelist</li> <li>try an alternative IP within a different geographic region</li> <li>run your software in a distributed network of servers</li> <li>run your software in close proximity to the exchange (same country, same city, same datacenter, same server rack, same server)</li> <li>...</li> </ul> <div class="markdown-heading"><h1 class="heading-element">Markets</h1><a id="user-content-markets" class="anchor" aria-label="Permalink: Markets" href="#markets"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <ul> <li><a href="#currency-structure">Currency Structure</a></li> <li><a href="#market-structure">Market Structure</a></li> <li><a href="#precision-and-limits">Precision And Limits</a></li> <li><a href="#loading-markets">Loading Markets</a></li> <li><a href="#symbols-and-market-ids">Symbols And Market Ids</a></li> <li><a href="#market-cache-force-reload">Market Cache Force Reload</a></li> </ul> <p>Each exchange is a place for trading some kinds of valuables. The exchanges may use differing terms to call them: <em>"a currency"</em>, <em>"an asset"</em>, <em>"a coin"</em>, <em>"a token"</em>, <em>"stock"</em>, <em>"commodity"</em>, <em>"crypto"</em>, "fiat", etc. A place for trading one asset for another is usually called <em>"a market"</em>, <em>"a symbol"</em>, <em>"a trading pair"</em>, <em>"a contract"</em>, etc.</p> <p>In terms of the ccxt library, every exchange offers multiple <strong>markets</strong> within itself. Each market is defined by two or more <strong>currencies</strong>. The set of markets differs from exchange to exchange opening possibilities for cross-exchange and cross-market arbitrage.</p> <div class="markdown-heading"><h2 class="heading-element">Currency Structure</h2><a id="user-content-currency-structure" class="anchor" aria-label="Permalink: Currency Structure" href="#currency-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ 'id': 'btc', // string literal for referencing within an exchange 'code': 'BTC', // uppercase unified string literal code of the currency 'name': 'Bitcoin', // string, human-readable name, if specified 'active': true, // boolean, currency status (tradeable and withdrawable) 'fee': 0.123, // withdrawal fee, flat 'precision': 8, // number of decimal digits "after the dot" (depends on exchange.precisionMode) 'deposit': true // boolean, deposits are available 'withdraw': true // boolean, withdraws are available 'limits': { // value limits when placing orders on this market 'amount': { 'min': 0.01, // order amount should be > min 'max': 1000, // order amount should be < max }, 'withdraw': { ... }, // withdrawal limits 'deposit': {...}, }, 'networks': {...} // network structures indexed by unified network identifiers (ERC20, TRC20, BSC, etc) 'info': { ... }, // the original unparsed currency info from the exchange }"><pre><span class="pl-kos">{</span> <span class="pl-s">'id'</span>: <span class="pl-s">'btc'</span><span class="pl-kos">,</span> <span class="pl-c">// string literal for referencing within an exchange</span> <span class="pl-s">'code'</span>: <span class="pl-s">'BTC'</span><span class="pl-kos">,</span> <span class="pl-c">// uppercase unified string literal code of the currency</span> <span class="pl-s">'name'</span>: <span class="pl-s">'Bitcoin'</span><span class="pl-kos">,</span> <span class="pl-c">// string, human-readable name, if specified</span> <span class="pl-s">'active'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c">// boolean, currency status (tradeable and withdrawable)</span> <span class="pl-s">'fee'</span>: <span class="pl-c1">0.123</span><span class="pl-kos">,</span> <span class="pl-c">// withdrawal fee, flat</span> <span class="pl-s">'precision'</span>: <span class="pl-c1">8</span><span class="pl-kos">,</span> <span class="pl-c">// number of decimal digits "after the dot" (depends on exchange.precisionMode)</span> <span class="pl-s">'deposit'</span>: <span class="pl-c1">true</span> <span class="pl-c">// boolean, deposits are available</span> <span class="pl-s">'withdraw'</span>: <span class="pl-c1">true</span> <span class="pl-c">// boolean, withdraws are available</span> <span class="pl-s">'limits'</span>: <span class="pl-kos">{</span> <span class="pl-c">// value limits when placing orders on this market</span> <span class="pl-s">'amount'</span>: <span class="pl-kos">{</span> <span class="pl-s">'min'</span>: <span class="pl-c1">0.01</span><span class="pl-kos">,</span> <span class="pl-c">// order amount should be > min</span> <span class="pl-s">'max'</span>: <span class="pl-c1">1000</span><span class="pl-kos">,</span> <span class="pl-c">// order amount should be < max</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'withdraw'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// withdrawal limits</span> <span class="pl-s">'deposit'</span>: <span class="pl-kos">{</span>...<span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'networks'</span>: <span class="pl-kos">{</span>...<span class="pl-kos">}</span> <span class="pl-c">// network structures indexed by unified network identifiers (ERC20, TRC20, BSC, etc)</span> <span class="pl-s">'info'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// the original unparsed currency info from the exchange</span> <span class="pl-kos">}</span></pre></div> <p>Each currency is an associative array (aka dictionary) with the following keys:</p> <ul> <li> <code>id</code>. The string or numeric ID of the currency within the exchange. Currency ids are used inside exchanges internally to identify coins during the request/response process.</li> <li> <code>code</code>. An uppercase string code representation of a particular currency. Currency codes are used to reference currencies within the ccxt library (explained below).</li> <li> <code>name</code>. A human-readable name of the currency (can be a mix of uppercase & lowercase characters).</li> <li> <code>fee</code>. The withdrawal fee value as specified by the exchange. In most cases it means a flat fixed amount paid in the same currency. If the exchnange does not specify it via public endpoints, the <code>fee</code> can be <code>undefined/None/null</code> or missing.</li> <li> <code>active</code>. A boolean indicating whether trading or funding (depositing or withdrawing) for this currency is currently possible, more about it here: <a href="#active-status"><code>active</code> status</a>.</li> <li> <code>info</code>. An associative array of non-common market properties, including fees, rates, limits and other general market information. The internal info array is different for each particular market, its contents depend on the exchange.</li> <li> <code>precision</code>. Precision accepted in values by exchanges upon referencing this currency. The value of this property depends on <a href="#precision-mode"><code>exchange.precisionMode</code></a>.</li> <li> <code>limits</code>. The minimums and maximums for amounts (volumes), withdrawals and deposits.</li> </ul> <div class="markdown-heading"><h2 class="heading-element">Network Structure</h2><a id="user-content-network-structure" class="anchor" aria-label="Permalink: Network Structure" href="#network-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ 'id': 'tron', // string literal for referencing within an exchange 'network': 'TRC20' // unified network 'name': 'Tron Network', // string, human-readable name, if specified 'active': true, // boolean, currency status (tradeable and withdrawable) 'fee': 0.123, // withdrawal fee, flat 'precision': 8, // number of decimal digits "after the dot" (depends on exchange.precisionMode) 'deposit': true // boolean, deposits are available 'withdraw': true // boolean, withdraws are available 'limits': { // value limits when placing orders on this market 'amount': { 'min': 0.01, // order amount should be > min 'max': 1000, // order amount should be < max }, 'withdraw': { ... }, // withdrawal limits 'deposit': {...}, // deposit limits }, 'info': { ... }, // the original unparsed currency info from the exchange }"><pre><span class="pl-kos">{</span> <span class="pl-s">'id'</span>: <span class="pl-s">'tron'</span><span class="pl-kos">,</span> <span class="pl-c">// string literal for referencing within an exchange</span> <span class="pl-s">'network'</span>: <span class="pl-s">'TRC20'</span> <span class="pl-c">// unified network</span> <span class="pl-s">'name'</span>: <span class="pl-s">'Tron Network'</span><span class="pl-kos">,</span> <span class="pl-c">// string, human-readable name, if specified</span> <span class="pl-s">'active'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c">// boolean, currency status (tradeable and withdrawable)</span> <span class="pl-s">'fee'</span>: <span class="pl-c1">0.123</span><span class="pl-kos">,</span> <span class="pl-c">// withdrawal fee, flat</span> <span class="pl-s">'precision'</span>: <span class="pl-c1">8</span><span class="pl-kos">,</span> <span class="pl-c">// number of decimal digits "after the dot" (depends on exchange.precisionMode)</span> <span class="pl-s">'deposit'</span>: <span class="pl-c1">true</span> <span class="pl-c">// boolean, deposits are available</span> <span class="pl-s">'withdraw'</span>: <span class="pl-c1">true</span> <span class="pl-c">// boolean, withdraws are available</span> <span class="pl-s">'limits'</span>: <span class="pl-kos">{</span> <span class="pl-c">// value limits when placing orders on this market</span> <span class="pl-s">'amount'</span>: <span class="pl-kos">{</span> <span class="pl-s">'min'</span>: <span class="pl-c1">0.01</span><span class="pl-kos">,</span> <span class="pl-c">// order amount should be > min</span> <span class="pl-s">'max'</span>: <span class="pl-c1">1000</span><span class="pl-kos">,</span> <span class="pl-c">// order amount should be < max</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'withdraw'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// withdrawal limits</span> <span class="pl-s">'deposit'</span>: <span class="pl-kos">{</span>...<span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// deposit limits</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'info'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// the original unparsed currency info from the exchange</span> <span class="pl-kos">}</span></pre></div> <p>Each network is an associative array (aka dictionary) with the following keys:</p> <ul> <li> <code>id</code>. The string or numeric ID of the network within the exchange. Network ids are used inside exchanges internally to identify networks during the request/response process.</li> <li> <code>network</code>. An uppercase string representation of a particular network. Networks are used to reference networks within the ccxt library.</li> <li> <code>name</code>. A human-readable name of the network (can be a mix of uppercase & lowercase characters).</li> <li> <code>fee</code>. The withdrawal fee value as specified by the exchange. In most cases it means a flat fixed amount paid in the same currency. If the exchnange does not specify it via public endpoints, the <code>fee</code> can be <code>undefined/None/null</code> or missing.</li> <li> <code>active</code>. A boolean indicating whether trading or funding (depositing or withdrawing) for this currency is currently possible, more about it here: <a href="#active-status"><code>active</code> status</a>.</li> <li> <code>info</code>. An associative array of non-common market properties, including fees, rates, limits and other general market information. The internal info array is different for each particular market, its contents depend on the exchange.</li> <li> <code>precision</code>. Precision accepted in values by exchanges upon referencing this currency. The value of this property depends on <a href="#precision-mode"><code>exchange.precisionMode</code></a>.</li> <li> <code>limits</code>. The minimums and maximums for amounts (volumes), withdrawals and deposits.</li> </ul> <div class="markdown-heading"><h2 class="heading-element">Market Structure</h2><a id="user-content-market-structure" class="anchor" aria-label="Permalink: Market Structure" href="#market-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ 'id': 'btcusd', // string literal for referencing within an exchange 'symbol': 'BTC/USD', // uppercase string literal of a pair of currencies 'base': 'BTC', // uppercase string, unified base currency code, 3 or more letters 'quote': 'USD', // uppercase string, unified quote currency code, 3 or more letters 'baseId': 'btc', // any string, exchange-specific base currency id 'quoteId': 'usd', // any string, exchange-specific quote currency id 'active': true, // boolean, market status 'type': 'spot', // spot for spot, future for expiry futures, swap for perpetual swaps, 'option' for options 'spot': true, // whether the market is a spot market 'margin': true, // whether the market is a margin market 'future': false, // whether the market is a expiring future 'swap': false, // whether the market is a perpetual swap 'option': false, // whether the market is an option contract 'contract': false, // whether the market is a future, a perpetual swap, or an option 'settle': 'USDT', // the unified currency code that the contract will settle in, only set if `contract` is true 'settleId': 'usdt', // the currencyId of that the contract will settle in, only set if `contract` is true 'contractSize': 1, // the size of one contract, only used if `contract` is true 'linear': true, // the contract is a linear contract (settled in quote currency) 'inverse': false, // the contract is an inverse contract (settled in base currency) 'expiry': 1641370465121, // the unix expiry timestamp in milliseconds, undefined for everything except market['type'] `future` 'expiryDatetime': '2022-03-26T00:00:00.000Z', // The datetime contract will in iso8601 format 'strike': 4000, // price at which a put or call option can be exercised 'optionType': 'call', // call or put string, call option represents an option with the right to buy and put an option with the right to sell // note, 'taker' and 'maker' compose extended data for markets, however it might be better to use `fetchTradingFees` for more accuracy 'taker': 0.002, // taker fee rate, 0.002 = 0.2% 'maker': 0.0016, // maker fee rate, 0.0016 = 0.16% 'percentage': true, // whether the taker and maker fee rate is a multiplier or a fixed flat amount 'tierBased': false, // whether the fee depends on your trading tier (your trading volume) 'feeSide': 'get', // string literal can be 'get', 'give', 'base', 'quote', 'other' 'precision': { // number of decimal digits "after the dot" 'price': 8, // integer or float for TICK_SIZE roundingMode, might be missing if not supplied by the exchange 'amount': 8, // integer, might be missing if not supplied by the exchange 'cost': 8, // integer, very few exchanges actually have it }, 'limits': { // value limits when placing orders on this market 'amount': { 'min': 0.01, // order amount should be > min 'max': 1000, // order amount should be < max }, 'price': { ... }, // same min/max limits for the price of the order 'cost': { ... }, // same limits for order cost = price * amount 'leverage': { ... }, // same min/max limits for the leverage of the order }, 'marginModes': { 'cross': false, // whether pair supports cross-margin trading 'isolated': false, // whether pair supports isolated-margin trading }, 'info': { ... }, // the original unparsed market info from the exchange }"><pre><span class="pl-kos">{</span> <span class="pl-s">'id'</span>: <span class="pl-s">'btcusd'</span><span class="pl-kos">,</span> <span class="pl-c">// string literal for referencing within an exchange</span> <span class="pl-s">'symbol'</span>: <span class="pl-s">'BTC/USD'</span><span class="pl-kos">,</span> <span class="pl-c">// uppercase string literal of a pair of currencies</span> <span class="pl-s">'base'</span>: <span class="pl-s">'BTC'</span><span class="pl-kos">,</span> <span class="pl-c">// uppercase string, unified base currency code, 3 or more letters</span> <span class="pl-s">'quote'</span>: <span class="pl-s">'USD'</span><span class="pl-kos">,</span> <span class="pl-c">// uppercase string, unified quote currency code, 3 or more letters</span> <span class="pl-s">'baseId'</span>: <span class="pl-s">'btc'</span><span class="pl-kos">,</span> <span class="pl-c">// any string, exchange-specific base currency id</span> <span class="pl-s">'quoteId'</span>: <span class="pl-s">'usd'</span><span class="pl-kos">,</span> <span class="pl-c">// any string, exchange-specific quote currency id</span> <span class="pl-s">'active'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c">// boolean, market status</span> <span class="pl-s">'type'</span>: <span class="pl-s">'spot'</span><span class="pl-kos">,</span> <span class="pl-c">// spot for spot, future for expiry futures, swap for perpetual swaps, 'option' for options</span> <span class="pl-s">'spot'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c">// whether the market is a spot market</span> <span class="pl-s">'margin'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c">// whether the market is a margin market</span> <span class="pl-s">'future'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c">// whether the market is a expiring future</span> <span class="pl-s">'swap'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c">// whether the market is a perpetual swap</span> <span class="pl-s">'option'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c">// whether the market is an option contract</span> <span class="pl-s">'contract'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c">// whether the market is a future, a perpetual swap, or an option</span> <span class="pl-s">'settle'</span>: <span class="pl-s">'USDT'</span><span class="pl-kos">,</span> <span class="pl-c">// the unified currency code that the contract will settle in, only set if `contract` is true</span> <span class="pl-s">'settleId'</span>: <span class="pl-s">'usdt'</span><span class="pl-kos">,</span> <span class="pl-c">// the currencyId of that the contract will settle in, only set if `contract` is true</span> <span class="pl-s">'contractSize'</span>: <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c">// the size of one contract, only used if `contract` is true</span> <span class="pl-s">'linear'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c">// the contract is a linear contract (settled in quote currency)</span> <span class="pl-s">'inverse'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c">// the contract is an inverse contract (settled in base currency)</span> <span class="pl-s">'expiry'</span>: <span class="pl-c1">1641370465121</span><span class="pl-kos">,</span> <span class="pl-c">// the unix expiry timestamp in milliseconds, undefined for everything except market['type'] `future`</span> <span class="pl-s">'expiryDatetime'</span>: <span class="pl-s">'2022-03-26T00:00:00.000Z'</span><span class="pl-kos">,</span> <span class="pl-c">// The datetime contract will in iso8601 format</span> <span class="pl-s">'strike'</span>: <span class="pl-c1">4000</span><span class="pl-kos">,</span> <span class="pl-c">// price at which a put or call option can be exercised</span> <span class="pl-s">'optionType'</span>: <span class="pl-s">'call'</span><span class="pl-kos">,</span> <span class="pl-c">// call or put string, call option represents an option with the right to buy and put an option with the right to sell</span> <span class="pl-c">// note, 'taker' and 'maker' compose extended data for markets, however it might be better to use `fetchTradingFees` for more accuracy</span> <span class="pl-s">'taker'</span>: <span class="pl-c1">0.002</span><span class="pl-kos">,</span> <span class="pl-c">// taker fee rate, 0.002 = 0.2%</span> <span class="pl-s">'maker'</span>: <span class="pl-c1">0.0016</span><span class="pl-kos">,</span> <span class="pl-c">// maker fee rate, 0.0016 = 0.16%</span> <span class="pl-s">'percentage'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c">// whether the taker and maker fee rate is a multiplier or a fixed flat amount</span> <span class="pl-s">'tierBased'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c">// whether the fee depends on your trading tier (your trading volume)</span> <span class="pl-s">'feeSide'</span>: <span class="pl-s">'get'</span><span class="pl-kos">,</span> <span class="pl-c">// string literal can be 'get', 'give', 'base', 'quote', 'other'</span> <span class="pl-s">'precision'</span>: <span class="pl-kos">{</span> <span class="pl-c">// number of decimal digits "after the dot"</span> <span class="pl-s">'price'</span>: <span class="pl-c1">8</span><span class="pl-kos">,</span> <span class="pl-c">// integer or float for TICK_SIZE roundingMode, might be missing if not supplied by the exchange</span> <span class="pl-s">'amount'</span>: <span class="pl-c1">8</span><span class="pl-kos">,</span> <span class="pl-c">// integer, might be missing if not supplied by the exchange</span> <span class="pl-s">'cost'</span>: <span class="pl-c1">8</span><span class="pl-kos">,</span> <span class="pl-c">// integer, very few exchanges actually have it</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'limits'</span>: <span class="pl-kos">{</span> <span class="pl-c">// value limits when placing orders on this market</span> <span class="pl-s">'amount'</span>: <span class="pl-kos">{</span> <span class="pl-s">'min'</span>: <span class="pl-c1">0.01</span><span class="pl-kos">,</span> <span class="pl-c">// order amount should be > min</span> <span class="pl-s">'max'</span>: <span class="pl-c1">1000</span><span class="pl-kos">,</span> <span class="pl-c">// order amount should be < max</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'price'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// same min/max limits for the price of the order</span> <span class="pl-s">'cost'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// same limits for order cost = price * amount</span> <span class="pl-s">'leverage'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// same min/max limits for the leverage of the order</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'marginModes'</span>: <span class="pl-kos">{</span> <span class="pl-s">'cross'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c">// whether pair supports cross-margin trading</span> <span class="pl-s">'isolated'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c">// whether pair supports isolated-margin trading</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'info'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// the original unparsed market info from the exchange</span> <span class="pl-kos">}</span></pre></div> <p>Each market is an associative array (aka dictionary) with the following keys:</p> <ul> <li> <code>id</code>. The string or numeric ID of the market or trade instrument within the exchange. Market ids are used inside exchanges internally to identify trading pairs during the request/response process.</li> <li> <code>symbol</code>. An uppercase string code representation of a particular trading pair or instrument. This is usually written as <code>BaseCurrency/QuoteCurrency</code> with a slash as in <code>BTC/USD</code>, <code>LTC/CNY</code> or <code>ETH/EUR</code>, etc. Symbols are used to reference markets within the ccxt library (explained below).</li> <li> <code>base</code>. A unified uppercase string code of base fiat or crypto currency. This is the standardized currency code that is used to refer to that currency or token throughout CCXT and throughout the Unified CCXT API, it's the language that CCXT understands.</li> <li> <code>quote</code>. A unified uppercase string code of quoted fiat or crypto currency.</li> <li> <code>baseId</code>. An exchange-specific id of the base currency for this market, not unified. Can be any string, literally. This is communicated to the exchange using the language the exchange understands.</li> <li> <code>quoteId</code>. An exchange-specific id of the quote currency, not unified.</li> <li> <code>active</code>. A boolean indicating whether or not trading this market is currently possible, more about it here: <a href="#active-status"><code>active</code> status</a>.</li> <li> <code>maker</code>. Float, 0.0015 = 0.15%. Maker fees are paid when you provide liquidity to the exchange i.e. you <em>market-make</em> an order and someone else fills it. Maker fees are usually lower than taker fees. Fees can be negative, this is very common amongst derivative exchanges. A negative fee means the exchange will pay a rebate (reward) to the user for trading this market (note, 'taker' and 'maker' publicly available fees, not taking into consideration your vip-level/volume/etc. Use <a href="#fee-schedule"><code>fetchTradingFees</code></a> to get the fees specific to your account).</li> <li> <code>taker</code>. Float, 0.002 = 0.2%. Taker fees are paid when you <em>take</em> liquidity from the exchange and fill someone else's order.</li> <li> <code>percentage</code>. A boolean true/false value indicating whether <code>taker</code> and <code>maker</code> are multipliers or fixed flat amounts.</li> <li> <code>tierBased</code>. A boolean true/false value indicating whether the fee depends on your trading tier (usually, your traded volume over a period of time).</li> <li> <code>info</code>. An associative array of non-common market properties, including fees, rates, limits and other general market information. The internal info array is different for each particular market, its contents depend on the exchange.</li> <li> <code>precision</code>. Precision accepted in order values by exchanges upon order placement for price, amount and cost. (The value inside this property depend on the <a href="#precision-mode"><code>exchange.precisionMode</code></a>).</li> <li> <code>limits</code>. The minimums and maximums for prices, amounts (volumes) and costs (where cost = price * amount).</li> <li> <code>optionType</code>. The type of the option, <code>call</code> option represents an option with the right to buy and <code>put</code> an option with the right to sell.</li> <li> <code>strike</code>. Price at which an option can be bought or sold when it is exercised.</li> </ul> <div class="markdown-heading"><h2 class="heading-element">Active Status</h2><a id="user-content-active-status" class="anchor" aria-label="Permalink: Active Status" href="#active-status"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The <code>active</code> flag is typically used in <a href="#currency-structure"><code>currencies</code></a> and <a href="#market-structure"><code>markets</code></a>. The exchanges might put a slightly different meaning into it. If a currency is inactive, most of the time all corresponding tickers, orderbooks and other related endpoints return empty responses, all zeroes, no data or outdated information. The user should check if the currency is <code>active</code> and <a href="#market-cache-force-reload">reload markets periodically</a>.</p> <p>Note: the <code>false</code> value for the <code>active</code> property doesn't always guarantee that all of the possible features like trading, withdrawing or depositing are disabled on the exchange. Likewise, neither the <code>true</code> value guarantees that all those features are enabled on the exchange. Check the underlying exchanges' documentation and the code in CCXT for the exact meaning of the <code>active</code> flag for this or that exchange. This flag is not yet supported or implemented by all markets and may be missing.</p> <p><strong>WARNING! The information about the fee is experimental, unstable and may be partial or not available at all.</strong></p> <div class="markdown-heading"><h2 class="heading-element">Precision And Limits</h2><a id="user-content-precision-and-limits" class="anchor" aria-label="Permalink: Precision And Limits" href="#precision-and-limits"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><strong>Do not confuse <code>limits</code> with <code>precision</code>!</strong> Precision has nothing to do with min limits. A precision of 8 digits does not necessarily mean a min limit of 0.00000001. The opposite is also true: a min limit of 0.0001 does not necessarily mean a precision of 4.</p> <p>Examples:</p> <ol> <li><code>(market['limits']['amount']['min'] == 0.05) && (market['precision']['amount'] == 4)</code></li> </ol> <p>In this example the <strong>amount</strong> of any order placed on the market <strong>must satisfy both conditions</strong>:</p> <ul> <li>The <em>amount value</em> should be >= 0.05: <div class="highlight highlight-source-diff notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="+ good: 0.05, 0.051, 0.0501, 0.0502, ..., 0.0599, 0.06, 0.0601, ... - bad: 0.04, 0.049, 0.0499"><pre><span class="pl-mi1"><span class="pl-mi1">+</span> good: 0.05, 0.051, 0.0501, 0.0502, ..., 0.0599, 0.06, 0.0601, ...</span> <span class="pl-md"><span class="pl-md">-</span> bad: 0.04, 0.049, 0.0499</span></pre></div> </li> <li> <em>Precision of the amount</em> should be up to 4 decimal digits: <div class="highlight highlight-source-diff notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="+ good: 0.05, 0.051, 0.052, ..., 0.0531, ..., 0.06, ... 0.0719, ... - bad: 0.05001, 0.05000, 0.06001"><pre><span class="pl-mi1"><span class="pl-mi1">+</span> good: 0.05, 0.051, 0.052, ..., 0.0531, ..., 0.06, ... 0.0719, ...</span> <span class="pl-md"><span class="pl-md">-</span> bad: 0.05001, 0.05000, 0.06001</span></pre></div> </li> </ul> <ol start="2"> <li><code>(market['limits']['price']['min'] == 0.019) && (market['precision']['price'] == 5)</code></li> </ol> <p>In this example the <strong>price</strong> of any order placed on the market <strong>must satisfy both conditions</strong>:</p> <ul> <li>The <em>price value</em> should be >= 0.019: <div class="highlight highlight-source-diff notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="+ good: 0.019, ... 0.0191, ... 0.01911, 0.01912, ... - bad: 0.016, ..., 0.01699"><pre><span class="pl-mi1"><span class="pl-mi1">+</span> good: 0.019, ... 0.0191, ... 0.01911, 0.01912, ...</span> <span class="pl-md"><span class="pl-md">-</span> bad: 0.016, ..., 0.01699</span></pre></div> </li> <li> <em>Precision of price</em> should be 5 decimal digits or less: <div class="highlight highlight-source-diff notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="+ good: 0.02, 0.021, 0.0212, 0.02123, 0.02124, 0.02125, ... - bad: 0.017000, 0.017001, ..."><pre><span class="pl-mi1"><span class="pl-mi1">+</span> good: 0.02, 0.021, 0.0212, 0.02123, 0.02124, 0.02125, ...</span> <span class="pl-md"><span class="pl-md">-</span> bad: 0.017000, 0.017001, ...</span></pre></div> </li> </ul> <ol start="3"> <li><code>(market['limits']['amount']['min'] == 50) && (market['precision']['amount'] == -1)</code></li> </ol> <p>In this example <strong>both conditions must be satisfied</strong>:</p> <ul> <li>The <em>amount value</em> should be greater than or equal to 50: <div class="highlight highlight-source-diff notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="+ good: 50, 60, 70, 80, 90, 100, ... 2000, ... - bad: 1, 2, 3, ..., 9"><pre><span class="pl-mi1"><span class="pl-mi1">+</span> good: 50, 60, 70, 80, 90, 100, ... 2000, ...</span> <span class="pl-md"><span class="pl-md">-</span> bad: 1, 2, 3, ..., 9</span></pre></div> </li> <li>A negative <em>amount precision</em> means that the amount should be an integer multiple of 10 (to the absolute power specified): <div class="highlight highlight-source-diff notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="+ good: 50, ..., 110, ... 1230, ..., 1000000, ..., 1234560, ... - bad: 9.5, ... 10.1, ..., 11, ... 200.71, ..."><pre><span class="pl-mi1"><span class="pl-mi1">+</span> good: 50, ..., 110, ... 1230, ..., 1000000, ..., 1234560, ...</span> <span class="pl-md"><span class="pl-md">-</span> bad: 9.5, ... 10.1, ..., 11, ... 200.71, ...</span></pre></div> </li> </ul> <p><em>The <code>precision</code> and <code>limits</code> params are currently under heavy development, some of these fields may be missing here and there until the unification process is complete. This does not influence most of the orders but can be significant in extreme cases of very large or very small orders.</em></p> <div class="markdown-heading"><h3 class="heading-element">Notes On Precision And Limits</h3><a id="user-content-notes-on-precision-and-limits" class="anchor" aria-label="Permalink: Notes On Precision And Limits" href="#notes-on-precision-and-limits"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The user is required to stay within all limits and precision! The values of the order should satisfy the following conditions:</p> <ul> <li>Order <code>amount</code> >= <code>limits['amount']['min']</code> </li> <li>Order <code>amount</code> <= <code>limits['amount']['max']</code> </li> <li>Order <code>price</code> >= <code>limits['price']['min']</code> </li> <li>Order <code>price</code> <= <code>limits['price']['max']</code> </li> <li>Order <code>cost</code> (<code>amount * price</code>) >= <code>limits['cost']['min']</code> </li> <li>Order <code>cost</code> (<code>amount * price</code>) <= <code>limits['cost']['max']</code> </li> <li>Precision of <code>amount</code> must be <= <code>precision['amount']</code> </li> <li>Precision of <code>price</code> must be <= <code>precision['price']</code> </li> </ul> <p>The above values can be missing with some exchanges that don't provide info on limits from their API or don't have it implemented yet.</p> <div class="markdown-heading"><h3 class="heading-element">Methods For Formatting Decimals</h3><a id="user-content-methods-for-formatting-decimals" class="anchor" aria-label="Permalink: Methods For Formatting Decimals" href="#methods-for-formatting-decimals"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Each exchange has its own rounding, counting and padding modes.</p> <p>Supported rounding modes are:</p> <ul> <li> <code>ROUND</code> – will round the last decimal digits to precision</li> <li> <code>TRUNCATE</code>– will cut off the digits after certain precision</li> </ul> <p>The decimal precision counting mode is available in the <code>exchange.precisionMode</code> property.</p> <div class="markdown-heading"><h4 class="heading-element">Precision Mode</h4><a id="user-content-precision-mode" class="anchor" aria-label="Permalink: Precision Mode" href="#precision-mode"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Supported precision modes in <code>exchange['precisionMode']</code> are:</p> <ul> <li> <code>DECIMAL_PLACES</code> – counts all digits, 99% of exchanges use this counting mode. With this mode of precision, the numbers in <code>market_or_currency['precision']</code> designate the number of decimal digits after the dot for further rounding or truncation.</li> <li> <code>SIGNIFICANT_DIGITS</code> – counts non-zero digits only, some exchanges (<code>bitfinex</code> and maybe a few other) implement this mode of counting decimals. With this mode of precision, the numbers in <code>market_or_currency['precision']</code> designate the Nth place of the last significant (non-zero) decimal digit after the dot.</li> <li> <code>TICK_SIZE</code> – some exchanges only allow a multiple of a specific value (<code>bitmex</code> uses this mode, for example). In this mode, the numbers in <code>market_or_currency['precision']</code> designate the minimal precision fractions (floats) for rounding or truncating.</li> </ul> <div class="markdown-heading"><h4 class="heading-element">Padding Mode</h4><a id="user-content-padding-mode" class="anchor" aria-label="Permalink: Padding Mode" href="#padding-mode"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Supported padding modes are:</p> <ul> <li> <code>NO_PADDING</code> – default for most cases</li> <li> <code>PAD_WITH_ZERO</code> – appends zero characters up to precision</li> </ul> <div class="markdown-heading"><h4 class="heading-element">Formatting To Precision</h4><a id="user-content-formatting-to-precision" class="anchor" aria-label="Permalink: Formatting To Precision" href="#formatting-to-precision"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Most of the time the user does not have to take care of precision formatting, since CCXT will handle that for the user when the user places orders or sends withdrawal requests, if the user follows the rules as described on <a href="#precision-and-limits">Precision And Limits</a>. However, in some cases precision-formatting details may be important, so the following methods may be useful in the userland.</p> <p>The exchange base class contains the <code>decimalToPrecision</code> method to help format values to the required decimal precision with support for different rounding, counting and padding modes.</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-6" class="anchor" aria-label="Permalink: Javascript" href="#javascript-6"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" function decimalToPrecision (x, roundingMode, numPrecisionDigits, countingMode = DECIMAL_PLACES, paddingMode = NO_PADDING)"><pre><span class="pl-k">function</span> <span class="pl-s1">decimalToPrecision</span> <span class="pl-kos">(</span><span class="pl-s1">x</span><span class="pl-kos">,</span> <span class="pl-s1">roundingMode</span><span class="pl-kos">,</span> <span class="pl-s1">numPrecisionDigits</span><span class="pl-kos">,</span> <span class="pl-s1">countingMode</span> <span class="pl-c1">=</span> <span class="pl-c1">DECIMAL_PLACES</span><span class="pl-kos">,</span> <span class="pl-s1">paddingMode</span> <span class="pl-c1">=</span> <span class="pl-c1">NO_PADDING</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-6" class="anchor" aria-label="Permalink: Python" href="#python-6"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# WARNING! The `decimal_to_precision` method is susceptible to getcontext().prec! def decimal_to_precision(n, rounding_mode=ROUND, precision=None, counting_mode=DECIMAL_PLACES, padding_mode=NO_PADDING):"><pre><span class="pl-c"># WARNING! The `decimal_to_precision` method is susceptible to getcontext().prec!</span> <span class="pl-k">def</span> <span class="pl-en">decimal_to_precision</span>(<span class="pl-s1">n</span>, <span class="pl-s1">rounding_mode</span><span class="pl-c1">=</span><span class="pl-c1">ROUND</span>, <span class="pl-s1">precision</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">counting_mode</span><span class="pl-c1">=</span><span class="pl-c1">DECIMAL_PLACES</span>, <span class="pl-s1">padding_mode</span><span class="pl-c1">=</span><span class="pl-c1">NO_PADDING</span>):</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-6" class="anchor" aria-label="Permalink: PHP" href="#php-6"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="function decimalToPrecision ($x, $roundingMode = ROUND, $numPrecisionDigits = null, $countingMode = DECIMAL_PLACES, $paddingMode = NO_PADDING)"><pre><span class="pl-k">function</span> decimalToPrecision (<span class="pl-s1"><span class="pl-c1">$</span>x</span>, <span class="pl-s1"><span class="pl-c1">$</span>roundingMode</span> = <span class="pl-c1">ROUND</span>, <span class="pl-s1"><span class="pl-c1">$</span>numPrecisionDigits</span> = <span class="pl-c1">null</span>, <span class="pl-s1"><span class="pl-c1">$</span>countingMode</span> = <span class="pl-c1">DECIMAL_PLACES</span>, <span class="pl-s1"><span class="pl-c1">$</span>paddingMode</span> = <span class="pl-c1">NO_PADDING</span>)</pre></div> <p>For examples of how to use the <code>decimalToPrecision</code> to format strings and floats, please, see the following files:</p> <ul> <li>Typescript: <a href="https://github.com/ccxt/ccxt/blob/master/ts/src/test/base/functions/test.number.ts">https://github.com/ccxt/ccxt/blob/master/ts/src/test/base/functions/test.number.ts</a> </li> <li>JavaScript: <a href="https://github.com/ccxt/ccxt/blob/master/js/src/test/base/functions/test.number.js">https://github.com/ccxt/ccxt/blob/master/js/src/test/base/functions/test.number.js</a> </li> <li>Python: <a href="https://github.com/ccxt/ccxt/blob/master/python/ccxt/test/base/test_number.py">https://github.com/ccxt/ccxt/blob/master/python/ccxt/test/base/test_number.py</a> </li> <li>PHP: <a href="https://github.com/ccxt/ccxt/blob/master/php/test/base/test_number.php">https://github.com/ccxt/ccxt/blob/master/php/test/base/test_number.php</a> </li> </ul> <p><strong>Python WARNING! The <code>decimal_to_precision</code> method is susceptible to <code>getcontext().prec!</code></strong></p> <p>For users' convenience CCXT base exchange class also implements the following methods:</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-7" class="anchor" aria-label="Permalink: Javascript" href="#javascript-7"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="function amountToPrecision (symbol, amount) function priceToPrecision (symbol, price) function costToPrecision (symbol, cost) function currencyToPrecision (code, amount)"><pre><span class="pl-k">function</span> <span class="pl-s1">amountToPrecision</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">)</span> <span class="pl-s1">function</span> <span class="pl-s1">priceToPrecision</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">price</span><span class="pl-kos">)</span> <span class="pl-s1">function</span> <span class="pl-s1">costToPrecision</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">cost</span><span class="pl-kos">)</span> <span class="pl-s1">function</span> <span class="pl-s1">currencyToPrecision</span> <span class="pl-kos">(</span><span class="pl-s1">code</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-7" class="anchor" aria-label="Permalink: Python" href="#python-7"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="def amount_to_precision (symbol, amount): def price_to_precision (symbol, price): def cost_to_precision (symbol, cost): def currency_to_precision (code, amount):"><pre><span class="pl-k">def</span> <span class="pl-en">amount_to_precision</span> (<span class="pl-s1">symbol</span>, <span class="pl-s1">amount</span>): <span class="pl-k">def</span> <span class="pl-en">price_to_precision</span> (<span class="pl-s1">symbol</span>, <span class="pl-s1">price</span>): <span class="pl-k">def</span> <span class="pl-en">cost_to_precision</span> (<span class="pl-s1">symbol</span>, <span class="pl-s1">cost</span>): <span class="pl-k">def</span> <span class="pl-en">currency_to_precision</span> (<span class="pl-s1">code</span>, <span class="pl-s1">amount</span>):</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-7" class="anchor" aria-label="Permalink: PHP" href="#php-7"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="function amount_to_precision($symbol, $amount) function price_to_precision($symbol, $price) function cost_to_precision($symbol, $cost) function currency_to_precision($code, $amount)"><pre><span class="pl-k">function</span> amount_to_precision(<span class="pl-s1"><span class="pl-c1">$</span>symbol</span>, <span class="pl-s1"><span class="pl-c1">$</span>amount</span>) <span class="pl-k">function</span> price_to_precision(<span class="pl-s1"><span class="pl-c1">$</span>symbol</span>, <span class="pl-s1"><span class="pl-c1">$</span>price</span>) <span class="pl-k">function</span> cost_to_precision(<span class="pl-s1"><span class="pl-c1">$</span>symbol</span>, <span class="pl-s1"><span class="pl-c1">$</span>cost</span>) <span class="pl-k">function</span> currency_to_precision(<span class="pl-s1"><span class="pl-c1">$</span>code</span>, <span class="pl-s1"><span class="pl-c1">$</span>amount</span>)</pre></div> <p>Every exchange has its own precision settings, the above methods will help format those values according to exchange-specific precision rules, in a way that is portable and agnostic of the underlying exchange. In order to make that possible, markets and currencies have to be loaded prior to formatting any values.</p> <p><strong>Make sure to <a href="#loading-markets">load the markets with <code>exchange.loadMarkets()</code></a> before calling these methods!</strong></p> <p>For example:</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-8" class="anchor" aria-label="Permalink: Javascript" href="#javascript-8"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="await exchange.loadMarkets () const symbol = 'BTC/USDT' const amount = 1.2345678 // amount in base currency BTC const price = 87654.321 // price in quote currency USDT const formattedAmount = exchange.amountToPrecision (symbol, amount) const formattedPrice = exchange.priceToPrecision (symbol, price) console.log (formattedAmount, formattedPrice)"><pre><span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">loadMarkets</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-k">const</span> <span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-s">'BTC/USDT'</span> <span class="pl-k">const</span> <span class="pl-s1">amount</span> <span class="pl-c1">=</span> <span class="pl-c1">1.2345678</span> <span class="pl-c">// amount in base currency BTC</span> <span class="pl-k">const</span> <span class="pl-s1">price</span> <span class="pl-c1">=</span> <span class="pl-c1">87654.321</span> <span class="pl-c">// price in quote currency USDT</span> <span class="pl-k">const</span> <span class="pl-s1">formattedAmount</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">amountToPrecision</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">)</span> <span class="pl-k">const</span> <span class="pl-s1">formattedPrice</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">priceToPrecision</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">price</span><span class="pl-kos">)</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">formattedAmount</span><span class="pl-kos">,</span> <span class="pl-s1">formattedPrice</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-8" class="anchor" aria-label="Permalink: Python" href="#python-8"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="exchange.load_markets() symbol = 'BTC/USDT' amount = 1.2345678 # amount in base currency BTC price = 87654.321 # price in quote currency USDT formatted_amount = exchange.amount_to_precision(symbol, amount) formatted_price = exchange.price_to_precision(symbol, price) print(formatted_amount, formatted_price)"><pre><span class="pl-s1">exchange</span>.<span class="pl-c1">load_markets</span>() <span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-s">'BTC/USDT'</span> <span class="pl-s1">amount</span> <span class="pl-c1">=</span> <span class="pl-c1">1.2345678</span> <span class="pl-c"># amount in base currency BTC</span> <span class="pl-s1">price</span> <span class="pl-c1">=</span> <span class="pl-c1">87654.321</span> <span class="pl-c"># price in quote currency USDT</span> <span class="pl-s1">formatted_amount</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">amount_to_precision</span>(<span class="pl-s1">symbol</span>, <span class="pl-s1">amount</span>) <span class="pl-s1">formatted_price</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">price_to_precision</span>(<span class="pl-s1">symbol</span>, <span class="pl-s1">price</span>) <span class="pl-en">print</span>(<span class="pl-s1">formatted_amount</span>, <span class="pl-s1">formatted_price</span>)</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-8" class="anchor" aria-label="Permalink: PHP" href="#php-8"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$exchange->load_markets(); $symbol = 'BTC/USDT'; $amount = 1.2345678; // amount in base currency BTC $price = 87654.321; // price in quote currency USDT $formatted_amount = $exchange->amount_to_precision($symbol, $amount); $formatted_price = $exchange->price_to_precision($symbol, $price); echo $formatted_amount, " ", $formatted_price, "\n";"><pre><span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">load_markets</span>(); <span class="pl-s1"><span class="pl-c1">$</span>symbol</span> = <span class="pl-s">'<span class="pl-s">BTC/USDT</span>'</span>; <span class="pl-s1"><span class="pl-c1">$</span>amount</span> = <span class="pl-c1">1.2345678</span>; <span class="pl-c">// amount in base currency BTC</span> <span class="pl-s1"><span class="pl-c1">$</span>price</span> = <span class="pl-c1">87654.321</span>; <span class="pl-c">// price in quote currency USDT</span> <span class="pl-s1"><span class="pl-c1">$</span>formatted_amount</span> = <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">amount_to_precision</span>(<span class="pl-s1"><span class="pl-c1">$</span>symbol</span>, <span class="pl-s1"><span class="pl-c1">$</span>amount</span>); <span class="pl-s1"><span class="pl-c1">$</span>formatted_price</span> = <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">price_to_precision</span>(<span class="pl-s1"><span class="pl-c1">$</span>symbol</span>, <span class="pl-s1"><span class="pl-c1">$</span>price</span>); <span class="pl-k">echo</span> <span class="pl-s1"><span class="pl-c1">$</span>formatted_amount</span>, <span class="pl-s">"<span class="pl-s"> </span>"</span>, <span class="pl-s1"><span class="pl-c1">$</span>formatted_price</span>, <span class="pl-s">"\n"</span>;</pre></div> <p>More practical examples that describe the behavior of <code>exchange.precisionMode</code>:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// case A exchange.precisionMode = ccxt.DECIMAL_PLACES market = exchange.market (symbol) market['precision']['amount'] === 8 // up to 8 decimals after the dot exchange.amountToPrecision (symbol, 0.123456789) === 0.12345678 exchange.amountToPrecision (symbol, 0.0000000000123456789) === 0.0000000 === 0.0"><pre><span class="pl-c">// case A</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">precisionMode</span> <span class="pl-c1">=</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">DECIMAL_PLACES</span> <span class="pl-s1">market</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">market</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">)</span> <span class="pl-s1">market</span><span class="pl-kos">[</span><span class="pl-s">'precision'</span><span class="pl-kos">]</span><span class="pl-kos">[</span><span class="pl-s">'amount'</span><span class="pl-kos">]</span> <span class="pl-c1">===</span> <span class="pl-c1">8</span> <span class="pl-c">// up to 8 decimals after the dot</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">amountToPrecision</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-c1">0.123456789</span><span class="pl-kos">)</span> <span class="pl-c1">===</span> <span class="pl-c1">0.12345678</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">amountToPrecision</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-c1">0.0000000000123456789</span><span class="pl-kos">)</span> <span class="pl-c1">===</span> <span class="pl-c1">0.0000000</span> <span class="pl-c1">===</span> <span class="pl-c1">0.0</span></pre></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// case B exchange.precisionMode = ccxt.TICK_SIZE market = exchange.market (symbol) market['precision']['amount'] === 0.00000001 // up to 0.00000001 precision exchange.amountToPrecision (symbol, 0.123456789) === 0.12345678 exchange.amountToPrecision (symbol, 0.0000000000123456789) === 0.00000000 === 0.0"><pre><span class="pl-c">// case B</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">precisionMode</span> <span class="pl-c1">=</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">TICK_SIZE</span> <span class="pl-s1">market</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">market</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">)</span> <span class="pl-s1">market</span><span class="pl-kos">[</span><span class="pl-s">'precision'</span><span class="pl-kos">]</span><span class="pl-kos">[</span><span class="pl-s">'amount'</span><span class="pl-kos">]</span> <span class="pl-c1">===</span> <span class="pl-c1">0.00000001</span> <span class="pl-c">// up to 0.00000001 precision</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">amountToPrecision</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-c1">0.123456789</span><span class="pl-kos">)</span> <span class="pl-c1">===</span> <span class="pl-c1">0.12345678</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">amountToPrecision</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-c1">0.0000000000123456789</span><span class="pl-kos">)</span> <span class="pl-c1">===</span> <span class="pl-c1">0.00000000</span> <span class="pl-c1">===</span> <span class="pl-c1">0.0</span></pre></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// case C exchange.precisionMode = ccxt.SIGNIFICANT_DIGITS market = exchange.market (symbol) market['precision']['amount'] === 8 // up to 8 significant non-zero digits exchange.amountToPrecision (symbol, 0.0000000000123456789) === 0.000000000012345678 exchange.amountToPrecision (symbol, 123.4567890123456789) === 123.45678"><pre><span class="pl-c">// case C</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">precisionMode</span> <span class="pl-c1">=</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">SIGNIFICANT_DIGITS</span> <span class="pl-s1">market</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">market</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">)</span> <span class="pl-s1">market</span><span class="pl-kos">[</span><span class="pl-s">'precision'</span><span class="pl-kos">]</span><span class="pl-kos">[</span><span class="pl-s">'amount'</span><span class="pl-kos">]</span> <span class="pl-c1">===</span> <span class="pl-c1">8</span> <span class="pl-c">// up to 8 significant non-zero digits</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">amountToPrecision</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-c1">0.0000000000123456789</span><span class="pl-kos">)</span> <span class="pl-c1">===</span> <span class="pl-c1">0.000000000012345678</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">amountToPrecision</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-c1">123.4567890123456789</span><span class="pl-kos">)</span> <span class="pl-c1">===</span> <span class="pl-c1">123.45678</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Loading Markets</h2><a id="user-content-loading-markets" class="anchor" aria-label="Permalink: Loading Markets" href="#loading-markets"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>In most cases you are required to load the list of markets and trading symbols for a particular exchange prior to accessing other API methods. If you forget to load markets the ccxt library will do that automatically upon your first call to the unified API. It will send two HTTP requests, first for markets and then the second one for other data, sequentially. For that reason, your first call to a unified CCXT API method like fetchTicker, fetchBalance, etc will take more time, than the consequent calls, since it has to do more work loading the market information from the exchange API. See <a href="#notes-on-rate-limiter">Notes On Rate Limiter</a> for more details.</p> <p>In order to load markets manually beforehand call the <code>loadMarkets ()</code> / <code>load_markets ()</code> method on an exchange instance. It returns an associative array of markets indexed by trading symbol. If you want more control over the execution of your logic, preloading markets by hand is recommended.</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-9" class="anchor" aria-label="Permalink: Javascript" href="#javascript-9"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(async () => { let kraken = new ccxt.kraken () let markets = await kraken.loadMarkets () console.log (kraken.id, markets) }) ()"><pre><span class="pl-kos">(</span><span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span> <span class="pl-k">let</span> <span class="pl-s1">kraken</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">kraken</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-k">let</span> <span class="pl-s1">markets</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">kraken</span><span class="pl-kos">.</span><span class="pl-en">loadMarkets</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">kraken</span><span class="pl-kos">.</span><span class="pl-c1">id</span><span class="pl-kos">,</span> <span class="pl-s1">markets</span><span class="pl-kos">)</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">(</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-9" class="anchor" aria-label="Permalink: Python" href="#python-9"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="okcoin = ccxt.okcoin() markets = okcoin.load_markets() print(okcoin.id, markets)"><pre><span class="pl-s1">okcoin</span> <span class="pl-c1">=</span> <span class="pl-s1">ccxt</span>.<span class="pl-c1">okcoin</span>() <span class="pl-s1">markets</span> <span class="pl-c1">=</span> <span class="pl-s1">okcoin</span>.<span class="pl-c1">load_markets</span>() <span class="pl-en">print</span>(<span class="pl-s1">okcoin</span>.<span class="pl-c1">id</span>, <span class="pl-s1">markets</span>)</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-9" class="anchor" aria-label="Permalink: PHP" href="#php-9"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$id = 'huobipro'; $exchange = '\\ccxt\\' . $id; $huobipro = new $exchange(); $markets = $huobipro->load_markets(); var_dump($huobipro->id, $markets);"><pre><span class="pl-s1"><span class="pl-c1">$</span>id</span> = <span class="pl-s">'<span class="pl-s">huobipro</span>'</span>; <span class="pl-s1"><span class="pl-c1">$</span>exchange</span> = <span class="pl-s">'\\<span class="pl-s">ccxt</span>\\'</span> . <span class="pl-s1"><span class="pl-c1">$</span>id</span>; <span class="pl-s1"><span class="pl-c1">$</span>huobipro</span> = <span class="pl-k">new</span> <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>(); <span class="pl-s1"><span class="pl-c1">$</span>markets</span> = <span class="pl-s1"><span class="pl-c1">$</span>huobipro</span>-><span class="pl-en">load_markets</span>(); <span class="pl-en">var_dump</span>(<span class="pl-s1"><span class="pl-c1">$</span>huobipro</span>-><span class="pl-c1">id</span>, <span class="pl-s1"><span class="pl-c1">$</span>markets</span>);</pre></div> <p>Apart from the market info, the <code>loadMarkets()</code> call will also load the currencies from the exchange and will cache the info in the <code>.markets</code> and the <code>.currencies</code> properties respectively.</p> <p>The user can also bypass the cache and call unified methods for fetching that information from the exchange endpoints directly, <code>fetchMarkets()</code> and <code>fetchCurrencies()</code>, though using these methods is not recommended for end-users. The recommended way to preload markets is by calling the <code>loadMarkets()</code> unified method. However, new exchange integrations are required to implement these methods if the underlying exchange has the corresponding API endpoints.</p> <div class="markdown-heading"><h2 class="heading-element">Symbols And Market Ids</h2><a id="user-content-symbols-and-market-ids" class="anchor" aria-label="Permalink: Symbols And Market Ids" href="#symbols-and-market-ids"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>A currency code is a code of three to five letters, like <code>BTC</code>, <code>ETH</code>, <code>USD</code>, <code>GBP</code>, <code>CNY</code>, <code>JPY</code>, <code>DOGE</code>, <code>RUB</code>, <code>ZEC</code>, <code>XRP</code>, <code>XMR</code>, etc. Some exchanges have exotic currencies with longer codes.</p> <p>A symbol is usually an uppercase string literal name of a pair of traded currencies with a slash in between. The first currency before the slash is usually called <em>base currency</em>, and the one after the slash is called <em>quote currency</em>. Examples of a symbol are: <code>BTC/USD</code>, <code>DOGE/LTC</code>, <code>ETH/EUR</code>, <code>DASH/XRP</code>, <code>BTC/CNY</code>, <code>ZEC/XMR</code>, <code>ETH/JPY</code>.</p> <p>Market ids are used during the REST request-response process to reference trading pairs within exchanges. The set of market ids is unique per exchange and cannot be used across exchanges. For example, the BTC/USD pair/market may have different ids on various popular exchanges, like <code>btcusd</code>, <code>BTCUSD</code>, <code>XBTUSD</code>, <code>btc/usd</code>, <code>42</code> (numeric id), <code>BTC/USD</code>, <code>Btc/Usd</code>, <code>tBTCUSD</code>, <code>XXBTZUSD</code>. You don't need to remember or use market ids, they are there for internal HTTP request-response purposes inside exchange implementations.</p> <p>The ccxt library abstracts uncommon market ids to symbols, standardized to a common format. Symbols aren't the same as market ids. Every market is referenced by a corresponding symbol. Symbols are common across exchanges which makes them suitable for arbitrage and many other things.</p> <p>Sometimes the user might notice a symbol like <code>'XBTM18'</code> or <code>'.XRPUSDM20180101'</code> or some other <em>"exotic/rare symbols"</em>. The symbol is <strong>not required</strong> to have a slash or to be a pair of currencies. The string in the symbol really depends on the type of the market (whether it is a spot market or a futures market, a darkpool market or an expired market, etc). Attempting to parse the symbol string is highly discouraged, one should not rely on the symbol format, it is recommended to use market properties instead.</p> <p>Market structures are indexed by symbols and ids. The base exchange class also has builtin methods for accessing markets by symbols. Most API methods require a symbol to be passed in their first argument. You are often required to specify a symbol when querying current prices, making orders, etc.</p> <p>Most of the time users will be working with market symbols. You will get a standard userland exception if you access non-existent keys in these dicts.</p> <div class="markdown-heading"><h3 class="heading-element">Methods For Markets And Currencies</h3><a id="user-content-methods-for-markets-and-currencies" class="anchor" aria-label="Permalink: Methods For Markets And Currencies" href="#methods-for-markets-and-currencies"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-10" class="anchor" aria-label="Permalink: Javascript" href="#javascript-10"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(async () => { console.log (await exchange.loadMarkets ()) let btcusd1 = exchange.markets['BTC/USD'] // get market structure by symbol let btcusd2 = exchange.market ('BTC/USD') // same result in a slightly different way let btcusdId = exchange.marketId ('BTC/USD') // get market id by symbol let symbols = exchange.symbols // get an array of symbols let symbols2 = Object.keys (exchange.markets) // same as previous line console.log (exchange.id, symbols) // print all symbols let currencies = exchange.currencies // a dictionary of currencies let bitfinex = new ccxt.bitfinex () await bitfinex.loadMarkets () bitfinex.markets['BTC/USD'] // symbol → market (get market by symbol) bitfinex.markets_by_id['XRPBTC'][0] // id → market (get market by id) bitfinex.markets['BTC/USD']['id'] // symbol → id (get id by symbol) bitfinex.markets_by_id['XRPBTC'][0]['symbol'] // id → symbol (get symbol by id) }) ()"><pre><span class="pl-kos">(</span><span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">loadMarkets</span> <span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-k">let</span> <span class="pl-s1">btcusd1</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">markets</span><span class="pl-kos">[</span><span class="pl-s">'BTC/USD'</span><span class="pl-kos">]</span> <span class="pl-c">// get market structure by symbol</span> <span class="pl-k">let</span> <span class="pl-s1">btcusd2</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">market</span> <span class="pl-kos">(</span><span class="pl-s">'BTC/USD'</span><span class="pl-kos">)</span> <span class="pl-c">// same result in a slightly different way</span> <span class="pl-k">let</span> <span class="pl-s1">btcusdId</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">marketId</span> <span class="pl-kos">(</span><span class="pl-s">'BTC/USD'</span><span class="pl-kos">)</span> <span class="pl-c">// get market id by symbol</span> <span class="pl-k">let</span> <span class="pl-s1">symbols</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">symbols</span> <span class="pl-c">// get an array of symbols</span> <span class="pl-k">let</span> <span class="pl-s1">symbols2</span> <span class="pl-c1">=</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">keys</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">markets</span><span class="pl-kos">)</span> <span class="pl-c">// same as previous line</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">id</span><span class="pl-kos">,</span> <span class="pl-s1">symbols</span><span class="pl-kos">)</span> <span class="pl-c">// print all symbols</span> <span class="pl-k">let</span> <span class="pl-s1">currencies</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">currencies</span> <span class="pl-c">// a dictionary of currencies</span> <span class="pl-k">let</span> <span class="pl-s1">bitfinex</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">bitfinex</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-k">await</span> <span class="pl-s1">bitfinex</span><span class="pl-kos">.</span><span class="pl-en">loadMarkets</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-s1">bitfinex</span><span class="pl-kos">.</span><span class="pl-c1">markets</span><span class="pl-kos">[</span><span class="pl-s">'BTC/USD'</span><span class="pl-kos">]</span> <span class="pl-c">// symbol → market (get market by symbol)</span> <span class="pl-s1">bitfinex</span><span class="pl-kos">.</span><span class="pl-c1">markets_by_id</span><span class="pl-kos">[</span><span class="pl-s">'XRPBTC'</span><span class="pl-kos">]</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span> <span class="pl-c">// id → market (get market by id)</span> <span class="pl-s1">bitfinex</span><span class="pl-kos">.</span><span class="pl-c1">markets</span><span class="pl-kos">[</span><span class="pl-s">'BTC/USD'</span><span class="pl-kos">]</span><span class="pl-kos">[</span><span class="pl-s">'id'</span><span class="pl-kos">]</span> <span class="pl-c">// symbol → id (get id by symbol)</span> <span class="pl-s1">bitfinex</span><span class="pl-kos">.</span><span class="pl-c1">markets_by_id</span><span class="pl-kos">[</span><span class="pl-s">'XRPBTC'</span><span class="pl-kos">]</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span><span class="pl-kos">[</span><span class="pl-s">'symbol'</span><span class="pl-kos">]</span> <span class="pl-c">// id → symbol (get symbol by id)</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">(</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-10" class="anchor" aria-label="Permalink: Python" href="#python-10"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="print(exchange.load_markets()) etheur1 = exchange.markets['ETH/EUR'] # get market structure by symbol etheur2 = exchange.market('ETH/EUR') # same result in a slightly different way etheurId = exchange.market_id('ETH/EUR') # get market id by symbol symbols = exchange.symbols # get a list of symbols symbols2 = list(exchange.markets.keys()) # same as previous line print(exchange.id, symbols) # print all symbols currencies = exchange.currencies # a dictionary of currencies kraken = ccxt.kraken() kraken.load_markets() kraken.markets['BTC/USD'] # symbol → market (get market by symbol) kraken.markets_by_id['XXRPZUSD'][0] # id → market (get market by id) kraken.markets['BTC/USD']['id'] # symbol → id (get id by symbol) kraken.markets_by_id['XXRPZUSD'][0]['symbol'] # id → symbol (get symbol by id)"><pre><span class="pl-en">print</span>(<span class="pl-s1">exchange</span>.<span class="pl-c1">load_markets</span>()) <span class="pl-s1">etheur1</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">markets</span>[<span class="pl-s">'ETH/EUR'</span>] <span class="pl-c"># get market structure by symbol</span> <span class="pl-s1">etheur2</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">market</span>(<span class="pl-s">'ETH/EUR'</span>) <span class="pl-c"># same result in a slightly different way</span> <span class="pl-s1">etheurId</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">market_id</span>(<span class="pl-s">'ETH/EUR'</span>) <span class="pl-c"># get market id by symbol</span> <span class="pl-s1">symbols</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">symbols</span> <span class="pl-c"># get a list of symbols</span> <span class="pl-s1">symbols2</span> <span class="pl-c1">=</span> <span class="pl-en">list</span>(<span class="pl-s1">exchange</span>.<span class="pl-c1">markets</span>.<span class="pl-c1">keys</span>()) <span class="pl-c"># same as previous line</span> <span class="pl-en">print</span>(<span class="pl-s1">exchange</span>.<span class="pl-c1">id</span>, <span class="pl-s1">symbols</span>) <span class="pl-c"># print all symbols</span> <span class="pl-s1">currencies</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">currencies</span> <span class="pl-c"># a dictionary of currencies</span> <span class="pl-s1">kraken</span> <span class="pl-c1">=</span> <span class="pl-s1">ccxt</span>.<span class="pl-c1">kraken</span>() <span class="pl-s1">kraken</span>.<span class="pl-c1">load_markets</span>() <span class="pl-s1">kraken</span>.<span class="pl-c1">markets</span>[<span class="pl-s">'BTC/USD'</span>] <span class="pl-c"># symbol → market (get market by symbol)</span> <span class="pl-s1">kraken</span>.<span class="pl-c1">markets_by_id</span>[<span class="pl-s">'XXRPZUSD'</span>][<span class="pl-c1">0</span>] <span class="pl-c"># id → market (get market by id)</span> <span class="pl-s1">kraken</span>.<span class="pl-c1">markets</span>[<span class="pl-s">'BTC/USD'</span>][<span class="pl-s">'id'</span>] <span class="pl-c"># symbol → id (get id by symbol)</span> <span class="pl-s1">kraken</span>.<span class="pl-c1">markets_by_id</span>[<span class="pl-s">'XXRPZUSD'</span>][<span class="pl-c1">0</span>][<span class="pl-s">'symbol'</span>] <span class="pl-c"># id → symbol (get symbol by id)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-10" class="anchor" aria-label="Permalink: PHP" href="#php-10"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$var_dump($exchange->load_markets()); $dashcny1 = $exchange->markets['DASH/CNY']; // get market structure by symbol $dashcny2 = $exchange->market('DASH/CNY'); // same result in a slightly different way $dashcnyId = $exchange->market_id('DASH/CNY'); // get market id by symbol $symbols = $exchange->symbols; // get an array of symbols $symbols2 = array_keys($exchange->markets); // same as previous line var_dump($exchange->id, $symbols); // print all symbols $currencies = $exchange->currencies; // an associative array of currencies $okcoin = '\\ccxt\\okcoin'; $okcoin = new $okcoin(); $okcoin->load_markets(); $okcoin->markets['BTC/USD']; // symbol → market (get market by symbol) $okcoin->markets_by_id['btc_usd'][0]; // id → market (get market by id) $okcoin->markets['BTC/USD']['id']; // symbol → id (get id by symbol) $okcoin->markets_by_id['btc_usd'][0]['symbol']; // id → symbol (get symbol by id)"><pre><span class="pl-s1"><span class="pl-c1">$</span>var_dump</span>(<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">load_markets</span>()); <span class="pl-s1"><span class="pl-c1">$</span>dashcny1</span> = <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">markets</span>[<span class="pl-s">'<span class="pl-s">DASH/CNY</span>'</span>]; <span class="pl-c">// get market structure by symbol</span> <span class="pl-s1"><span class="pl-c1">$</span>dashcny2</span> = <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">market</span>(<span class="pl-s">'<span class="pl-s">DASH/CNY</span>'</span>); <span class="pl-c">// same result in a slightly different way</span> <span class="pl-s1"><span class="pl-c1">$</span>dashcnyId</span> = <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">market_id</span>(<span class="pl-s">'<span class="pl-s">DASH/CNY</span>'</span>); <span class="pl-c">// get market id by symbol</span> <span class="pl-s1"><span class="pl-c1">$</span>symbols</span> = <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">symbols</span>; <span class="pl-c">// get an array of symbols</span> <span class="pl-s1"><span class="pl-c1">$</span>symbols2</span> = <span class="pl-en">array_keys</span>(<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">markets</span>); <span class="pl-c">// same as previous line</span> <span class="pl-en">var_dump</span>(<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">id</span>, <span class="pl-s1"><span class="pl-c1">$</span>symbols</span>); <span class="pl-c">// print all symbols</span> <span class="pl-s1"><span class="pl-c1">$</span>currencies</span> = <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">currencies</span>; <span class="pl-c">// an associative array of currencies</span> <span class="pl-s1"><span class="pl-c1">$</span>okcoin</span> = <span class="pl-s">'\\<span class="pl-s">ccxt</span>\\<span class="pl-s">okcoin</span>'</span>; <span class="pl-s1"><span class="pl-c1">$</span>okcoin</span> = <span class="pl-k">new</span> <span class="pl-s1"><span class="pl-c1">$</span>okcoin</span>(); <span class="pl-s1"><span class="pl-c1">$</span>okcoin</span>-><span class="pl-en">load_markets</span>(); <span class="pl-s1"><span class="pl-c1">$</span>okcoin</span>-><span class="pl-c1">markets</span>[<span class="pl-s">'<span class="pl-s">BTC/USD</span>'</span>]; <span class="pl-c">// symbol → market (get market by symbol)</span> <span class="pl-s1"><span class="pl-c1">$</span>okcoin</span>-><span class="pl-c1">markets_by_id</span>[<span class="pl-s">'<span class="pl-s">btc_usd</span>'</span>][<span class="pl-c1">0</span>]; <span class="pl-c">// id → market (get market by id)</span> <span class="pl-s1"><span class="pl-c1">$</span>okcoin</span>-><span class="pl-c1">markets</span>[<span class="pl-s">'<span class="pl-s">BTC/USD</span>'</span>][<span class="pl-s">'<span class="pl-s">id</span>'</span>]; <span class="pl-c">// symbol → id (get id by symbol)</span> <span class="pl-s1"><span class="pl-c1">$</span>okcoin</span>-><span class="pl-c1">markets_by_id</span>[<span class="pl-s">'<span class="pl-s">btc_usd</span>'</span>][<span class="pl-c1">0</span>][<span class="pl-s">'<span class="pl-s">symbol</span>'</span>]; <span class="pl-c">// id → symbol (get symbol by id)</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Naming Consistency</h3><a id="user-content-naming-consistency" class="anchor" aria-label="Permalink: Naming Consistency" href="#naming-consistency"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>There is a bit of term ambiguity across various exchanges that may cause confusion among newcoming traders. Some exchanges call markets as <em>pairs</em>, whereas other exchanges call symbols as <em>products</em>. In terms of the ccxt library, each exchange contains one or more trading markets. Each market has an id and a symbol. Most symbols are pairs of base currency and quote currency.</p> <p><code>Exchanges → Markets → Symbols → Currencies</code></p> <p>Historically various symbolic names have been used to designate same trading pairs. Some cryptocurrencies (like Dash) even changed their names more than once during their ongoing lifetime. For consistency across exchanges the ccxt library will perform the following known substitutions for symbols and currencies:</p> <ul> <li> <code>XBT → BTC</code>: <code>XBT</code> is newer but <code>BTC</code> is more common among exchanges and sounds more like bitcoin (<a href="https://www.google.ru/search?q=xbt+vs+btc" rel="nofollow">read more</a>).</li> <li> <code>BCC → BCH</code>: The Bitcoin Cash fork is often called with two different symbolic names: <code>BCC</code> and <code>BCH</code>. The name <code>BCC</code> is ambiguous for Bitcoin Cash, it is confused with BitConnect. The ccxt library will convert <code>BCC</code> to <code>BCH</code> where it is appropriate (some exchanges and aggregators confuse them).</li> <li> <code>DRK → DASH</code>: <code>DASH</code> was Darkcoin then became Dash (<a href="https://minergate.com/blog/dashcoin-and-dash/" rel="nofollow">read more</a>).</li> <li> <code>BCHABC → BCH</code>: On November 15 2018 Bitcoin Cash forked the second time, so, now there is <code>BCH</code> (for BCH ABC) and <code>BSV</code> (for BCH SV).</li> <li> <code>BCHSV → BSV</code>: This is a common substitution mapping for the Bitcoin Cash SV fork (some exchanges call it <code>BSV</code>, others call it <code>BCHSV</code>, we use the former).</li> <li> <code>DSH → DASH</code>: Try not to confuse symbols and currencies. The <code>DSH</code> (Dashcoin) is not the same as <code>DASH</code> (Dash). Some exchanges have <code>DASH</code> labelled inconsistently as <code>DSH</code>, the ccxt library does a correction for that as well (<code>DSH → DASH</code>), but only on certain exchanges that have these two currencies confused, whereas most exchanges have them both correct. Just remember that <code>DASH/BTC</code> is not the same as <code>DSH/BTC</code>.</li> <li> <code>XRB</code> → <code>NANO</code>: <code>NANO</code> is the newer code for RaiBlocks, thus, CCXT unified API uses will replace the older <code>XRB</code> with <code>NANO</code> where needed. <a href="https://hackernoon.com/nano-rebrand-announcement-9101528a7b76" rel="nofollow">https://hackernoon.com/nano-rebrand-announcement-9101528a7b76</a> </li> <li> <code>USD</code> → <code>USDT</code>: Some exchanges, like Bitfinex, HitBTC and a few other name the currency as <code>USD</code> in their listings, but those markets are actually trading <code>USDT</code>. The confusion can come from a 3-letter limitation on symbol names or may be due to other reasons. In cases where the traded currency is actually <code>USDT</code> and is not <code>USD</code> – the CCXT library will perform <code>USD</code> → <code>USDT</code> conversion. Note, however, that some exchanges have both <code>USD</code> and <code>USDT</code> symbols, for example, Kraken has a <code>USDT/USD</code> trading pair.</li> </ul> <div class="markdown-heading"><h4 class="heading-element">Notes On Naming Consistency</h4><a id="user-content-notes-on-naming-consistency" class="anchor" aria-label="Permalink: Notes On Naming Consistency" href="#notes-on-naming-consistency"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Each exchange has an associative array of substitutions for cryptocurrency symbolic codes in the <code>exchange.commonCurrencies</code> property, like:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="'commonCurrencies' : { 'XBT': 'BTC', 'OPTIMISM': 'OP', // ... etc }"><pre class="notranslate"><code>'commonCurrencies' : { 'XBT': 'BTC', 'OPTIMISM': 'OP', // ... etc } </code></pre></div> <p>where key represents actual name how exchange engine refers to that coin, and the value represents what you want to refer to it with through ccxt.</p> <p>Sometimes the user may notice exotic symbol names with mixed-case words and spaces in the code. The logic behind having these names is explained by the rules for resolving conflicts in naming and currency-coding when one or more currencies have the same symbolic code with different exchanges:</p> <ul> <li>First, we gather all info available from the exchanges themselves about the currency codes in question. They usually have a description of their coin listings somewhere in their API or their docs, knowledgebases or elsewhere on their websites.</li> <li>When we identify each particular cryptocurrency standing behind the currency code, we look them up on <a href="https://coinmarketcap.com" rel="nofollow">CoinMarketCap</a>.</li> <li>The currency that has the greatest market capitalization of all wins the currency code and keeps it. For example, HOT often stand for either <code>Holo</code> or <code>Hydro Protocol</code>. In this case <code>Holo</code> retains the code <code>HOT</code>, and <code>Hydro Protocol</code> will have its name as its code, literally, <code>Hydro Protocol</code>. So, there may be trading pairs with symbols like <code>HOT/USD</code> (for <code>Holo</code>) and <code>Hydro Protocol/USD</code> – those are two different markets.</li> <li>If market cap of a particular coin is unknown or is not enough to determine the winner, we also take trading volumes and other factors into consideration.</li> <li>When the winner is determined all other competing currencies get their code names properly remapped and substituted within conflicting exchanges via <code>.commonCurrencies</code>. <strong>Note, it should be defined before '.loadMarkets()' happens!</strong> </li> <li>Unfortunately this is a work in progress, because new currencies get listed daily and new exchanges are added from time to time, so, in general this is a never-ending process of self-correction in a quickly changing environment, practically, in <em>"live mode"</em>. We are thankful for all reported conflicts and mismatches you may find.</li> </ul> <div class="markdown-heading"><h4 class="heading-element">Questions On Naming Consistency</h4><a id="user-content-questions-on-naming-consistency" class="anchor" aria-label="Permalink: Questions On Naming Consistency" href="#questions-on-naming-consistency"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>Is it possible for symbols to change?</em></p> <p>In short, yes, sometimes, but rarely. Symbolic mappings can be changed if that is absolutely required and cannot be avoided. However, all previous symbolic changes were related to resolving conflicts or forks. So far, there was no precedent of a market cap of one coin overtaking another coin with the same symbolic code in CCXT.</p> <p><em>Can we rely on always listing the same crypto with the same symbol?</em></p> <p>More or less ) First, this library is a work in progress, and it is trying to adapt to the everchanging reality, so there may be conflicts that we will fix by changing some mappings in the future. Ultimately, the license says "no warranties, use at your own risk". However, we don't change symbolic mappings randomly all over the place, because we understand the consequences and we'd want to rely on the library as well and we don't like to break the backward-compatibility at all.</p> <p>If it so happens that a symbol of a major token is forked or has to be changed, then the control is still in the users' hands. The <code>exchange.commonCurrencies</code> property can be <a href="#overriding-exchange-properties-upon-instantiation">overrided upon initialization or later</a>, just like any other exchange property. If a significant token is involved, we usually post instructions on how to retain the old behavior by adding a couple of lines to the constructor params.</p> <div class="markdown-heading"><h4 class="heading-element">Consistency Of Base And Quote Currencies</h4><a id="user-content-consistency-of-base-and-quote-currencies" class="anchor" aria-label="Permalink: Consistency Of Base And Quote Currencies" href="#consistency-of-base-and-quote-currencies"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>It depends on which exchange you are using, but some of them have a reversed (inconsistent) pairing of <code>base</code> and <code>quote</code>. They actually have base and quote misplaced (switched/reversed sides). In that case you'll see a difference of parsed <code>base</code> and <code>quote</code> currency values with the unparsed <code>info</code> in the market substructure.</p> <p>For those exchanges the ccxt will do a correction, switching and normalizing sides of base and quote currencies when parsing exchange replies. This logic is financially and terminologically correct. If you want less confusion, remember the following rule: <strong>base is always before the slash, quote is always after the slash in any symbol and with any market</strong>.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="base currency ↓ BTC / USDT ETH / BTC DASH / ETH ↑ quote currency"><pre lang="text" class="notranslate"><code>base currency ↓ BTC / USDT ETH / BTC DASH / ETH ↑ quote currency </code></pre></div> <div class="markdown-heading"><h4 class="heading-element">Contract Naming Conventions</h4><a id="user-content-contract-naming-conventions" class="anchor" aria-label="Permalink: Contract Naming Conventions" href="#contract-naming-conventions"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>We currently load spot markets with the unified <code>BASE/QUOTE</code> symbol schema into the <code>.markets</code> mapping, indexed by symbol. This would cause a naming conflict for futures and other derivatives that have the same symbol as their spot market counterparts. To accomodate both types of markets in the <code>.markets</code> we require the symbols between 'future' and 'spot' markets to be distinct, as well as the symbols between 'linear' and 'inverse' contracts to be distinct.</p> <p><strong>Please, check this announcement: <a href="https://github.com/ccxt/ccxt/issues/10931">Unified contract naming conventions</a></strong></p> <p>CCXT supports the following types of derivative contracts:</p> <ul> <li> <code>future</code> – for expiring futures contracts that have a delivery/settlement date <a href="https://en.wikipedia.org/wiki/Futures_contract" rel="nofollow"></a> </li> <li> <code>swap</code> – for perpetual swap futures that don't have a delivery date <a href="https://en.wikipedia.org/wiki/Perpetual_futures" rel="nofollow"></a> </li> <li> <code>option</code> – for option contracts (<a href="https://en.wikipedia.org/wiki/Option_contract" rel="nofollow">https://en.wikipedia.org/wiki/Option_contract</a>)</li> </ul> <div class="markdown-heading"><h5 class="heading-element">Future</h5><a id="user-content-future" class="anchor" aria-label="Permalink: Future" href="#future"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>A future market symbol consists of the underlying currency, the quoting currency, the settlement currency and an arbitrary identifier. Most often the identifier is the settlement date of the future contract in <code>YYMMDD</code> format:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// // base asset or currency // ↓ // ↓ quote asset or currency // ↓ ↓ // ↓ ↓ settlement asset or currency // ↓ ↓ ↓ // ↓ ↓ ↓ identifier (settlement date) // ↓ ↓ ↓ ↓ // ↓ ↓ ↓ ↓ 'BTC/USDT:BTC-211225' // BTC/USDT futures contract settled in BTC (inverse) on 2021-12-25 'BTC/USDT:USDT-211225' // BTC/USDT futures contract settled in USDT (linear, vanilla) on 2021-12-25 'ETH/USDT:ETH-210625' // ETH/USDT futures contract settled in ETH (inverse) on 2021-06-25 'ETH/USDT:USDT-210625' // ETH/USDT futures contract settled in USDT (linear, vanilla) on 2021-06-25"><pre><span class="pl-c">//</span> <span class="pl-c">// base asset or currency</span> <span class="pl-c">// ↓</span> <span class="pl-c">// ↓ quote asset or currency</span> <span class="pl-c">// ↓ ↓</span> <span class="pl-c">// ↓ ↓ settlement asset or currency</span> <span class="pl-c">// ↓ ↓ ↓</span> <span class="pl-c">// ↓ ↓ ↓ identifier (settlement date)</span> <span class="pl-c">// ↓ ↓ ↓ ↓</span> <span class="pl-c">// ↓ ↓ ↓ ↓</span> <span class="pl-s">'BTC/USDT:BTC-211225'</span> <span class="pl-c">// BTC/USDT futures contract settled in BTC (inverse) on 2021-12-25</span> <span class="pl-s">'BTC/USDT:USDT-211225'</span> <span class="pl-c">// BTC/USDT futures contract settled in USDT (linear, vanilla) on 2021-12-25</span> <span class="pl-s">'ETH/USDT:ETH-210625'</span> <span class="pl-c">// ETH/USDT futures contract settled in ETH (inverse) on 2021-06-25</span> <span class="pl-s">'ETH/USDT:USDT-210625'</span> <span class="pl-c">// ETH/USDT futures contract settled in USDT (linear, vanilla) on 2021-06-25</span></pre></div> <div class="markdown-heading"><h5 class="heading-element">Perpetual Swap (Perpetual Future)</h5><a id="user-content-perpetual-swap-perpetual-future" class="anchor" aria-label="Permalink: Perpetual Swap (Perpetual Future)" href="#perpetual-swap-perpetual-future"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// base asset or currency // ↓ // ↓ quote asset or currency // ↓ ↓ // ↓ ↓ settlement asset or currency // ↓ ↓ ↓ // ↓ ↓ ↓ 'BTC/USDT:BTC' // BTC/USDT inverse perpetual swap contract funded in BTC 'BTC/USDT:USDT' // BTC/USDT linear perpetual swap contract funded in USDT 'ETH/USDT:ETH' // ETH/USDT inverse perpetual swap contract funded in ETH 'ETH/USDT:USDT' // ETH/USDT linear perpetual swap contract funded in USDT"><pre><span class="pl-c">// base asset or currency</span> <span class="pl-c">// ↓</span> <span class="pl-c">// ↓ quote asset or currency</span> <span class="pl-c">// ↓ ↓</span> <span class="pl-c">// ↓ ↓ settlement asset or currency</span> <span class="pl-c">// ↓ ↓ ↓</span> <span class="pl-c">// ↓ ↓ ↓</span> <span class="pl-s">'BTC/USDT:BTC'</span> <span class="pl-c">// BTC/USDT inverse perpetual swap contract funded in BTC</span> <span class="pl-s">'BTC/USDT:USDT'</span> <span class="pl-c">// BTC/USDT linear perpetual swap contract funded in USDT</span> <span class="pl-s">'ETH/USDT:ETH'</span> <span class="pl-c">// ETH/USDT inverse perpetual swap contract funded in ETH</span> <span class="pl-s">'ETH/USDT:USDT'</span> <span class="pl-c">// ETH/USDT linear perpetual swap contract funded in USDT</span></pre></div> <div class="markdown-heading"><h5 class="heading-element">Option</h5><a id="user-content-option" class="anchor" aria-label="Permalink: Option" href="#option"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// // base asset or currency // ↓ // ↓ quote asset or currency // ↓ ↓ // ↓ ↓ settlement asset or currency // ↓ ↓ ↓ // ↓ ↓ ↓ identifier (settlement date) // ↓ ↓ ↓ ↓ // ↓ ↓ ↓ ↓ strike price // ↓ ↓ ↓ ↓ ↓ // ↓ ↓ ↓ ↓ ↓ type, put (P) or call (C) // ↓ ↓ ↓ ↓ ↓ ↓ 'BTC/USDT:BTC-211225-60000-P' // BTC/USDT put option contract strike price 60000 USDT settled in BTC (inverse) on 2021-12-25 'ETH/USDT:USDT-211225-40000-C' // BTC/USDT call option contract strike price 40000 USDT settled in USDT (linear, vanilla) on 2021-12-25 'ETH/USDT:ETH-210625-5000-P' // ETH/USDT put option contract strike price 5000 USDT settled in ETH (inverse) on 2021-06-25 'ETH/USDT:USDT-210625-5000-C' // ETH/USDT call option contract strike price 5000 USDT settled in USDT (linear, vanilla) on 2021-06-25"><pre><span class="pl-c">//</span> <span class="pl-c">// base asset or currency</span> <span class="pl-c">// ↓</span> <span class="pl-c">// ↓ quote asset or currency</span> <span class="pl-c">// ↓ ↓</span> <span class="pl-c">// ↓ ↓ settlement asset or currency</span> <span class="pl-c">// ↓ ↓ ↓</span> <span class="pl-c">// ↓ ↓ ↓ identifier (settlement date)</span> <span class="pl-c">// ↓ ↓ ↓ ↓</span> <span class="pl-c">// ↓ ↓ ↓ ↓ strike price</span> <span class="pl-c">// ↓ ↓ ↓ ↓ ↓</span> <span class="pl-c">// ↓ ↓ ↓ ↓ ↓ type, put (P) or call (C)</span> <span class="pl-c">// ↓ ↓ ↓ ↓ ↓ ↓</span> <span class="pl-s">'BTC/USDT:BTC-211225-60000-P'</span> <span class="pl-c">// BTC/USDT put option contract strike price 60000 USDT settled in BTC (inverse) on 2021-12-25</span> <span class="pl-s">'ETH/USDT:USDT-211225-40000-C'</span> <span class="pl-c">// BTC/USDT call option contract strike price 40000 USDT settled in USDT (linear, vanilla) on 2021-12-25</span> <span class="pl-s">'ETH/USDT:ETH-210625-5000-P'</span> <span class="pl-c">// ETH/USDT put option contract strike price 5000 USDT settled in ETH (inverse) on 2021-06-25</span> <span class="pl-s">'ETH/USDT:USDT-210625-5000-C'</span> <span class="pl-c">// ETH/USDT call option contract strike price 5000 USDT settled in USDT (linear, vanilla) on 2021-06-25</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Unified Networks</h3><a id="user-content-unified-networks" class="anchor" aria-label="Permalink: Unified Networks" href="#unified-networks"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <table role="table"> <thead> <tr> <th>Network</th> <th>CCXT Code</th> </tr> </thead> <tbody> <tr> <td>Bitcoin</td> <td>BTC</td> </tr> <tr> <td>Ethereum</td> <td>ETH (For Ethereum) / ERC20 (For Tokens)</td> </tr> <tr> <td>Ripple</td> <td>XRP</td> </tr> <tr> <td>Litecoin</td> <td>LTC</td> </tr> <tr> <td>Dogecoin</td> <td>DOGE</td> </tr> <tr> <td>Stellar</td> <td>XLM</td> </tr> <tr> <td>Tron</td> <td>TRX (For TRX) / TRC20 (For Tokens)</td> </tr> <tr> <td>Ethereum Classic</td> <td>ETC</td> </tr> <tr> <td>Zcash</td> <td>ZEC</td> </tr> <tr> <td>BSC (Binance Smart Chain)</td> <td>BEP20</td> </tr> <tr> <td>Monero</td> <td>XMR</td> </tr> <tr> <td>Cardano</td> <td>ADA</td> </tr> <tr> <td>Tezos</td> <td>XTZ</td> </tr> <tr> <td>Cosmos</td> <td>ATOM</td> </tr> <tr> <td>Solana</td> <td>SOL</td> </tr> <tr> <td>BNB Beacon Chain</td> <td>BEP2</td> </tr> <tr> <td>Polkadot</td> <td>DOT</td> </tr> <tr> <td>Algorand</td> <td>ALGO</td> </tr> <tr> <td>Avalanche</td> <td>AVAX</td> </tr> <tr> <td>Chainlink</td> <td>LINK</td> </tr> <tr> <td>Bitcoin Cash</td> <td>BCH</td> </tr> <tr> <td>Filecoin</td> <td>FIL</td> </tr> <tr> <td>Kusama</td> <td>KSM</td> </tr> <tr> <td>Elrond</td> <td>EGLD</td> </tr> <tr> <td>THORChain</td> <td>RUNE</td> </tr> <tr> <td>Internet Computer</td> <td>ICP</td> </tr> <tr> <td>Near Protocol</td> <td>NEAR</td> </tr> <tr> <td>Celo</td> <td>CELO</td> </tr> <tr> <td>Hedera Hashgraph</td> <td>HBAR</td> </tr> <tr> <td>IOTA</td> <td>MIOTA</td> </tr> <tr> <td>Klaytn</td> <td>KLAY</td> </tr> <tr> <td>VeChain</td> <td>VET</td> </tr> <tr> <td>Theta Network</td> <td>THETA</td> </tr> <tr> <td>Stacks</td> <td>STX</td> </tr> <tr> <td>Bitcoin Lightning Network</td> <td>LIGHTNING</td> </tr> <tr> <td>Optimism</td> <td>OPTIMISM</td> </tr> <tr> <td>Arbitrum</td> <td>ARBITRUM</td> </tr> <tr> <td>zkSync</td> <td>zkSync</td> </tr> <tr> <td>Polygon</td> <td>MATIC</td> </tr> <tr> <td>Fantom</td> <td>FTM</td> </tr> </tbody> </table> <div class="markdown-heading"><h2 class="heading-element">Market Cache Force Reload</h2><a id="user-content-market-cache-force-reload" class="anchor" aria-label="Permalink: Market Cache Force Reload" href="#market-cache-force-reload"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The <code>loadMarkets () / load_markets ()</code> is also a dirty method with a side effect of saving the array of markets on the exchange instance. You only need to call it once per exchange. All subsequent calls to the same method will return the locally saved (cached) array of markets.</p> <p>When exchange markets are loaded, you can then access market information any time via the <code>markets</code> property. This property contains an associative array of markets indexed by symbol. If you need to force reload the list of markets after you have them loaded already, pass the reload = true flag to the same method again.</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-11" class="anchor" aria-label="Permalink: Javascript" href="#javascript-11"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(async () => { let kraken = new ccxt.kraken ({ verbose: true }) // log HTTP requests await kraken.loadMarkets () // request markets console.log (kraken.id, kraken.markets) // output a full list of all loaded markets console.log (Object.keys (kraken.markets)) // output a short list of market symbols console.log (kraken.markets['BTC/USD']) // output single market details await kraken.loadMarkets () // return a locally cached version, no reload let reloadedMarkets = await kraken.loadMarkets (true) // force HTTP reload = true console.log (reloadedMarkets['ETH/BTC']) }) ()"><pre><span class="pl-kos">(</span><span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span> <span class="pl-k">let</span> <span class="pl-s1">kraken</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">kraken</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">verbose</span>: <span class="pl-c1">true</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c">// log HTTP requests</span> <span class="pl-k">await</span> <span class="pl-s1">kraken</span><span class="pl-kos">.</span><span class="pl-en">loadMarkets</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c">// request markets</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">kraken</span><span class="pl-kos">.</span><span class="pl-c1">id</span><span class="pl-kos">,</span> <span class="pl-s1">kraken</span><span class="pl-kos">.</span><span class="pl-c1">markets</span><span class="pl-kos">)</span> <span class="pl-c">// output a full list of all loaded markets</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">keys</span> <span class="pl-kos">(</span><span class="pl-s1">kraken</span><span class="pl-kos">.</span><span class="pl-c1">markets</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-c">// output a short list of market symbols</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">kraken</span><span class="pl-kos">.</span><span class="pl-c1">markets</span><span class="pl-kos">[</span><span class="pl-s">'BTC/USD'</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-c">// output single market details</span> <span class="pl-k">await</span> <span class="pl-s1">kraken</span><span class="pl-kos">.</span><span class="pl-en">loadMarkets</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c">// return a locally cached version, no reload</span> <span class="pl-k">let</span> <span class="pl-s1">reloadedMarkets</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">kraken</span><span class="pl-kos">.</span><span class="pl-en">loadMarkets</span> <span class="pl-kos">(</span><span class="pl-c1">true</span><span class="pl-kos">)</span> <span class="pl-c">// force HTTP reload = true</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">reloadedMarkets</span><span class="pl-kos">[</span><span class="pl-s">'ETH/BTC'</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">(</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-11" class="anchor" aria-label="Permalink: Python" href="#python-11"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="poloniex = ccxt.poloniex({'verbose': True}) # log HTTP requests poloniex.load_markets() # request markets print(poloniex.id, poloniex.markets) # output a full list of all loaded markets print(list(poloniex.markets.keys())) # output a short list of market symbols print(poloniex.markets['BTC/ETH']) # output single market details poloniex.load_markets() # return a locally cached version, no reload reloadedMarkets = poloniex.load_markets(True) # force HTTP reload = True print(reloadedMarkets['ETH/ZEC'])"><pre><span class="pl-s1">poloniex</span> <span class="pl-c1">=</span> <span class="pl-s1">ccxt</span>.<span class="pl-c1">poloniex</span>({<span class="pl-s">'verbose'</span>: <span class="pl-c1">True</span>}) <span class="pl-c"># log HTTP requests</span> <span class="pl-s1">poloniex</span>.<span class="pl-c1">load_markets</span>() <span class="pl-c"># request markets</span> <span class="pl-en">print</span>(<span class="pl-s1">poloniex</span>.<span class="pl-c1">id</span>, <span class="pl-s1">poloniex</span>.<span class="pl-c1">markets</span>) <span class="pl-c"># output a full list of all loaded markets</span> <span class="pl-en">print</span>(<span class="pl-en">list</span>(<span class="pl-s1">poloniex</span>.<span class="pl-c1">markets</span>.<span class="pl-c1">keys</span>())) <span class="pl-c"># output a short list of market symbols</span> <span class="pl-en">print</span>(<span class="pl-s1">poloniex</span>.<span class="pl-c1">markets</span>[<span class="pl-s">'BTC/ETH'</span>]) <span class="pl-c"># output single market details</span> <span class="pl-s1">poloniex</span>.<span class="pl-c1">load_markets</span>() <span class="pl-c"># return a locally cached version, no reload</span> <span class="pl-s1">reloadedMarkets</span> <span class="pl-c1">=</span> <span class="pl-s1">poloniex</span>.<span class="pl-c1">load_markets</span>(<span class="pl-c1">True</span>) <span class="pl-c"># force HTTP reload = True</span> <span class="pl-en">print</span>(<span class="pl-s1">reloadedMarkets</span>[<span class="pl-s">'ETH/ZEC'</span>])</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-11" class="anchor" aria-label="Permalink: PHP" href="#php-11"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$bitfinex = new \ccxt\bitfinex(array('verbose' => true)); // log HTTP requests $bitfinex.load_markets(); // request markets var_dump($bitfinex->id, $bitfinex->markets); // output a full list of all loaded markets var_dump(array_keys ($bitfinex->markets)); // output a short list of market symbols var_dump($bitfinex->markets['XRP/USD']); // output single market details $bitfinex->load_markets(); // return a locally cached version, no reload $reloadedMarkets = $bitfinex->load_markets(true); // force HTTP reload = true var_dump($bitfinex->markets['XRP/BTC']);"><pre><span class="pl-s1"><span class="pl-c1">$</span>bitfinex</span> = <span class="pl-k">new</span> \<span class="pl-v">ccxt</span>\<span class="pl-v">bitfinex</span>(<span class="pl-en">array</span>(<span class="pl-s">'<span class="pl-s">verbose</span>'</span> => <span class="pl-c1">true</span>)); <span class="pl-c">// log HTTP requests</span> <span class="pl-s1"><span class="pl-c1">$</span>bitfinex</span>.<span class="pl-en">load_markets</span>(); <span class="pl-c">// request markets</span> <span class="pl-en">var_dump</span>(<span class="pl-s1"><span class="pl-c1">$</span>bitfinex</span>-><span class="pl-c1">id</span>, <span class="pl-s1"><span class="pl-c1">$</span>bitfinex</span>-><span class="pl-c1">markets</span>); <span class="pl-c">// output a full list of all loaded markets</span> <span class="pl-en">var_dump</span>(<span class="pl-en">array_keys</span> (<span class="pl-s1"><span class="pl-c1">$</span>bitfinex</span>-><span class="pl-c1">markets</span>)); <span class="pl-c">// output a short list of market symbols</span> <span class="pl-en">var_dump</span>(<span class="pl-s1"><span class="pl-c1">$</span>bitfinex</span>-><span class="pl-c1">markets</span>[<span class="pl-s">'<span class="pl-s">XRP/USD</span>'</span>]); <span class="pl-c">// output single market details</span> <span class="pl-s1"><span class="pl-c1">$</span>bitfinex</span>-><span class="pl-en">load_markets</span>(); <span class="pl-c">// return a locally cached version, no reload</span> <span class="pl-s1"><span class="pl-c1">$</span>reloadedMarkets</span> = <span class="pl-s1"><span class="pl-c1">$</span>bitfinex</span>-><span class="pl-en">load_markets</span>(<span class="pl-c1">true</span>); <span class="pl-c">// force HTTP reload = true</span> <span class="pl-en">var_dump</span>(<span class="pl-s1"><span class="pl-c1">$</span>bitfinex</span>-><span class="pl-c1">markets</span>[<span class="pl-s">'<span class="pl-s">XRP/BTC</span>'</span>]);</pre></div> <div class="markdown-heading"><h1 class="heading-element">Implicit API</h1><a id="user-content-implicit-api" class="anchor" aria-label="Permalink: Implicit API" href="#implicit-api"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <ul> <li><a href="#api-methods--endpoints">API Methods / Endpoints</a></li> <li><a href="#implicit-api-methods">Implicit API Methods</a></li> <li><a href="#publicprivate-api">Public/Private API</a></li> <li><a href="#synchronous-vs-asynchronous-calls">Synchronous vs Asynchronous Calls</a></li> <li><a href="#passing-parameters-to-api-methods">Passing Parameters To API Methods</a></li> </ul> <div class="markdown-heading"><h2 class="heading-element">API Methods / Endpoints</h2><a id="user-content-api-methods--endpoints" class="anchor" aria-label="Permalink: API Methods / Endpoints" href="#api-methods--endpoints"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Each exchange offers a set of API methods. Each method of the API is called an <em>endpoint</em>. Endpoints are HTTP URLs for querying various types of information. All endpoints return JSON in response to client requests.</p> <p>Usually, there is an endpoint for getting a list of markets from an exchange, an endpoint for retrieving an order book for a particular market, an endpoint for retrieving trade history, endpoints for placing and canceling orders, for money deposit and withdrawal, etc... Basically every kind of action you could perform within a particular exchange has a separate endpoint URL offered by the API.</p> <p>Because the set of methods differs from exchange to exchange, the ccxt library implements the following:</p> <ul> <li>a public and private API for all possible URLs and methods</li> <li>a unified API supporting a subset of common methods</li> </ul> <p>The endpoint URLs are predefined in the <code>api</code> property for each exchange. You don't have to override it, unless you are implementing a new exchange API (at least you should know what you're doing).</p> <p>Most of exchange-specific API methods are implicit, meaning that they aren't defined explicitly anywhere in code. The library implements a declarative approach for defining implicit (non-unified) exchanges' API methods.</p> <div class="markdown-heading"><h2 class="heading-element">Implicit API Methods</h2><a id="user-content-implicit-api-methods" class="anchor" aria-label="Permalink: Implicit API Methods" href="#implicit-api-methods"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Each method of the API usually has its own endpoint. The library defines all endpoints for each particular exchange in the <code>.api</code> property. Upon exchange construction an implicit <em>magic</em> method (aka <em>partial function</em> or <em>closure</em>) will be created inside <code>defineRestApi()/define_rest_api()</code> on the exchange instance for each endpoint from the list of <code>.api</code> endpoints. This is performed for all exchanges universally. Each generated method will be accessible in both <code>camelCase</code> and <code>under_score</code> notations.</p> <p>The endpoints definition is a <strong>full list of ALL API URLs</strong> exposed by an exchange. This list gets converted to callable methods upon exchange instantiation. Each URL in the API endpoint list gets a corresponding callable method. This is done automatically for all exchanges, therefore the ccxt library supports <strong>all possible URLs</strong> offered by crypto exchanges.</p> <p>Each implicit method gets a unique name which is constructed from the <code>.api</code> definition. For example, a private HTTPS PUT <code>https://api.exchange.com/order/{id}/cancel</code> endpoint will have a corresponding exchange method named <code>.privatePutOrderIdCancel()</code>/<code>.private_put_order_id_cancel()</code>. A public HTTPS GET <code>https://api.exchange.com/market/ticker/{pair}</code> endpoint would result in the corresponding method named <code>.publicGetTickerPair()</code>/<code>.public_get_ticker_pair()</code>, and so on.</p> <p>An implicit method takes a dictionary of parameters, sends the request to the exchange and returns an exchange-specific JSON result from the API <strong>as is, unparsed</strong>. To pass a parameter, add it to the dictionary explicitly under a key equal to the parameter's name. For the examples above, this would look like <code>.privatePutOrderIdCancel ({ id: '41987a2b-...' })</code> and <code>.publicGetTickerPair ({ pair: 'BTC/USD' })</code>.</p> <p>The recommended way of working with exchanges is not using exchange-specific implicit methods but using the unified ccxt methods instead. The exchange-specific methods should be used as a fallback in cases when a corresponding unified method isn't available (yet).</p> <p>To get a list of all available methods with an exchange instance, including implicit methods and unified methods you can simply do the following:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="console.log (new ccxt.kraken ()) // JavaScript print(dir(ccxt.kraken())) # Python var_dump (new \ccxt\kraken ()); // PHP"><pre lang="text" class="notranslate"><code>console.log (new ccxt.kraken ()) // JavaScript print(dir(ccxt.kraken())) # Python var_dump (new \ccxt\kraken ()); // PHP </code></pre></div> <div class="markdown-heading"><h2 class="heading-element">Public/Private API</h2><a id="user-content-publicprivate-api" class="anchor" aria-label="Permalink: Public/Private API" href="#publicprivate-api"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>API URLs are often grouped into two sets of methods called a <em>public API</em> for market data and a <em>private API</em> for trading and account access. These groups of API methods are usually prefixed with a word 'public' or 'private'.</p> <p>A public API is used to access market data and does not require any authentication whatsoever. Most exchanges provide market data openly to all (under their rate limit). With the ccxt library anyone can access market data out of the box without having to register with the exchanges and without setting up account keys and passwords.</p> <p>Public APIs include the following:</p> <ul> <li>instruments/trading pairs</li> <li>price feeds (exchange rates)</li> <li>order books (L1, L2, L3...)</li> <li>trade history (closed orders, transactions, executions)</li> <li>tickers (spot / 24h price)</li> <li>OHLCV series for charting</li> <li>other public endpoints</li> </ul> <p>The private API is mostly used for trading and for accessing account-specific private data, therefore it requires authentication. You have to get the private API keys from the exchanges. It often means registering with an exchange website and creating the API keys for your account. Most exchanges require personal information or identification. Some exchanges will only allow trading after completing the KYC verification. Private APIs allow the following:</p> <ul> <li>manage personal account info</li> <li>query account balances</li> <li>trade by making market and limit orders</li> <li>create deposit addresses and fund accounts</li> <li>request withdrawal of fiat and crypto funds</li> <li>query personal open / closed orders</li> <li>query positions in margin/leverage trading</li> <li>get ledger history</li> <li>transfer funds between accounts</li> <li>use merchant services</li> </ul> <p>Some exchanges offer the same logic under different names. For example, a public API is also often called <em>market data</em>, <em>basic</em>, <em>market</em>, <em>mapi</em>, <em>api</em>, <em>price</em>, etc... All of them mean a set of methods for accessing data available to public. A private API is also often called <em>trading</em>, <em>trade</em>, <em>tapi</em>, <em>exchange</em>, <em>account</em>, etc...</p> <p>A few exchanges also expose a merchant API which allows you to create invoices and accept crypto and fiat payments from your clients. This kind of API is often called <em>merchant</em>, <em>wallet</em>, <em>payment</em>, <em>ecapi</em> (for e-commerce).</p> <p>To get a list of all available methods with an exchange instance, you can simply do the following:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="console.log (new ccxt.kraken ()) // JavaScript print(dir(ccxt.kraken())) # Python var_dump (new \ccxt\kraken ()); // PHP"><pre lang="text" class="notranslate"><code>console.log (new ccxt.kraken ()) // JavaScript print(dir(ccxt.kraken())) # Python var_dump (new \ccxt\kraken ()); // PHP </code></pre></div> <p><strong>contract only and margin only</strong></p> <ul> <li>methods in this documentation that are documented as <strong>contract only</strong> or <strong>margin only</strong> are only intended to be used for contract trading and margin trading respectively. They may work when trading in other types of markets but will most likely return irrelevant information.</li> </ul> <div class="markdown-heading"><h2 class="heading-element">Synchronous vs Asynchronous Calls</h2><a id="user-content-synchronous-vs-asynchronous-calls" class="anchor" aria-label="Permalink: Synchronous vs Asynchronous Calls" href="#synchronous-vs-asynchronous-calls"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-12" class="anchor" aria-label="Permalink: Javascript" href="#javascript-12"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>In the JavaScript version of CCXT all methods are asynchronous and return <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" rel="nofollow">Promises</a> that resolve with a decoded JSON object. In CCXT we use the modern <em>async/await</em> syntax to work with Promises. If you're not familiar with that syntax, you can read more about it <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function" rel="nofollow">here</a>.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// JavaScript (async () => { let pairs = await kraken.publicGetSymbolsDetails () let marketIds = Object.keys (pairs['result']) let marketId = marketIds[0] let ticker = await kraken.publicGetTicker ({ pair: marketId }) console.log (kraken.id, marketId, ticker) }) ()"><pre><span class="pl-c">// JavaScript</span> <span class="pl-kos">(</span><span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span> <span class="pl-k">let</span> <span class="pl-s1">pairs</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">kraken</span><span class="pl-kos">.</span><span class="pl-en">publicGetSymbolsDetails</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-k">let</span> <span class="pl-s1">marketIds</span> <span class="pl-c1">=</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">keys</span> <span class="pl-kos">(</span><span class="pl-s1">pairs</span><span class="pl-kos">[</span><span class="pl-s">'result'</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-k">let</span> <span class="pl-s1">marketId</span> <span class="pl-c1">=</span> <span class="pl-s1">marketIds</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span> <span class="pl-k">let</span> <span class="pl-s1">ticker</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">kraken</span><span class="pl-kos">.</span><span class="pl-en">publicGetTicker</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">pair</span>: <span class="pl-s1">marketId</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">kraken</span><span class="pl-kos">.</span><span class="pl-c1">id</span><span class="pl-kos">,</span> <span class="pl-s1">marketId</span><span class="pl-kos">,</span> <span class="pl-s1">ticker</span><span class="pl-kos">)</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">(</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-12" class="anchor" aria-label="Permalink: Python" href="#python-12"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The ccxt library supports asynchronous concurrency mode in Python 3.5+ with async/await syntax. The asynchronous Python version uses pure <a href="https://docs.python.org/3/library/asyncio.html" rel="nofollow">asyncio</a> with <a href="http://aiohttp.readthedocs.io" rel="nofollow">aiohttp</a>. In async mode you have all the same properties and methods, but most methods are decorated with an async keyword. If you want to use async mode, you should link against the <code>ccxt.async_support</code> subpackage, like in the following example:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# Python import asyncio import ccxt.async_support as ccxt async def print_poloniex_ethbtc_ticker(): poloniex = ccxt.poloniex() print(await poloniex.fetch_ticker('ETH/BTC')) await polonix.close() # close the exchange instance when you don't need it anymore asyncio.run(print_poloniex_ethbtc_ticker())"><pre><span class="pl-c"># Python</span> <span class="pl-k">import</span> <span class="pl-s1">asyncio</span> <span class="pl-k">import</span> <span class="pl-s1">ccxt</span>.<span class="pl-s1">async_support</span> <span class="pl-k">as</span> <span class="pl-s1">ccxt</span> <span class="pl-k">async</span> <span class="pl-k">def</span> <span class="pl-en">print_poloniex_ethbtc_ticker</span>(): <span class="pl-s1">poloniex</span> <span class="pl-c1">=</span> <span class="pl-s1">ccxt</span>.<span class="pl-c1">poloniex</span>() <span class="pl-en">print</span>(<span class="pl-k">await</span> <span class="pl-s1">poloniex</span>.<span class="pl-c1">fetch_ticker</span>(<span class="pl-s">'ETH/BTC'</span>)) <span class="pl-k">await</span> <span class="pl-s1">polonix</span>.<span class="pl-c1">close</span>() <span class="pl-c"># close the exchange instance when you don't need it anymore</span> <span class="pl-s1">asyncio</span>.<span class="pl-c1">run</span>(<span class="pl-en">print_poloniex_ethbtc_ticker</span>())</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-12" class="anchor" aria-label="Permalink: PHP" href="#php-12"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>CCXT support PHP 8+ versions. The library has both synchronous and asynchronous versions. To use synchronous version, use <code>\ccxt</code> namespace (i.e. <code>new ccxt\binance()</code>) and to use asynchronous version, use <code>\ccxt\async</code> namespace (i.e. <code>new ccxt\async\binance()</code>). Asynchronous version uses <a href="https://reactphp.org/" rel="nofollow">ReactPHP</a> library in the background. In async mode you have all the same properties and methods, but any networking API method should be decorated with the <code>\React\Async\await</code> keyword and your script should be in a ReactPHP wrapper:</p> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// PHP <?php include 'vendor/autoload.php'; use function React\Async\await; $okx = new \ccxt\async\okx(); while (true) { $result = await($okx->fetch_ticker('ETH/BTC')); var_dump($result); }"><pre><span class="pl-c">// PHP</span> <span class="pl-ent"><?php</span> <span class="pl-k">include</span> <span class="pl-s">'<span class="pl-s">vendor/autoload.php</span>'</span>; <span class="pl-k">use</span> <span class="pl-k">function</span> <span class="pl-v">React</span>\<span class="pl-v">Async</span>\<span class="pl-en">await</span>; <span class="pl-s1"><span class="pl-c1">$</span>okx</span> = <span class="pl-k">new</span> \<span class="pl-v">ccxt</span>\<span class="pl-v">async</span>\<span class="pl-v">okx</span>(); <span class="pl-k">while</span> (<span class="pl-c1">true</span>) { <span class="pl-s1"><span class="pl-c1">$</span>result</span> = <span class="pl-en">await</span>(<span class="pl-s1"><span class="pl-c1">$</span>okx</span>-><span class="pl-en">fetch_ticker</span>(<span class="pl-s">'<span class="pl-s">ETH/BTC</span>'</span>)); <span class="pl-en">var_dump</span>(<span class="pl-s1"><span class="pl-c1">$</span>result</span>); }</pre></div> <p>See further examples in the <code>examples/php</code> directory; look for filenames that include the <code>async</code> word. Also, make sure you have installed the required dependencies using <code>composer require recoil/recoil clue/buzz-react react/event-loop recoil/react react/http</code>. Lastly, <a href="https://sergeyzhuk.me/2018/10/26/from-promise-to-coroutines/" rel="nofollow">this article</a> provides a good introduction to the methods used here. While syntactically the change is simple (i.e., just using a <code>yield</code> keyword before relevant methods), concurrency has significant implications for the overall design of your code.</p> <div class="markdown-heading"><h3 class="heading-element">Returned JSON Objects</h3><a id="user-content-returned-json-objects" class="anchor" aria-label="Permalink: Returned JSON Objects" href="#returned-json-objects"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>All public and private API methods return raw decoded JSON objects in response from the exchanges, as is, untouched. The unified API returns JSON-decoded objects in a common format and structured uniformly across all exchanges.</p> <div class="markdown-heading"><h2 class="heading-element">Passing Parameters To API Methods</h2><a id="user-content-passing-parameters-to-api-methods" class="anchor" aria-label="Permalink: Passing Parameters To API Methods" href="#passing-parameters-to-api-methods"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The set of all possible API endpoints differs from exchange to exchange. Most of methods accept a single associative array (or a Python dict) of key-value parameters. The params are passed as follows:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="bitso.publicGetTicker ({ book: 'eth_mxn' }) // JavaScript ccxt.zaif().public_get_ticker_pair ({ 'pair': 'btc_jpy' }) # Python $luno->public_get_ticker (array ('pair' => 'XBTIDR')); // PHP"><pre lang="text" class="notranslate"><code>bitso.publicGetTicker ({ book: 'eth_mxn' }) // JavaScript ccxt.zaif().public_get_ticker_pair ({ 'pair': 'btc_jpy' }) # Python $luno->public_get_ticker (array ('pair' => 'XBTIDR')); // PHP </code></pre></div> <p>The unified methods of exchanges might expect and will accept various <code>params</code> which affect their functionality, like:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="params = {'type':'margin', 'isIsolated': 'TRUE'} # --------------┑ # params will go as the last argument to the unified method | # v binance.create_order('BTC/USDT', 'limit', 'buy', amount, price, params)"><pre><span class="pl-s1">params</span> <span class="pl-c1">=</span> {<span class="pl-s">'type'</span>:<span class="pl-s">'margin'</span>, <span class="pl-s">'isIsolated'</span>: <span class="pl-s">'TRUE'</span>} <span class="pl-c"># --------------┑</span> <span class="pl-c"># params will go as the last argument to the unified method |</span> <span class="pl-c"># v</span> <span class="pl-s1">binance</span>.<span class="pl-c1">create_order</span>(<span class="pl-s">'BTC/USDT'</span>, <span class="pl-s">'limit'</span>, <span class="pl-s">'buy'</span>, <span class="pl-s1">amount</span>, <span class="pl-s1">price</span>, <span class="pl-s1">params</span>)</pre></div> <p>An exchange will not accept the params from a different exchange, they're not interchangeable. The list of accepted parameters is defined by each specific exchange.</p> <p>To find which parameters can be passed to a unified method:</p> <ul> <li>either open the <a href="https://github.com/ccxt/ccxt/tree/master/js">exchange-specific implementation</a> file and search for the desired function (i.e. <code>createOrder</code>) to inspect and find out the details of <code>params</code> usage</li> <li>or go to the exchange's API docs and read the list of parameters for your specific function or endpoint (i.e. <code>order</code>)</li> </ul> <p>For a full list of accepted method parameters for each exchange, please consult <a href="#exchanges">API docs</a>.</p> <div class="markdown-heading"><h3 class="heading-element">API Method Naming Conventions</h3><a id="user-content-api-method-naming-conventions" class="anchor" aria-label="Permalink: API Method Naming Conventions" href="#api-method-naming-conventions"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>An exchange method name is a concatenated string consisting of type (public or private), HTTP method (GET, POST, PUT, DELETE) and endpoint URL path like in the following examples:</p> <table role="table"> <thead> <tr> <th>Method Name</th> <th>Base API URL</th> <th>Endpoint URL</th> </tr> </thead> <tbody> <tr> <td>publicGetIdOrderbook</td> <td><a href="https://bitbay.net/API/Public" rel="nofollow">https://bitbay.net/API/Public</a></td> <td>{id}/orderbook</td> </tr> <tr> <td>publicGetPairs</td> <td><a href="https://bitlish.com/api" rel="nofollow">https://bitlish.com/api</a></td> <td>pairs</td> </tr> <tr> <td>publicGetJsonMarketTicker</td> <td><a href="https://www.bitmarket.net" rel="nofollow">https://www.bitmarket.net</a></td> <td>json/{market}/ticker</td> </tr> <tr> <td>privateGetUserMargin</td> <td><a href="https://bitmex.com" rel="nofollow">https://bitmex.com</a></td> <td>user/margin</td> </tr> <tr> <td>privatePostTrade</td> <td><a href="https://btc-x.is/api" rel="nofollow">https://btc-x.is/api</a></td> <td>trade</td> </tr> <tr> <td>tapiCancelOrder</td> <td><a href="https://yobit.net" rel="nofollow">https://yobit.net</a></td> <td>tapi/CancelOrder</td> </tr> <tr> <td>...</td> <td>...</td> <td>...</td> </tr> </tbody> </table> <p>The ccxt library supports both camelcase notation (preferred in JavaScript) and underscore notation (preferred in Python and PHP), therefore all methods can be called in either notation or coding style in any language. Both of these notations work in JavaScript, Python and PHP:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="exchange.methodName () // camelcase pseudocode exchange.method_name() // underscore pseudocode"><pre lang="text" class="notranslate"><code>exchange.methodName () // camelcase pseudocode exchange.method_name() // underscore pseudocode </code></pre></div> <p>To get a list of all available methods with an exchange instance, you can simply do the following:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="console.log (new ccxt.kraken ()) // JavaScript print(dir(ccxt.hitbtc())) # Python var_dump (new \ccxt\okcoin ()); // PHP"><pre lang="text" class="notranslate"><code>console.log (new ccxt.kraken ()) // JavaScript print(dir(ccxt.hitbtc())) # Python var_dump (new \ccxt\okcoin ()); // PHP </code></pre></div> <div class="markdown-heading"><h1 class="heading-element">Unified API</h1><a id="user-content-unified-api" class="anchor" aria-label="Permalink: Unified API" href="#unified-api"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <ul> <li><a href="#overriding-unified-api-params">Overriding Unified API Params</a></li> <li><a href="#pagination">Pagination</a></li> <li><a href="#automatic-pagination">Automatic Pagination</a></li> </ul> <p>The unified ccxt API is a subset of methods common among the exchanges. It currently contains the following methods:</p> <ul> <li> <code>fetchMarkets ()</code>: Fetches a list of all available markets from an exchange and returns an array of markets (objects with properties such as <code>symbol</code>, <code>base</code>, <code>quote</code> etc.). Some exchanges do not have means for obtaining a list of markets via their online API. For those, the list of markets is hardcoded.</li> <li> <code>fetchCurrencies ()</code>: Fetches all available currencies an exchange and returns an associative dictionary of currencies (objects with properties such as <code>code</code>, <code>name</code>, etc.). Some exchanges do not have means for obtaining currencies via their online API. For those, the currencies will be extracted from market pairs or hardcoded.</li> <li> <code>loadMarkets ([reload])</code>: Returns the list of markets as an object indexed by symbol and caches it with the exchange instance. Returns cached markets if loaded already, unless the <code>reload = true</code> flag is forced.</li> <li> <code>fetchOrderBook (symbol, limit = undefined, params = {})</code>: Fetch L2/L3 order book for a particular market trading symbol.</li> <li> <code>fetchStatus (params = {})</code>: Returns information regarding the exchange status from either the info hardcoded in the exchange instance or the API, if available.</li> <li> <code>fetchL2OrderBook (symbol, limit = undefined, params)</code>: Level 2 (price-aggregated) order book for a particular symbol.</li> <li> <code>fetchTrades (symbol, since, limit, params)</code>: Fetch recent trades for a particular trading symbol.</li> <li> <code>fetchTicker (symbol)</code>: Fetch latest ticker data by trading symbol.</li> <li> <code>fetchBalance ()</code>: Fetch Balance.</li> <li><code>createOrder (symbol, type, side, amount, price, params)</code></li> <li><code>createOrders(orders, params)</code></li> <li><code>createLimitBuyOrder (symbol, amount, price, param)</code></li> <li><code>createLimitSellOrder (symbol, amount, price, param)</code></li> <li><code>createMarketBuyOrder (symbol, amount, param)</code></li> <li><code>createMarketSellOrder (symbol, amount, param)</code></li> <li><code>cancelOrder (id, symbol, params)</code></li> <li><code>fetchOrder (id, symbol, params)</code></li> <li><code>fetchOrders (symbol, since, limit, params)</code></li> <li><code>fetchOpenOrders (symbol, since, limit, params)</code></li> <li><code>fetchCanceledOrders (symbol, since, limit, params)</code></li> <li><code>fetchClosedOrders (symbol, since, limit, params)</code></li> <li><code>fetchMyTrades (symbol, since, limit, params)</code></li> <li><code>fetchOpenInterest (symbol, params)</code></li> <li><code>fetchVolatilityHistory (code, params)</code></li> <li><code>fetchUnderlyingAssets ()</code></li> <li><code>fetchSettlementHistory (symbol, since, limit, params)</code></li> <li><code>fetchLiquidations (symbol, since, limit, params)</code></li> <li><code>fetchMyLiquidations (symbol, since, limit, params)</code></li> <li><code>fetchGreeks (symbol, params)</code></li> <li><code>fetchCrossBorrowRate (code, params)</code></li> <li><code>fetchCrossBorrowRates (params)</code></li> <li><code>fetchIsolatedBorrowRate (symbol, params)</code></li> <li><code>fetchIsolatedBorrowRates (params)</code></li> <li><code>fetchOption (symbol, params)</code></li> <li><code>fetchOptionChain (code, params)</code></li> <li><code>fetchConvertQuote (fromCode, toCode, amount, params)</code></li> <li><code>createConvertTrade (id, fromCode, toCode, amount, params)</code></li> <li><code>fetchFundingRate (symbol, params)</code></li> <li><code>fetchFundingRates (symbols, params)</code></li> <li><code>fetchFundingRateHistory (symbol, since, limit, params)</code></li> <li><code>fetchFundingRateInterval (symbol, params)</code></li> <li><code>fetchFundingRateIntervals (symbols, params)</code></li> <li><code>fetchLongShortRatio (symbol, params)</code></li> <li>...</li> </ul> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TODO: better formatting"><pre lang="text" class="notranslate"><code>TODO: better formatting </code></pre></div> <div class="markdown-heading"><h2 class="heading-element">Overriding Unified API Params</h2><a id="user-content-overriding-unified-api-params" class="anchor" aria-label="Permalink: Overriding Unified API Params" href="#overriding-unified-api-params"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Note, that most of methods of the unified API accept an optional <code>params</code> argument. It is an associative array (a dictionary, empty by default) containing the params you want to override. The contents of <code>params</code> are exchange-specific, consult the exchanges' API documentation for supported fields and values. Use the <code>params</code> dictionary if you need to pass a custom setting or an optional parameter to your unified query.</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-13" class="anchor" aria-label="Permalink: Javascript" href="#javascript-13"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(async () => { const params = { 'foo': 'bar', // exchange-specific overrides in unified queries 'Hello': 'World!', // see their docs for more details on parameter names } // the overrides go into the last argument to the unified call ↓ HERE const result = await exchange.fetchOrderBook (symbol, length, params) }) ()"><pre><span class="pl-kos">(</span><span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-s">'foo'</span>: <span class="pl-s">'bar'</span><span class="pl-kos">,</span> <span class="pl-c">// exchange-specific overrides in unified queries</span> <span class="pl-s">'Hello'</span>: <span class="pl-s">'World!'</span><span class="pl-kos">,</span> <span class="pl-c">// see their docs for more details on parameter names</span> <span class="pl-kos">}</span> <span class="pl-c">// the overrides go into the last argument to the unified call ↓ HERE</span> <span class="pl-k">const</span> <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchOrderBook</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">length</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">(</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-13" class="anchor" aria-label="Permalink: Python" href="#python-13"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="params = { 'foo': 'bar', # exchange-specific overrides in unified queries 'Hello': 'World!', # see their docs for more details on parameter names } # overrides go in the last argument to the unified call ↓ HERE result = exchange.fetch_order_book(symbol, length, params)"><pre><span class="pl-s1">params</span> <span class="pl-c1">=</span> { <span class="pl-s">'foo'</span>: <span class="pl-s">'bar'</span>, <span class="pl-c"># exchange-specific overrides in unified queries</span> <span class="pl-s">'Hello'</span>: <span class="pl-s">'World!'</span>, <span class="pl-c"># see their docs for more details on parameter names</span> } <span class="pl-c"># overrides go in the last argument to the unified call ↓ HERE</span> <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">fetch_order_book</span>(<span class="pl-s1">symbol</span>, <span class="pl-s1">length</span>, <span class="pl-s1">params</span>)</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-13" class="anchor" aria-label="Permalink: PHP" href="#php-13"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$params = array ( 'foo' => 'bar', // exchange-specific overrides in unified queries 'Hello' => 'World!', // see their docs for more details on parameter names } // overrides go into the last argument to the unified call ↓ HERE $result = $exchange->fetch_order_book ($symbol, $length, $params);"><pre><span class="pl-s1"><span class="pl-c1">$</span>params</span> = array ( <span class="pl-s">'<span class="pl-s">foo</span>'</span> => <span class="pl-s">'<span class="pl-s">bar</span>'</span>, <span class="pl-c">// exchange-specific overrides in unified queries</span> <span class="pl-s">'<span class="pl-s">Hello</span>'</span> => <span class="pl-s">'<span class="pl-s">World!</span>'</span>, <span class="pl-c">// see their docs for more details on parameter names</span> } <span class="pl-c">// overrides go into the last argument to the unified call ↓ HERE</span> <span class="pl-s1"><span class="pl-c1">$</span>result</span> = <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">fetch_order_book</span> (<span class="pl-s1"><span class="pl-c1">$</span>symbol</span>, <span class="pl-s1"><span class="pl-c1">$</span>length</span>, <span class="pl-s1"><span class="pl-c1">$</span>params</span>);</pre></div> <div class="markdown-heading"><h2 class="heading-element">Pagination</h2><a id="user-content-pagination" class="anchor" aria-label="Permalink: Pagination" href="#pagination"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Most of unified methods will return either a single object or a plain array (a list) of objects (trades, orders, transactions and so on). However, very few exchanges (if any at all) will return all orders, all trades, all ohlcv candles or all transactions at once. Most often their APIs <code>limit</code> output to a certain number of most recent objects. <strong>YOU CANNOT GET ALL OBJECTS SINCE THE BEGINNING OF TIME TO THE PRESENT MOMENT IN JUST ONE CALL</strong>. Practically, very few exchanges will tolerate or allow that.</p> <p>To fetch historical orders or trades, the user will need to traverse the data in portions or "pages" of objects. Pagination often implies <em>"fetching portions of data one by one"</em> in a loop.</p> <p>In most cases users are <strong>required to use at least some type of pagination</strong> in order to get the expected results consistently. If the user does not apply any pagination, most methods will return the exchanges' default, which may start from the beginning of history or may be a subset of most recent objects. The default behaviour (without pagination) is exchange-specific! The means of pagination are often used with the following methods in particular:</p> <ul> <li><code>fetchTrades()</code></li> <li><code>fetchOHLCV()</code></li> <li><code>fetchOrders()</code></li> <li><code>fetchCanceledOrders()</code></li> <li><code>fetchClosedOrder()</code></li> <li><code>fetchClosedOrders()</code></li> <li><code>fetchOpenOrder()</code></li> <li><code>fetchOpenOrders()</code></li> <li><code>fetchMyTrades()</code></li> <li><code>fetchTransactions()</code></li> <li><code>fetchDeposit()</code></li> <li><code>fetchDeposits()</code></li> <li><code>fetchWithdrawals()</code></li> </ul> <p>With methods returning lists of objects, exchanges may offer one or more types of pagination. CCXT unifies <strong>date-based pagination</strong> by default, with timestamps <strong>in milliseconds</strong> throughout the entire library.</p> <div class="markdown-heading"><h3 class="heading-element">Automatic Pagination</h3><a id="user-content-automatic-pagination" class="anchor" aria-label="Permalink: Automatic Pagination" href="#automatic-pagination"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>Warning: this is an experimental feature and might produce unexpected/incorrect results in some instances.</em></p> <p>Recently, CCXT introduced a way to paginate through several results automatically by just providing the <code>paginate</code> flag inside <code>params,</code> lifting this work from the userland. Most leading exchanges support it, and more will be added in the future, but the easiest way to check it is to look in the method's documentation and search for the <em>pagination</em> parameter. As always there are exceptions, and some endpoints might not provide a way to paginate either through a timestamp or a cursor, and in those cases, there's nothing CCXT can do about it.</p> <p>Right now, we have three different ways of paginating:</p> <ul> <li> <strong>dynamic/time-based</strong>: uses the <code>until</code> and <code>since</code> parameters to paginate through dynamic results like (trades, orders, transactions, etc). Since we don't know a priori how many entries are available to be fetched, it will perform one request at a time until we reach the end of the data or the maximum amount of pagination calls (configurable through an option)</li> <li> <strong>deterministic</strong>: when we can pre-compute the boundaries of each page, it will perform the requests concurrently for maximum performance. This applies to OHLCV, Funding Rates, and Open Interest and also respects the <code>paginationCalls</code> option.</li> <li> <strong>cursor-based</strong>: when the exchange provides a cursor inside the response, we extract the cursor and perform the subsequent request until the end of the data or reach the maximum number of pagination calls.</li> </ul> <p>The user cannot select the pagination method used, it will depend from implementation to implementation, considering the exchange API's features.</p> <div class="markdown-heading"><h4 class="heading-element">Pagination params</h4><a id="user-content-pagination-params" class="anchor" aria-label="Permalink: Pagination params" href="#pagination-params"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>We can't perform an infinite amount of requests, and some of them might throw an error for different reasons, thus, we have some options that allow the user to control these variables and other pagination specificities.</p> <p><em>All the options below, should be provided inside <code>params</code>, you can check the examples below</em></p> <ul> <li> <strong>paginate</strong>: (<strong>boolean</strong>) indicates that the user wants to paginate through different pages to get more data. Default is <em>false</em>.</li> <li> <strong>paginationCalls</strong>: (<strong>integer</strong>) allows the user to control the maximum amount of requests to paginate the data. Due to the rate limits, this value should not be too high. Default is 10.</li> <li> <strong>maxRetries</strong>: (<strong>integer</strong>) how many times should the pagination mechanism retry upon getting an error. Default is 3</li> <li> <strong>paginationDirection</strong>: (<strong>string</strong>) Only applies to the dynamic pagination and it can be either <em>forward</em> (start the pagination from some time in the past and paginate forward) or <em>backward</em> (start from the most recent time and paginate backward). If <em>forward</em> is selected then a <em>since</em> parameter must also be provided. Default is <em>backward</em>.</li> <li> <strong>maxEntriesPerRequest</strong>: (<strong>integer</strong>): The max amount of entries per request so that we can maximize the data retrieved per call. It varies from endpoint to endpoint and CCXT will populate this value for you, but you can override it if needed.</li> </ul> <div class="markdown-heading"><h4 class="heading-element">Examples</h4><a id="user-content-examples" class="anchor" aria-label="Permalink: Examples" href="#examples"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" trades = await binance.fetch_trades("BTC/USDT", params = {"paginate": True}) # dynamic/time-based ohlcv = await binance.fetch_ohlcv("BTC/USDT", params = {"paginate": True, "paginationCalls": 5}) # deterministic-pagination will perform 5 requests trades = await binance.fetch_trades("BTC/USDT", since = 1664812416000, params = {"paginate": True, "paginationDirection": "forward"}) # dynamic/time-based pagination starting from 1664812416000 ledger = await bybit.fetch_ledger(params = {"paginate": True}) # bybit returns a cursor so the pagination will be cursor-based funding_rates = await binance.fetch_funding_rate_history("BTC/USDT:USDT", params = {"paginate": True, "maxEntriesPerRequest": 50}) # customizes the number of entries per request "><pre><span class="pl-s1">trades</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">binance</span>.<span class="pl-c1">fetch_trades</span>(<span class="pl-s">"BTC/USDT"</span>, <span class="pl-s1">params</span> <span class="pl-c1">=</span> {<span class="pl-s">"paginate"</span>: <span class="pl-c1">True</span>}) <span class="pl-c"># dynamic/time-based</span> <span class="pl-s1">ohlcv</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">binance</span>.<span class="pl-c1">fetch_ohlcv</span>(<span class="pl-s">"BTC/USDT"</span>, <span class="pl-s1">params</span> <span class="pl-c1">=</span> {<span class="pl-s">"paginate"</span>: <span class="pl-c1">True</span>, <span class="pl-s">"paginationCalls"</span>: <span class="pl-c1">5</span>}) <span class="pl-c"># deterministic-pagination will perform 5 requests</span> <span class="pl-s1">trades</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">binance</span>.<span class="pl-c1">fetch_trades</span>(<span class="pl-s">"BTC/USDT"</span>, <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-c1">1664812416000</span>, <span class="pl-s1">params</span> <span class="pl-c1">=</span> {<span class="pl-s">"paginate"</span>: <span class="pl-c1">True</span>, <span class="pl-s">"paginationDirection"</span>: <span class="pl-s">"forward"</span>}) <span class="pl-c"># dynamic/time-based pagination starting from 1664812416000</span> <span class="pl-s1">ledger</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">bybit</span>.<span class="pl-c1">fetch_ledger</span>(<span class="pl-s1">params</span> <span class="pl-c1">=</span> {<span class="pl-s">"paginate"</span>: <span class="pl-c1">True</span>}) <span class="pl-c"># bybit returns a cursor so the pagination will be cursor-based</span> <span class="pl-s1">funding_rates</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">binance</span>.<span class="pl-c1">fetch_funding_rate_history</span>(<span class="pl-s">"BTC/USDT:USDT"</span>, <span class="pl-s1">params</span> <span class="pl-c1">=</span> {<span class="pl-s">"paginate"</span>: <span class="pl-c1">True</span>, <span class="pl-s">"maxEntriesPerRequest"</span>: <span class="pl-c1">50</span>}) <span class="pl-c"># customizes the number of entries per request</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Working With Datetimes And Timestamps</h3><a id="user-content-working-with-datetimes-and-timestamps" class="anchor" aria-label="Permalink: Working With Datetimes And Timestamps" href="#working-with-datetimes-and-timestamps"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>All unified timestamps throughout the CCXT library are integers <strong>in milliseconds</strong> unless explicitly stated otherwise.</p> <p>Below is the set of methods for working with UTC dates and timestamps and for converting between them:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="exchange.parse8601 ('2018-01-01T00:00:00Z') == 1514764800000 // integer in milliseconds, Z = UTC exchange.iso8601 (1514764800000) == '2018-01-01T00:00:00Z' // from milliseconds to iso8601 string exchange.seconds () // integer UTC timestamp in seconds exchange.milliseconds () // integer UTC timestamp in milliseconds"><pre><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">parse8601</span> <span class="pl-kos">(</span><span class="pl-s">'2018-01-01T00:00:00Z'</span><span class="pl-kos">)</span> <span class="pl-c1">==</span> <span class="pl-c1">1514764800000</span> <span class="pl-c">// integer in milliseconds, Z = UTC</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">iso8601</span> <span class="pl-kos">(</span><span class="pl-c1">1514764800000</span><span class="pl-kos">)</span> <span class="pl-c1">==</span> <span class="pl-s">'2018-01-01T00:00:00Z'</span> <span class="pl-c">// from milliseconds to iso8601 string</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">seconds</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c">// integer UTC timestamp in seconds</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">milliseconds</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c">// integer UTC timestamp in milliseconds</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Date-based Pagination</h3><a id="user-content-date-based-pagination" class="anchor" aria-label="Permalink: Date-based Pagination" href="#date-based-pagination"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>This is the type of pagination currently used throughout the CCXT Unified API. The user supplies a <code>since</code> timestamp <strong>in milliseconds</strong> (!) and a number to <code>limit</code> results. To traverse the objects of interest page by page, the user runs the following (below is pseudocode, it may require overriding some exchange-specific params, depending on the exchange in question):</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-14" class="anchor" aria-label="Permalink: Javascript" href="#javascript-14"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if (exchange.has['fetchTrades']) { let since = exchange.milliseconds () - 86400000 // -1 day from now // alternatively, fetch from a certain starting datetime // let since = exchange.parse8601 ('2018-01-01T00:00:00Z') let allTrades = [] while (since < exchange.milliseconds ()) { const symbol = undefined // change for your symbol const limit = 20 // change for your limit const trades = await exchange.fetchTrades (symbol, since, limit) if (trades.length) { since = trades[trades.length - 1]['timestamp'] + 1 allTrades = allTrades.concat (trades) } else { break } } }"><pre><span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">has</span><span class="pl-kos">[</span><span class="pl-s">'fetchTrades'</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">let</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">milliseconds</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">-</span> <span class="pl-c1">86400000</span> <span class="pl-c">// -1 day from now</span> <span class="pl-c">// alternatively, fetch from a certain starting datetime</span> <span class="pl-c">// let since = exchange.parse8601 ('2018-01-01T00:00:00Z')</span> <span class="pl-k">let</span> <span class="pl-s1">allTrades</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">]</span> <span class="pl-k">while</span> <span class="pl-kos">(</span><span class="pl-s1">since</span> <span class="pl-c1"><</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">milliseconds</span> <span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span> <span class="pl-c">// change for your symbol</span> <span class="pl-k">const</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">20</span> <span class="pl-c">// change for your limit</span> <span class="pl-k">const</span> <span class="pl-s1">trades</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchTrades</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">since</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span><span class="pl-kos">)</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">trades</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-s1">trades</span><span class="pl-kos">[</span><span class="pl-s1">trades</span><span class="pl-kos">.</span><span class="pl-c1">length</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span><span class="pl-kos">]</span><span class="pl-kos">[</span><span class="pl-s">'timestamp'</span><span class="pl-kos">]</span> <span class="pl-c1">+</span> <span class="pl-c1">1</span> <span class="pl-s1">allTrades</span> <span class="pl-c1">=</span> <span class="pl-s1">allTrades</span><span class="pl-kos">.</span><span class="pl-en">concat</span> <span class="pl-kos">(</span><span class="pl-s1">trades</span><span class="pl-kos">)</span> <span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span> <span class="pl-k">break</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-14" class="anchor" aria-label="Permalink: Python" href="#python-14"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if exchange.has['fetchOrders']: since = exchange.milliseconds () - 86400000 # -1 day from now # alternatively, fetch from a certain starting datetime # since = exchange.parse8601('2018-01-01T00:00:00Z') all_orders = [] while since < exchange.milliseconds (): symbol = None # change for your symbol limit = 20 # change for your limit orders = await exchange.fetch_orders(symbol, since, limit) if len(orders): since = orders[len(orders) - 1]['timestamp'] + 1 all_orders += orders else: break"><pre><span class="pl-k">if</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">has</span>[<span class="pl-s">'fetchOrders'</span>]: <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">milliseconds</span> () <span class="pl-c1">-</span> <span class="pl-c1">86400000</span> <span class="pl-c"># -1 day from now</span> <span class="pl-c"># alternatively, fetch from a certain starting datetime</span> <span class="pl-c"># since = exchange.parse8601('2018-01-01T00:00:00Z')</span> <span class="pl-s1">all_orders</span> <span class="pl-c1">=</span> [] <span class="pl-k">while</span> <span class="pl-s1">since</span> <span class="pl-c1"><</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">milliseconds</span> (): <span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-c1">None</span> <span class="pl-c"># change for your symbol</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">20</span> <span class="pl-c"># change for your limit</span> <span class="pl-s1">orders</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">fetch_orders</span>(<span class="pl-s1">symbol</span>, <span class="pl-s1">since</span>, <span class="pl-s1">limit</span>) <span class="pl-k">if</span> <span class="pl-en">len</span>(<span class="pl-s1">orders</span>): <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-s1">orders</span>[<span class="pl-en">len</span>(<span class="pl-s1">orders</span>) <span class="pl-c1">-</span> <span class="pl-c1">1</span>][<span class="pl-s">'timestamp'</span>] <span class="pl-c1">+</span> <span class="pl-c1">1</span> <span class="pl-s1">all_orders</span> <span class="pl-c1">+=</span> <span class="pl-s1">orders</span> <span class="pl-k">else</span>: <span class="pl-k">break</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-14" class="anchor" aria-label="Permalink: PHP" href="#php-14"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if ($exchange->has['fetchMyTrades']) { $since = exchange->milliseconds () - 86400000; // -1 day from now // alternatively, fetch from a certain starting datetime // $since = $exchange->parse8601 ('2018-01-01T00:00:00Z'); $all_trades = array (); while (since < exchange->milliseconds ()) { $symbol = null; // change for your symbol $limit = 20; // change for your limit $trades = $exchange->fetchMyTrades ($symbol, $since, $limit); if (count($trades)) { $since = $trades[count($trades) - 1]['timestamp'] + 1; $all_trades = array_merge ($all_trades, $trades); } else { break; } } }"><pre><span class="pl-k">if</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">has</span>[<span class="pl-s">'<span class="pl-s">fetchMyTrades</span>'</span>]) { <span class="pl-s1"><span class="pl-c1">$</span>since</span> = exchange-><span class="pl-en">milliseconds</span> () - <span class="pl-c1">86400000</span>; <span class="pl-c">// -1 day from now</span> <span class="pl-c">// alternatively, fetch from a certain starting datetime</span> <span class="pl-c">// $since = $exchange->parse8601 ('2018-01-01T00:00:00Z');</span> <span class="pl-s1"><span class="pl-c1">$</span>all_trades</span> = <span class="pl-en">array</span> (); <span class="pl-k">while</span> (since < exchange-><span class="pl-en">milliseconds</span> ()) { <span class="pl-s1"><span class="pl-c1">$</span>symbol</span> = <span class="pl-c1">null</span>; <span class="pl-c">// change for your symbol</span> <span class="pl-s1"><span class="pl-c1">$</span>limit</span> = <span class="pl-c1">20</span>; <span class="pl-c">// change for your limit</span> <span class="pl-s1"><span class="pl-c1">$</span>trades</span> = <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">fetchMyTrades</span> (<span class="pl-s1"><span class="pl-c1">$</span>symbol</span>, <span class="pl-s1"><span class="pl-c1">$</span>since</span>, <span class="pl-s1"><span class="pl-c1">$</span>limit</span>); <span class="pl-k">if</span> (<span class="pl-en">count</span>(<span class="pl-s1"><span class="pl-c1">$</span>trades</span>)) { <span class="pl-s1"><span class="pl-c1">$</span>since</span> = <span class="pl-s1"><span class="pl-c1">$</span>trades</span>[<span class="pl-en">count</span>(<span class="pl-s1"><span class="pl-c1">$</span>trades</span>) - <span class="pl-c1">1</span>][<span class="pl-s">'<span class="pl-s">timestamp</span>'</span>] + <span class="pl-c1">1</span>; <span class="pl-s1"><span class="pl-c1">$</span>all_trades</span> = <span class="pl-en">array_merge</span> (<span class="pl-s1"><span class="pl-c1">$</span>all_trades</span>, <span class="pl-s1"><span class="pl-c1">$</span>trades</span>); } <span class="pl-k">else</span> { <span class="pl-k">break</span>; } } }</pre></div> <div class="markdown-heading"><h3 class="heading-element">id-based Pagination</h3><a id="user-content-id-based-pagination" class="anchor" aria-label="Permalink: id-based Pagination" href="#id-based-pagination"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The user supplies a <code>from_id</code> of the object, from where the query should continue returning results, and a number to <code>limit</code> results. This is the default with some exchanges, however, this type is not unified (yet). To paginate objects based on their ids, the user would run the following:</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-15" class="anchor" aria-label="Permalink: Javascript" href="#javascript-15"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if (exchange.has['fetchTrades']) { let from_id = 'abc123' // all ids are strings let allTrades = [] while (true) { const symbol = undefined // change for your symbol const since = undefined const limit = 20 // change for your limit const params = { 'from_id': from_id, // exchange-specific non-unified parameter name } const trades = await exchange.fetchTrades (symbol, since, limit, params) if (trades.length) { from_id = trades[trades.length - 1]['id'] allTrades.push (trades) } else { break } } }"><pre><span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">has</span><span class="pl-kos">[</span><span class="pl-s">'fetchTrades'</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">let</span> <span class="pl-s1">from_id</span> <span class="pl-c1">=</span> <span class="pl-s">'abc123'</span> <span class="pl-c">// all ids are strings</span> <span class="pl-k">let</span> <span class="pl-s1">allTrades</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">]</span> <span class="pl-k">while</span> <span class="pl-kos">(</span><span class="pl-c1">true</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span> <span class="pl-c">// change for your symbol</span> <span class="pl-k">const</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span> <span class="pl-k">const</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">20</span> <span class="pl-c">// change for your limit</span> <span class="pl-k">const</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-s">'from_id'</span>: <span class="pl-s1">from_id</span><span class="pl-kos">,</span> <span class="pl-c">// exchange-specific non-unified parameter name</span> <span class="pl-kos">}</span> <span class="pl-k">const</span> <span class="pl-s1">trades</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchTrades</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">since</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">trades</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-s1">from_id</span> <span class="pl-c1">=</span> <span class="pl-s1">trades</span><span class="pl-kos">[</span><span class="pl-s1">trades</span><span class="pl-kos">.</span><span class="pl-c1">length</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span><span class="pl-kos">]</span><span class="pl-kos">[</span><span class="pl-s">'id'</span><span class="pl-kos">]</span> <span class="pl-s1">allTrades</span><span class="pl-kos">.</span><span class="pl-en">push</span> <span class="pl-kos">(</span><span class="pl-s1">trades</span><span class="pl-kos">)</span> <span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span> <span class="pl-k">break</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-15" class="anchor" aria-label="Permalink: Python" href="#python-15"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if exchange.has['fetchOrders']: from_id = 'abc123' # all ids are strings all_orders = [] while True: symbol = None # change for your symbol since = None limit = 20 # change for your limit params = { 'from_id': from_id, # exchange-specific non-unified parameter name } orders = await exchange.fetch_orders(symbol, since, limit, params) if len(orders): from_id = orders[len(orders) - 1]['id'] all_orders += orders else: break"><pre><span class="pl-k">if</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">has</span>[<span class="pl-s">'fetchOrders'</span>]: <span class="pl-s1">from_id</span> <span class="pl-c1">=</span> <span class="pl-s">'abc123'</span> <span class="pl-c"># all ids are strings</span> <span class="pl-s1">all_orders</span> <span class="pl-c1">=</span> [] <span class="pl-k">while</span> <span class="pl-c1">True</span>: <span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-c1">None</span> <span class="pl-c"># change for your symbol</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-c1">None</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">20</span> <span class="pl-c"># change for your limit</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> { <span class="pl-s">'from_id'</span>: <span class="pl-s1">from_id</span>, <span class="pl-c"># exchange-specific non-unified parameter name</span> } <span class="pl-s1">orders</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">fetch_orders</span>(<span class="pl-s1">symbol</span>, <span class="pl-s1">since</span>, <span class="pl-s1">limit</span>, <span class="pl-s1">params</span>) <span class="pl-k">if</span> <span class="pl-en">len</span>(<span class="pl-s1">orders</span>): <span class="pl-s1">from_id</span> <span class="pl-c1">=</span> <span class="pl-s1">orders</span>[<span class="pl-en">len</span>(<span class="pl-s1">orders</span>) <span class="pl-c1">-</span> <span class="pl-c1">1</span>][<span class="pl-s">'id'</span>] <span class="pl-s1">all_orders</span> <span class="pl-c1">+=</span> <span class="pl-s1">orders</span> <span class="pl-k">else</span>: <span class="pl-k">break</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-15" class="anchor" aria-label="Permalink: PHP" href="#php-15"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if ($exchange->has['fetchMyTrades']) { $from_id = 'abc123' // all ids are strings $all_trades = array (); while (true) { $symbol = null; // change for your symbol $since = null; $limit = 20; // change for your limit $params = array ( 'from_id' => $from_id, // exchange-specific non-unified parameter name ); $trades = $exchange->fetchMyTrades ($symbol, $since, $limit, $params); if (count($trades)) { $from_id = $trades[count($trades) - 1]['id']; $all_trades = array_merge ($all_trades, $trades); } else { break; } } }"><pre><span class="pl-k">if</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">has</span>[<span class="pl-s">'<span class="pl-s">fetchMyTrades</span>'</span>]) { <span class="pl-s1"><span class="pl-c1">$</span>from_id</span> = <span class="pl-s">'<span class="pl-s">abc123</span>'</span> <span class="pl-c">// all ids are strings</span> <span class="pl-s1"><span class="pl-c1">$</span>all_trades</span> = <span class="pl-en">array</span> (); <span class="pl-k">while</span> (<span class="pl-c1">true</span>) { <span class="pl-s1"><span class="pl-c1">$</span>symbol</span> = <span class="pl-c1">null</span>; <span class="pl-c">// change for your symbol</span> <span class="pl-s1"><span class="pl-c1">$</span>since</span> = <span class="pl-c1">null</span>; <span class="pl-s1"><span class="pl-c1">$</span>limit</span> = <span class="pl-c1">20</span>; <span class="pl-c">// change for your limit</span> <span class="pl-s1"><span class="pl-c1">$</span>params</span> = <span class="pl-en">array</span> ( <span class="pl-s">'<span class="pl-s">from_id</span>'</span> => <span class="pl-s1"><span class="pl-c1">$</span>from_id</span>, <span class="pl-c">// exchange-specific non-unified parameter name</span> ); <span class="pl-s1"><span class="pl-c1">$</span>trades</span> = <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">fetchMyTrades</span> (<span class="pl-s1"><span class="pl-c1">$</span>symbol</span>, <span class="pl-s1"><span class="pl-c1">$</span>since</span>, <span class="pl-s1"><span class="pl-c1">$</span>limit</span>, <span class="pl-s1"><span class="pl-c1">$</span>params</span>); <span class="pl-k">if</span> (<span class="pl-en">count</span>(<span class="pl-s1"><span class="pl-c1">$</span>trades</span>)) { <span class="pl-s1"><span class="pl-c1">$</span>from_id</span> = <span class="pl-s1"><span class="pl-c1">$</span>trades</span>[<span class="pl-en">count</span>(<span class="pl-s1"><span class="pl-c1">$</span>trades</span>) - <span class="pl-c1">1</span>][<span class="pl-s">'<span class="pl-s">id</span>'</span>]; <span class="pl-s1"><span class="pl-c1">$</span>all_trades</span> = <span class="pl-en">array_merge</span> (<span class="pl-s1"><span class="pl-c1">$</span>all_trades</span>, <span class="pl-s1"><span class="pl-c1">$</span>trades</span>); } <span class="pl-k">else</span> { <span class="pl-k">break</span>; } } }</pre></div> <div class="markdown-heading"><h3 class="heading-element">Pagenumber-based (Cursor) Pagination</h3><a id="user-content-pagenumber-based-cursor-pagination" class="anchor" aria-label="Permalink: Pagenumber-based (Cursor) Pagination" href="#pagenumber-based-cursor-pagination"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The user supplies a page number or an <em>initial "cursor"</em> value. The exchange returns a page of results and the <em>next "cursor"</em> value, to proceed from. Most of exchanges that implement this type of pagination will either return the next cursor within the response itself or will return the next cursor values within HTTP response headers.</p> <p>See an example implementation here: <a href="https://github.com/ccxt/ccxt/blob/master/examples/py/coinbasepro-fetch-my-trades-pagination.py">https://github.com/ccxt/ccxt/blob/master/examples/py/coinbasepro-fetch-my-trades-pagination.py</a></p> <p>Upon each iteration of the loop the user has to take the next cursor and put it into the overrided params for the next query (on the following iteration):</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-16" class="anchor" aria-label="Permalink: Javascript" href="#javascript-16"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if (exchange.has['fetchTrades']) { let page = 0 // exchange-specific type and value let allTrades = [] while (true) { const symbol = undefined // change for your symbol const since = undefined const limit = 20 // change for your limit const params = { 'page': page, // exchange-specific non-unified parameter name } const trades = await exchange.fetchTrades (symbol, since, limit, params) if (trades.length) { // not thread-safu and exchange-specific ! last_json_response = exchange.parseJson (exchange.last_http_response) page = last_json_response['cursor'] allTrades.push (trades) } else { break } } }"><pre><span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">has</span><span class="pl-kos">[</span><span class="pl-s">'fetchTrades'</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">let</span> <span class="pl-s1">page</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span> <span class="pl-c">// exchange-specific type and value</span> <span class="pl-k">let</span> <span class="pl-s1">allTrades</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">]</span> <span class="pl-k">while</span> <span class="pl-kos">(</span><span class="pl-c1">true</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span> <span class="pl-c">// change for your symbol</span> <span class="pl-k">const</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span> <span class="pl-k">const</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">20</span> <span class="pl-c">// change for your limit</span> <span class="pl-k">const</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-s">'page'</span>: <span class="pl-s1">page</span><span class="pl-kos">,</span> <span class="pl-c">// exchange-specific non-unified parameter name</span> <span class="pl-kos">}</span> <span class="pl-k">const</span> <span class="pl-s1">trades</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchTrades</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">since</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">trades</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-c">// not thread-safu and exchange-specific !</span> <span class="pl-s1">last_json_response</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">parseJson</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">last_http_response</span><span class="pl-kos">)</span> <span class="pl-s1">page</span> <span class="pl-c1">=</span> <span class="pl-s1">last_json_response</span><span class="pl-kos">[</span><span class="pl-s">'cursor'</span><span class="pl-kos">]</span> <span class="pl-s1">allTrades</span><span class="pl-kos">.</span><span class="pl-en">push</span> <span class="pl-kos">(</span><span class="pl-s1">trades</span><span class="pl-kos">)</span> <span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span> <span class="pl-k">break</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-16" class="anchor" aria-label="Permalink: Python" href="#python-16"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if exchange.has['fetchOrders']: cursor = 0 # exchange-specific type and value all_orders = [] while True: symbol = None # change for your symbol since = None limit = 20 # change for your limit params = { 'cursor': cursor, # exchange-specific non-unified parameter name } orders = await exchange.fetch_orders(symbol, since, limit, params) if len(orders): # not thread-safu and exchange-specific ! cursor = exchange.last_response_headers['CB-AFTER'] all_orders += orders else: break"><pre><span class="pl-k">if</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">has</span>[<span class="pl-s">'fetchOrders'</span>]: <span class="pl-s1">cursor</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span> <span class="pl-c"># exchange-specific type and value</span> <span class="pl-s1">all_orders</span> <span class="pl-c1">=</span> [] <span class="pl-k">while</span> <span class="pl-c1">True</span>: <span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-c1">None</span> <span class="pl-c"># change for your symbol</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-c1">None</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">20</span> <span class="pl-c"># change for your limit</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> { <span class="pl-s">'cursor'</span>: <span class="pl-s1">cursor</span>, <span class="pl-c"># exchange-specific non-unified parameter name</span> } <span class="pl-s1">orders</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">fetch_orders</span>(<span class="pl-s1">symbol</span>, <span class="pl-s1">since</span>, <span class="pl-s1">limit</span>, <span class="pl-s1">params</span>) <span class="pl-k">if</span> <span class="pl-en">len</span>(<span class="pl-s1">orders</span>): <span class="pl-c"># not thread-safu and exchange-specific !</span> <span class="pl-s1">cursor</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">last_response_headers</span>[<span class="pl-s">'CB-AFTER'</span>] <span class="pl-s1">all_orders</span> <span class="pl-c1">+=</span> <span class="pl-s1">orders</span> <span class="pl-k">else</span>: <span class="pl-k">break</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-16" class="anchor" aria-label="Permalink: PHP" href="#php-16"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if ($exchange->has['fetchMyTrades']) { $start = '0' // exchange-specific type and value $all_trades = array (); while (true) { $symbol = null; // change for your symbol $since = null; $limit = 20; // change for your limit $params = array ( 'start' => $start, // exchange-specific non-unified parameter name ); $trades = $exchange->fetchMyTrades ($symbol, $since, $limit, $params); if (count($trades)) { // not thread-safu and exchange-specific ! $last_json_response = $exchange->parse_json ($exchange->last_http_response); $start = $last_json_response['next']; $all_trades = array_merge ($all_trades, $trades); } else { break; } } }"><pre><span class="pl-k">if</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">has</span>[<span class="pl-s">'<span class="pl-s">fetchMyTrades</span>'</span>]) { <span class="pl-s1"><span class="pl-c1">$</span>start</span> = <span class="pl-s">'<span class="pl-s">0</span>'</span> <span class="pl-c">// exchange-specific type and value</span> <span class="pl-s1"><span class="pl-c1">$</span>all_trades</span> = <span class="pl-en">array</span> (); <span class="pl-k">while</span> (<span class="pl-c1">true</span>) { <span class="pl-s1"><span class="pl-c1">$</span>symbol</span> = <span class="pl-c1">null</span>; <span class="pl-c">// change for your symbol</span> <span class="pl-s1"><span class="pl-c1">$</span>since</span> = <span class="pl-c1">null</span>; <span class="pl-s1"><span class="pl-c1">$</span>limit</span> = <span class="pl-c1">20</span>; <span class="pl-c">// change for your limit</span> <span class="pl-s1"><span class="pl-c1">$</span>params</span> = <span class="pl-en">array</span> ( <span class="pl-s">'<span class="pl-s">start</span>'</span> => <span class="pl-s1"><span class="pl-c1">$</span>start</span>, <span class="pl-c">// exchange-specific non-unified parameter name</span> ); <span class="pl-s1"><span class="pl-c1">$</span>trades</span> = <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">fetchMyTrades</span> (<span class="pl-s1"><span class="pl-c1">$</span>symbol</span>, <span class="pl-s1"><span class="pl-c1">$</span>since</span>, <span class="pl-s1"><span class="pl-c1">$</span>limit</span>, <span class="pl-s1"><span class="pl-c1">$</span>params</span>); <span class="pl-k">if</span> (<span class="pl-en">count</span>(<span class="pl-s1"><span class="pl-c1">$</span>trades</span>)) { <span class="pl-c">// not thread-safu and exchange-specific !</span> <span class="pl-s1"><span class="pl-c1">$</span>last_json_response</span> = <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">parse_json</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">last_http_response</span>); <span class="pl-s1"><span class="pl-c1">$</span>start</span> = <span class="pl-s1"><span class="pl-c1">$</span>last_json_response</span>[<span class="pl-s">'<span class="pl-s">next</span>'</span>]; <span class="pl-s1"><span class="pl-c1">$</span>all_trades</span> = <span class="pl-en">array_merge</span> (<span class="pl-s1"><span class="pl-c1">$</span>all_trades</span>, <span class="pl-s1"><span class="pl-c1">$</span>trades</span>); } <span class="pl-k">else</span> { <span class="pl-k">break</span>; } } }</pre></div> <div class="markdown-heading"><h1 class="heading-element">Public API</h1><a id="user-content-public-api" class="anchor" aria-label="Permalink: Public API" href="#public-api"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <ul> <li><a href="#order-book">Order Book</a></li> <li><a href="#price-tickers">Price Tickers</a></li> <li><a href="#ohlcv-candlestick-charts">OHLCV Candlestick Charts</a></li> <li><a href="#public-trades">Public Trades</a></li> <li><a href="#exchange-time">Exchange Time</a></li> <li><a href="#exchange-status">Exchange Status</a></li> <li><a href="#borrow-rates">Borrow Rates</a></li> <li><a href="#borrow-rate-history">Borrow Rate History</a></li> <li><a href="#leverage-tiers">Leverage Tiers</a></li> <li><a href="#funding-rate">Funding Rate</a></li> <li><a href="#funding-rate-history">Funding Rate History</a></li> <li><a href="#open-interest-history">Open Interest History</a></li> <li><a href="#volatility-history">Volatility History</a></li> <li><a href="#underlying-assets">Underlying Assets</a></li> <li><a href="#liquidations">Liquidations</a></li> <li><a href="#greeks">Greeks</a></li> <li><a href="#option-chain">OptionChain</a></li> </ul> <div class="markdown-heading"><h2 class="heading-element">Order Book</h2><a id="user-content-order-book" class="anchor" aria-label="Permalink: Order Book" href="#order-book"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Exchanges expose information on open orders with bid (buy) and ask (sell) prices, volumes and other data. Usually there is a separate endpoint for querying current state (stack frame) of the <em>order book</em> for a particular market. An order book is also often called <em>market depth</em>. The order book information is used in the trading decision making process.</p> <p>To get data on order books, you can use</p> <ul> <li> <code>fetchOrderBook ()</code> // for a single markets order books</li> <li> <code>fetchOrderBooks ( symbols )</code> // for multiple markets order books</li> <li> <code>fetchOrderBooks ()</code> // for the order books of all markets</li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="async fetchOrderBook (symbol, limit = undefined, params = {})"><pre><span class="pl-en">async</span> <span class="pl-s1">fetchOrderBook</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbol</strong> (String) <em>required</em> Unified CCXT symbol (e.g. <code>"BTC/USDT"</code>)</li> <li> <strong>limit</strong> (Integer) The number of orders to return in the order book (e.g. <code>10</code>)</li> <li> <strong>params</strong> (Dictionary) Extra parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>An <a href="#order-book-structure">order book structure</a> </li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="async fetchOrderBooks (symbols = undefined, limit = undefined, params = {})"><pre><span class="pl-en">async</span> <span class="pl-s1">fetchOrderBooks</span> <span class="pl-kos">(</span><span class="pl-s1">symbols</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbols</strong> ([String]) Unified CCXT symbols (e.g. <code>["BTC/USDT", "ETH/USDT"]</code>)</li> <li> <strong>limit</strong> (Integer) The number of orders to return in the order book (e.g. <code>10</code>)</li> <li> <strong>params</strong> (Dictionary) Extra parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>A dictionary of <a href="#order-book-structure">order book structures</a> indexed by market symbols</li> </ul> <div class="markdown-heading"><h3 class="heading-element">fetchOrderBook Examples</h3><a id="user-content-fetchorderbook-examples" class="anchor" aria-label="Permalink: fetchOrderBook Examples" href="#fetchorderbook-examples"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-17" class="anchor" aria-label="Permalink: Javascript" href="#javascript-17"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="delay = 2000 // milliseconds = seconds * 1000 (async () => { for (symbol in exchange.markets) { console.log (await exchange.fetchOrderBook (symbol)) await new Promise (resolve => setTimeout (resolve, delay)) // rate limit } }) ()"><pre><span class="pl-s1">delay</span> <span class="pl-c1">=</span> <span class="pl-c1">2000</span> <span class="pl-c">// milliseconds = seconds * 1000</span> <span class="pl-kos">(</span><span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span> <span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span> <span class="pl-k">in</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">markets</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchOrderBook</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-k">await</span> <span class="pl-k">new</span> <span class="pl-v">Promise</span> <span class="pl-kos">(</span><span class="pl-s1">resolve</span> <span class="pl-c1">=></span> <span class="pl-en">setTimeout</span> <span class="pl-kos">(</span><span class="pl-s1">resolve</span><span class="pl-kos">,</span> <span class="pl-s1">delay</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-c">// rate limit</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">(</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-17" class="anchor" aria-label="Permalink: Python" href="#python-17"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import time delay = 2 # seconds for symbol in exchange.markets: print (exchange.fetch_order_book (symbol)) time.sleep (delay) # rate limit"><pre><span class="pl-k">import</span> <span class="pl-s1">time</span> <span class="pl-s1">delay</span> <span class="pl-c1">=</span> <span class="pl-c1">2</span> <span class="pl-c"># seconds</span> <span class="pl-k">for</span> <span class="pl-s1">symbol</span> <span class="pl-c1">in</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">markets</span>: <span class="pl-en">print</span> (<span class="pl-s1">exchange</span>.<span class="pl-c1">fetch_order_book</span> (<span class="pl-s1">symbol</span>)) <span class="pl-s1">time</span>.<span class="pl-c1">sleep</span> (<span class="pl-s1">delay</span>) <span class="pl-c"># rate limit</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-17" class="anchor" aria-label="Permalink: PHP" href="#php-17"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$delay = 2000000; // microseconds = seconds * 1000000 foreach ($exchange->markets as $symbol => $market) { var_dump ($exchange->fetch_order_book ($symbol)); usleep ($delay); // rate limit }"><pre><span class="pl-s1"><span class="pl-c1">$</span>delay</span> = <span class="pl-c1">2000000</span>; <span class="pl-c">// microseconds = seconds * 1000000</span> <span class="pl-k">foreach</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">markets</span> <span class="pl-k">as</span> <span class="pl-s1"><span class="pl-c1">$</span>symbol</span> => <span class="pl-s1"><span class="pl-c1">$</span>market</span>) { <span class="pl-en">var_dump</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">fetch_order_book</span> (<span class="pl-s1"><span class="pl-c1">$</span>symbol</span>)); <span class="pl-en">usleep</span> (<span class="pl-s1"><span class="pl-c1">$</span>delay</span>); <span class="pl-c">// rate limit</span> }</pre></div> <div class="markdown-heading"><h3 class="heading-element">Order Book Structure</h3><a id="user-content-order-book-structure" class="anchor" aria-label="Permalink: Order Book Structure" href="#order-book-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ 'bids': [ [ price, amount ], // [ float, float ] [ price, amount ], ... ], 'asks': [ [ price, amount ], [ price, amount ], ... ], 'symbol': 'ETH/BTC', // a unified market symbol 'timestamp': 1499280391811, // Unix Timestamp in milliseconds (seconds * 1000) 'datetime': '2017-07-05T18:47:14.692Z', // ISO8601 datetime string with milliseconds 'nonce': 1499280391811, // an increasing unique identifier of the orderbook snapshot }"><pre><span class="pl-kos">{</span> <span class="pl-s">'bids'</span>: <span class="pl-kos">[</span> <span class="pl-kos">[</span> <span class="pl-s1">price</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span> <span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-c">// [ float, float ]</span> <span class="pl-kos">[</span> <span class="pl-s1">price</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span> <span class="pl-kos">]</span><span class="pl-kos">,</span> ... <span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-s">'asks'</span>: <span class="pl-kos">[</span> <span class="pl-kos">[</span> <span class="pl-s1">price</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span> <span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-kos">[</span> <span class="pl-s1">price</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span> <span class="pl-kos">]</span><span class="pl-kos">,</span> ... <span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-s">'symbol'</span>: <span class="pl-s">'ETH/BTC'</span><span class="pl-kos">,</span> <span class="pl-c">// a unified market symbol</span> <span class="pl-s">'timestamp'</span>: <span class="pl-c1">1499280391811</span><span class="pl-kos">,</span> <span class="pl-c">// Unix Timestamp in milliseconds (seconds * 1000)</span> <span class="pl-s">'datetime'</span>: <span class="pl-s">'2017-07-05T18:47:14.692Z'</span><span class="pl-kos">,</span> <span class="pl-c">// ISO8601 datetime string with milliseconds</span> <span class="pl-s">'nonce'</span>: <span class="pl-c1">1499280391811</span><span class="pl-kos">,</span> <span class="pl-c">// an increasing unique identifier of the orderbook snapshot</span> <span class="pl-kos">}</span></pre></div> <p><strong>The timestamp and datetime may be missing (<code>undefined/None/null</code>) if the exchange in question does not provide a corresponding value in the API response.</strong></p> <p>Prices and amounts are floats. The bids array is sorted by price in descending order. The best (highest) bid price is the first element and the worst (lowest) bid price is the last element. The asks array is sorted by price in ascending order. The best (lowest) ask price is the first element and the worst (highest) ask price is the last element. Bid/ask arrays can be empty if there are no corresponding orders in the order book of an exchange.</p> <p>Exchanges may return the stack of orders in various levels of details for analysis. It is either in full detail containing each and every order, or it is aggregated having slightly less detail where orders are grouped and merged by price and volume. Having greater detail requires more traffic and bandwidth and is slower in general but gives a benefit of higher precision. Having less detail is usually faster, but may not be enough in some very specific cases.</p> <div class="markdown-heading"><h3 class="heading-element">Notes On Order Book Structure</h3><a id="user-content-notes-on-order-book-structure" class="anchor" aria-label="Permalink: Notes On Order Book Structure" href="#notes-on-order-book-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <ul> <li>The <code>orderbook['timestamp']</code> is the time when the exchange generated this orderbook response (before replying it back to you). This may be missing (<code>undefined/None/null</code>), as documented in the Manual, not all exchanges provide a timestamp there. If it is defined, then it is the UTC timestamp <strong>in milliseconds</strong> since 1 Jan 1970 00:00:00.</li> <li>Some exchanges may index orders in the orderbook by order ids, in that case the order id may be returned as the third element of bids and asks: <code>[ price, amount, id ]</code>. This is often the case with L3 orderbooks without aggregation. The order <code>id</code>, if shown in the orderbook, refers to the orderbook and does not necessarily correspond to the actual order id from the exchanges' database as seen by the owner or by the others. The order id is an <code>id</code> of the row inside the orderbook, but not necessarily the true-<code>id</code> of the order (though, they may be equal as well, depending on the exchange in question).</li> <li>In some cases the exchanges may supply L2 aggregated orderbooks with order counts for each aggregated level, in that case the order count may be returned as the third element of bids and asks: <code>[ price, amount, count ]</code>. The <code>count</code> tells how many orders are aggregated on each price level in bids and asks.</li> <li>Also, some exchanges may return the order timestamp as the third element of bids and asks: <code>[ price, amount, timestamp ]</code>. The <code>timestamp</code> tells when the order was placed on the orderbook.</li> </ul> <div class="markdown-heading"><h3 class="heading-element">Market Depth</h3><a id="user-content-market-depth" class="anchor" aria-label="Permalink: Market Depth" href="#market-depth"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Some exchanges accept a dictionary of extra parameters to the <code>fetchOrderBook () / fetch_order_book ()</code> function. <strong>All extra <code>params</code> are exchange-specific (non-unified)</strong>. You will need to consult exchanges docs if you want to override a particular param, like the depth of the order book. You can get a limited count of returned orders or a desired level of aggregation (aka <em>market depth</em>) by specifying an limit argument and exchange-specific extra <code>params</code> like so:</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-18" class="anchor" aria-label="Permalink: Javascript" href="#javascript-18"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" (async function test () { const ccxt = require ('ccxt') const exchange = new ccxt.bitfinex () const limit = 5 const orders = await exchange.fetchOrderBook ('BTC/USD', limit, { // this parameter is exchange-specific, all extra params have unique names per exchange 'group': 1, // 1 = orders are grouped by price, 0 = orders are separate }) }) ()"><pre><span class="pl-kos">(</span><span class="pl-k">async</span> <span class="pl-k">function</span> <span class="pl-en">test</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-s1">ccxt</span> <span class="pl-c1">=</span> <span class="pl-en">require</span> <span class="pl-kos">(</span><span class="pl-s">'ccxt'</span><span class="pl-kos">)</span> <span class="pl-k">const</span> <span class="pl-s1">exchange</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">bitfinex</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-k">const</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">5</span> <span class="pl-k">const</span> <span class="pl-s1">orders</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchOrderBook</span> <span class="pl-kos">(</span><span class="pl-s">'BTC/USD'</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c">// this parameter is exchange-specific, all extra params have unique names per exchange</span> <span class="pl-s">'group'</span>: <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c">// 1 = orders are grouped by price, 0 = orders are separate</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">(</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-18" class="anchor" aria-label="Permalink: Python" href="#python-18"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" import ccxt # return up to ten bidasks on each side of the order book stack limit = 10 ccxt.cex().fetch_order_book('BTC/USD', limit)"><pre><span class="pl-k">import</span> <span class="pl-s1">ccxt</span> <span class="pl-c"># return up to ten bidasks on each side of the order book stack</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">10</span> <span class="pl-s1">ccxt</span>.<span class="pl-c1">cex</span>().<span class="pl-c1">fetch_order_book</span>(<span class="pl-s">'BTC/USD'</span>, <span class="pl-s1">limit</span>)</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-18" class="anchor" aria-label="Permalink: PHP" href="#php-18"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" // instantiate the exchange by id $exchange = '\\ccxt\\kraken'; $exchange = new $exchange (); // up to ten orders on each side, for example $limit = 20; var_dump ($exchange->fetch_order_book ('BTC/USD', $limit));"><pre><span class="pl-c">// instantiate the exchange by id</span> <span class="pl-s1"><span class="pl-c1">$</span>exchange</span> = <span class="pl-s">'\\<span class="pl-s">ccxt</span>\\<span class="pl-s">kraken</span>'</span>; <span class="pl-s1"><span class="pl-c1">$</span>exchange</span> = <span class="pl-k">new</span> <span class="pl-s1"><span class="pl-c1">$</span>exchange</span> (); <span class="pl-c">// up to ten orders on each side, for example</span> <span class="pl-s1"><span class="pl-c1">$</span>limit</span> = <span class="pl-c1">20</span>; <span class="pl-en">var_dump</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">fetch_order_book</span> (<span class="pl-s">'<span class="pl-s">BTC/USD</span>'</span>, <span class="pl-s1"><span class="pl-c1">$</span>limit</span>));</pre></div> <p>The levels of detail or levels of order book aggregation are often number-labelled like L1, L2, L3...</p> <ul> <li> <strong>L1</strong>: less detail for quickly obtaining very basic info, namely, the market price only. It appears to look like just one order in the order book.</li> <li> <strong>L2</strong>: most common level of aggregation where order volumes are grouped by price. If two orders have the same price, they appear as one single order for a volume equal to their total sum. This is most likely the level of aggregation you need for the majority of purposes.</li> <li> <strong>L3</strong>: most detailed level with no aggregation where each order is separate from other orders. This LOD naturally contains duplicates in the output. So, if two orders have equal prices they are <strong>not</strong> merged together and it's up to the exchange's matching engine to decide on their priority in the stack. You don't really need L3 detail for successful trading. In fact, you most probably don't need it at all. Therefore some exchanges don't support it and always return aggregated order books.</li> </ul> <p>If you want to get an L2 order book, whatever the exchange returns, use the <code>fetchL2OrderBook(symbol, limit, params)</code> or <code>fetch_l2_order_book(symbol, limit, params)</code> unified method for that.</p> <p>The <code>limit</code> argument does not guarantee that the number of bids or asks will always be equal to <code>limit</code>. It designates the upper boundary or the maximum, so at some moment in time there may be less than <code>limit</code> bids or asks. This is the case when the exchange does not have enough orders on the orderbook. However, if the underlying exchange API does not support a <code>limit</code> parameter for the orderbook endpoint at all, then the <code>limit</code> argument will be ignored. CCXT does not trim <code>bids</code> and <code>asks</code> if the exchange returns more than you request.</p> <div class="markdown-heading"><h3 class="heading-element">Market Price</h3><a id="user-content-market-price" class="anchor" aria-label="Permalink: Market Price" href="#market-price"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>In order to get current best price (query market price) and calculate bidask spread take first elements from bid and ask, like so:</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-19" class="anchor" aria-label="Permalink: Javascript" href="#javascript-19"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="let orderbook = await exchange.fetchOrderBook (exchange.symbols[0]) let bid = orderbook.bids.length ? orderbook.bids[0][0] : undefined let ask = orderbook.asks.length ? orderbook.asks[0][0] : undefined let spread = (bid && ask) ? ask - bid : undefined console.log (exchange.id, 'market price', { bid, ask, spread })"><pre><span class="pl-k">let</span> <span class="pl-s1">orderbook</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchOrderBook</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">symbols</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-k">let</span> <span class="pl-s1">bid</span> <span class="pl-c1">=</span> <span class="pl-s1">orderbook</span><span class="pl-kos">.</span><span class="pl-c1">bids</span><span class="pl-kos">.</span><span class="pl-c1">length</span> ? <span class="pl-s1">orderbook</span><span class="pl-kos">.</span><span class="pl-c1">bids</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span> : <span class="pl-c1">undefined</span> <span class="pl-k">let</span> <span class="pl-s1">ask</span> <span class="pl-c1">=</span> <span class="pl-s1">orderbook</span><span class="pl-kos">.</span><span class="pl-c1">asks</span><span class="pl-kos">.</span><span class="pl-c1">length</span> ? <span class="pl-s1">orderbook</span><span class="pl-kos">.</span><span class="pl-c1">asks</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span> : <span class="pl-c1">undefined</span> <span class="pl-k">let</span> <span class="pl-s1">spread</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-s1">bid</span> <span class="pl-c1">&&</span> <span class="pl-s1">ask</span><span class="pl-kos">)</span> ? <span class="pl-s1">ask</span> <span class="pl-c1">-</span> <span class="pl-s1">bid</span> : <span class="pl-c1">undefined</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">id</span><span class="pl-kos">,</span> <span class="pl-s">'market price'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> bid<span class="pl-kos">,</span> ask<span class="pl-kos">,</span> spread <span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-19" class="anchor" aria-label="Permalink: Python" href="#python-19"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="orderbook = exchange.fetch_order_book (exchange.symbols[0]) bid = orderbook['bids'][0][0] if len (orderbook['bids']) > 0 else None ask = orderbook['asks'][0][0] if len (orderbook['asks']) > 0 else None spread = (ask - bid) if (bid and ask) else None print (exchange.id, 'market price', { 'bid': bid, 'ask': ask, 'spread': spread })"><pre><span class="pl-s1">orderbook</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">fetch_order_book</span> (<span class="pl-s1">exchange</span>.<span class="pl-c1">symbols</span>[<span class="pl-c1">0</span>]) <span class="pl-s1">bid</span> <span class="pl-c1">=</span> <span class="pl-s1">orderbook</span>[<span class="pl-s">'bids'</span>][<span class="pl-c1">0</span>][<span class="pl-c1">0</span>] <span class="pl-k">if</span> <span class="pl-en">len</span> (<span class="pl-s1">orderbook</span>[<span class="pl-s">'bids'</span>]) <span class="pl-c1">></span> <span class="pl-c1">0</span> <span class="pl-k">else</span> <span class="pl-c1">None</span> <span class="pl-s1">ask</span> <span class="pl-c1">=</span> <span class="pl-s1">orderbook</span>[<span class="pl-s">'asks'</span>][<span class="pl-c1">0</span>][<span class="pl-c1">0</span>] <span class="pl-k">if</span> <span class="pl-en">len</span> (<span class="pl-s1">orderbook</span>[<span class="pl-s">'asks'</span>]) <span class="pl-c1">></span> <span class="pl-c1">0</span> <span class="pl-k">else</span> <span class="pl-c1">None</span> <span class="pl-s1">spread</span> <span class="pl-c1">=</span> (<span class="pl-s1">ask</span> <span class="pl-c1">-</span> <span class="pl-s1">bid</span>) <span class="pl-k">if</span> (<span class="pl-s1">bid</span> <span class="pl-c1">and</span> <span class="pl-s1">ask</span>) <span class="pl-k">else</span> <span class="pl-c1">None</span> <span class="pl-en">print</span> (<span class="pl-s1">exchange</span>.<span class="pl-c1">id</span>, <span class="pl-s">'market price'</span>, { <span class="pl-s">'bid'</span>: <span class="pl-s1">bid</span>, <span class="pl-s">'ask'</span>: <span class="pl-s1">ask</span>, <span class="pl-s">'spread'</span>: <span class="pl-s1">spread</span> })</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-19" class="anchor" aria-label="Permalink: PHP" href="#php-19"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$orderbook = $exchange->fetch_order_book ($exchange->symbols[0]); $bid = count ($orderbook['bids']) ? $orderbook['bids'][0][0] : null; $ask = count ($orderbook['asks']) ? $orderbook['asks'][0][0] : null; $spread = ($bid && $ask) ? $ask - $bid : null; $result = array ('bid' => $bid, 'ask' => $ask, 'spread' => $spread); var_dump ($exchange->id, 'market price', $result);"><pre><span class="pl-s1"><span class="pl-c1">$</span>orderbook</span> = <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">fetch_order_book</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">symbols</span>[<span class="pl-c1">0</span>]); <span class="pl-s1"><span class="pl-c1">$</span>bid</span> = <span class="pl-en">count</span> (<span class="pl-s1"><span class="pl-c1">$</span>orderbook</span>[<span class="pl-s">'<span class="pl-s">bids</span>'</span>]) ? <span class="pl-s1"><span class="pl-c1">$</span>orderbook</span>[<span class="pl-s">'<span class="pl-s">bids</span>'</span>][<span class="pl-c1">0</span>][<span class="pl-c1">0</span>] : <span class="pl-c1">null</span>; <span class="pl-s1"><span class="pl-c1">$</span>ask</span> = <span class="pl-en">count</span> (<span class="pl-s1"><span class="pl-c1">$</span>orderbook</span>[<span class="pl-s">'<span class="pl-s">asks</span>'</span>]) ? <span class="pl-s1"><span class="pl-c1">$</span>orderbook</span>[<span class="pl-s">'<span class="pl-s">asks</span>'</span>][<span class="pl-c1">0</span>][<span class="pl-c1">0</span>] : <span class="pl-c1">null</span>; <span class="pl-s1"><span class="pl-c1">$</span>spread</span> = (<span class="pl-s1"><span class="pl-c1">$</span>bid</span> && <span class="pl-s1"><span class="pl-c1">$</span>ask</span>) ? <span class="pl-s1"><span class="pl-c1">$</span>ask</span> - <span class="pl-s1"><span class="pl-c1">$</span>bid</span> : <span class="pl-c1">null</span>; <span class="pl-s1"><span class="pl-c1">$</span>result</span> = <span class="pl-en">array</span> (<span class="pl-s">'<span class="pl-s">bid</span>'</span> => <span class="pl-s1"><span class="pl-c1">$</span>bid</span>, <span class="pl-s">'<span class="pl-s">ask</span>'</span> => <span class="pl-s1"><span class="pl-c1">$</span>ask</span>, <span class="pl-s">'<span class="pl-s">spread</span>'</span> => <span class="pl-s1"><span class="pl-c1">$</span>spread</span>); <span class="pl-en">var_dump</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">id</span>, <span class="pl-s">'<span class="pl-s">market price</span>'</span>, <span class="pl-s1"><span class="pl-c1">$</span>result</span>);</pre></div> <div class="markdown-heading"><h2 class="heading-element">Price Tickers</h2><a id="user-content-price-tickers" class="anchor" aria-label="Permalink: Price Tickers" href="#price-tickers"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>A price ticker contains statistics for a particular market/symbol for some period of time in recent past, usually last 24 hours. The methods for fetching tickers are described below.</p> <div class="markdown-heading"><h3 class="heading-element">A Single Ticker For One Symbol</h3><a id="user-content-a-single-ticker-for-one-symbol" class="anchor" aria-label="Permalink: A Single Ticker For One Symbol" href="#a-single-ticker-for-one-symbol"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// one ticker fetchTicker (symbol, params = {}) // example fetchTicker ('ETH/BTC') fetchTicker ('BTC/USDT')"><pre><span class="pl-c">// one ticker</span> <span class="pl-en">fetchTicker</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c">// example</span> <span class="pl-en">fetchTicker</span> <span class="pl-kos">(</span><span class="pl-s">'ETH/BTC'</span><span class="pl-kos">)</span> <span class="pl-en">fetchTicker</span> <span class="pl-kos">(</span><span class="pl-s">'BTC/USDT'</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Multiple Tickers For All Or Many Symbols</h3><a id="user-content-multiple-tickers-for-all-or-many-symbols" class="anchor" aria-label="Permalink: Multiple Tickers For All Or Many Symbols" href="#multiple-tickers-for-all-or-many-symbols"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// multiple tickers fetchTickers (symbols = undefined, params = {}) // for all tickers at once // for example fetchTickers () // all symbols fetchTickers ([ 'ETH/BTC', 'BTC/USDT' ]) // an array of specific symbols"><pre><span class="pl-c">// multiple tickers</span> <span class="pl-en">fetchTickers</span> <span class="pl-kos">(</span><span class="pl-s1">symbols</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c">// for all tickers at once</span> <span class="pl-c">// for example</span> <span class="pl-en">fetchTickers</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c">// all symbols</span> <span class="pl-en">fetchTickers</span> <span class="pl-kos">(</span><span class="pl-kos">[</span> <span class="pl-s">'ETH/BTC'</span><span class="pl-kos">,</span> <span class="pl-s">'BTC/USDT'</span> <span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-c">// an array of specific symbols</span></pre></div> <p>Check the <code>exchange.has['fetchTicker']</code> and <code>exchange.has['fetchTickers']</code> properties of the exchange instance to determine if the exchange in question does support these methods.</p> <p><strong>Please, note, that calling <code>fetchTickers ()</code> without a symbol is usually strictly rate-limited, an exchange may ban you if you poll that endpoint too frequently.</strong></p> <div class="markdown-heading"><h3 class="heading-element">Ticker Structure</h3><a id="user-content-ticker-structure" class="anchor" aria-label="Permalink: Ticker Structure" href="#ticker-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>A ticker is a statistical calculation with the information calculated over the past 24 hours for a specific market.</p> <p>The structure of a ticker is as follows:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ 'symbol': string symbol of the market ('BTC/USD', 'ETH/BTC', ...) 'info': { the original non-modified unparsed reply from exchange API }, 'timestamp': int (64-bit Unix Timestamp in milliseconds since Epoch 1 Jan 1970) 'datetime': ISO8601 datetime string with milliseconds 'high': float, // highest price 'low': float, // lowest price 'bid': float, // current best bid (buy) price 'bidVolume': float, // current best bid (buy) amount (may be missing or undefined) 'ask': float, // current best ask (sell) price 'askVolume': float, // current best ask (sell) amount (may be missing or undefined) 'vwap': float, // volume weighed average price 'open': float, // opening price 'close': float, // price of last trade (closing price for current period) 'last': float, // same as `close`, duplicated for convenience 'previousClose': float, // closing price for the previous period 'change': float, // absolute change, `last - open` 'percentage': float, // relative change, `(change/open) * 100` 'average': float, // average price, `(last + open) / 2` 'baseVolume': float, // volume of base currency traded for last 24 hours 'quoteVolume': float, // volume of quote currency traded for last 24 hours }"><pre><span class="pl-kos">{</span> <span class="pl-s">'symbol'</span>: <span class="pl-s1">string</span> <span class="pl-s1">symbol</span> <span class="pl-k">of</span> <span class="pl-s1">the</span> <span class="pl-en">market</span> <span class="pl-kos">(</span><span class="pl-s">'BTC/USD'</span><span class="pl-kos">,</span> <span class="pl-s">'ETH/BTC'</span><span class="pl-kos">,</span> ...<span class="pl-kos">)</span> <span class="pl-s">'info'</span>: <span class="pl-kos">{</span> <span class="pl-s1">the</span> <span class="pl-s1">original</span> <span class="pl-s1">non</span><span class="pl-c1">-</span><span class="pl-s1">modified</span> <span class="pl-s1">unparsed</span> <span class="pl-s1">reply</span> <span class="pl-k">from</span> <span class="pl-s1">exchange</span> <span class="pl-c1">API</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'timestamp'</span>: <span class="pl-s1">int</span> <span class="pl-kos">(</span><span class="pl-c1">64</span><span class="pl-c1">-</span><span class="pl-s1">bit</span> <span class="pl-v">Unix</span> <span class="pl-v">Timestamp</span> <span class="pl-k">in</span> <span class="pl-s1">milliseconds</span> <span class="pl-s1">since</span> <span class="pl-v">Epoch</span> <span class="pl-c1">1</span> <span class="pl-v">Jan</span> <span class="pl-c1">1970</span><span class="pl-kos">)</span> <span class="pl-s">'datetime'</span>: <span class="pl-c1">ISO8601</span> <span class="pl-s1">datetime</span> <span class="pl-s1">string</span> <span class="pl-s1">with</span> <span class="pl-s1">milliseconds</span> <span class="pl-s">'high'</span>: <span class="pl-s1">float</span><span class="pl-kos">,</span> <span class="pl-c">// highest price</span> <span class="pl-s">'low'</span>: <span class="pl-s1">float</span><span class="pl-kos">,</span> <span class="pl-c">// lowest price</span> <span class="pl-s">'bid'</span>: <span class="pl-s1">float</span><span class="pl-kos">,</span> <span class="pl-c">// current best bid (buy) price</span> <span class="pl-s">'bidVolume'</span>: <span class="pl-s1">float</span><span class="pl-kos">,</span> <span class="pl-c">// current best bid (buy) amount (may be missing or undefined)</span> <span class="pl-s">'ask'</span>: <span class="pl-s1">float</span><span class="pl-kos">,</span> <span class="pl-c">// current best ask (sell) price</span> <span class="pl-s">'askVolume'</span>: <span class="pl-s1">float</span><span class="pl-kos">,</span> <span class="pl-c">// current best ask (sell) amount (may be missing or undefined)</span> <span class="pl-s">'vwap'</span>: <span class="pl-s1">float</span><span class="pl-kos">,</span> <span class="pl-c">// volume weighed average price</span> <span class="pl-s">'open'</span>: <span class="pl-s1">float</span><span class="pl-kos">,</span> <span class="pl-c">// opening price</span> <span class="pl-s">'close'</span>: <span class="pl-s1">float</span><span class="pl-kos">,</span> <span class="pl-c">// price of last trade (closing price for current period)</span> <span class="pl-s">'last'</span>: <span class="pl-s1">float</span><span class="pl-kos">,</span> <span class="pl-c">// same as `close`, duplicated for convenience</span> <span class="pl-s">'previousClose'</span>: <span class="pl-s1">float</span><span class="pl-kos">,</span> <span class="pl-c">// closing price for the previous period</span> <span class="pl-s">'change'</span>: <span class="pl-s1">float</span><span class="pl-kos">,</span> <span class="pl-c">// absolute change, `last - open`</span> <span class="pl-s">'percentage'</span>: <span class="pl-s1">float</span><span class="pl-kos">,</span> <span class="pl-c">// relative change, `(change/open) * 100`</span> <span class="pl-s">'average'</span>: <span class="pl-s1">float</span><span class="pl-kos">,</span> <span class="pl-c">// average price, `(last + open) / 2`</span> <span class="pl-s">'baseVolume'</span>: <span class="pl-s1">float</span><span class="pl-kos">,</span> <span class="pl-c">// volume of base currency traded for last 24 hours</span> <span class="pl-s">'quoteVolume'</span>: <span class="pl-s1">float</span><span class="pl-kos">,</span> <span class="pl-c">// volume of quote currency traded for last 24 hours</span><span class="pl-kos"></span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h4 class="heading-element">Notes On Ticker Structure</h4><a id="user-content-notes-on-ticker-structure" class="anchor" aria-label="Permalink: Notes On Ticker Structure" href="#notes-on-ticker-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <ul> <li>All fields in the ticker represent the past 24 hours prior to <code>timestamp</code>.</li> <li>The <code>bidVolume</code> is the volume (amount) of current best bid in the orderbook.</li> <li>The <code>askVolume</code> is the volume (amount) of current best ask in the orderbook.</li> <li>The <code>baseVolume</code> is the amount of base currency traded (bought or sold) in last 24 hours.</li> <li>The <code>quoteVolume</code> is the amount of quote currency traded (bought or sold) in last 24 hours.</li> </ul> <p><strong>All prices in ticker structure are in quote currency. Some fields in a returned ticker structure may be undefined/None/null.</strong></p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="base currency ↓ BTC / USDT ETH / BTC DASH / ETH ↑ quote currency"><pre lang="text" class="notranslate"><code>base currency ↓ BTC / USDT ETH / BTC DASH / ETH ↑ quote currency </code></pre></div> <p>Timestamp and datetime are both Universal Time Coordinated (UTC) in milliseconds.</p> <ul> <li> <code>ticker['timestamp']</code> is the time when the exchange generated this response (before replying it back to you). It may be missing (<code>undefined/None/null</code>), as documented in the Manual, not all exchanges provide a timestamp there. If it is defined, then it is a UTC timestamp <strong>in milliseconds</strong> since 1 Jan 1970 00:00:00.</li> <li> <code>exchange.last_response_headers['Date']</code> is the date-time string of the last HTTP response received (from HTTP headers). The 'Date' parser should respect the timezone designated there. The precision of the date-time is 1 second, 1000 milliseconds. This date should be set by the exchange server when the message originated according to the following standards: <ul> <li><a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.18" rel="nofollow">https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.18</a></li> <li><a href="https://tools.ietf.org/html/rfc1123#section-5.2.14" rel="nofollow">https://tools.ietf.org/html/rfc1123#section-5.2.14</a></li> <li><a href="https://tools.ietf.org/html/rfc822#section-5" rel="nofollow">https://tools.ietf.org/html/rfc822#section-5</a></li> </ul> </li> </ul> <p>Although some exchanges do mix-in orderbook's top bid/ask prices into their tickers (and some exchanges even serve top bid/ask volumes) you should not treat a ticker as a <code>fetchOrderBook</code> replacement. The main purpose of a ticker is to serve statistical data, as such, treat it as "live 24h OHLCV". It is known that exchanges discourage frequent <code>fetchTicker</code> requests by imposing stricter rate limits on these queries. If you need a unified way to access bids and asks you should use <code>fetchL[123]OrderBook</code> family instead.</p> <p>To get historical prices and volumes use the unified <a href="#ohlcv-candlestick-charts"><code>fetchOHLCV</code></a> method where available. To get historical mark, index, and premium index prices, add one of <code>'price': 'mark'</code>, <code>'price': 'index'</code>, <code>'price': 'premiumIndex'</code> respectively to the <a href="#overriding-unified-api-params">params-overrides</a> of <code>fetchOHLCV</code>. There are also convenience methods <code>fetchMarkPriceOHLCV</code>, <code>fetchIndexPriceOHLCV</code>, and <code>fetchPremiumIndexOHLCV</code> that obtain the mark, index and premiumIndex historical prices and volumes.</p> <p>Methods for fetching tickers:</p> <ul> <li> <code>fetchTicker (symbol[, params = {}])</code>, symbol is required, params are optional</li> <li> <code>fetchTickers ([symbols = undefined[, params = {}]])</code>, both arguments optional</li> </ul> <div class="markdown-heading"><h3 class="heading-element">Individually By Symbol</h3><a id="user-content-individually-by-symbol" class="anchor" aria-label="Permalink: Individually By Symbol" href="#individually-by-symbol"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>To get the individual ticker data from an exchange for a particular trading pair or a specific symbol – call the <code>fetchTicker (symbol)</code>:</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-20" class="anchor" aria-label="Permalink: Javascript" href="#javascript-20"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if (exchange.has['fetchTicker']) { console.log (await (exchange.fetchTicker ('BTC/USD'))) // ticker for BTC/USD let symbols = Object.keys (exchange.markets) let random = Math.floor (Math.random () * (symbols.length - 1)) console.log (exchange.fetchTicker (symbols[random])) // ticker for a random symbol }"><pre><span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">has</span><span class="pl-kos">[</span><span class="pl-s">'fetchTicker'</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-k">await</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchTicker</span> <span class="pl-kos">(</span><span class="pl-s">'BTC/USD'</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-c">// ticker for BTC/USD</span> <span class="pl-k">let</span> <span class="pl-s1">symbols</span> <span class="pl-c1">=</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">keys</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">markets</span><span class="pl-kos">)</span> <span class="pl-k">let</span> <span class="pl-s1">random</span> <span class="pl-c1">=</span> <span class="pl-v">Math</span><span class="pl-kos">.</span><span class="pl-en">floor</span> <span class="pl-kos">(</span><span class="pl-v">Math</span><span class="pl-kos">.</span><span class="pl-en">random</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">*</span> <span class="pl-kos">(</span><span class="pl-s1">symbols</span><span class="pl-kos">.</span><span class="pl-c1">length</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchTicker</span> <span class="pl-kos">(</span><span class="pl-s1">symbols</span><span class="pl-kos">[</span><span class="pl-s1">random</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-c">// ticker for a random symbol</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-20" class="anchor" aria-label="Permalink: Python" href="#python-20"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import random if (exchange.has['fetchTicker']): print(exchange.fetch_ticker('LTC/ZEC')) # ticker for LTC/ZEC symbols = list(exchange.markets.keys()) print(exchange.fetch_ticker(random.choice(symbols))) # ticker for a random symbol"><pre><span class="pl-k">import</span> <span class="pl-s1">random</span> <span class="pl-k">if</span> (<span class="pl-s1">exchange</span>.<span class="pl-c1">has</span>[<span class="pl-s">'fetchTicker'</span>]): <span class="pl-en">print</span>(<span class="pl-s1">exchange</span>.<span class="pl-c1">fetch_ticker</span>(<span class="pl-s">'LTC/ZEC'</span>)) <span class="pl-c"># ticker for LTC/ZEC</span> <span class="pl-s1">symbols</span> <span class="pl-c1">=</span> <span class="pl-en">list</span>(<span class="pl-s1">exchange</span>.<span class="pl-c1">markets</span>.<span class="pl-c1">keys</span>()) <span class="pl-en">print</span>(<span class="pl-s1">exchange</span>.<span class="pl-c1">fetch_ticker</span>(<span class="pl-s1">random</span>.<span class="pl-c1">choice</span>(<span class="pl-s1">symbols</span>))) <span class="pl-c"># ticker for a random symbol</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-20" class="anchor" aria-label="Permalink: PHP" href="#php-20"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="//(don't forget to set your timezone properly!) if ($exchange->has['fetchTicker']) { var_dump ($exchange->fetch_ticker ('ETH/CNY')); // ticker for ETH/CNY $symbols = array_keys ($exchange->markets); $random = rand () % count ($symbols); var_dump ($exchange->fetch_ticker ($symbols[$random])); // ticker for a random symbol }"><pre><span class="pl-c">//(don't forget to set your timezone properly!)</span> <span class="pl-k">if</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">has</span>[<span class="pl-s">'<span class="pl-s">fetchTicker</span>'</span>]) { <span class="pl-en">var_dump</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">fetch_ticker</span> (<span class="pl-s">'<span class="pl-s">ETH/CNY</span>'</span>)); <span class="pl-c">// ticker for ETH/CNY</span> <span class="pl-s1"><span class="pl-c1">$</span>symbols</span> = <span class="pl-en">array_keys</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">markets</span>); <span class="pl-s1"><span class="pl-c1">$</span>random</span> = <span class="pl-en">rand</span> () % <span class="pl-en">count</span> (<span class="pl-s1"><span class="pl-c1">$</span>symbols</span>); <span class="pl-en">var_dump</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">fetch_ticker</span> (<span class="pl-s1"><span class="pl-c1">$</span>symbols</span>[<span class="pl-s1"><span class="pl-c1">$</span>random</span>])); <span class="pl-c">// ticker for a random symbol</span> }</pre></div> <div class="markdown-heading"><h3 class="heading-element">All At Once</h3><a id="user-content-all-at-once" class="anchor" aria-label="Permalink: All At Once" href="#all-at-once"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Some exchanges (not all of them) also support fetching all tickers at once. See <a href="#exchanges">their docs</a> for details. You can fetch all tickers with a single call like so:</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-21" class="anchor" aria-label="Permalink: Javascript" href="#javascript-21"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if (exchange.has['fetchTickers']) { console.log (await (exchange.fetchTickers ())) // all tickers indexed by their symbols }"><pre><span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">has</span><span class="pl-kos">[</span><span class="pl-s">'fetchTickers'</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-k">await</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchTickers</span> <span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-c">// all tickers indexed by their symbols</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-21" class="anchor" aria-label="Permalink: Python" href="#python-21"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if (exchange.has['fetchTickers']): print(exchange.fetch_tickers()) # all tickers indexed by their symbols"><pre><span class="pl-k">if</span> (<span class="pl-s1">exchange</span>.<span class="pl-c1">has</span>[<span class="pl-s">'fetchTickers'</span>]): <span class="pl-en">print</span>(<span class="pl-s1">exchange</span>.<span class="pl-c1">fetch_tickers</span>()) <span class="pl-c"># all tickers indexed by their symbols</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-21" class="anchor" aria-label="Permalink: PHP" href="#php-21"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if ($exchange->has['fetchTickers']) { var_dump ($exchange->fetch_tickers ()); // all tickers indexed by their symbols }"><pre><span class="pl-k">if</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">has</span>[<span class="pl-s">'<span class="pl-s">fetchTickers</span>'</span>]) { <span class="pl-en">var_dump</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">fetch_tickers</span> ()); <span class="pl-c">// all tickers indexed by their symbols</span> }</pre></div> <p>Fetching all tickers requires more traffic than fetching a single ticker. Also, note that some exchanges impose higher rate-limits on subsequent fetches of all tickers (see their docs on corresponding endpoints for details). <strong>The cost of the <code>fetchTickers()</code> call in terms of rate limit is often higher than average</strong>. If you only need one ticker, fetching by a particular symbol is faster as well. You probably want to fetch all tickers only if you really need all of them and, most likely, you don't want to fetchTickers more frequently than once in a minute or so.</p> <p>Also, some exchanges may impose additional requirements on the <code>fetchTickers()</code> call, sometimes you can't fetch the tickers for all symbols because of the API limitations of the exchange in question. Some exchanges accept a list of symbols in HTTP URL query params, however, because URL length is limited, and in extreme cases exchanges can have thousands of markets – a list of all their symbols simply would not fit in the URL, so it has to be a limited subset of their symbols. Sometimes, there are other reasons for requiring a list of symbols, and there may be a limit on the number of symbols you can fetch at once, but whatever the limitation, please, blame the exchange. To pass the symbols of interest to the exchange, you can supply a list of strings as the first argument to fetchTickers:</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-22" class="anchor" aria-label="Permalink: Javascript" href="#javascript-22"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="//JavaScript if (exchange.has['fetchTickers']) { console.log (await (exchange.fetchTickers ([ 'ETH/BTC', 'LTC/BTC' ]))) // listed tickers indexed by their symbols }"><pre><span class="pl-c">//JavaScript</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">has</span><span class="pl-kos">[</span><span class="pl-s">'fetchTickers'</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-k">await</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchTickers</span> <span class="pl-kos">(</span><span class="pl-kos">[</span> <span class="pl-s">'ETH/BTC'</span><span class="pl-kos">,</span> <span class="pl-s">'LTC/BTC'</span> <span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-c">// listed tickers indexed by their symbols</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-22" class="anchor" aria-label="Permalink: Python" href="#python-22"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if (exchange.has['fetchTickers']): print(exchange.fetch_tickers(['ETH/BTC', 'LTC/BTC'])) # listed tickers indexed by their symbols"><pre><span class="pl-k">if</span> (<span class="pl-s1">exchange</span>.<span class="pl-c1">has</span>[<span class="pl-s">'fetchTickers'</span>]): <span class="pl-en">print</span>(<span class="pl-s1">exchange</span>.<span class="pl-c1">fetch_tickers</span>([<span class="pl-s">'ETH/BTC'</span>, <span class="pl-s">'LTC/BTC'</span>])) <span class="pl-c"># listed tickers indexed by their symbols</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-22" class="anchor" aria-label="Permalink: PHP" href="#php-22"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if ($exchange->has['fetchTickers']) { var_dump ($exchange->fetch_tickers (array ('ETH/BTC', 'LTC/BTC'))); // listed tickers indexed by their symbols }"><pre><span class="pl-k">if</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">has</span>[<span class="pl-s">'<span class="pl-s">fetchTickers</span>'</span>]) { <span class="pl-en">var_dump</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">fetch_tickers</span> (<span class="pl-en">array</span> (<span class="pl-s">'<span class="pl-s">ETH/BTC</span>'</span>, <span class="pl-s">'<span class="pl-s">LTC/BTC</span>'</span>))); <span class="pl-c">// listed tickers indexed by their symbols</span> }</pre></div> <p>Note that the list of symbols is not required in most cases, but you must add additional logic if you want to handle all possible limitations that might be imposed on the exchanges' side.</p> <p>Like most methods of the Unified CCXT API, the last argument to fetchTickers is the <code>params</code> argument for overriding request parameters that are sent towards the exchange.</p> <p>The structure of the returned value is as follows:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ 'info': { ... }, // the original JSON response from the exchange as is 'BTC/USD': { ... }, // a single ticker for BTC/USD 'ETH/BTC': { ... }, // a ticker for ETH/BTC ... }"><pre><span class="pl-kos">{</span> <span class="pl-s">'info'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// the original JSON response from the exchange as is</span> <span class="pl-s">'BTC/USD'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// a single ticker for BTC/USD</span> <span class="pl-s">'ETH/BTC'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// a ticker for ETH/BTC</span> ... <span class="pl-kos">}</span></pre></div> <p>A general solution for fetching all tickers from all exchanges (even the ones that don't have a corresponding API endpoint) is on the way, this section will be updated soon.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="UNDER CONSTRUCTION"><pre lang="text" class="notranslate"><code>UNDER CONSTRUCTION </code></pre></div> <div class="markdown-heading"><h2 class="heading-element">OHLCV Candlestick Charts</h2><a id="user-content-ohlcv-candlestick-charts" class="anchor" aria-label="Permalink: OHLCV Candlestick Charts" href="#ohlcv-candlestick-charts"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Most exchanges have endpoints for fetching OHLCV data, but some of them don't. The exchange boolean (true/false) property named <code>has['fetchOHLCV']</code> indicates whether the exchange supports candlestick data series or not.</p> <p>To fetch OHLCV candles/bars from an exchange, ccxt has the <code>fetchOHLCV</code> method, which is declared in the following way:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchOHLCV (symbol, timeframe = '1m', since = undefined, limit = undefined, params = {})"><pre><span class="pl-en">fetchOHLCV</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">timeframe</span> <span class="pl-c1">=</span> <span class="pl-s">'1m'</span><span class="pl-kos">,</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>You can call the unified <code>fetchOHLCV</code> / <code>fetch_ohlcv</code> method to get the list of OHLCV candles for a particular symbol like so:</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-23" class="anchor" aria-label="Permalink: Javascript" href="#javascript-23"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="let sleep = (ms) => new Promise (resolve => setTimeout (resolve, ms)); if (exchange.has.fetchOHLCV) { for (symbol in exchange.markets) { await sleep (exchange.rateLimit) // milliseconds console.log (await exchange.fetchOHLCV (symbol, '1m')) // one minute } }"><pre><span class="pl-k">let</span> <span class="pl-en">sleep</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-s1">ms</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-k">new</span> <span class="pl-v">Promise</span> <span class="pl-kos">(</span><span class="pl-s1">resolve</span> <span class="pl-c1">=></span> <span class="pl-en">setTimeout</span> <span class="pl-kos">(</span><span class="pl-s1">resolve</span><span class="pl-kos">,</span> <span class="pl-s1">ms</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">has</span><span class="pl-kos">.</span><span class="pl-c1">fetchOHLCV</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span> <span class="pl-k">in</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">markets</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">await</span> <span class="pl-en">sleep</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">rateLimit</span><span class="pl-kos">)</span> <span class="pl-c">// milliseconds</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchOHLCV</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s">'1m'</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-c">// one minute</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-23" class="anchor" aria-label="Permalink: Python" href="#python-23"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import time if exchange.has['fetchOHLCV']: for symbol in exchange.markets: time.sleep (exchange.rateLimit / 1000) # time.sleep wants seconds print (symbol, exchange.fetch_ohlcv (symbol, '1d')) # one day"><pre><span class="pl-k">import</span> <span class="pl-s1">time</span> <span class="pl-k">if</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">has</span>[<span class="pl-s">'fetchOHLCV'</span>]: <span class="pl-k">for</span> <span class="pl-s1">symbol</span> <span class="pl-c1">in</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">markets</span>: <span class="pl-s1">time</span>.<span class="pl-c1">sleep</span> (<span class="pl-s1">exchange</span>.<span class="pl-c1">rateLimit</span> <span class="pl-c1">/</span> <span class="pl-c1">1000</span>) <span class="pl-c"># time.sleep wants seconds</span> <span class="pl-en">print</span> (<span class="pl-s1">symbol</span>, <span class="pl-s1">exchange</span>.<span class="pl-c1">fetch_ohlcv</span> (<span class="pl-s1">symbol</span>, <span class="pl-s">'1d'</span>)) <span class="pl-c"># one day</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-23" class="anchor" aria-label="Permalink: PHP" href="#php-23"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if ($exchange->has['fetchOHLCV']) { foreach ($exchange->markets as $symbol => $market) { usleep ($exchange->rateLimit * 1000); // usleep wants microseconds var_dump ($exchange->fetch_ohlcv ($symbol, '1M')); // one month } }"><pre><span class="pl-k">if</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">has</span>[<span class="pl-s">'<span class="pl-s">fetchOHLCV</span>'</span>]) { <span class="pl-k">foreach</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">markets</span> <span class="pl-k">as</span> <span class="pl-s1"><span class="pl-c1">$</span>symbol</span> => <span class="pl-s1"><span class="pl-c1">$</span>market</span>) { <span class="pl-en">usleep</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">rateLimit</span> * <span class="pl-c1">1000</span>); <span class="pl-c">// usleep wants microseconds</span> <span class="pl-en">var_dump</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">fetch_ohlcv</span> (<span class="pl-s1"><span class="pl-c1">$</span>symbol</span>, <span class="pl-s">'<span class="pl-s">1M</span>'</span>)); <span class="pl-c">// one month</span> } }</pre></div> <p>To get the list of available timeframes for your exchange see the <code>timeframes</code> property. Note that it is only populated when <code>has['fetchOHLCV']</code> is true as well.</p> <p>The returned list of candles may have one or more missing periods, if the exchange did not have any trades for the specified timerange and symbol. To a user that would appear as gaps in a continuous list of candles. That is considered normal. If the exchange did not have any candles at that time, the CCXT library will show the results as returned from the exchange itself.</p> <p><strong>There's a limit on how far back in time your requests can go.</strong> Most of exchanges will not allow to query detailed candlestick history (like those for 1-minute and 5-minute timeframes) too far in the past. They usually keep a reasonable amount of most recent candles, like 1000 last candles for any timeframe is more than enough for most of needs. You can work around that limitation by continuously fetching (aka <em>REST polling</em>) latest OHLCVs and storing them in a CSV file or in a database.</p> <p><strong>Note that the info from the last (current) candle may be incomplete until the candle is closed (until the next candle starts).</strong></p> <p>Like with most other unified and implicit methods, the <code>fetchOHLCV</code> method accepts as its last argument an associative array (a dictionary) of extra <code>params</code>, which is used to <a href="#overriding-unified-api-params">override default values</a> that are sent in requests to the exchanges. The contents of <code>params</code> are exchange-specific, consult the exchanges' API documentation for supported fields and values.</p> <p>The <code>since</code> argument is an integer UTC timestamp <strong>in milliseconds</strong> (everywhere throughout the library with all unified methods).</p> <p>If <code>since</code> is not specified the <code>fetchOHLCV</code> method will return the time range as is the default from the exchange itself. This is not a bug. Some exchanges will return candles from the beginning of time, others will return most recent candles only, the exchanges' default behaviour is expected. Thus, without specifying <code>since</code> the range of returned candles will be exchange-specific. One should pass the <code>since</code> argument to ensure getting precisely the history range needed.</p> <div class="markdown-heading"><h3 class="heading-element">Get raw OHLCV response</h3><a id="user-content-get-raw-ohlcv-response" class="anchor" aria-label="Permalink: Get raw OHLCV response" href="#get-raw-ohlcv-response"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Currently, the structure CCXT uses does not include the raw response from the exchange. However, users might be able to override the return value by doing:</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-24" class="anchor" aria-label="Permalink: Javascript" href="#javascript-24"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const ex = new ccxt.coinbase(); const originalParser = ex.parseOHLCV.bind(ex); ex.parseOHLCV = ((ohlcv, market = undefined) => { return { 'result': originalParser(ohlcv, market), 'raw': ohlcv, }; }); const result = await ex.fetchOHLCV('BTC/USDT', '1m'); console.log (result[0]);"><pre><span class="pl-k">const</span> <span class="pl-s1">ex</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">coinbase</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">originalParser</span> <span class="pl-c1">=</span> <span class="pl-s1">ex</span><span class="pl-kos">.</span><span class="pl-c1">parseOHLCV</span><span class="pl-kos">.</span><span class="pl-en">bind</span><span class="pl-kos">(</span><span class="pl-s1">ex</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">ex</span><span class="pl-kos">.</span><span class="pl-c1">parseOHLCV</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">ohlcv</span><span class="pl-kos">,</span> <span class="pl-s1">market</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-kos">{</span> <span class="pl-s">'result'</span>: <span class="pl-s1">originalParser</span><span class="pl-kos">(</span><span class="pl-s1">ohlcv</span><span class="pl-kos">,</span> <span class="pl-s1">market</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s">'raw'</span>: <span class="pl-s1">ohlcv</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">ex</span><span class="pl-kos">.</span><span class="pl-en">fetchOHLCV</span><span class="pl-kos">(</span><span class="pl-s">'BTC/USDT'</span><span class="pl-kos">,</span> <span class="pl-s">'1m'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">result</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-24" class="anchor" aria-label="Permalink: Python" href="#python-24"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# add raw member at last position in list async def test(): ex = ccxt.async_support.coinbase() prase_ohlcv_original = ex.parse_ohlcv def prase_ohlcv_custom(ohlcv, market): res = prase_ohlcv_original(ohlcv, market) res.append(ohlcv) return res ex.parse_ohlcv = prase_ohlcv_custom result = await ex.fetch_ohlcv('BTC/USDT', '1m') print (result[0]) asyncio.run(test())"><pre><span class="pl-c"># add raw member at last position in list</span> <span class="pl-k">async</span> <span class="pl-k">def</span> <span class="pl-en">test</span>(): <span class="pl-s1">ex</span> <span class="pl-c1">=</span> <span class="pl-s1">ccxt</span>.<span class="pl-c1">async_support</span>.<span class="pl-c1">coinbase</span>() <span class="pl-s1">prase_ohlcv_original</span> <span class="pl-c1">=</span> <span class="pl-s1">ex</span>.<span class="pl-c1">parse_ohlcv</span> <span class="pl-k">def</span> <span class="pl-en">prase_ohlcv_custom</span>(<span class="pl-s1">ohlcv</span>, <span class="pl-s1">market</span>): <span class="pl-s1">res</span> <span class="pl-c1">=</span> <span class="pl-en">prase_ohlcv_original</span>(<span class="pl-s1">ohlcv</span>, <span class="pl-s1">market</span>) <span class="pl-s1">res</span>.<span class="pl-c1">append</span>(<span class="pl-s1">ohlcv</span>) <span class="pl-k">return</span> <span class="pl-s1">res</span> <span class="pl-s1">ex</span>.<span class="pl-c1">parse_ohlcv</span> <span class="pl-c1">=</span> <span class="pl-s1">prase_ohlcv_custom</span> <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">ex</span>.<span class="pl-c1">fetch_ohlcv</span>(<span class="pl-s">'BTC/USDT'</span>, <span class="pl-s">'1m'</span>) <span class="pl-en">print</span> (<span class="pl-s1">result</span>[<span class="pl-c1">0</span>]) <span class="pl-s1">asyncio</span>.<span class="pl-c1">run</span>(<span class="pl-en">test</span>())</pre></div> <div class="markdown-heading"><h3 class="heading-element">Notes On Latency</h3><a id="user-content-notes-on-latency" class="anchor" aria-label="Permalink: Notes On Latency" href="#notes-on-latency"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Trading strategies require fresh up-to-date information for technical analysis, indicators and signals. Building a speculative trading strategy based on the OHLCV candles received from the exchange may have critical drawbacks. Developers should account for the details explained in this section to build successful bots.</p> <p>First and foremost, when using CCXT you're talking to the exchanges directly. CCXT is not a server, nor a service, it's a software library. All data that you are getting with CCXT is received directly from the exchanges first-hand.</p> <p>The exchanges usually provide two categories of public market data:</p> <ol> <li>Fast primary first-order data that includes real time orderbooks and trades or fills</li> <li>Slow second-order data that includes secondary tickers and kline OHLCV candles, that are calculated from the first-order data</li> </ol> <p>The primary first-order data is updated by the exchanges APIs in pseudo real time, or as close to real time as possible, as fast as possible. The second-order data requires time for the exchange to calculate it. For example, a ticker is nothing more than a rolling 24-hour statistical cut of orderbooks and trades. OHLCV candles and volumes are also calculated from first-order trades and represent fixed statistical cuts of specific periods. The volume traded within an hour is just a sum of traded volumes of the corresponding trades that happened within that hour.</p> <p>Obviously, it takes some time for the exchange to collect the first-order data and calculate the secondary statistical data from it. That literally means that <strong>tickers and OHLCVs are always slower than orderbooks and trades</strong>. In other words, there is always some latency in the exchange API between the moment when a trade happens and the moment when a corresponding OHLCV candle is updated or published by the exchange API.</p> <p>The latency (or how much time is needed by the exchange API for calculating the secondary data) depends on how fast the exchange engine is, so it is exchange-specific. Top exchange engines will usually return and update fresh last-minute OHLCV candles and tickers at a very fast rate. Some exchanges might do it in regular intervals like once a second or once in a few seconds. Slow exchange engines might take minutes to update the secondary statistical information, their APIs might return the current most recent OHLCV candle a few minutes late.</p> <p>If your strategy depends on the fresh last-minute most recent data you don't want to build it based on tickers or OHLCVs received from the exchange. Tickers and exchanges' OHLCVs are only suitable for display purposes, or for simple trading strategies for hour-timeframes or day-timeframes that are less susceptible to latency.</p> <p>Thankfully, the developers of time-critical trading strategies don't have to rely on secondary data from the exchanges and can calculate the OHLCVs and tickers in the userland. That may be faster and more efficient than waiting for the exchanges to update the info on their end. One can aggregate the public trade history by polling it frequently and calculate candles by walking over the list of trades - please take a look into "build-ohlcv-bars" file inside <a href="https://github.com/ccxt/ccxt/tree/master/examples">examples folder</a></p> <p>Due to the differences in their internal implementations the exchanges may be faster to update their primary and secondary market data over WebSockets. The latency remains exchange-specific, cause the exchange engine still needs time to calculate the secondary data, regardless of whether you're polling it over the RESTful API with CCXT or getting updates via WebSockets with CCXT Pro. WebSockets can improve the networking latency, so a fast exchange will work even better, but adding the support for WS subscriptions will not make a slow exchange engine work much faster.</p> <p>If you want to stay on top of the second-order data latency, then you will have to calculate it on your side and beat the exchange engine in speed of doing so. Depending on the needs of your application, it may be tricky, since you will need to handle redundancy, "data holes" in the history, exchange downtimes, and other aspects of data aggregation which is a whole universe in itself that is impossible to fully cover in this Manual.</p> <div class="markdown-heading"><h3 class="heading-element">OHLCV Structure</h3><a id="user-content-ohlcv-structure" class="anchor" aria-label="Permalink: OHLCV Structure" href="#ohlcv-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The fetchOHLCV method shown above returns a list (a flat array) of OHLCV candles represented by the following structure:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ [ 1504541580000, // UTC timestamp in milliseconds, integer 4235.4, // (O)pen price, float 4240.6, // (H)ighest price, float 4230.0, // (L)owest price, float 4230.7, // (C)losing price, float 37.72941911 // (V)olume float (usually in terms of the base currency, the exchanges docstring may list whether quote or base units are used) ], ... ]"><pre><span class="pl-kos">[</span> <span class="pl-kos">[</span> <span class="pl-c1">1504541580000</span><span class="pl-kos">,</span> <span class="pl-c">// UTC timestamp in milliseconds, integer</span> <span class="pl-c1">4235.4</span><span class="pl-kos">,</span> <span class="pl-c">// (O)pen price, float</span> <span class="pl-c1">4240.6</span><span class="pl-kos">,</span> <span class="pl-c">// (H)ighest price, float</span> <span class="pl-c1">4230.0</span><span class="pl-kos">,</span> <span class="pl-c">// (L)owest price, float</span> <span class="pl-c1">4230.7</span><span class="pl-kos">,</span> <span class="pl-c">// (C)losing price, float</span> <span class="pl-c1">37.72941911</span> <span class="pl-c">// (V)olume float (usually in terms of the base currency, the exchanges docstring may list whether quote or base units are used)</span> <span class="pl-kos">]</span><span class="pl-kos">,</span> ... <span class="pl-kos">]</span></pre></div> <p>The list of candles is returned sorted in ascending (historical/chronological) order, oldest candle first, most recent candle last.</p> <div class="markdown-heading"><h3 class="heading-element">Mark, Index and PremiumIndex Candlestick Charts</h3><a id="user-content-mark-index-and-premiumindex-candlestick-charts" class="anchor" aria-label="Permalink: Mark, Index and PremiumIndex Candlestick Charts" href="#mark-index-and-premiumindex-candlestick-charts"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>To obtain historical Mark, Index Price and Premium Index candlesticks pass the <code>'price'</code> <a href="overriding-unified-api-params">params-override</a> to <code>fetchOHLCV</code>. The <code>'price'</code> parameter accepts one of the following values:</p> <ul> <li><code>'mark'</code></li> <li><code>'index'</code></li> <li><code>'premiumIndex'</code></li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// JavaScript async function main () { const exchange = new ccxt.binanceusdm () const markKlines = await exchange.fetchOHLCV ('ADA/USDT', '1h', undefined, undefined, { 'price': 'mark' }) console.log (markKlines) const indexKlines = await exchange.fetchOHLCV ('ADA/USDT', '1h', undefined, undefined, { 'price': 'index' }) console.log (indexKlines) } main ()"><pre><span class="pl-c">// JavaScript</span> <span class="pl-k">async</span> <span class="pl-k">function</span> <span class="pl-en">main</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-s1">exchange</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">binanceusdm</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-k">const</span> <span class="pl-s1">markKlines</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchOHLCV</span> <span class="pl-kos">(</span><span class="pl-s">'ADA/USDT'</span><span class="pl-kos">,</span> <span class="pl-s">'1h'</span><span class="pl-kos">,</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-s">'price'</span>: <span class="pl-s">'mark'</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">markKlines</span><span class="pl-kos">)</span> <span class="pl-k">const</span> <span class="pl-s1">indexKlines</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchOHLCV</span> <span class="pl-kos">(</span><span class="pl-s">'ADA/USDT'</span><span class="pl-kos">,</span> <span class="pl-s">'1h'</span><span class="pl-kos">,</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-s">'price'</span>: <span class="pl-s">'index'</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">indexKlines</span><span class="pl-kos">)</span> <span class="pl-kos">}</span> <span class="pl-en">main</span> <span class="pl-kos">(</span><span class="pl-kos">)</span></pre></div> <p>There are also convenience methods <code>fetchMarkOHLCV</code>, <code>fetchIndexOHLCV</code> and <code>fetchPremiumIndexOHLCV</code></p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-25" class="anchor" aria-label="Permalink: Javascript" href="#javascript-25"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="async function main () { const exchange = new ccxt.binanceusdm () const markKlines = await exchange.fetchMarkOHLCV ('ADA/USDT', '1h') console.log (markKlines) const indexKlines = await exchange.fetchIndexOHLCV ('ADA/USDT', '1h') console.log (indexKlines) } main ()"><pre><span class="pl-k">async</span> <span class="pl-k">function</span> <span class="pl-en">main</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-s1">exchange</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">binanceusdm</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-k">const</span> <span class="pl-s1">markKlines</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchMarkOHLCV</span> <span class="pl-kos">(</span><span class="pl-s">'ADA/USDT'</span><span class="pl-kos">,</span> <span class="pl-s">'1h'</span><span class="pl-kos">)</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">markKlines</span><span class="pl-kos">)</span> <span class="pl-k">const</span> <span class="pl-s1">indexKlines</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchIndexOHLCV</span> <span class="pl-kos">(</span><span class="pl-s">'ADA/USDT'</span><span class="pl-kos">,</span> <span class="pl-s">'1h'</span><span class="pl-kos">)</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">indexKlines</span><span class="pl-kos">)</span> <span class="pl-kos">}</span> <span class="pl-en">main</span> <span class="pl-kos">(</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-25" class="anchor" aria-label="Permalink: Python" href="#python-25"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="exchange = ccxt.binance() response = exchange.fetch_ohlcv('ADA/USDT', '1h', params={'price':'index'}) pprint(response) # Convenience methods mark_klines = exchange.fetch_mark_ohlcv('ADA/USDT', '1h') index_klines = exchange.fetch_index_ohlcv('ADA/USDT', '1h') pprint(mark_klines) pprint(index_klines)"><pre><span class="pl-s1">exchange</span> <span class="pl-c1">=</span> <span class="pl-s1">ccxt</span>.<span class="pl-c1">binance</span>() <span class="pl-s1">response</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">fetch_ohlcv</span>(<span class="pl-s">'ADA/USDT'</span>, <span class="pl-s">'1h'</span>, <span class="pl-s1">params</span><span class="pl-c1">=</span>{<span class="pl-s">'price'</span>:<span class="pl-s">'index'</span>}) <span class="pl-en">pprint</span>(<span class="pl-s1">response</span>) <span class="pl-c"># Convenience methods</span> <span class="pl-s1">mark_klines</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">fetch_mark_ohlcv</span>(<span class="pl-s">'ADA/USDT'</span>, <span class="pl-s">'1h'</span>) <span class="pl-s1">index_klines</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">fetch_index_ohlcv</span>(<span class="pl-s">'ADA/USDT'</span>, <span class="pl-s">'1h'</span>) <span class="pl-en">pprint</span>(<span class="pl-s1">mark_klines</span>) <span class="pl-en">pprint</span>(<span class="pl-s1">index_klines</span>)</pre></div> <div class="markdown-heading"><h3 class="heading-element">OHLCV Emulation</h3><a id="user-content-ohlcv-emulation" class="anchor" aria-label="Permalink: OHLCV Emulation" href="#ohlcv-emulation"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Some exchanges don't offer any OHLCV method, and for those, the ccxt library will emulate OHLCV candles from <a href="#public-trades">Public Trades</a>. In that case you will see <code>exchange.has['fetchOHLCV'] = 'emulated'</code>. However, because the trade history is usually very limited, the emulated fetchOHLCV methods cover most recent info only and should only be used as a fallback, when no other option is available.</p> <p><strong>WARNING: the fetchOHLCV emulation is experimental!</strong></p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="UNDER CONSTRUCTION"><pre lang="text" class="notranslate"><code>UNDER CONSTRUCTION </code></pre></div> <div class="markdown-heading"><h2 class="heading-element">Public Trades</h2><a id="user-content-public-trades" class="anchor" aria-label="Permalink: Public Trades" href="#public-trades"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-diff notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- this is under heavy development right now, contributions appreciated"><pre><span class="pl-md"><span class="pl-md">-</span> this is under heavy development right now, contributions appreciated</span></pre></div> <p>You can call the unified <code>fetchTrades</code> / <code>fetch_trades</code> method to get the list of most recent trades for a particular symbol. The <code>fetchTrades</code> method is declared in the following way:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="async fetchTrades (symbol, since = undefined, limit = undefined, params = {})"><pre><span class="pl-en">async</span> <span class="pl-s1">fetchTrades</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>For example, if you want to print recent trades for all symbols one by one sequentially (mind the rateLimit!) you would do it like so:</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Typescript</strong></h4><a id="user-content-typescript" class="anchor" aria-label="Permalink: Typescript" href="#typescript"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if (exchange.has['fetchTrades']) { let sleep = (ms) => new Promise (resolve => setTimeout (resolve, ms)); for (symbol in exchange.markets) { console.log (await exchange.fetchTrades (symbol)) } }"><pre><span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">has</span><span class="pl-kos">[</span><span class="pl-s">'fetchTrades'</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">let</span> <span class="pl-en">sleep</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-s1">ms</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-k">new</span> <span class="pl-v">Promise</span> <span class="pl-kos">(</span><span class="pl-s1">resolve</span> <span class="pl-c1">=></span> <span class="pl-en">setTimeout</span> <span class="pl-kos">(</span><span class="pl-s1">resolve</span><span class="pl-kos">,</span> <span class="pl-s1">ms</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span> <span class="pl-k">in</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">markets</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchTrades</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-26" class="anchor" aria-label="Permalink: Python" href="#python-26"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import time if exchange.has['fetchTrades']: for symbol in exchange.markets: # ensure you have called loadMarkets() or load_markets() method. print (symbol, exchange.fetch_trades (symbol))"><pre><span class="pl-k">import</span> <span class="pl-s1">time</span> <span class="pl-k">if</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">has</span>[<span class="pl-s">'fetchTrades'</span>]: <span class="pl-k">for</span> <span class="pl-s1">symbol</span> <span class="pl-c1">in</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">markets</span>: <span class="pl-c"># ensure you have called loadMarkets() or load_markets() method.</span> <span class="pl-en">print</span> (<span class="pl-s1">symbol</span>, <span class="pl-s1">exchange</span>.<span class="pl-c1">fetch_trades</span> (<span class="pl-s1">symbol</span>))</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-24" class="anchor" aria-label="Permalink: PHP" href="#php-24"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if ($exchange->has['fetchTrades']) { foreach ($exchange->markets as $symbol => $market) { var_dump ($exchange->fetch_trades ($symbol)); } }"><pre><span class="pl-k">if</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">has</span>[<span class="pl-s">'<span class="pl-s">fetchTrades</span>'</span>]) { <span class="pl-k">foreach</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">markets</span> <span class="pl-k">as</span> <span class="pl-s1"><span class="pl-c1">$</span>symbol</span> => <span class="pl-s1"><span class="pl-c1">$</span>market</span>) { <span class="pl-en">var_dump</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">fetch_trades</span> (<span class="pl-s1"><span class="pl-c1">$</span>symbol</span>)); } }</pre></div> <p>The fetchTrades method shown above returns an ordered list of trades (a flat array, sorted by timestamp in ascending order, oldest trade first, most recent trade last). A list of trades is represented by the <a href="#trade-structure">trade structure</a>.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ { 'info': { ... }, // the original decoded JSON as is 'id': '12345-67890:09876/54321', // string trade id 'timestamp': 1502962946216, // Unix timestamp in milliseconds 'datetime': '2017-08-17 12:42:48.000', // ISO8601 datetime with milliseconds 'symbol': 'ETH/BTC', // symbol 'order': '12345-67890:09876/54321', // string order id or undefined/None/null 'type': 'limit', // order type, 'market', 'limit' or undefined/None/null 'side': 'buy', // direction of the trade, 'buy' or 'sell' 'takerOrMaker': 'taker', // string, 'taker' or 'maker' 'price': 0.06917684, // float price in quote currency 'amount': 1.5, // amount of base currency 'cost': 0.10376526, // total cost, `price * amount`, 'fee': { // if provided by exchange or calculated by ccxt 'cost': 0.0015, // float 'currency': 'ETH', // usually base currency for buys, quote currency for sells 'rate': 0.002, // the fee rate (if available) }, 'fees': [ // an array of fees if paid in multiple currencies { // if provided by exchange or calculated by ccxt 'cost': 0.0015, // float 'currency': 'ETH', // usually base currency for buys, quote currency for sells 'rate': 0.002, // the fee rate (if available) }, ] }, ... ]"><pre><span class="pl-kos">[</span> <span class="pl-kos">{</span> <span class="pl-s">'info'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// the original decoded JSON as is</span> <span class="pl-s">'id'</span>: <span class="pl-s">'12345-67890:09876/54321'</span><span class="pl-kos">,</span> <span class="pl-c">// string trade id</span> <span class="pl-s">'timestamp'</span>: <span class="pl-c1">1502962946216</span><span class="pl-kos">,</span> <span class="pl-c">// Unix timestamp in milliseconds</span> <span class="pl-s">'datetime'</span>: <span class="pl-s">'2017-08-17 12:42:48.000'</span><span class="pl-kos">,</span> <span class="pl-c">// ISO8601 datetime with milliseconds</span> <span class="pl-s">'symbol'</span>: <span class="pl-s">'ETH/BTC'</span><span class="pl-kos">,</span> <span class="pl-c">// symbol</span> <span class="pl-s">'order'</span>: <span class="pl-s">'12345-67890:09876/54321'</span><span class="pl-kos">,</span> <span class="pl-c">// string order id or undefined/None/null</span> <span class="pl-s">'type'</span>: <span class="pl-s">'limit'</span><span class="pl-kos">,</span> <span class="pl-c">// order type, 'market', 'limit' or undefined/None/null</span> <span class="pl-s">'side'</span>: <span class="pl-s">'buy'</span><span class="pl-kos">,</span> <span class="pl-c">// direction of the trade, 'buy' or 'sell'</span> <span class="pl-s">'takerOrMaker'</span>: <span class="pl-s">'taker'</span><span class="pl-kos">,</span> <span class="pl-c">// string, 'taker' or 'maker'</span> <span class="pl-s">'price'</span>: <span class="pl-c1">0.06917684</span><span class="pl-kos">,</span> <span class="pl-c">// float price in quote currency</span> <span class="pl-s">'amount'</span>: <span class="pl-c1">1.5</span><span class="pl-kos">,</span> <span class="pl-c">// amount of base currency</span> <span class="pl-s">'cost'</span>: <span class="pl-c1">0.10376526</span><span class="pl-kos">,</span> <span class="pl-c">// total cost, `price * amount`,</span> <span class="pl-s">'fee'</span>: <span class="pl-kos">{</span> <span class="pl-c">// if provided by exchange or calculated by ccxt</span> <span class="pl-s">'cost'</span>: <span class="pl-c1">0.0015</span><span class="pl-kos">,</span> <span class="pl-c">// float</span> <span class="pl-s">'currency'</span>: <span class="pl-s">'ETH'</span><span class="pl-kos">,</span> <span class="pl-c">// usually base currency for buys, quote currency for sells</span> <span class="pl-s">'rate'</span>: <span class="pl-c1">0.002</span><span class="pl-kos">,</span> <span class="pl-c">// the fee rate (if available)</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'fees'</span>: <span class="pl-kos">[</span> <span class="pl-c">// an array of fees if paid in multiple currencies</span> <span class="pl-kos">{</span> <span class="pl-c">// if provided by exchange or calculated by ccxt</span> <span class="pl-s">'cost'</span>: <span class="pl-c1">0.0015</span><span class="pl-kos">,</span> <span class="pl-c">// float</span> <span class="pl-s">'currency'</span>: <span class="pl-s">'ETH'</span><span class="pl-kos">,</span> <span class="pl-c">// usually base currency for buys, quote currency for sells</span> <span class="pl-s">'rate'</span>: <span class="pl-c1">0.002</span><span class="pl-kos">,</span> <span class="pl-c">// the fee rate (if available)</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> ... <span class="pl-kos">]</span></pre></div> <p>Most exchanges return most of the above fields for each trade, though there are exchanges that don't return the type, the side, the trade id or the order id of the trade. Most of the time you are guaranteed to have the timestamp, the datetime, the symbol, the price and the amount of each trade.</p> <p>The second optional argument <code>since</code> reduces the array by timestamp, the third <code>limit</code> argument reduces by number (count) of returned items.</p> <p>If the user does not specify <code>since</code>, the <code>fetchTrades</code> method will return the default range of public trades from the exchange. The default set is exchange-specific, some exchanges will return trades starting from the date of listing a pair on the exchange, other exchanges will return a reduced set of trades (like, last 24 hours, last 100 trades, etc). If the user wants precise control over the timeframe, the user is responsible for specifying the <code>since</code> argument.</p> <p>Most of unified methods will return either a single object or a plain array (a list) of objects (trades). However, very few exchanges (if any at all) will return all trades at once. Most often their APIs <code>limit</code> output to a certain number of most recent objects. <strong>YOU CANNOT GET ALL OBJECTS SINCE THE BEGINNING OF TIME TO THE PRESENT MOMENT IN JUST ONE CALL</strong>. Practically, very few exchanges will tolerate or allow that.</p> <p>To fetch historical trades, the user will need to traverse the data in portions or "pages" of objects. Pagination often implies <em>"fetching portions of data one by one"</em> in a loop.</p> <p>In most cases users are <strong>required to use at least some type of pagination</strong> in order to get the expected results consistently.</p> <p>On the other hand, <strong>some exchanges don't support pagination for public trades at all</strong>. In general the exchanges will provide just the most recent trades.</p> <p>The <code>fetchTrades ()</code> / <code>fetch_trades()</code> method also accepts an optional <code>params</code> (assoc-key array/dict, empty by default) as its fourth argument. You can use it to pass extra params to method calls or to override a particular default value (where supported by the exchange). See the API docs for your exchange for more details.</p> <div class="markdown-heading"><h2 class="heading-element">Exchange Time</h2><a id="user-content-exchange-time" class="anchor" aria-label="Permalink: Exchange Time" href="#exchange-time"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The <code>fetchTime()</code> method (if available) returns the current integer timestamp in milliseconds from the exchange server.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchTime(params = {})"><pre><span class="pl-en">fetchTime</span><span class="pl-kos">(</span><span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Exchange Status</h2><a id="user-content-exchange-status" class="anchor" aria-label="Permalink: Exchange Status" href="#exchange-status"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The exchange status describes the latest known information on the availability of the exchange API. This information is either hardcoded into the exchange class or fetched live directly from the exchange API. The <code>fetchStatus(params = {})</code> method can be used to get this information. The status returned by <code>fetchStatus</code> is one of:</p> <ul> <li>Hardcoded into the exchange class, e.g. if the API has been broken or shutdown.</li> <li>Updated using the exchange ping or <code>fetchTime</code> endpoint to see if its alive</li> <li>Updated using the dedicated exchange API status endpoint.</li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchStatus(params = {})"><pre><span class="pl-en">fetchStatus</span><span class="pl-kos">(</span><span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Exchange Status Structure</h3><a id="user-content-exchange-status-structure" class="anchor" aria-label="Permalink: Exchange Status Structure" href="#exchange-status-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The <code>fetchStatus()</code> method will return a status structure like shown below:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ 'status': 'ok', // 'ok', 'shutdown', 'error', 'maintenance' 'updated': undefined, // integer, last updated timestamp in milliseconds if updated via the API 'eta': undefined, // when the maintenance or outage is expected to end 'url': undefined, // a link to a GitHub issue or to an exchange post on the subject }"><pre><span class="pl-kos">{</span> <span class="pl-s">'status'</span>: <span class="pl-s">'ok'</span><span class="pl-kos">,</span> <span class="pl-c">// 'ok', 'shutdown', 'error', 'maintenance'</span> <span class="pl-s">'updated'</span>: <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-c">// integer, last updated timestamp in milliseconds if updated via the API</span> <span class="pl-s">'eta'</span>: <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-c">// when the maintenance or outage is expected to end</span> <span class="pl-s">'url'</span>: <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-c">// a link to a GitHub issue or to an exchange post on the subject</span> <span class="pl-kos">}</span></pre></div> <p>The possible values in the <code>status</code> field are:</p> <ul> <li> <code>'ok'</code> means the exchange API is fully operational</li> <li> <code>'shutdown</code>' means the exchange was closed, and the <code>updated</code> field should contain the datetime of the shutdown</li> <li> <code>'error'</code> means that either the exchange API is broken, or the implementation of the exchange in CCXT is broken</li> <li> <code>'maintenance'</code> means regular maintenance, and the <code>eta</code> field should contain the datetime when the exchange is expected to be operational again</li> </ul> <div class="markdown-heading"><h2 class="heading-element">Borrow Rates</h2><a id="user-content-borrow-rates" class="anchor" aria-label="Permalink: Borrow Rates" href="#borrow-rates"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>margin only</em></p> <p>When short trading or trading with leverage on a spot market, currency must be borrowed. Interest is accrued for the borrowed currency.</p> <p>Data on the borrow rate for a currency can be retrieved using</p> <ul> <li> <code>fetchCrossBorrowRate ()</code> for a single currencies borrow rate</li> <li> <code>fetchCrossBorrowRates ()</code> for all currencies borrow rates</li> <li> <code>fetchIsolatedBorrowRate ()</code> for a trading pairs borrow rate</li> <li> <code>fetchIsolatedBorrowRates ()</code> for all trading pairs borrow rates</li> <li> <code>fetchBorrowRatesPerSymbol ()</code> for the borrow rates of currencies in individual markets</li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchCrossBorrowRate (code, params = {})"><pre><span class="pl-en">fetchCrossBorrowRate</span> <span class="pl-kos">(</span><span class="pl-s1">code</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>code</strong> (String) Unified CCXT currency code, required (e.g. <code>"USDT"</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"settle": "USDT"}</code>)</li> </ul> <p>Returns</p> <ul> <li>A <a href="#borrow-rate-structure">borrow rate structure</a> </li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchCrossBorrowRates (params = {})"><pre><span class="pl-en">fetchCrossBorrowRates</span> <span class="pl-kos">(</span><span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"startTime": 1610248118000}</code>)</li> </ul> <p>Returns</p> <ul> <li>A dictionary of <a href="#borrow-rate-structure">borrow rate structures</a> with unified currency codes as keys</li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchIsolatedBorrowRate (symbol, params = {})"><pre><span class="pl-en">fetchIsolatedBorrowRate</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbol</strong> (String) Unified CCXT market symbol, required (e.g. <code>"BTC/USDT"</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"settle": "USDT"}</code>)</li> </ul> <p>Returns</p> <ul> <li>An <a href="#isolated-borrow-rate-structure">isolated borrow rate structure</a> </li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchIsolatedBorrowRates (params = {})"><pre><span class="pl-en">fetchIsolatedBorrowRates</span> <span class="pl-kos">(</span><span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"startTime": 1610248118000}</code>)</li> </ul> <p>Returns</p> <ul> <li>A dictionary of <a href="#isolated-borrow-rate-structure">isolated borrow rate structures</a> with unified market symbols as keys</li> </ul> <div class="markdown-heading"><h3 class="heading-element">Isolated Borrow Rate Structure</h3><a id="user-content-isolated-borrow-rate-structure" class="anchor" aria-label="Permalink: Isolated Borrow Rate Structure" href="#isolated-borrow-rate-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ symbol: 'BTC/USDT', // Unified market symbol base: 'BTC', // Unified currency code of the base currency baseRate: 0.00025, // A decimal value rate that interest is accrued at quote: 'USDT', // Unified currency code of the quote currency quoteRate: 0.00025, // A decimal value rate that interest is accrued at period: 86400000, // The amount of time in milliseconds that is required to accrue the interest amount specified by rate timestamp: 1646956800000, // Timestamp for when the currency had this rate datetime: '2022-03-11T00:00:00.000Z', // Datetime for when the currency had this rate info: [ ... ] }"><pre><span class="pl-kos">{</span> <span class="pl-c1">symbol</span>: <span class="pl-s">'BTC/USDT'</span><span class="pl-kos">,</span> <span class="pl-c">// Unified market symbol</span> <span class="pl-c1">base</span>: <span class="pl-s">'BTC'</span><span class="pl-kos">,</span> <span class="pl-c">// Unified currency code of the base currency</span> <span class="pl-c1">baseRate</span>: <span class="pl-c1">0.00025</span><span class="pl-kos">,</span> <span class="pl-c">// A decimal value rate that interest is accrued at</span> <span class="pl-c1">quote</span>: <span class="pl-s">'USDT'</span><span class="pl-kos">,</span> <span class="pl-c">// Unified currency code of the quote currency</span> <span class="pl-c1">quoteRate</span>: <span class="pl-c1">0.00025</span><span class="pl-kos">,</span> <span class="pl-c">// A decimal value rate that interest is accrued at</span> <span class="pl-c1">period</span>: <span class="pl-c1">86400000</span><span class="pl-kos">,</span> <span class="pl-c">// The amount of time in milliseconds that is required to accrue the interest amount specified by rate</span> <span class="pl-c1">timestamp</span>: <span class="pl-c1">1646956800000</span><span class="pl-kos">,</span> <span class="pl-c">// Timestamp for when the currency had this rate</span> <span class="pl-c1">datetime</span>: <span class="pl-s">'2022-03-11T00:00:00.000Z'</span><span class="pl-kos">,</span> <span class="pl-c">// Datetime for when the currency had this rate</span> <span class="pl-c1">info</span>: <span class="pl-kos">[</span> ... <span class="pl-kos">]</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Borrow Rate Structure</h3><a id="user-content-borrow-rate-structure" class="anchor" aria-label="Permalink: Borrow Rate Structure" href="#borrow-rate-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ currency: 'USDT', // Unified currency code rate: 0.0006, // A ratio of the rate that interest is accrued at period: 86400000, // The amount of time in milliseconds that is required to accrue the interest amount specified by rate timestamp: 1646956800000, // Timestamp for when the currency had this rate datetime: '2022-03-11T00:00:00.000Z', // Datetime for when the currency had this rate info: [ ... ] }"><pre><span class="pl-kos">{</span> <span class="pl-c1">currency</span>: <span class="pl-s">'USDT'</span><span class="pl-kos">,</span> <span class="pl-c">// Unified currency code</span> <span class="pl-c1">rate</span>: <span class="pl-c1">0.0006</span><span class="pl-kos">,</span> <span class="pl-c">// A ratio of the rate that interest is accrued at</span> <span class="pl-c1">period</span>: <span class="pl-c1">86400000</span><span class="pl-kos">,</span> <span class="pl-c">// The amount of time in milliseconds that is required to accrue the interest amount specified by rate</span> <span class="pl-c1">timestamp</span>: <span class="pl-c1">1646956800000</span><span class="pl-kos">,</span> <span class="pl-c">// Timestamp for when the currency had this rate</span> <span class="pl-c1">datetime</span>: <span class="pl-s">'2022-03-11T00:00:00.000Z'</span><span class="pl-kos">,</span> <span class="pl-c">// Datetime for when the currency had this rate</span> <span class="pl-c1">info</span>: <span class="pl-kos">[</span> ... <span class="pl-kos">]</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Borrow Rate History</h2><a id="user-content-borrow-rate-history" class="anchor" aria-label="Permalink: Borrow Rate History" href="#borrow-rate-history"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>margin only</em></p> <p>The <code>fetchBorrowRateHistory</code> method retrieves a history of a currencies borrow interest rate at specific time slots</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchBorrowRateHistory (code, since = undefined, limit = undefined, params = {})"><pre><span class="pl-en">fetchBorrowRateHistory</span> <span class="pl-kos">(</span><span class="pl-s1">code</span><span class="pl-kos">,</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>code</strong> (String) <em>required</em> Unified CCXT currency code (e.g. <code>"USDT"</code>)</li> <li> <strong>since</strong> (Integer) Timestamp for the earliest borrow rate (e.g. <code>1645807945000</code>)</li> <li> <strong>limit</strong> (Integer) The maximum number of <a href="#borrow-rate-structure">borrow rate structures</a> to retrieve (e.g. <code>10</code>)</li> <li> <strong>params</strong> (Dictionary) Extra parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>An array of <a href="#borrow-rate-structure">borrow rate structures</a> </li> </ul> <div class="markdown-heading"><h2 class="heading-element">Leverage Tiers</h2><a id="user-content-leverage-tiers" class="anchor" aria-label="Permalink: Leverage Tiers" href="#leverage-tiers"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>contract only</em></p> <ul> <li>Leverage Tier methods are private on <strong>binance</strong> </li> </ul> <p>The <code>fetchLeverageTiers()</code> method can be used to obtain the maximum leverage for a market at varying position sizes. It can also be used to obtain the maintenance margin rate, and the max tradeable amount for a market when that information is not available from the market object</p> <p>While you can obtain the absolute maximum leverage for a market by accessing <code>market['limits']['leverage']['max']</code>, for many contract markets, the maximum leverage will depend on the size of your position.</p> <p>You can access those limits by using</p> <ul> <li> <code>fetchMarketLeverageTiers()</code> (single symbol)</li> <li> <code>fetchLeverageTiers([symbol1, symbol2, ...])</code> (multiple symbols)</li> <li> <code>fetchLeverageTiers()</code> (all market symbols)</li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchMarketLeverageTiers(symbol, params = {})"><pre><span class="pl-en">fetchMarketLeverageTiers</span><span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbol</strong> (String) <em>required</em> Unified CCXT symbol (e.g. <code>"BTC/USDT:USDT"</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"settle": "usdt"}</code>)</li> </ul> <p>Returns</p> <ul> <li>a <a href="#leverage-tiers-structure">leverage-tiers-structure</a> </li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchLeverageTiers(symbols = undefined, params = {})"><pre><span class="pl-en">fetchLeverageTiers</span><span class="pl-kos">(</span><span class="pl-s1">symbols</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbols</strong> ([String]) Unified CCXT symbol (e.g. <code>"BTC/USDT:USDT"</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"settle": "usdt"}</code>)</li> </ul> <p>Returns</p> <ul> <li>an array of <a href="#leverage-tiers-structure">leverage-tiers-structures</a> </li> </ul> <div class="markdown-heading"><h3 class="heading-element">Leverage Tiers Structure</h3><a id="user-content-leverage-tiers-structure" class="anchor" aria-label="Permalink: Leverage Tiers Structure" href="#leverage-tiers-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ { "tier": 1, // tier index "symbol": "BTC/USDT", // the market symbol that the leverage tier applies to "currency": "USDT", // the currency that minNotional and maxNotional are in "minNotional": 0, // the lowest amount of this tier // stake = 0.0 "maxNotional": 10000, // the highest amount of this tier // max stake amount at 75x leverage = 133.33333333333334 "maintenanceMarginRate": 0.0065, // maintenance margin rate "maxLeverage": 75, // max available leverage for this market when the value of the trade is > minNotional and < maxNotional "info": { ... } // Response from exchange }, { "tier": 2, "symbol": "BTC/USDT", "currency": "USDT", "minNotional": 10000, // min stake amount at 50x leverage = 200.0 "maxNotional": 50000, // max stake amount at 50x leverage = 1000.0 "maintenanceMarginRate": 0.01, "maxLeverage": 50, "info": { ... }, }, ... { "tier": 9, "symbol": "BTC/USDT", "currency": "USDT", "minNotional": 20000000, "maxNotional": 50000000, "maintenanceMarginRate": 0.5, "maxLeverage": 1, "info": { ... }, }, ]"><pre><span class="pl-kos">[</span> <span class="pl-kos">{</span> <span class="pl-s">"tier"</span>: <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c">// tier index</span> <span class="pl-s">"symbol"</span>: <span class="pl-s">"BTC/USDT"</span><span class="pl-kos">,</span> <span class="pl-c">// the market symbol that the leverage tier applies to</span> <span class="pl-s">"currency"</span>: <span class="pl-s">"USDT"</span><span class="pl-kos">,</span> <span class="pl-c">// the currency that minNotional and maxNotional are in</span> <span class="pl-s">"minNotional"</span>: <span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-c">// the lowest amount of this tier // stake = 0.0</span> <span class="pl-s">"maxNotional"</span>: <span class="pl-c1">10000</span><span class="pl-kos">,</span> <span class="pl-c">// the highest amount of this tier // max stake amount at 75x leverage = 133.33333333333334</span> <span class="pl-s">"maintenanceMarginRate"</span>: <span class="pl-c1">0.0065</span><span class="pl-kos">,</span> <span class="pl-c">// maintenance margin rate</span> <span class="pl-s">"maxLeverage"</span>: <span class="pl-c1">75</span><span class="pl-kos">,</span> <span class="pl-c">// max available leverage for this market when the value of the trade is > minNotional and < maxNotional</span> <span class="pl-s">"info"</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span> <span class="pl-c">// Response from exchange</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-s">"tier"</span>: <span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-s">"symbol"</span>: <span class="pl-s">"BTC/USDT"</span><span class="pl-kos">,</span> <span class="pl-s">"currency"</span>: <span class="pl-s">"USDT"</span><span class="pl-kos">,</span> <span class="pl-s">"minNotional"</span>: <span class="pl-c1">10000</span><span class="pl-kos">,</span> <span class="pl-c">// min stake amount at 50x leverage = 200.0</span> <span class="pl-s">"maxNotional"</span>: <span class="pl-c1">50000</span><span class="pl-kos">,</span> <span class="pl-c">// max stake amount at 50x leverage = 1000.0</span> <span class="pl-s">"maintenanceMarginRate"</span>: <span class="pl-c1">0.01</span><span class="pl-kos">,</span> <span class="pl-s">"maxLeverage"</span>: <span class="pl-c1">50</span><span class="pl-kos">,</span> <span class="pl-s">"info"</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> ... <span class="pl-kos">{</span> <span class="pl-s">"tier"</span>: <span class="pl-c1">9</span><span class="pl-kos">,</span> <span class="pl-s">"symbol"</span>: <span class="pl-s">"BTC/USDT"</span><span class="pl-kos">,</span> <span class="pl-s">"currency"</span>: <span class="pl-s">"USDT"</span><span class="pl-kos">,</span> <span class="pl-s">"minNotional"</span>: <span class="pl-c1">20000000</span><span class="pl-kos">,</span> <span class="pl-s">"maxNotional"</span>: <span class="pl-c1">50000000</span><span class="pl-kos">,</span> <span class="pl-s">"maintenanceMarginRate"</span>: <span class="pl-c1">0.5</span><span class="pl-kos">,</span> <span class="pl-s">"maxLeverage"</span>: <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-s">"info"</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">]</span></pre></div> <p>In the example above:</p> <ul> <li>stakes below 133.33 = a max leverage of 75</li> <li>stakes from 200 + 1000 = a max leverage of 50</li> <li>a stake amount of 150 = a max leverage of (10000 / 150) = 66.66</li> <li>stakes between 133.33-200 = a max leverage of (10000 / stake) = 50.01 -> 74.99</li> </ul> <p><strong>Note for Huobi users:</strong> Huobi uses both leverage and amount to determine maintenance margin rates: <a href="https://www.huobi.com/support/en-us/detail/900000089903" rel="nofollow">https://www.huobi.com/support/en-us/detail/900000089903</a></p> <div class="markdown-heading"><h2 class="heading-element">Funding Rate</h2><a id="user-content-funding-rate" class="anchor" aria-label="Permalink: Funding Rate" href="#funding-rate"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>contract only</em></p> <p>Data on the current, most recent, and next funding rates can be obtained using the methods</p> <ul> <li> <code>fetchFundingRates ()</code> for all market symbols</li> <li> <code>fetchFundingRates ([ symbol1, symbol2, ... ])</code> for multiple market symbols</li> <li> <code>fetchFundingRate (symbol)</code> for a single market symbol</li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchFundingRate (symbol, params = {})"><pre><span class="pl-en">fetchFundingRate</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbol</strong> (String) <em>required</em> Unified CCXT symbol (e.g. <code>"BTC/USDT:USDT"</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>a <a href="#funding-rate-structure">funding rate structure</a> </li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchFundingRates (symbols = undefined, params = {})"><pre><span class="pl-en">fetchFundingRates</span> <span class="pl-kos">(</span><span class="pl-s1">symbols</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbols</strong> ([String]) An optional array/list of unified CCXT symbols (e.g. <code>["BTC/USDT:USDT", "ETH/USDT:USDT"]</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>An array of <a href="#funding-rate-structure">funding rate structures</a> indexed by market symbols</li> </ul> <div class="markdown-heading"><h2 class="heading-element">Funding Interval</h2><a id="user-content-funding-interval" class="anchor" aria-label="Permalink: Funding Interval" href="#funding-interval"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>contract only</em></p> <p>Retrieve the current funding interval using the following methods:</p> <ul> <li> <code>fetchFundingInterval (symbol)</code> for a single market symbol</li> <li> <code>fetchFundingIntervals ()</code> for all market symbols</li> <li> <code>fetchFundingIntervals ([ symbol1, symbol2, ... ])</code> for multiple market symbols</li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchFundingInterval (symbol, params = {})"><pre><span class="pl-en">fetchFundingInterval</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbol</strong> (String) <em>required</em> Unified CCXT symbol (e.g. <code>"BTC/USDT:USDT"</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>A <a href="#funding-rate-structure">funding rate structure</a> </li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchFundingIntervals (symbols = undefined, params = {})"><pre><span class="pl-en">fetchFundingIntervals</span> <span class="pl-kos">(</span><span class="pl-s1">symbols</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbols</strong> ([String]) An optional array/list of unified CCXT symbols (e.g. <code>["BTC/USDT:USDT", "ETH/USDT:USDT"]</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>An array of <a href="#funding-rate-structure">funding rate structures</a> </li> </ul> <div class="markdown-heading"><h3 class="heading-element">Funding Rate Structure</h3><a id="user-content-funding-rate-structure" class="anchor" aria-label="Permalink: Funding Rate Structure" href="#funding-rate-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ info: { ... }, symbol: 'BTC/USDT:USDT', markPrice: 39294.43, indexPrice: 39291.78, interestRate: 0.0003, estimatedSettlePrice: undefined, timestamp: undefined, datetime: undefined, fundingRate: 0.000072, fundingTimestamp: 1645833600000, fundingDatetime: '2022-02-26T00:00:00.000Z', nextFundingRate: -0.000018, // nextFundingRate is actually two funding rates from now nextFundingTimestamp: undefined, nextFundingDatetime: undefined, previousFundingRate: undefined, previousFundingTimestamp: undefined, previousFundingDatetime: undefined, interval: '8h', }"><pre><span class="pl-kos">{</span> <span class="pl-c1">info</span>: <span class="pl-kos">{</span> ...<span class="pl-s1"></span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">symbol</span>: <span class="pl-s">'BTC/USDT:USDT'</span><span class="pl-kos">,</span> <span class="pl-c1">markPrice</span>: <span class="pl-c1">39294.43</span><span class="pl-kos">,</span> <span class="pl-c1">indexPrice</span>: <span class="pl-c1">39291.78</span><span class="pl-kos">,</span> <span class="pl-c1">interestRate</span>: <span class="pl-c1">0.0003</span><span class="pl-kos">,</span> <span class="pl-c1">estimatedSettlePrice</span>: <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-c1">timestamp</span>: <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-c1">datetime</span>: <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-c1">fundingRate</span>: <span class="pl-c1">0.000072</span><span class="pl-kos">,</span> <span class="pl-c1">fundingTimestamp</span>: <span class="pl-c1">1645833600000</span><span class="pl-kos">,</span> <span class="pl-c1">fundingDatetime</span>: <span class="pl-s">'2022-02-26T00:00:00.000Z'</span><span class="pl-kos">,</span> <span class="pl-c1">nextFundingRate</span>: <span class="pl-c1">-</span><span class="pl-c1">0.000018</span><span class="pl-kos">,</span> <span class="pl-c">// nextFundingRate is actually two funding rates from now</span> <span class="pl-c1">nextFundingTimestamp</span>: <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-c1">nextFundingDatetime</span>: <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-c1">previousFundingRate</span>: <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-c1">previousFundingTimestamp</span>: <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-c1">previousFundingDatetime</span>: <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-c1">interval</span>: <span class="pl-s">'8h'</span><span class="pl-kos">,</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Funding Rate History</h2><a id="user-content-funding-rate-history" class="anchor" aria-label="Permalink: Funding Rate History" href="#funding-rate-history"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>contract only</em></p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchFundingRateHistory (symbol = undefined, since = undefined, limit = undefined, params = {})"><pre><span class="pl-en">fetchFundingRateHistory</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbol</strong> (String) Unified CCXT symbol (e.g. <code>"BTC/USDT:USDT"</code>)</li> <li> <strong>since</strong> (Integer) Timestamp for the earliest funding rate (e.g. <code>1645807945000</code>)</li> <li> <strong>limit</strong> (Integer) The maximum number of funding rates to retrieve (e.g. <code>10</code>)</li> <li> <strong>params</strong> (Dictionary) Extra parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>An array of <a href="#funding-rate-history-structure">funding rate history structures</a> </li> </ul> <div class="markdown-heading"><h3 class="heading-element">Funding Rate History Structure</h3><a id="user-content-funding-rate-history-structure" class="anchor" aria-label="Permalink: Funding Rate History Structure" href="#funding-rate-history-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ info: { ... }, symbol: "BTC/USDT:USDT", fundingRate: -0.000068, timestamp: 1642953600000, datetime: "2022-01-23T16:00:00.000Z" }"><pre><span class="pl-kos">{</span> <span class="pl-c1">info</span>: <span class="pl-kos">{</span> ...<span class="pl-s1"></span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">symbol</span>: <span class="pl-s">"BTC/USDT:USDT"</span><span class="pl-kos">,</span> <span class="pl-c1">fundingRate</span>: <span class="pl-c1">-</span><span class="pl-c1">0.000068</span><span class="pl-kos">,</span> <span class="pl-c1">timestamp</span>: <span class="pl-c1">1642953600000</span><span class="pl-kos">,</span> <span class="pl-c1">datetime</span>: <span class="pl-s">"2022-01-23T16:00:00.000Z"</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Open Interest</h2><a id="user-content-open-interest" class="anchor" aria-label="Permalink: Open Interest" href="#open-interest"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>contract only</em></p> <p>Use the <code>fetchOpenInterest</code> method to get the current open interest for a symbol from the exchange.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchOpenInterest (symbol, params = {})"><pre><span class="pl-en">fetchOpenInterest</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbol</strong> (String) Unified CCXT market symbol (e.g. <code>"BTC/USDT:USDT"</code>)</li> <li> <strong>params</strong> (Dictionary) Extra parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>A dictionary of <a href="#open-interest-structure">open interest structures</a> </li> </ul> <div class="markdown-heading"><h3 class="heading-element">Open Interest History</h3><a id="user-content-open-interest-history" class="anchor" aria-label="Permalink: Open Interest History" href="#open-interest-history"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>contract only</em></p> <p>Use the <code>fetchOpenInterestHistory</code> method to get a history of open interest for a symbol from the exchange.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchOpenInterestHistory (symbol, timeframe = '5m', since = undefined, limit = undefined, params = {})"><pre><span class="pl-en">fetchOpenInterestHistory</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">timeframe</span> <span class="pl-c1">=</span> <span class="pl-s">'5m'</span><span class="pl-kos">,</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbol</strong> (String) Unified CCXT market symbol (e.g. <code>"BTC/USDT:USDT"</code>)</li> <li> <strong>timeframe</strong> (String) Check exchange.timeframes for available values</li> <li> <strong>since</strong> (Integer) Timestamp for the earliest open interest record (e.g. <code>1645807945000</code>)</li> <li> <strong>limit</strong> (Integer) The maximum number of <a href="#open-interest-structures">open interest structures</a> to retrieve (e.g. <code>10</code>)</li> <li> <strong>params</strong> (Dictionary) Extra parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p><strong>Note for OKX users:</strong> instead of a unified symbol okx.fetchOpenInterestHistory expects a unified currency code in the <strong>symbol</strong> argument (e.g. <code>'BTC'</code>).</p> <p>Returns</p> <ul> <li>An array of <a href="#open-interest-structure">open interest structures</a> </li> </ul> <div class="markdown-heading"><h3 class="heading-element">Open Interest Structure</h3><a id="user-content-open-interest-structure" class="anchor" aria-label="Permalink: Open Interest Structure" href="#open-interest-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ symbol: 'BTC/USDT', baseVolume: 80872.801, // deprecated quoteVolume: 3508262107.38, // deprecated openInterestAmount: 80872.801, openInterestValue: 3508262107.38, timestamp: 1649379000000, datetime: '2022-04-08T00:50:00.000Z', info: { symbol: 'BTCUSDT', sumOpenInterest: '80872.80100000', sumOpenInterestValue: '3508262107.38000000', timestamp: '1649379000000' } }"><pre><span class="pl-kos">{</span> <span class="pl-c1">symbol</span>: <span class="pl-s">'BTC/USDT'</span><span class="pl-kos">,</span> <span class="pl-c1">baseVolume</span>: <span class="pl-c1">80872.801</span><span class="pl-kos">,</span> <span class="pl-c">// deprecated</span> <span class="pl-c1">quoteVolume</span>: <span class="pl-c1">3508262107.38</span><span class="pl-kos">,</span> <span class="pl-c">// deprecated</span> <span class="pl-c1">openInterestAmount</span>: <span class="pl-c1">80872.801</span><span class="pl-kos">,</span> <span class="pl-c1">openInterestValue</span>: <span class="pl-c1">3508262107.38</span><span class="pl-kos">,</span> <span class="pl-c1">timestamp</span>: <span class="pl-c1">1649379000000</span><span class="pl-kos">,</span> <span class="pl-c1">datetime</span>: <span class="pl-s">'2022-04-08T00:50:00.000Z'</span><span class="pl-kos">,</span> <span class="pl-c1">info</span>: <span class="pl-kos">{</span> <span class="pl-c1">symbol</span>: <span class="pl-s">'BTCUSDT'</span><span class="pl-kos">,</span> <span class="pl-c1">sumOpenInterest</span>: <span class="pl-s">'80872.80100000'</span><span class="pl-kos">,</span> <span class="pl-c1">sumOpenInterestValue</span>: <span class="pl-s">'3508262107.38000000'</span><span class="pl-kos">,</span> <span class="pl-c1">timestamp</span>: <span class="pl-s">'1649379000000'</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Historical Volatility</h2><a id="user-content-historical-volatility" class="anchor" aria-label="Permalink: Historical Volatility" href="#historical-volatility"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>option only</em></p> <p>Use the <code>fetchVolatilityHistory</code> method to get the volatility history for the code of an options underlying asset from the exchange.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchVolatilityHistory (code, params = {})"><pre><span class="pl-en">fetchVolatilityHistory</span> <span class="pl-kos">(</span><span class="pl-s1">code</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>code</strong> (String) <em>required</em> Unified CCXT currency code (e.g. <code>"BTC"</code>)</li> <li> <strong>params</strong> (Dictionary) Extra parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>An array of <a href="#volatility-structure">volatility history structures</a> </li> </ul> <div class="markdown-heading"><h3 class="heading-element">Volatility Structure</h3><a id="user-content-volatility-structure" class="anchor" aria-label="Permalink: Volatility Structure" href="#volatility-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ info: { "period": 7, "value": "0.23854072", "time": "1690574400000" } timestamp: 1649379000000, datetime: '2023-07-28T00:50:00.000Z', volatility: 0.23854072, }"><pre><span class="pl-kos">{</span> info: <span class="pl-kos">{</span> <span class="pl-s">"period"</span>: <span class="pl-c1">7</span><span class="pl-kos">,</span> <span class="pl-s">"value"</span>: <span class="pl-s">"0.23854072"</span><span class="pl-kos">,</span> <span class="pl-s">"time"</span>: <span class="pl-s">"1690574400000"</span> <span class="pl-kos">}</span> <span class="pl-s1">timestamp</span>: <span class="pl-c1">1649379000000</span><span class="pl-kos">,</span> <span class="pl-s1">datetime</span>: <span class="pl-s">'2023-07-28T00:50:00.000Z'</span><span class="pl-kos">,</span> <span class="pl-s1">volatility</span>: <span class="pl-c1">0.23854072</span><span class="pl-kos">,</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Underlying Assets</h2><a id="user-content-underlying-assets" class="anchor" aria-label="Permalink: Underlying Assets" href="#underlying-assets"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>contract only</em></p> <p>Use the <code>fetchUnderlyingAssets</code> method to get the market id's of underlying assets for a contract market type from the exchange.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchUnderlyingAssets (params = {})"><pre><span class="pl-en">fetchUnderlyingAssets</span> <span class="pl-kos">(</span><span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>params</strong> (Dictionary) Extra parameters specific to the exchange API endpoint (e.g. <code>{"instType": "OPTION"}</code>)</li> <li> <strong>params.type</strong> (String) Unified marketType, the default is 'option' (e.g. <code>"option"</code>)</li> </ul> <p>Returns</p> <ul> <li>An <a href="#underlying-assets-structure">underlying assets structure</a> </li> </ul> <div class="markdown-heading"><h3 class="heading-element">Underlying Assets Structure</h3><a id="user-content-underlying-assets-structure" class="anchor" aria-label="Permalink: Underlying Assets Structure" href="#underlying-assets-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ 'BTC_USDT', 'ETH_USDT', 'DOGE_USDT' ]"><pre><span class="pl-kos">[</span> <span class="pl-s">'BTC_USDT'</span><span class="pl-kos">,</span> <span class="pl-s">'ETH_USDT'</span><span class="pl-kos">,</span> <span class="pl-s">'DOGE_USDT'</span> <span class="pl-kos">]</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Settlement History</h2><a id="user-content-settlement-history" class="anchor" aria-label="Permalink: Settlement History" href="#settlement-history"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>contract only</em></p> <p>Use the <code>fetchSettlementHistory</code> method to get the public settlement history for a contract market from the exchange.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchSettlementHistory (symbol = undefined, since = undefined, limit = undefined, params = {})"><pre><span class="pl-en">fetchSettlementHistory</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbol</strong> (String) Unified CCXT symbol (e.g. <code>"BTC/USDT:USDT-230728-25500-P"</code>)</li> <li> <strong>since</strong> (Integer) Timestamp for the earliest settlement (e.g. <code>1694073600000</code>)</li> <li> <strong>limit</strong> (Integer) The maximum number of settlements to retrieve (e.g. <code>10</code>)</li> <li> <strong>params</strong> (Dictionary) Extra parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>An array of <a href="#settlement-history-structure">settlement history structures</a> </li> </ul> <div class="markdown-heading"><h3 class="heading-element">Settlement History Structure</h3><a id="user-content-settlement-history-structure" class="anchor" aria-label="Permalink: Settlement History Structure" href="#settlement-history-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ info: { ... }, symbol: 'BTC/USDT:USDT-230728-25500-P', price: 25761.35807869, timestamp: 1694073600000, datetime: '2023-09-07T08:00:00.000Z', }"><pre><span class="pl-kos">{</span> <span class="pl-c1">info</span>: <span class="pl-kos">{</span> ...<span class="pl-s1"></span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">symbol</span>: <span class="pl-s">'BTC/USDT:USDT-230728-25500-P'</span><span class="pl-kos">,</span> <span class="pl-c1">price</span>: <span class="pl-c1">25761.35807869</span><span class="pl-kos">,</span> <span class="pl-c1">timestamp</span>: <span class="pl-c1">1694073600000</span><span class="pl-kos">,</span> <span class="pl-c1">datetime</span>: <span class="pl-s">'2023-09-07T08:00:00.000Z'</span><span class="pl-kos">,</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Liquidations</h2><a id="user-content-liquidations" class="anchor" aria-label="Permalink: Liquidations" href="#liquidations"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Use the <code>fetchLiquidations</code> method to get the public liquidations of a trading pair from the exchange.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchLiquidations (symbol, since = undefined, limit = undefined, params = {})"><pre><span class="pl-en">fetchLiquidations</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbol</strong> (String) Unified CCXT symbol (e.g. <code>"BTC/USDT:USDT-231006-25000-P"</code>)</li> <li> <strong>since</strong> (Integer) Timestamp for the earliest liquidation (e.g. <code>1694073600000</code>)</li> <li> <strong>limit</strong> (Integer) The maximum number of liquidations to retrieve (e.g. <code>10</code>)</li> <li> <strong>params</strong> (Dictionary) Extra parameters specific to the exchange API endpoint (e.g. <code>{"until": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>An array of <a href="#liquidation-structure">liquidation structures</a> </li> </ul> <div class="markdown-heading"><h3 class="heading-element">Liquidation Structure</h3><a id="user-content-liquidation-structure" class="anchor" aria-label="Permalink: Liquidation Structure" href="#liquidation-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ { 'info': { ... }, // the original decoded JSON as is 'symbol': 'BTC/USDT:USDT-231006-25000-P', // unified CCXT market symbol 'contracts': 2, // the number of derivative contracts 'contractSize': 0.001, // the contract size for the trading pair 'price': 27038.64, // the average liquidation price in the quote currency 'baseValue': 0.002, // value in the base currency (contracts * contractSize) 'quoteValue': 54.07728, // value in the quote currency ((contracts * contractSize) * price) 'timestamp': 1696996782210, // Unix timestamp in milliseconds 'datetime': '2023-10-11 03:59:42.000', // ISO8601 datetime with milliseconds }, ... ]"><pre><span class="pl-kos">[</span> <span class="pl-kos">{</span> <span class="pl-s">'info'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// the original decoded JSON as is</span> <span class="pl-s">'symbol'</span>: <span class="pl-s">'BTC/USDT:USDT-231006-25000-P'</span><span class="pl-kos">,</span> <span class="pl-c">// unified CCXT market symbol</span> <span class="pl-s">'contracts'</span>: <span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-c">// the number of derivative contracts</span> <span class="pl-s">'contractSize'</span>: <span class="pl-c1">0.001</span><span class="pl-kos">,</span> <span class="pl-c">// the contract size for the trading pair</span> <span class="pl-s">'price'</span>: <span class="pl-c1">27038.64</span><span class="pl-kos">,</span> <span class="pl-c">// the average liquidation price in the quote currency</span> <span class="pl-s">'baseValue'</span>: <span class="pl-c1">0.002</span><span class="pl-kos">,</span> <span class="pl-c">// value in the base currency (contracts * contractSize)</span> <span class="pl-s">'quoteValue'</span>: <span class="pl-c1">54.07728</span><span class="pl-kos">,</span> <span class="pl-c">// value in the quote currency ((contracts * contractSize) * price)</span> <span class="pl-s">'timestamp'</span>: <span class="pl-c1">1696996782210</span><span class="pl-kos">,</span> <span class="pl-c">// Unix timestamp in milliseconds</span> <span class="pl-s">'datetime'</span>: <span class="pl-s">'2023-10-11 03:59:42.000'</span><span class="pl-kos">,</span> <span class="pl-c">// ISO8601 datetime with milliseconds</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> ... <span class="pl-kos">]</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Greeks</h2><a id="user-content-greeks" class="anchor" aria-label="Permalink: Greeks" href="#greeks"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>option only</em></p> <p>Use the <code>fetchGreeks</code> method to get the public greeks and implied volatility of an options trading pair from the exchange. The greeks measure how factors like the underlying assets price, time to expiration, volatility, and interest rates, affect the price of an options contract.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchGreeks (symbol, params = {})"><pre><span class="pl-en">fetchGreeks</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbol</strong> (String) Unified CCXT symbol (e.g. <code>"BTC/USD:BTC-240927-40000-C"</code>)</li> <li> <strong>params</strong> (Dictionary) Extra parameters specific to the exchange API endpoint (e.g. <code>{"category": "options"}</code>)</li> </ul> <p>Returns</p> <ul> <li>A <a href="#greeks-structure">greeks structure</a> </li> </ul> <div class="markdown-heading"><h3 class="heading-element">Greeks Structure</h3><a id="user-content-greeks-structure" class="anchor" aria-label="Permalink: Greeks Structure" href="#greeks-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ 'symbol': 'BTC/USD:BTC-240927-40000-C', // unified CCXT market symbol 'timestamp': 1699593511632, // unix timestamp in milliseconds 'datetime': '2023-11-10T05:18:31.632Z', // ISO8601 datetime with milliseconds 'delta': 0.59833, // measures the rate of change in the options price per $1 change in the underlying assets price 'gamma': 0.00002, // measures the rate of change in the delta per $1 change in the underlying assets price 'theta': -13.4441, // measures the dollar amount that an options price will decline per day 'vega': 142.30124, // measures the dollar amount that an options price changes with a 1% change in the implied volatility 'rho': 131.82621, // measures the dollar amount that an options price changes with a 1% change in interest rates 'bidSize': 2.2, // the options bid amount 'askSize': 9, // the options ask amount 'bidImpliedVolatility': 60.06, // the expected percentage price change of the underlying asset, over the remaining life of the option, calculated using the bid price 'askImpliedVolatility': 61.85, // the expected percentage price change of the underlying asset, over the remaining life of the option, calculated using the ask price 'markImpliedVolatility': 60.86, // the expected percentage price change of the underlying asset, over the remaining life of the option, calculated using the mark price 'bidPrice': 0.214, // the bid price of the option 'askPrice': 0.2205, // the ask price of the option 'markPrice': 0.2169, // the mark price of the option 'lastPrice': 0.215, // the last price of the option 'underlyingPrice': 39165.86, // the current market price of the underlying asset 'info': { ... }, // the original decoded JSON as is }"><pre><span class="pl-kos">{</span> <span class="pl-s">'symbol'</span>: <span class="pl-s">'BTC/USD:BTC-240927-40000-C'</span><span class="pl-kos">,</span> <span class="pl-c">// unified CCXT market symbol</span> <span class="pl-s">'timestamp'</span>: <span class="pl-c1">1699593511632</span><span class="pl-kos">,</span> <span class="pl-c">// unix timestamp in milliseconds</span> <span class="pl-s">'datetime'</span>: <span class="pl-s">'2023-11-10T05:18:31.632Z'</span><span class="pl-kos">,</span> <span class="pl-c">// ISO8601 datetime with milliseconds</span> <span class="pl-s">'delta'</span>: <span class="pl-c1">0.59833</span><span class="pl-kos">,</span> <span class="pl-c">// measures the rate of change in the options price per $1 change in the underlying assets price</span> <span class="pl-s">'gamma'</span>: <span class="pl-c1">0.00002</span><span class="pl-kos">,</span> <span class="pl-c">// measures the rate of change in the delta per $1 change in the underlying assets price</span> <span class="pl-s">'theta'</span>: <span class="pl-c1">-</span><span class="pl-c1">13.4441</span><span class="pl-kos">,</span> <span class="pl-c">// measures the dollar amount that an options price will decline per day</span> <span class="pl-s">'vega'</span>: <span class="pl-c1">142.30124</span><span class="pl-kos">,</span> <span class="pl-c">// measures the dollar amount that an options price changes with a 1% change in the implied volatility</span> <span class="pl-s">'rho'</span>: <span class="pl-c1">131.82621</span><span class="pl-kos">,</span> <span class="pl-c">// measures the dollar amount that an options price changes with a 1% change in interest rates</span> <span class="pl-s">'bidSize'</span>: <span class="pl-c1">2.2</span><span class="pl-kos">,</span> <span class="pl-c">// the options bid amount</span> <span class="pl-s">'askSize'</span>: <span class="pl-c1">9</span><span class="pl-kos">,</span> <span class="pl-c">// the options ask amount</span> <span class="pl-s">'bidImpliedVolatility'</span>: <span class="pl-c1">60.06</span><span class="pl-kos">,</span> <span class="pl-c">// the expected percentage price change of the underlying asset, over the remaining life of the option, calculated using the bid price</span> <span class="pl-s">'askImpliedVolatility'</span>: <span class="pl-c1">61.85</span><span class="pl-kos">,</span> <span class="pl-c">// the expected percentage price change of the underlying asset, over the remaining life of the option, calculated using the ask price</span> <span class="pl-s">'markImpliedVolatility'</span>: <span class="pl-c1">60.86</span><span class="pl-kos">,</span> <span class="pl-c">// the expected percentage price change of the underlying asset, over the remaining life of the option, calculated using the mark price</span> <span class="pl-s">'bidPrice'</span>: <span class="pl-c1">0.214</span><span class="pl-kos">,</span> <span class="pl-c">// the bid price of the option</span> <span class="pl-s">'askPrice'</span>: <span class="pl-c1">0.2205</span><span class="pl-kos">,</span> <span class="pl-c">// the ask price of the option</span> <span class="pl-s">'markPrice'</span>: <span class="pl-c1">0.2169</span><span class="pl-kos">,</span> <span class="pl-c">// the mark price of the option</span> <span class="pl-s">'lastPrice'</span>: <span class="pl-c1">0.215</span><span class="pl-kos">,</span> <span class="pl-c">// the last price of the option</span> <span class="pl-s">'underlyingPrice'</span>: <span class="pl-c1">39165.86</span><span class="pl-kos">,</span> <span class="pl-c">// the current market price of the underlying asset</span> <span class="pl-s">'info'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// the original decoded JSON as is</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Option Chain</h2><a id="user-content-option-chain" class="anchor" aria-label="Permalink: Option Chain" href="#option-chain"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>option only</em></p> <p>Use the <code>fetchOption</code> method to get the public details of a single option contract from the exchange.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchOption (symbol, params = {})"><pre><span class="pl-en">fetchOption</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbol</strong> (String) Unified CCXT market symbol (e.g. <code>"BTC/USD:BTC-240927-40000-C"</code>)</li> <li> <strong>params</strong> (Dictionary) Extra parameters specific to the exchange API endpoint (e.g. <code>{"category": "options"}</code>)</li> </ul> <p>Returns</p> <ul> <li>An <a href="#option-chain-structure">option chain structure</a> </li> </ul> <p>Use the <code>fetchOptionChain</code> method to get the public option chain data of an underlying currency from the exchange.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchOptionChain (code, params = {})"><pre><span class="pl-en">fetchOptionChain</span> <span class="pl-kos">(</span><span class="pl-s1">code</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>code</strong> (String) Unified CCXT currency code (e.g. <code>"BTC"</code>)</li> <li> <strong>params</strong> (Dictionary) Extra parameters specific to the exchange API endpoint (e.g. <code>{"category": "options"}</code>)</li> </ul> <p>Returns</p> <ul> <li>A list of <a href="#option-chain-structure">option chain structures</a> </li> </ul> <div class="markdown-heading"><h3 class="heading-element">Option Chain Structure</h3><a id="user-content-option-chain-structure" class="anchor" aria-label="Permalink: Option Chain Structure" href="#option-chain-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ 'info': { ... }, // the original decoded JSON as is 'currency': 'BTC', // unified CCXT currency code 'symbol': 'BTC/USD:BTC-240927-40000-C', // unified CCXT market symbol 'timestamp': 1699593511632, // unix timestamp in milliseconds 'datetime': '2023-11-10T05:18:31.632Z', // ISO8601 datetime with milliseconds 'impliedVolatility': 60.06, // the expected percentage price change of the underlying asset, over the remaining life of the option 'openInterest': 10, // the number of open options contracts that have not been settled 'bidPrice': 0.214, // the bid price of the option 'askPrice': 0.2205, // the ask price of the option 'midPrice': 0.2205, // the price in between the bid and the ask 'markPrice': 0.2169, // the mark price of the option 'lastPrice': 0.215, // the last price of the option 'underlyingPrice': 39165.86, // the current market price of the underlying asset 'change': 15.43, // the 24 hour price change in a dollar amount 'percentage': 11.86, // the 24 hour price change as a percentage 'baseVolume': 100.86, // the volume in units of the base currency 'quoteVolume': 23772.86, // the volume in units of the quote currency }"><pre><span class="pl-kos">{</span> <span class="pl-s">'info'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// the original decoded JSON as is</span> <span class="pl-s">'currency'</span>: <span class="pl-s">'BTC'</span><span class="pl-kos">,</span> <span class="pl-c">// unified CCXT currency code</span> <span class="pl-s">'symbol'</span>: <span class="pl-s">'BTC/USD:BTC-240927-40000-C'</span><span class="pl-kos">,</span> <span class="pl-c">// unified CCXT market symbol</span> <span class="pl-s">'timestamp'</span>: <span class="pl-c1">1699593511632</span><span class="pl-kos">,</span> <span class="pl-c">// unix timestamp in milliseconds</span> <span class="pl-s">'datetime'</span>: <span class="pl-s">'2023-11-10T05:18:31.632Z'</span><span class="pl-kos">,</span> <span class="pl-c">// ISO8601 datetime with milliseconds</span> <span class="pl-s">'impliedVolatility'</span>: <span class="pl-c1">60.06</span><span class="pl-kos">,</span> <span class="pl-c">// the expected percentage price change of the underlying asset, over the remaining life of the option</span> <span class="pl-s">'openInterest'</span>: <span class="pl-c1">10</span><span class="pl-kos">,</span> <span class="pl-c">// the number of open options contracts that have not been settled</span> <span class="pl-s">'bidPrice'</span>: <span class="pl-c1">0.214</span><span class="pl-kos">,</span> <span class="pl-c">// the bid price of the option</span> <span class="pl-s">'askPrice'</span>: <span class="pl-c1">0.2205</span><span class="pl-kos">,</span> <span class="pl-c">// the ask price of the option</span> <span class="pl-s">'midPrice'</span>: <span class="pl-c1">0.2205</span><span class="pl-kos">,</span> <span class="pl-c">// the price in between the bid and the ask</span> <span class="pl-s">'markPrice'</span>: <span class="pl-c1">0.2169</span><span class="pl-kos">,</span> <span class="pl-c">// the mark price of the option</span> <span class="pl-s">'lastPrice'</span>: <span class="pl-c1">0.215</span><span class="pl-kos">,</span> <span class="pl-c">// the last price of the option</span> <span class="pl-s">'underlyingPrice'</span>: <span class="pl-c1">39165.86</span><span class="pl-kos">,</span> <span class="pl-c">// the current market price of the underlying asset</span> <span class="pl-s">'change'</span>: <span class="pl-c1">15.43</span><span class="pl-kos">,</span> <span class="pl-c">// the 24 hour price change in a dollar amount</span> <span class="pl-s">'percentage'</span>: <span class="pl-c1">11.86</span><span class="pl-kos">,</span> <span class="pl-c">// the 24 hour price change as a percentage</span> <span class="pl-s">'baseVolume'</span>: <span class="pl-c1">100.86</span><span class="pl-kos">,</span> <span class="pl-c">// the volume in units of the base currency</span> <span class="pl-s">'quoteVolume'</span>: <span class="pl-c1">23772.86</span><span class="pl-kos">,</span> <span class="pl-c">// the volume in units of the quote currency</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Long Short Ratio</h2><a id="user-content-long-short-ratio" class="anchor" aria-label="Permalink: Long Short Ratio" href="#long-short-ratio"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>contract only</em></p> <p>Use the <code>fetchLongShortRatio</code> method to fetch the current long short ratio of a symbol and use the <code>fetchLongShortRatioHistory</code> to fetch the history of long short ratios for a symbol.</p> <ul> <li> <code>fetchLongShortRatio (symbol, period)</code> for the current ratio of a single market symbol</li> <li> <code>fetchLongShortRatioHistory (symbol, period, since, limit)</code> for the history of ratios of a single market symbol</li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchLongShortRatio (symbol, period = undefined, params = {})"><pre><span class="pl-en">fetchLongShortRatio</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">period</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbol</strong> (String) <em>required</em> Unified CCXT symbol (e.g. <code>"BTC/USDT:USDT"</code>)</li> <li> <strong>period</strong> (String) The period to calculate the ratio from (e.g. <code>"24h"</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>a <a href="#long-short-ratio-structure">long short ratio structure</a> </li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchLongShortRatioHistory (symbol = undefined, period = undefined, since = undefined, limit = undefined, params = {})"><pre><span class="pl-en">fetchLongShortRatioHistory</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">period</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbol</strong> (String) Unified CCXT symbol (e.g. <code>"BTC/USDT:USDT"</code>)</li> <li> <strong>period</strong> (String) The period to calculate the ratio from (e.g. <code>"24h"</code>)</li> <li> <strong>since</strong> (Integer) Timestamp for the earliest ratio (e.g. <code>1645807945000</code>)</li> <li> <strong>limit</strong> (Integer) The maximum number of ratios to retrieve (e.g. <code>10</code>)</li> <li> <strong>params</strong> (Dictionary) Extra parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>an array of <a href="#long-short-ratio-structure">long short ratio structures</a> </li> </ul> <div class="markdown-heading"><h3 class="heading-element">Long Short Ratio Structure</h3><a id="user-content-long-short-ratio-structure" class="anchor" aria-label="Permalink: Long Short Ratio Structure" href="#long-short-ratio-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ info: { ... }, symbol: 'BTC/USDT:USDT', timestamp: 1645833600000, datetime: '2022-02-26T00:00:00.000Z', timeframe: '24h', longShortRatio: 0.000072, }"><pre><span class="pl-kos">{</span> <span class="pl-c1">info</span>: <span class="pl-kos">{</span> ...<span class="pl-s1"></span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">symbol</span>: <span class="pl-s">'BTC/USDT:USDT'</span><span class="pl-kos">,</span> <span class="pl-c1">timestamp</span>: <span class="pl-c1">1645833600000</span><span class="pl-kos">,</span> <span class="pl-c1">datetime</span>: <span class="pl-s">'2022-02-26T00:00:00.000Z'</span><span class="pl-kos">,</span> <span class="pl-c1">timeframe</span>: <span class="pl-s">'24h'</span><span class="pl-kos">,</span> <span class="pl-c1">longShortRatio</span>: <span class="pl-c1">0.000072</span><span class="pl-kos">,</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h1 class="heading-element">Private API</h1><a id="user-content-private-api" class="anchor" aria-label="Permalink: Private API" href="#private-api"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <ul> <li><a href="#authentication">Authentication</a></li> <li><a href="#sign-in">Sign In</a></li> <li><a href="#api-keys-setup">API Keys Setup</a></li> <li><a href="#accounts">Accounts</a></li> <li><a href="#account-balance">Account Balance</a></li> <li><a href="#orders">Orders</a></li> <li><a href="#my-trades">My Trades</a></li> <li><a href="#ledger">Ledger</a></li> <li><a href="#deposit">Deposit</a></li> <li><a href="#withdrawal">Withdrawal</a></li> <li><a href="#deposit-addresses">Deposit Addresses</a></li> <li><a href="#transfers">Transfers</a></li> <li><a href="#fees">Fees</a></li> <li><a href="#borrow-interest">Borrow Interest</a></li> <li><a href="#borrow-and-repay-margin">Borrow And Repay Margin</a></li> <li><a href="#margin">Margin</a></li> <li><a href="#margin-mode">Margin Mode</a></li> <li><a href="#leverage">Leverage</a></li> <li><a href="#positions">Positions</a></li> <li><a href="#funding-history">Funding History</a></li> <li><a href="#conversion">Conversion</a></li> </ul> <p>In order to be able to access your user account, perform algorithmic trading by placing market and limit orders, query balances, deposit and withdraw funds and so on, you need to obtain your API keys for authentication from each exchange you want to trade with. They usually have it available on a separate tab or page within your user account settings. API keys are exchange-specific and cannnot be interchanged under any circumstances.</p> <p>The exchanges' private APIs will usually allow the following types of interaction:</p> <ul> <li>the current state of the user's account balance can be obtained with the <code>fetchBalance()</code> method as described in the <a href="#account-balance">Account Balance</a> section</li> <li>the user can place and cancel orders with <code>createOrder()</code>, <code>cancelOrder()</code>, as well as fetch current open orders and the past order history with methods like <code>fetchOrder</code>, <code>fetchOrders()</code>, <code>fetchOpenOrder()</code>, <code>fetchOpenOrders()</code>, <code>fetchCanceledOrders</code>, <code>fetchClosedOrder</code>, <code>fetchClosedOrders</code>, as described in the section on <a href="#orders">Orders</a> </li> <li>the user can query the history of past trades executed with their account using <code>fetchMyTrades</code>, as described in the <a href="#my-trades">My Trades</a> section, also see <a href="#how-orders-are-related-to-trades">How Orders Are Related To Trades</a> </li> <li>the user can query their positions with <code>fetchPositions()</code> and <code>fetchPosition()</code> as described in the <a href="#positions">Positions</a> section</li> <li>the user can fetch the history of their transactions (on-chain <em>transactions</em> which are either <em>deposits</em> to the exchange account or <em>withdrawals</em> from the exchange account) with <code>fetchTransactions()</code>, or with <code>fetchDeposit()</code>, <code>fetchDeposits()</code> <code>fetchWithdrawal()</code>, and <code>fetchWithdrawals()</code> separately, depending on what is available from the exchange API</li> <li>if the exchange API provides a ledger endpoint, the user can fetch a history of all money movements that somehow affected the balance, with <code>fetchLedger</code> that will return all accounting ledger entries such as trades, deposits, withdrawals, internal transfers between accounts, rebates, bonuses, fees, staking profits and so on, as described in the <a href="#ledger">Ledger</a> section.</li> </ul> <div class="markdown-heading"><h2 class="heading-element">Authentication</h2><a id="user-content-authentication" class="anchor" aria-label="Permalink: Authentication" href="#authentication"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Authentication with all exchanges is handled automatically if provided with proper API keys. The process of authentication usually goes through the following pattern:</p> <ol> <li>Generate new nonce. A nonce is an integer, often a Unix Timestamp in seconds or milliseconds (since epoch January 1, 1970). The nonce should be unique to a particular request and constantly increasing, so that no two requests share the same nonce. Each next request should have greater nonce than the previous request. <strong>The default nonce is a 32-bit Unix Timestamp in seconds.</strong> </li> <li>Append public apiKey and nonce to other endpoint params, if any, then serialize the whole thing for signing.</li> <li>Sign the serialized params using HMAC-SHA256/384/512 or MD5 with your secret key.</li> <li>Append the signature in Hex or Base64 and nonce to HTTP headers or body.</li> </ol> <p>This process may differ from exchange to exchange. Some exchanges may want the signature in a different encoding, some of them vary in header and body param names and formats, but the general pattern is the same for all of them.</p> <p><strong>You should not share the same API keypair across multiple instances of an exchange running simultaneously, in separate scripts or in multiple threads. Using the same keypair from different instances simultaneously may cause all sorts of unexpected behaviour.</strong></p> <p><strong>DO NOT REUSE API KEYS WITH DIFFERENT SOFTWARE! The other software will screw your nonce too high. If you get <a href="#invalid-nonce">InvalidNonce</a> errors – make sure to generate a fresh new keypair first and foremost.</strong></p> <p>The authentication is already handled for you, so you don't need to perform any of those steps manually unless you are implementing a new exchange class. The only thing you need for trading is the actual API key pair.</p> <div class="markdown-heading"><h3 class="heading-element">API Keys Setup</h3><a id="user-content-api-keys-setup" class="anchor" aria-label="Permalink: API Keys Setup" href="#api-keys-setup"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="markdown-heading"><h4 class="heading-element">Required Credentials</h4><a id="user-content-required-credentials" class="anchor" aria-label="Permalink: Required Credentials" href="#required-credentials"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The API credentials usually include the following:</p> <ul> <li> <code>apiKey</code>. This is your public API Key and/or Token. This part is <em>non-secret</em>, it is included in your request header or body and sent over HTTPS in open text to identify your request. It is often a string in Hex or Base64 encoding or an UUID identifier.</li> <li> <code>secret</code>. This is your private key. Keep it secret, don't tell it to anybody. It is used to sign your requests locally before sending them to exchanges. The secret key does not get sent over the internet in the request-response process and should not be published or emailed. It is used together with the nonce to generate a cryptographically strong signature. That signature is sent with your public key to authenticate your identity. Each request has a unique nonce and therefore a unique cryptographic signature.</li> <li> <code>uid</code>. Some exchanges (not all of them) also generate a user id or <em>uid</em> for short. It can be a string or numeric literal. You should set it, if that is explicitly required by your exchange. See <a href="#exchanges">their docs</a> for details.</li> <li> <code>password</code>. Some exchanges (not all of them) also require your password/phrase for trading. You should set this string, if that is explicitly required by your exchange. See <a href="#exchanges">their docs</a> for details.</li> </ul> <p>In order to create API keys find the API tab or button in your user settings on the exchange website. Then create your keys and copy-paste them to your config file. Your config file permissions should be set appropriately, unreadable to anyone except the owner.</p> <p><strong>Remember to keep your apiKey and secret key safe from unauthorized use, do not send or tell it to anybody. A leak of the secret key or a breach in security can cost you a fund loss.</strong></p> <div class="markdown-heading"><h4 class="heading-element">Credential Validation</h4><a id="user-content-credential-validation" class="anchor" aria-label="Permalink: Credential Validation" href="#credential-validation"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>For checking if the user has supplied all the required credentials the <code>Exchange</code> base class has a method called <code>exchange.checkRequiredCredentials()</code> or <code>exchange.check_required_credentials()</code>. Calling that method will throw an <code>AuthenticationError</code>, if some of the credentials are missing or empty. The <code>Exchange</code> base class also has property <code>exchange.requiredCredentials</code> that allows a user to see which credentials are required for this or that exchange, as shown below:</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-26" class="anchor" aria-label="Permalink: Javascript" href="#javascript-26"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const ccxt = require ('ccxt') const exchange = new ccxt.binance() console.log (exchange.requiredCredentials) // prints required credentials exchange.checkRequiredCredentials() // throw AuthenticationError"><pre><span class="pl-k">const</span> <span class="pl-s1">ccxt</span> <span class="pl-c1">=</span> <span class="pl-en">require</span> <span class="pl-kos">(</span><span class="pl-s">'ccxt'</span><span class="pl-kos">)</span> <span class="pl-k">const</span> <span class="pl-s1">exchange</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">binance</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">requiredCredentials</span><span class="pl-kos">)</span> <span class="pl-c">// prints required credentials</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">checkRequiredCredentials</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c">// throw AuthenticationError</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-27" class="anchor" aria-label="Permalink: Python" href="#python-27"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import ccxt exchange = ccxt.coinbasepro() print(exchange.requiredCredentials) # prints required credentials exchange.check_required_credentials() # raises AuthenticationError"><pre><span class="pl-k">import</span> <span class="pl-s1">ccxt</span> <span class="pl-s1">exchange</span> <span class="pl-c1">=</span> <span class="pl-s1">ccxt</span>.<span class="pl-c1">coinbasepro</span>() <span class="pl-en">print</span>(<span class="pl-s1">exchange</span>.<span class="pl-c1">requiredCredentials</span>) <span class="pl-c"># prints required credentials</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">check_required_credentials</span>() <span class="pl-c"># raises AuthenticationError</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-25" class="anchor" aria-label="Permalink: PHP" href="#php-25"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="include 'ccxt.php'; $exchange = new \ccxt\bittrex (); var_dump($exchange->requiredCredentials); // prints required credentials $exchange->check_required_credentials(); // throws AuthenticationError"><pre><span class="pl-k">include</span> <span class="pl-s">'<span class="pl-s">ccxt.php</span>'</span>; <span class="pl-s1"><span class="pl-c1">$</span>exchange</span> = <span class="pl-k">new</span> \<span class="pl-v">ccxt</span>\<span class="pl-v">bittrex</span> (); <span class="pl-en">var_dump</span>(<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">requiredCredentials</span>); <span class="pl-c">// prints required credentials</span> <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">check_required_credentials</span>(); <span class="pl-c">// throws AuthenticationError</span></pre></div> <div class="markdown-heading"><h4 class="heading-element">Configuring API Keys</h4><a id="user-content-configuring-api-keys" class="anchor" aria-label="Permalink: Configuring API Keys" href="#configuring-api-keys"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>To set up an exchange for trading just assign the API credentials to an existing exchange instance or pass them to exchange constructor upon instantiation, like so:</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-27" class="anchor" aria-label="Permalink: Javascript" href="#javascript-27"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const ccxt = require ('ccxt') // any time let kraken = new ccxt.kraken () kraken.apiKey = 'YOUR_KRAKEN_API_KEY' kraken.secret = 'YOUR_KRAKEN_SECRET_KEY' // upon instantiation let okcoin = new ccxt.okcoin ({ apiKey: 'YOUR_OKCOIN_API_KEY', secret: 'YOUR_OKCOIN_SECRET_KEY', }) // from variable id const exchangeId = 'binance' , exchangeClass = ccxt[exchangeId] , exchange = new exchangeClass ({ 'apiKey': 'YOUR_API_KEY', 'secret': 'YOUR_SECRET', })"><pre><span class="pl-k">const</span> <span class="pl-s1">ccxt</span> <span class="pl-c1">=</span> <span class="pl-en">require</span> <span class="pl-kos">(</span><span class="pl-s">'ccxt'</span><span class="pl-kos">)</span> <span class="pl-c">// any time</span> <span class="pl-k">let</span> <span class="pl-s1">kraken</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">kraken</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-s1">kraken</span><span class="pl-kos">.</span><span class="pl-c1">apiKey</span> <span class="pl-c1">=</span> <span class="pl-s">'YOUR_KRAKEN_API_KEY'</span> <span class="pl-s1">kraken</span><span class="pl-kos">.</span><span class="pl-c1">secret</span> <span class="pl-c1">=</span> <span class="pl-s">'YOUR_KRAKEN_SECRET_KEY'</span> <span class="pl-c">// upon instantiation</span> <span class="pl-k">let</span> <span class="pl-s1">okcoin</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">okcoin</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">apiKey</span>: <span class="pl-s">'YOUR_OKCOIN_API_KEY'</span><span class="pl-kos">,</span> <span class="pl-c1">secret</span>: <span class="pl-s">'YOUR_OKCOIN_SECRET_KEY'</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c">// from variable id</span> <span class="pl-k">const</span> <span class="pl-s1">exchangeId</span> <span class="pl-c1">=</span> <span class="pl-s">'binance'</span> <span class="pl-kos">,</span> <span class="pl-s1">exchangeClass</span> <span class="pl-c1">=</span> <span class="pl-s1">ccxt</span><span class="pl-kos">[</span><span class="pl-s1">exchangeId</span><span class="pl-kos">]</span> <span class="pl-kos">,</span> <span class="pl-s1">exchange</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">exchangeClass</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-s">'apiKey'</span>: <span class="pl-s">'YOUR_API_KEY'</span><span class="pl-kos">,</span> <span class="pl-s">'secret'</span>: <span class="pl-s">'YOUR_SECRET'</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-28" class="anchor" aria-label="Permalink: Python" href="#python-28"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import ccxt # any time bitfinex = ccxt.bitfinex () bitfinex.apiKey = 'YOUR_BFX_API_KEY' bitfinex.secret = 'YOUR_BFX_SECRET' # upon instantiation hitbtc = ccxt.hitbtc ({ 'apiKey': 'YOUR_HITBTC_API_KEY', 'secret': 'YOUR_HITBTC_SECRET_KEY', }) # from variable id exchange_id = 'binance' exchange_class = getattr(ccxt, exchange_id) exchange = exchange_class({ 'apiKey': 'YOUR_API_KEY', 'secret': 'YOUR_SECRET', })"><pre><span class="pl-k">import</span> <span class="pl-s1">ccxt</span> <span class="pl-c"># any time</span> <span class="pl-s1">bitfinex</span> <span class="pl-c1">=</span> <span class="pl-s1">ccxt</span>.<span class="pl-c1">bitfinex</span> () <span class="pl-s1">bitfinex</span>.<span class="pl-c1">apiKey</span> <span class="pl-c1">=</span> <span class="pl-s">'YOUR_BFX_API_KEY'</span> <span class="pl-s1">bitfinex</span>.<span class="pl-c1">secret</span> <span class="pl-c1">=</span> <span class="pl-s">'YOUR_BFX_SECRET'</span> <span class="pl-c"># upon instantiation</span> <span class="pl-s1">hitbtc</span> <span class="pl-c1">=</span> <span class="pl-s1">ccxt</span>.<span class="pl-c1">hitbtc</span> ({ <span class="pl-s">'apiKey'</span>: <span class="pl-s">'YOUR_HITBTC_API_KEY'</span>, <span class="pl-s">'secret'</span>: <span class="pl-s">'YOUR_HITBTC_SECRET_KEY'</span>, }) <span class="pl-c"># from variable id</span> <span class="pl-s1">exchange_id</span> <span class="pl-c1">=</span> <span class="pl-s">'binance'</span> <span class="pl-s1">exchange_class</span> <span class="pl-c1">=</span> <span class="pl-en">getattr</span>(<span class="pl-s1">ccxt</span>, <span class="pl-s1">exchange_id</span>) <span class="pl-s1">exchange</span> <span class="pl-c1">=</span> <span class="pl-en">exchange_class</span>({ <span class="pl-s">'apiKey'</span>: <span class="pl-s">'YOUR_API_KEY'</span>, <span class="pl-s">'secret'</span>: <span class="pl-s">'YOUR_SECRET'</span>, })</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-26" class="anchor" aria-label="Permalink: PHP" href="#php-26"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="include 'ccxt.php' // any time $hitbtc = new \ccxt\hitbtc (); $hitbtc->apiKey = 'YOUR_HITBTC_API_KEY'; $hitbtc->secret = 'YOUR_HITBTC_SECRET_KEY'; // upon instantiation $zaif = new \ccxt\zaif (array ( 'apiKey' => 'YOUR_ZAIF_API_KEY', 'secret' => 'YOUR_ZAIF_SECRET_KEY' )); // from variable id $exchange_id = 'binance'; $exchange_class = "\\ccxt\\$exchange_id"; $exchange = new $exchange_class (array ( 'apiKey' => 'YOUR_API_KEY', 'secret' => 'YOUR_SECRET', ));"><pre><span class="pl-k">include</span> <span class="pl-s">'<span class="pl-s">ccxt.php</span>'</span> <span class="pl-c">// any time</span> <span class="pl-s1"><span class="pl-c1">$</span>hitbtc</span> = <span class="pl-k">new</span> \<span class="pl-v">ccxt</span>\<span class="pl-v">hitbtc</span> (); <span class="pl-s1"><span class="pl-c1">$</span>hitbtc</span>-><span class="pl-c1">apiKey</span> = <span class="pl-s">'<span class="pl-s">YOUR_HITBTC_API_KEY</span>'</span>; <span class="pl-s1"><span class="pl-c1">$</span>hitbtc</span>-><span class="pl-c1">secret</span> = <span class="pl-s">'<span class="pl-s">YOUR_HITBTC_SECRET_KEY</span>'</span>; <span class="pl-c">// upon instantiation</span> <span class="pl-s1"><span class="pl-c1">$</span>zaif</span> = <span class="pl-k">new</span> \<span class="pl-v">ccxt</span>\<span class="pl-v">zaif</span> (<span class="pl-en">array</span> ( <span class="pl-s">'<span class="pl-s">apiKey</span>'</span> => <span class="pl-s">'<span class="pl-s">YOUR_ZAIF_API_KEY</span>'</span>, <span class="pl-s">'<span class="pl-s">secret</span>'</span> => <span class="pl-s">'<span class="pl-s">YOUR_ZAIF_SECRET_KEY</span>'</span> )); <span class="pl-c">// from variable id</span> <span class="pl-s1"><span class="pl-c1">$</span>exchange_id</span> = <span class="pl-s">'<span class="pl-s">binance</span>'</span>; <span class="pl-s1"><span class="pl-c1">$</span>exchange_class</span> = <span class="pl-s">"\\<span class="pl-s">ccxt</span>\\<span class="pl-s1"><span class="pl-c1">$</span>exchange_id</span>"</span>; <span class="pl-s1"><span class="pl-c1">$</span>exchange</span> = <span class="pl-k">new</span> <span class="pl-s1"><span class="pl-c1">$</span>exchange_class</span> (<span class="pl-en">array</span> ( <span class="pl-s">'<span class="pl-s">apiKey</span>'</span> => <span class="pl-s">'<span class="pl-s">YOUR_API_KEY</span>'</span>, <span class="pl-s">'<span class="pl-s">secret</span>'</span> => <span class="pl-s">'<span class="pl-s">YOUR_SECRET</span>'</span>, ));</pre></div> <p>Note that your private requests will fail with an exception or error if you don't set up your API credentials before you start trading. To avoid character escaping <strong>always write your credentials in single quotes</strong>, not double quotes (<code>'VERY_GOOD'</code>, <code>"VERY_BAD"</code>).</p> <div class="markdown-heading"><h4 class="heading-element">API Key Permissions</h4><a id="user-content-api-key-permissions" class="anchor" aria-label="Permalink: API Key Permissions" href="#api-key-permissions"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>When you get errors like <code>"Invalid API-key, IP, or permissions for action."</code> or <code>"API-key format invalid"</code>, then, most likely, the problem is not within ccxt, please avoid opening a new issue unless you ensure that:</p> <ol> <li>You don't have typos, empty spaces, or quotes in your keys</li> <li>Your current IP address (check <a href="https://api.ipify.org/" rel="nofollow">IPv4</a> or <a href="https://api64.ipify.org/" rel="nofollow">IPv6</a>) is added into API-KEY's whitelist (if you use proxy, consider that too)</li> <li>You have selected the correct options in permissions list for that api-key</li> <li>You are not accidentally mixing "testnet" api-keys or "testnet" mode in your script</li> <li>You have checked already <a href="https://github.com/ccxt/ccxt/issues?q=is%3Aissue+%22Invalid+Api-Key+ID%22">reported issues</a> about this error</li> </ol> <div class="markdown-heading"><h4 class="heading-element">Sign In</h4><a id="user-content-sign-in" class="anchor" aria-label="Permalink: Sign In" href="#sign-in"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Some exchanges required you to sign in prior to calling private methods, which can be done using the <code>signIn</code> method</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-28" class="anchor" aria-label="Permalink: Javascript" href="#javascript-28"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="signIn (params = {})"><pre><span class="pl-en">signIn</span> <span class="pl-kos">(</span><span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"2fa": "329293"}</code>)</li> </ul> <p>Returns</p> <ul> <li>response from the exchange</li> </ul> <div class="markdown-heading"><h2 class="heading-element">Overriding The Nonce</h2><a id="user-content-overriding-the-nonce" class="anchor" aria-label="Permalink: Overriding The Nonce" href="#overriding-the-nonce"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><strong>The default nonce is defined by the underlying exchange. You can override it with a milliseconds-nonce if you want to make private requests more frequently than once per second! Most exchanges will throttle your requests if you hit their rate limits, read <a href="https://github.com/ccxt/ccxt/wiki/Exchanges">API docs for your exchange</a> carefully!</strong></p> <p>In case you need to reset the nonce it is much easier to create another pair of keys for using with private APIs. Creating new keys and setting up a fresh unused keypair in your config is usually enough for that.</p> <p>In some cases you are unable to create new keys due to lack of permissions or whatever. If that happens you can still override the nonce. Base market class has the following methods for convenience:</p> <ul> <li> <code>seconds ()</code>: returns a Unix Timestamp in seconds.</li> <li> <code>milliseconds ()</code>: same in milliseconds (ms = 1000 * s, thousandths of a second).</li> <li> <code>microseconds ()</code>: same in microseconds (μs = 1000 * ms, millionths of a second).</li> </ul> <p>There are exchanges that confuse milliseconds with microseconds in their API docs, let's all forgive them for that, folks. You can use methods listed above to override the nonce value. If you need to use the same keypair from multiple instances simultaneously use closures or a common function to avoid nonce conflicts. In Javascript you can override the nonce by providing a <code>nonce</code> parameter to the exchange constructor or by setting it explicitly on exchange object:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// JavaScript // 1: custom nonce redefined in constructor parameters let nonce = 1 let kraken1 = new ccxt.kraken ({ nonce: () => nonce++ }) // 2: nonce redefined explicitly let kraken2 = new ccxt.kraken () kraken2.nonce = function () { return nonce++ } // uses same nonce as kraken1 // 3: milliseconds nonce let kraken3 = new ccxt.kraken ({ nonce: function () { return this.milliseconds () }, }) // 4: newer ES syntax let kraken4 = new ccxt.kraken ({ nonce () { return this.milliseconds () }, })"><pre><span class="pl-c">// JavaScript</span> <span class="pl-c">// 1: custom nonce redefined in constructor parameters</span> <span class="pl-k">let</span> <span class="pl-s1">nonce</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span> <span class="pl-k">let</span> <span class="pl-s1">kraken1</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">kraken</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-en">nonce</span>: <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-s1">nonce</span><span class="pl-c1">++</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c">// 2: nonce redefined explicitly</span> <span class="pl-k">let</span> <span class="pl-s1">kraken2</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">kraken</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-s1">kraken2</span><span class="pl-kos">.</span><span class="pl-en">nonce</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-s1">nonce</span><span class="pl-c1">++</span> <span class="pl-kos">}</span> <span class="pl-c">// uses same nonce as kraken1</span> <span class="pl-c">// 3: milliseconds nonce</span> <span class="pl-k">let</span> <span class="pl-s1">kraken3</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">kraken</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-en">nonce</span>: <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">milliseconds</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c">// 4: newer ES syntax</span> <span class="pl-k">let</span> <span class="pl-s1">kraken4</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">kraken</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-en">nonce</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">milliseconds</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>In Python and PHP you can do the same by subclassing and overriding nonce function of a particular exchange class:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# Python # 1: the shortest coinbasepro = ccxt.coinbasepro({'nonce': ccxt.Exchange.milliseconds}) # 2: custom nonce class MyKraken(ccxt.kraken): n = 1 def nonce(self): return self.n += 1 # 3: milliseconds nonce class MyBitfinex(ccxt.bitfinex): def nonce(self): return self.milliseconds() # 4: milliseconds nonce inline hitbtc = ccxt.hitbtc({ 'nonce': lambda: int(time.time() * 1000) }) # 5: milliseconds nonce acx = ccxt.acx({'nonce': lambda: ccxt.Exchange.milliseconds()})"><pre><span class="pl-c"># Python</span> <span class="pl-c"># 1: the shortest</span> <span class="pl-s1">coinbasepro</span> <span class="pl-c1">=</span> <span class="pl-s1">ccxt</span>.<span class="pl-c1">coinbasepro</span>({<span class="pl-s">'nonce'</span>: <span class="pl-s1">ccxt</span>.<span class="pl-c1">Exchange</span>.<span class="pl-c1">milliseconds</span>}) <span class="pl-c"># 2: custom nonce</span> <span class="pl-k">class</span> <span class="pl-v">MyKraken</span>(<span class="pl-s1">ccxt</span>.<span class="pl-c1">kraken</span>): <span class="pl-s1">n</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span> <span class="pl-k">def</span> <span class="pl-en">nonce</span>(<span class="pl-s1">self</span>): <span class="pl-k">return</span> <span class="pl-s1">self</span>.<span class="pl-c1">n</span> <span class="pl-c1">+</span><span class="pl-c1">=</span> <span class="pl-c1">1</span> <span class="pl-c"># 3: milliseconds nonce</span> <span class="pl-k">class</span> <span class="pl-v">MyBitfinex</span>(<span class="pl-s1">ccxt</span>.<span class="pl-c1">bitfinex</span>): <span class="pl-k">def</span> <span class="pl-en">nonce</span>(<span class="pl-s1">self</span>): <span class="pl-k">return</span> <span class="pl-s1">self</span>.<span class="pl-c1">milliseconds</span>() <span class="pl-c"># 4: milliseconds nonce inline</span> <span class="pl-s1">hitbtc</span> <span class="pl-c1">=</span> <span class="pl-s1">ccxt</span>.<span class="pl-c1">hitbtc</span>({ <span class="pl-s">'nonce'</span>: <span class="pl-k">lambda</span>: <span class="pl-en">int</span>(<span class="pl-s1">time</span>.<span class="pl-c1">time</span>() <span class="pl-c1">*</span> <span class="pl-c1">1000</span>) }) <span class="pl-c"># 5: milliseconds nonce</span> <span class="pl-s1">acx</span> <span class="pl-c1">=</span> <span class="pl-s1">ccxt</span>.<span class="pl-c1">acx</span>({<span class="pl-s">'nonce'</span>: <span class="pl-k">lambda</span>: <span class="pl-s1">ccxt</span>.<span class="pl-c1">Exchange</span>.<span class="pl-c1">milliseconds</span>()})</pre></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// PHP // 1: custom nonce value class Myokcoin extends \ccxt\okcoin { public function __construct ($options = array ()) { parent::__construct (array_merge (array ('i' => 1), $options)); } public function nonce () { return $this->i++; } } // 2: milliseconds nonce class MyZaif extends \ccxt\zaif { public function __construct ($options = array ()) { parent::__construct (array_merge (array ('i' => 1), $options)); } public function nonce () { return $this->milliseconds (); } }"><pre><span class="pl-c">// PHP</span> <span class="pl-c">// 1: custom nonce value</span> <span class="pl-k">class</span> Myokcoin <span class="pl-k">extends</span> \<span class="pl-v">ccxt</span>\okcoin { <span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">__construct</span> (<span class="pl-s1"><span class="pl-c1">$</span>options</span> = <span class="pl-en">array</span> ()) { <span class="pl-smi">parent</span>::<span class="pl-en">__construct</span> (<span class="pl-en">array_merge</span> (<span class="pl-en">array</span> (<span class="pl-s">'<span class="pl-s">i</span>'</span> => <span class="pl-c1">1</span>), <span class="pl-s1"><span class="pl-c1">$</span>options</span>)); } <span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">nonce</span> () { <span class="pl-k">return</span> <span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-><span class="pl-c1">i</span>++; } } <span class="pl-c">// 2: milliseconds nonce</span> <span class="pl-k">class</span> MyZaif <span class="pl-k">extends</span> \<span class="pl-v">ccxt</span>\zaif { <span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">__construct</span> (<span class="pl-s1"><span class="pl-c1">$</span>options</span> = <span class="pl-en">array</span> ()) { <span class="pl-smi">parent</span>::<span class="pl-en">__construct</span> (<span class="pl-en">array_merge</span> (<span class="pl-en">array</span> (<span class="pl-s">'<span class="pl-s">i</span>'</span> => <span class="pl-c1">1</span>), <span class="pl-s1"><span class="pl-c1">$</span>options</span>)); } <span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">nonce</span> () { <span class="pl-k">return</span> <span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-><span class="pl-en">milliseconds</span> (); } }</pre></div> <div class="markdown-heading"><h2 class="heading-element">Accounts</h2><a id="user-content-accounts" class="anchor" aria-label="Permalink: Accounts" href="#accounts"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>You can get all the accounts associated with a profile by using the <code>fetchAccounts()</code> method</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchAccounts (params = {})"><pre><span class="pl-en">fetchAccounts</span> <span class="pl-kos">(</span><span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Accounts Structure</h3><a id="user-content-accounts-structure" class="anchor" aria-label="Permalink: Accounts Structure" href="#accounts-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The <code>fetchAccounts()</code> method will return a structure like shown below:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ { id: "s32kj302lasli3930", type: "main", name: "main", code: "USDT", info: { ... } }, { id: "20f0sdlri34lf90", name: "customAccount", type: "margin", code: "USDT", info: { ... } }, { id: "4oidfk40dadeg4328", type: "spot", name: "spotAccount32", code: "BTC", info: { ... } }, ... ]"><pre><span class="pl-kos">[</span> <span class="pl-kos">{</span> <span class="pl-c1">id</span>: <span class="pl-s">"s32kj302lasli3930"</span><span class="pl-kos">,</span> <span class="pl-c1">type</span>: <span class="pl-s">"main"</span><span class="pl-kos">,</span> <span class="pl-c1">name</span>: <span class="pl-s">"main"</span><span class="pl-kos">,</span> <span class="pl-c1">code</span>: <span class="pl-s">"USDT"</span><span class="pl-kos">,</span> <span class="pl-c1">info</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">id</span>: <span class="pl-s">"20f0sdlri34lf90"</span><span class="pl-kos">,</span> <span class="pl-c1">name</span>: <span class="pl-s">"customAccount"</span><span class="pl-kos">,</span> <span class="pl-c1">type</span>: <span class="pl-s">"margin"</span><span class="pl-kos">,</span> <span class="pl-c1">code</span>: <span class="pl-s">"USDT"</span><span class="pl-kos">,</span> <span class="pl-c1">info</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">id</span>: <span class="pl-s">"4oidfk40dadeg4328"</span><span class="pl-kos">,</span> <span class="pl-c1">type</span>: <span class="pl-s">"spot"</span><span class="pl-kos">,</span> <span class="pl-c1">name</span>: <span class="pl-s">"spotAccount32"</span><span class="pl-kos">,</span> <span class="pl-c1">code</span>: <span class="pl-s">"BTC"</span><span class="pl-kos">,</span> <span class="pl-c1">info</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> ... <span class="pl-kos">]</span></pre></div> <p>Types of account is one of the <a href="####Account-Balance">unified account types</a> or <code>subaccount</code></p> <div class="markdown-heading"><h2 class="heading-element">Account Balance</h2><a id="user-content-account-balance" class="anchor" aria-label="Permalink: Account Balance" href="#account-balance"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>To query for balance and get the amount of funds available for trading or funds locked in orders, use the <code>fetchBalance</code> method:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchBalance (params = {})"><pre><span class="pl-en">fetchBalance</span> <span class="pl-kos">(</span><span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>params</strong> (Dictionary) Extra parameters specific to the exchange API endpoint (e.g. <code>{"currency": "usdt"}</code>)</li> </ul> <p>Returns</p> <ul> <li>A <a href="#balance-structure">balance structure</a> </li> </ul> <div class="markdown-heading"><h3 class="heading-element">Balance Structure</h3><a id="user-content-balance-structure" class="anchor" aria-label="Permalink: Balance Structure" href="#balance-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ 'info': { ... }, // the original untouched non-parsed reply with details 'timestamp': 1499280391811, // Unix Timestamp in milliseconds (seconds * 1000) 'datetime': '2017-07-05T18:47:14.692Z', // ISO8601 datetime string with milliseconds //------------------------------------------------------------------------- // indexed by availability of funds first, then by currency 'free': { // money, available for trading, by currency 'BTC': 321.00, // floats... 'USD': 123.00, ... }, 'used': { ... }, // money on hold, locked, frozen, or pending, by currency 'total': { ... }, // total (free + used), by currency 'debt': { ... }, // debt, by currency //------------------------------------------------------------------------- // indexed by currency first, then by availability of funds 'BTC': { // string, three-letter currency code, uppercase 'free': 321.00 // float, money available for trading 'used': 234.00, // float, money on hold, locked, frozen or pending 'total': 555.00, // float, total balance (free + used) }, 'USD': { // ... 'free': 123.00 // ... 'used': 456.00, 'total': 579.00, }, ... }"><pre><span class="pl-kos">{</span> <span class="pl-s">'info'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// the original untouched non-parsed reply with details</span> <span class="pl-s">'timestamp'</span>: <span class="pl-c1">1499280391811</span><span class="pl-kos">,</span> <span class="pl-c">// Unix Timestamp in milliseconds (seconds * 1000)</span> <span class="pl-s">'datetime'</span>: <span class="pl-s">'2017-07-05T18:47:14.692Z'</span><span class="pl-kos">,</span> <span class="pl-c">// ISO8601 datetime string with milliseconds</span> <span class="pl-c">//-------------------------------------------------------------------------</span> <span class="pl-c">// indexed by availability of funds first, then by currency</span> <span class="pl-s">'free'</span>: <span class="pl-kos">{</span> <span class="pl-c">// money, available for trading, by currency</span> <span class="pl-s">'BTC'</span>: <span class="pl-c1">321.00</span><span class="pl-kos">,</span> <span class="pl-c">// floats...</span> <span class="pl-s">'USD'</span>: <span class="pl-c1">123.00</span><span class="pl-kos">,</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'used'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// money on hold, locked, frozen, or pending, by currency</span> <span class="pl-s">'total'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// total (free + used), by currency</span> <span class="pl-s">'debt'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// debt, by currency</span> <span class="pl-c">//-------------------------------------------------------------------------</span> <span class="pl-c">// indexed by currency first, then by availability of funds</span> <span class="pl-s">'BTC'</span>: <span class="pl-kos">{</span> <span class="pl-c">// string, three-letter currency code, uppercase</span> <span class="pl-s">'free'</span>: <span class="pl-c1">321.00</span> <span class="pl-c">// float, money available for trading</span> <span class="pl-s">'used'</span>: <span class="pl-c1">234.00</span><span class="pl-kos">,</span> <span class="pl-c">// float, money on hold, locked, frozen or pending</span> <span class="pl-s">'total'</span>: <span class="pl-c1">555.00</span><span class="pl-kos">,</span> <span class="pl-c">// float, total balance (free + used)</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'USD'</span>: <span class="pl-kos">{</span> <span class="pl-c">// ...</span> <span class="pl-s">'free'</span>: <span class="pl-c1">123.00</span> <span class="pl-c">// ...</span> <span class="pl-s">'used'</span>: <span class="pl-c1">456.00</span><span class="pl-kos">,</span> <span class="pl-s">'total'</span>: <span class="pl-c1">579.00</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> ... <span class="pl-kos">}</span></pre></div> <p>The <code>timestamp</code> and <code>datetime</code> values may be undefined or missing if the underlying exchange does not provide them.</p> <p>Some exchanges may not return full balance info. Many exchanges do not return balances for your empty or unused accounts. In that case some currencies may be missing in returned balance structure.</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-29" class="anchor" aria-label="Permalink: Javascript" href="#javascript-29"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(async () => { console.log (await exchange.fetchBalance ()) }) ()"><pre><span class="pl-kos">(</span><span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchBalance</span> <span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">(</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-29" class="anchor" aria-label="Permalink: Python" href="#python-29"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="print (exchange.fetch_balance ())"><pre><span class="pl-en">print</span> (<span class="pl-s1">exchange</span>.<span class="pl-c1">fetch_balance</span> ())</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-27" class="anchor" aria-label="Permalink: PHP" href="#php-27"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="var_dump ($exchange->fetch_balance ());"><pre><span class="pl-en">var_dump</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">fetch_balance</span> ());</pre></div> <div class="markdown-heading"><h2 class="heading-element">Orders</h2><a id="user-content-orders" class="anchor" aria-label="Permalink: Orders" href="#orders"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-diff notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- this part of the unified API is currenty a work in progress - there may be some issues and missing implementations here and there - contributions, pull requests and feedback appreciated"><pre><span class="pl-md"><span class="pl-md">-</span> this part of the unified API is currenty a work in progress</span> <span class="pl-md"><span class="pl-md">-</span> there may be some issues and missing implementations here and there</span> <span class="pl-md"><span class="pl-md">-</span> contributions, pull requests and feedback appreciated</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Querying Orders</h3><a id="user-content-querying-orders" class="anchor" aria-label="Permalink: Querying Orders" href="#querying-orders"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Most of the time you can query orders by an id or by a symbol, though not all exchanges offer a full and flexible set of endpoints for querying orders. Some exchanges might not have a method for fetching recently closed orders, the other can lack a method for getting an order by id, etc. The ccxt library will target those cases by making workarounds where possible.</p> <p>The list of methods for querying orders consists of the following:</p> <ul> <li><code>fetchCanceledOrders (symbol = undefined, since = undefined, limit = undefined, params = {})</code></li> <li><code>fetchClosedOrder (id, symbol = undefined, params = {})</code></li> <li><code>fetchClosedOrders (symbol = undefined, since = undefined, limit = undefined, params = {})</code></li> <li><code>fetchOpenOrder (id, symbol = undefined, params = {})</code></li> <li><code>fetchOpenOrders (symbol = undefined, since = undefined, limit = undefined, params = {})</code></li> <li><code>fetchOrder (id, symbol = undefined, params = {})</code></li> <li><code>fetchOrders (symbol = undefined, since = undefined, limit = undefined, params = {})</code></li> </ul> <p>Note that the naming of those methods indicates if the method returns a single order or multiple orders (an array/list of orders). The <code>fetchOrder()</code> method requires a mandatory order id argument (a string). Some exchanges also require a symbol to fetch an order by id, where order ids can intersect with various trading pairs. Also, note that all other methods above return an array (a list) of orders. Most of them will require a symbol argument as well, however, some exchanges allow querying with a symbol unspecified (meaning <em>all symbols</em>).</p> <p>The library will throw a NotSupported exception if a user calls a method that is not available from the exchange or is not implemented in ccxt.</p> <p>To check if any of the above methods are available, look into the <code>.has</code> property of the exchange:</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-30" class="anchor" aria-label="Permalink: Javascript" href="#javascript-30"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="'use strict'; const ccxt = require ('ccxt') const id = 'poloniex' exchange = new ccxt[id] () console.log (exchange.has)"><pre><span class="pl-s">'use strict'</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">ccxt</span> <span class="pl-c1">=</span> <span class="pl-en">require</span> <span class="pl-kos">(</span><span class="pl-s">'ccxt'</span><span class="pl-kos">)</span> <span class="pl-k">const</span> <span class="pl-s1">id</span> <span class="pl-c1">=</span> <span class="pl-s">'poloniex'</span> <span class="pl-s1">exchange</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">[</span><span class="pl-s1">id</span><span class="pl-kos">]</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">has</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-30" class="anchor" aria-label="Permalink: Python" href="#python-30"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import ccxt id = 'binance' exchange = getattr(ccxt, id)() print(exchange.has)"><pre><span class="pl-k">import</span> <span class="pl-s1">ccxt</span> <span class="pl-s1">id</span> <span class="pl-c1">=</span> <span class="pl-s">'binance'</span> <span class="pl-s1">exchange</span> <span class="pl-c1">=</span> <span class="pl-en">getattr</span>(<span class="pl-s1">ccxt</span>, <span class="pl-s1">id</span>)() <span class="pl-en">print</span>(<span class="pl-s1">exchange</span>.<span class="pl-c1">has</span>)</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-28" class="anchor" aria-label="Permalink: PHP" href="#php-28"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$exchange = new \ccxt\bitfinex(); print_r ($exchange->has); // or var_dump"><pre><span class="pl-s1"><span class="pl-c1">$</span>exchange</span> = <span class="pl-k">new</span> \<span class="pl-v">ccxt</span>\<span class="pl-v">bitfinex</span>(); <span class="pl-en">print_r</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">has</span>); <span class="pl-c">// or var_dump</span></pre></div> <p>A typical structure of the <code>.has</code> property usually contains the following flags corresponding to order API methods for querying orders:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="exchange.has = { // ... other flags ... 'fetchOrder': true, // available from the exchange directly and implemented in ccxt 'fetchOrders': false, // not available from the exchange or not implemented in ccxt 'fetchOpenOrders': true, 'fetchClosedOrders': 'emulated', // not available from the exchange, but emulated in ccxt // ... other flags ... }"><pre><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">has</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c">// ... other flags ...</span> <span class="pl-s">'fetchOrder'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c">// available from the exchange directly and implemented in ccxt</span> <span class="pl-s">'fetchOrders'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c">// not available from the exchange or not implemented in ccxt</span> <span class="pl-s">'fetchOpenOrders'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-s">'fetchClosedOrders'</span>: <span class="pl-s">'emulated'</span><span class="pl-kos">,</span> <span class="pl-c">// not available from the exchange, but emulated in ccxt</span> <span class="pl-c">// ... other flags ...</span> <span class="pl-kos">}</span></pre></div> <p>The meanings of boolean <code>true</code> and <code>false</code> are obvious. A string value of <code>emulated</code> means that particular method is missing in the exchange API and ccxt will workaround that where possible on the client-side.</p> <div class="markdown-heading"><h4 class="heading-element">Understanding The Orders API Design</h4><a id="user-content-understanding-the-orders-api-design" class="anchor" aria-label="Permalink: Understanding The Orders API Design" href="#understanding-the-orders-api-design"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The exchanges' order management APIs differ by design. The user has to understand the purpose of each specific method and how they're combined together into a complete order API:</p> <ul> <li> <code>fetchCanceledOrders()</code>- fetches a list of canceled orders</li> <li> <code>fetchClosedOrder()</code>- fetches a single closed order by order id</li> <li> <code>fetchClosedOrders()</code> – fetches a list of closed (or canceled) orders.</li> <li> <code>fetchMyTrades()</code> – though not a part of the orders' API, it is closely related, since it provides the history of settled trades.</li> <li> <code>fetchOpenOrder()</code>- fetches a single open order by order id</li> <li> <code>fetchOpenOrders()</code> – fetches a list of open orders.</li> <li> <code>fetchOrder()</code> – fetches a single order (open or closed) by order <code>id</code>.</li> <li> <code>fetchOrders()</code> – fetches a list of all orders (either open or closed/canceled).</li> <li> <code>createOrder()</code> – used for placing orders</li> <li> <code>createOrders()</code> – used for placing multiple orders within the same request</li> <li> <code>cancelOrder()</code> – used for canceling a single order</li> <li> <code>cancelOrders()</code> - used for canceling multiple orders</li> <li> <code>cancelAllOrders()</code> - used for canceling all orders</li> <li> <code>cancelAllOrdersAfter()</code> - used for canceling all orders after the given timeout</li> </ul> <p>The majority of the exchanges will have a way of fetching currently-open orders. Thus, the <code>exchange.has['fetchOpenOrders']</code>. If that method is not available, then most likely the <code>exchange.has['fetchOrders']</code> that will provide a list of all orders. The exchange will return a list of open orders either from <code>fetchOpenOrders()</code> or from <code>fetchOrders()</code>. One of the two methods is usually available from any exchange.</p> <p>Some exchanges will provide the order history, other exchanges will not. If the underlying exchange provides the order history, then the <code>exchange.has['fetchClosedOrders']</code> or the <code>exchange.has['fetchOrders']</code>. If the underlying exchange does not provide the order history, then <code>fetchClosedOrders()</code> and <code>fetchOrders()</code> are not available. In the latter case, the user is required to build a local cache of orders and track the open orders using <code>fetchOpenOrders()</code> and <code>fetchOrder()</code> for order statuses and for marking them as closed locally in the userland (when they're not open anymore).</p> <p>If the underlying exchange does not have methods for order history (<code>fetchClosedOrders()</code> and <code>fetchOrders()</code>), then it will provide <code>fetchOpenOrders</code> + the trade history with <code>fetchMyTrades</code> (see <a href="#how-orders-are-related-to-trades">How Orders Are Related To Trades</a>). That set of information is in many cases enough for tracking in a live-trading robot. If there's no order history – you have to track your live orders and restore historical info from open orders and historical trades.</p> <p>In general, the underlying exchanges will usually provide one or more of the following types of historical data:</p> <ul> <li><code>fetchClosedOrders()</code></li> <li><code>fetchOrders()</code></li> <li><code>fetchMyTrades()</code></li> </ul> <p>Any of the above three methods may be missing, but the exchanges APIs will usually provide at least one of the three methods.</p> <p>If the underlying exchange does not provide historical orders, the CCXT library will not emulate the missing functionality – it has to be added on the user side where necessary.</p> <p><strong>Please, note, that a certain method may be missing either because the exchange does not have a corresponding API endpoint, or because CCXT has not implemented it yet (the library is also a work in progress). In the latter case, the missing method will be added as soon as possible.</strong></p> <div class="markdown-heading"><h4 class="heading-element">Querying Multiple Orders And Trades</h4><a id="user-content-querying-multiple-orders-and-trades" class="anchor" aria-label="Permalink: Querying Multiple Orders And Trades" href="#querying-multiple-orders-and-trades"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>All methods returning lists of trades and lists of orders, accept the second <code>since</code> argument and the third <code>limit</code> argument:</p> <ul> <li> <code>fetchTrades()</code> (public)</li> <li> <code>fetchMyTrades()</code> (private)</li> <li><code>fetchOrders()</code></li> <li><code>fetchOpenOrders()</code></li> <li><code>fetchClosedOrders()</code></li> <li><code>fetchCanceledOrders()</code></li> </ul> <p>The second argument <code>since</code> reduces the array by timestamp, the third <code>limit</code> argument reduces by number (count) of returned items.</p> <p>If the user does not specify <code>since</code>, the <code>fetchTrades()/fetchOrders()</code> methods will return the default set of results from the exchange. The default set is exchange-specific, some exchanges will return trades or recent orders starting from the date of listing a pair on the exchange, other exchanges will return a reduced set of trades or orders (like, last 24 hours, last 100 trades, first 100 orders, etc). If the user wants precise control over the timeframe, the user is responsible for specifying the <code>since</code> argument.</p> <p><strong>NOTE: not all exchanges provide means for filtering the lists of trades and orders by starting time, so, the support for <code>since </code> and <code>limit</code> is exchange-specific. However, most exchanges do provide at least some alternative for "pagination" and "scrolling" which can be overrided with extra <code>params</code> argument.</strong></p> <p>Some exchanges do not have a method for fetching closed orders or all orders. They will offer just the <code>fetchOpenOrders()</code> endpoint, and sometimes also a <code>fetchOrder</code> endpoint as well. Those exchanges don't have any methods for fetching the order history. To maintain the order history for those exchanges the user has to store a dictionary or a database of orders in the userland and update the orders in the database after calling methods like <code>createOrder()</code>, <code>fetchOpenOrders()</code>, <code>cancelOrder()</code>, <code>cancelAllOrders()</code>.</p> <div class="markdown-heading"><h4 class="heading-element">By Order Id</h4><a id="user-content-by-order-id" class="anchor" aria-label="Permalink: By Order Id" href="#by-order-id"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>To get the details of a particular order by its id, use the <code>fetchOrder()</code> / <code>fetch_order()</code> method. Some exchanges also require a symbol even when fetching a particular order by id.</p> <p>The signature of the fetchOrder/fetch_order method is as follows:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if (exchange.has['fetchOrder']) { // you can use the params argument for custom overrides let order = await exchange.fetchOrder (id, symbol = undefined, params = {}) }"><pre><span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">has</span><span class="pl-kos">[</span><span class="pl-s">'fetchOrder'</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-c">// you can use the params argument for custom overrides</span> <span class="pl-k">let</span> <span class="pl-s1">order</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchOrder</span> <span class="pl-kos">(</span><span class="pl-s1">id</span><span class="pl-kos">,</span> <span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">}</span></pre></div> <p><strong>Some exchanges don't have an endpoint for fetching an order by id, ccxt will emulate it where possible.</strong> For now it may still be missing here and there, as this is a work in progress.</p> <p>You can pass custom overrided key-values in the additional params argument to supply a specific order type, or some other setting if needed.</p> <p>Below are examples of using the fetchOrder method to get order info from an authenticated exchange instance:</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-31" class="anchor" aria-label="Permalink: Javascript" href="#javascript-31"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(async function () { const order = await exchange.fetchOrder (id) console.log (order) }) ()"><pre><span class="pl-kos">(</span><span class="pl-k">async</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-s1">order</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchOrder</span> <span class="pl-kos">(</span><span class="pl-s1">id</span><span class="pl-kos">)</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">order</span><span class="pl-kos">)</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">(</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-31" class="anchor" aria-label="Permalink: Python" href="#python-31"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if exchange.has['fetchOrder']: order = exchange.fetch_order(id) print(order) # Python 3.7+ asyncio (asynchronous) import asyncio import ccxt.async_support as ccxt if exchange.has['fetchOrder']: order = asyncio.run(exchange.fetch_order(id)) print(order)"><pre><span class="pl-k">if</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">has</span>[<span class="pl-s">'fetchOrder'</span>]: <span class="pl-s1">order</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">fetch_order</span>(<span class="pl-s1">id</span>) <span class="pl-en">print</span>(<span class="pl-s1">order</span>) <span class="pl-c"># Python 3.7+ asyncio (asynchronous)</span> <span class="pl-k">import</span> <span class="pl-s1">asyncio</span> <span class="pl-k">import</span> <span class="pl-s1">ccxt</span>.<span class="pl-s1">async_support</span> <span class="pl-k">as</span> <span class="pl-s1">ccxt</span> <span class="pl-k">if</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">has</span>[<span class="pl-s">'fetchOrder'</span>]: <span class="pl-s1">order</span> <span class="pl-c1">=</span> <span class="pl-s1">asyncio</span>.<span class="pl-c1">run</span>(<span class="pl-s1">exchange</span>.<span class="pl-c1">fetch_order</span>(<span class="pl-s1">id</span>)) <span class="pl-en">print</span>(<span class="pl-s1">order</span>)</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-29" class="anchor" aria-label="Permalink: PHP" href="#php-29"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if ($exchange->has['fetchOrder']) { $order = $exchange->fetch_order($id); var_dump($order); }"><pre><span class="pl-k">if</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">has</span>[<span class="pl-s">'<span class="pl-s">fetchOrder</span>'</span>]) { <span class="pl-s1"><span class="pl-c1">$</span>order</span> = <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">fetch_order</span>(<span class="pl-s1"><span class="pl-c1">$</span>id</span>); <span class="pl-en">var_dump</span>(<span class="pl-s1"><span class="pl-c1">$</span>order</span>); }</pre></div> <div class="markdown-heading"><h4 class="heading-element">All Orders</h4><a id="user-content-all-orders" class="anchor" aria-label="Permalink: All Orders" href="#all-orders"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if (exchange.has['fetchOrders']) exchange.fetchOrders (symbol = undefined, since = undefined, limit = undefined, params = {})"><pre><span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">has</span><span class="pl-kos">[</span><span class="pl-s">'fetchOrders'</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchOrders</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p><strong>Some exchanges don't have an endpoint for fetching all orders, ccxt will emulate it where possible.</strong> For now it may still be missing here and there, as this is a work in progress.</p> <div class="markdown-heading"><h4 class="heading-element">Open Orders</h4><a id="user-content-open-orders" class="anchor" aria-label="Permalink: Open Orders" href="#open-orders"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if (exchange.has['fetchOpenOrders']) exchange.fetchOpenOrders (symbol = undefined, since = undefined, limit = undefined, params = {})"><pre><span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">has</span><span class="pl-kos">[</span><span class="pl-s">'fetchOpenOrders'</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchOpenOrders</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element">Closed Orders</h4><a id="user-content-closed-orders" class="anchor" aria-label="Permalink: Closed Orders" href="#closed-orders"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Do not confuse <em>closed orders</em> with <em>trades</em> aka <em>fills</em> ! An order can be closed (filled) with multiple opposing trades! So, a <em>closed order</em> is not the same as a <em>trade</em>. In general, the order does not have a <code>fee</code> at all, but each particular user trade does have <code>fee</code>, <code>cost</code> and other properties. However, many exchanges propagate those properties to the orders as well.</p> <p><strong>Some exchanges don't have an endpoint for fetching closed orders, ccxt will emulate it where possible.</strong> For now it may still be missing here and there, as this is a work in progress.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if (exchange.has['fetchClosedOrders']) exchange.fetchClosedOrders (symbol = undefined, since = undefined, limit = undefined, params = {})"><pre><span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">has</span><span class="pl-kos">[</span><span class="pl-s">'fetchClosedOrders'</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchClosedOrders</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Order Structure</h3><a id="user-content-order-structure" class="anchor" aria-label="Permalink: Order Structure" href="#order-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Most of methods returning orders within ccxt unified API will yield an order structure as described below:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ 'id': '12345-67890:09876/54321', // string 'clientOrderId': 'abcdef-ghijklmnop-qrstuvwxyz', // a user-defined clientOrderId, if any 'datetime': '2017-08-17 12:42:48.000', // ISO8601 datetime of 'timestamp' with milliseconds 'timestamp': 1502962946216, // order placing/opening Unix timestamp in milliseconds 'lastTradeTimestamp': 1502962956216, // Unix timestamp of the most recent trade on this order 'status': 'open', // 'open', 'closed', 'canceled', 'expired', 'rejected' 'symbol': 'ETH/BTC', // symbol 'type': 'limit', // 'market', 'limit' 'timeInForce': 'GTC', // 'GTC', 'IOC', 'FOK', 'PO' 'side': 'buy', // 'buy', 'sell' 'price': 0.06917684, // float price in quote currency (may be empty for market orders) 'average': 0.06917684, // float average filling price 'amount': 1.5, // ordered amount of base currency 'filled': 1.1, // filled amount of base currency 'remaining': 0.4, // remaining amount to fill 'cost': 0.076094524, // 'filled' * 'price' (filling price used where available) 'trades': [ ... ], // a list of order trades/executions 'fee': { // fee info, if available 'currency': 'BTC', // which currency the fee is (usually quote) 'cost': 0.0009, // the fee amount in that currency 'rate': 0.002, // the fee rate (if available) }, 'info': { ... }, // the original unparsed order structure as is }"><pre><span class="pl-kos">{</span> <span class="pl-s">'id'</span>: <span class="pl-s">'12345-67890:09876/54321'</span><span class="pl-kos">,</span> <span class="pl-c">// string</span> <span class="pl-s">'clientOrderId'</span>: <span class="pl-s">'abcdef-ghijklmnop-qrstuvwxyz'</span><span class="pl-kos">,</span> <span class="pl-c">// a user-defined clientOrderId, if any</span> <span class="pl-s">'datetime'</span>: <span class="pl-s">'2017-08-17 12:42:48.000'</span><span class="pl-kos">,</span> <span class="pl-c">// ISO8601 datetime of 'timestamp' with milliseconds</span> <span class="pl-s">'timestamp'</span>: <span class="pl-c1">1502962946216</span><span class="pl-kos">,</span> <span class="pl-c">// order placing/opening Unix timestamp in milliseconds</span> <span class="pl-s">'lastTradeTimestamp'</span>: <span class="pl-c1">1502962956216</span><span class="pl-kos">,</span> <span class="pl-c">// Unix timestamp of the most recent trade on this order</span> <span class="pl-s">'status'</span>: <span class="pl-s">'open'</span><span class="pl-kos">,</span> <span class="pl-c">// 'open', 'closed', 'canceled', 'expired', 'rejected'</span> <span class="pl-s">'symbol'</span>: <span class="pl-s">'ETH/BTC'</span><span class="pl-kos">,</span> <span class="pl-c">// symbol</span> <span class="pl-s">'type'</span>: <span class="pl-s">'limit'</span><span class="pl-kos">,</span> <span class="pl-c">// 'market', 'limit'</span> <span class="pl-s">'timeInForce'</span>: <span class="pl-s">'GTC'</span><span class="pl-kos">,</span> <span class="pl-c">// 'GTC', 'IOC', 'FOK', 'PO'</span> <span class="pl-s">'side'</span>: <span class="pl-s">'buy'</span><span class="pl-kos">,</span> <span class="pl-c">// 'buy', 'sell'</span> <span class="pl-s">'price'</span>: <span class="pl-c1">0.06917684</span><span class="pl-kos">,</span> <span class="pl-c">// float price in quote currency (may be empty for market orders)</span> <span class="pl-s">'average'</span>: <span class="pl-c1">0.06917684</span><span class="pl-kos">,</span> <span class="pl-c">// float average filling price</span> <span class="pl-s">'amount'</span>: <span class="pl-c1">1.5</span><span class="pl-kos">,</span> <span class="pl-c">// ordered amount of base currency</span> <span class="pl-s">'filled'</span>: <span class="pl-c1">1.1</span><span class="pl-kos">,</span> <span class="pl-c">// filled amount of base currency</span> <span class="pl-s">'remaining'</span>: <span class="pl-c1">0.4</span><span class="pl-kos">,</span> <span class="pl-c">// remaining amount to fill</span> <span class="pl-s">'cost'</span>: <span class="pl-c1">0.076094524</span><span class="pl-kos">,</span> <span class="pl-c">// 'filled' * 'price' (filling price used where available)</span> <span class="pl-s">'trades'</span>: <span class="pl-kos">[</span> ... <span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-c">// a list of order trades/executions</span> <span class="pl-s">'fee'</span>: <span class="pl-kos">{</span> <span class="pl-c">// fee info, if available</span> <span class="pl-s">'currency'</span>: <span class="pl-s">'BTC'</span><span class="pl-kos">,</span> <span class="pl-c">// which currency the fee is (usually quote)</span> <span class="pl-s">'cost'</span>: <span class="pl-c1">0.0009</span><span class="pl-kos">,</span> <span class="pl-c">// the fee amount in that currency</span> <span class="pl-s">'rate'</span>: <span class="pl-c1">0.002</span><span class="pl-kos">,</span> <span class="pl-c">// the fee rate (if available)</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'info'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// the original unparsed order structure as is</span> <span class="pl-kos">}</span></pre></div> <ul> <li>The <code>status</code> of an order is usually either <code>'open'</code> (not filled or partially filled), <code>'closed'</code> (fully filled), or <code>'canceled'</code> (unfilled and canceled, or partially filled then canceled).</li> <li>Some exchanges allow the user to specify an expiration timestamp upon placing a new order. If the order is not filled by that time, its <code>status</code> becomes <code>'expired'</code>.</li> <li>Use the <code>filled</code> value to determine if the order is filled, partially filled or fully filled, and by how much.</li> <li>The work on <code>'fee'</code> info is still in progress, fee info may be missing partially or entirely, depending on the exchange capabilities.</li> <li>The <code>fee</code> currency may be different from both traded currencies (for example, an ETH/BTC order with fees in USD).</li> <li>The <code>lastTradeTimestamp</code> timestamp may have no value and may be <code>undefined/None/null</code> where not supported by the exchange or in case of an open order (an order that has not been filled nor partially filled yet).</li> <li>The <code>lastTradeTimestamp</code>, if any, designates the timestamp of the last trade, in case the order is filled fully or partially, otherwise <code>lastTradeTimestamp</code> is <code>undefined/None/null</code>.</li> <li>Order <code>status</code> prevails or has precedence over the <code>lastTradeTimestamp</code>.</li> <li>The <code>cost</code> of an order is: <code>{ filled * price }</code> </li> <li>The <code>cost</code> of an order means the total <em>quote</em> volume of the order (whereas the <code>amount</code> is the <em>base</em> volume). The value of <code>cost</code> should be as close to the actual most recent known order cost as possible. The <code>cost</code> field itself is there mostly for convenience and can be deduced from other fields.</li> <li>The <code>clientOrderId</code> field can be set upon placing orders by the user with <a href="#custom-order-params">custom order params</a>. Using the <code>clientOrderId</code> the user can later distinguish between own orders. This is only available for the exchanges that do support <code>clientOrderId</code> at this time.</li> </ul> <div class="markdown-heading"><h4 class="heading-element">timeInForce</h4><a id="user-content-timeinforce" class="anchor" aria-label="Permalink: timeInForce" href="#timeinforce"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The <code>timeInForce</code> field may be <code>undefined/None/null</code> if not specified by the exchange. The unification of <code>timeInForce</code> is a work in progress.</p> <p>Possible values for the<code>timeInForce</code> field:</p> <ul> <li> <code>'GTC'</code> = <em>Good Till Cancel(ed)</em>, the order stays on the orderbook until it is matched or canceled.</li> <li> <code>'IOC'</code> = <em>Immediate Or Cancel</em>, the order has to be matched immediately and filled either partially or completely, the unfilled remainder is canceled (or the entire order is canceled).</li> <li> <code>'FOK'</code> = <em>Fill Or Kill</em>, the order has to get fully filled and closed immediately, otherwise the entire order is canceled.</li> <li> <code>'PO'</code> = <em>Post Only</em>, the order is either placed as a maker order, or it is canceled. This means the order must be placed on orderbook for at at least time in an unfilled state. The unification of <code>PO</code> as a <code>timeInForce</code> option is a work in progress with unified exchanges having <code>exchange.has['createPostOnlyOrder'] == True</code>.</li> </ul> <div class="markdown-heading"><h3 class="heading-element">Placing Orders</h3><a id="user-content-placing-orders" class="anchor" aria-label="Permalink: Placing Orders" href="#placing-orders"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>There are different types of orders that a user can send to the exchange, regular orders eventually land in the orderbook of a corresponding symbol, others orders may be more advanced. Here is a list outlining various types of orders:</p> <ul> <li> <a href="#limit-orders">Limit Orders</a> – regular orders having an <code>amount</code> in base currency (how much you want to buy or sell) and a <code>price</code> in quote currency (for which price you want to buy or sell).</li> <li> <a href="#market-orders">Market Orders</a> – regular orders having an <code>amount</code> in base currency (how much you want to buy or sell) <ul> <li> <a href="#market-buys">Market Buys</a> – some exchanges require market buy orders with an <code>amount</code> in quote currency (how much you want to spend for buying)</li> </ul> </li> <li> <a href="#conditional-orders">Trigger Orders</a> aka <em>conditional orders</em> – an advanced type of order used to wait for a certain condition on a market and then react automatically: when a <code>triggerPrice</code> is reached, the trigger order gets triggered and then a regular limit <code>price</code> or market price order is placed, that eventually results in entering a position or exiting a position</li> <li> <a href="#stop-loss-orders">Stop Loss Orders</a> – almost the same as trigger orders, but used to close a position to stop further losses on that position: when the price reaches <code>triggerPrice</code> then the stop loss order is triggered that results in placing another regular limit or market order to close a position at a specific limit <code>price</code> or at market price (a position with a stop loss order attached to it).</li> <li> <a href="#take-profit-orders">Take Profit Orders</a> – a counterpart to stop loss orders, this type of order is used to close a position to take existing profits on that position: when the price reaches <code>triggerPrice</code> then the take profit order is triggered that results in placing another regular limit or market order to close a position at a specific limit <code>price</code> or at market price (a position with a take profit order attached to it).</li> <li> <a href="#stoploss-and-takeprofit-orders-attached-to-a-position">StopLoss And TakeProfit Orders Attached To A Position</a> – advanced orders, consisting of three orders of types listed above: a regular limit or market order placed to enter a position with stop loss and/or take profit orders that will be placed upon opening that position and will be used to close that position later (when a stop loss is reached, it will close the position and will cancel its take profit counterpart, and vice versa, when a take profit is reached, it will close the position and will cancel its stop loss counterpart, these two counterparts are also known as "OCO orders – one cancels the other), apart from the <code>amount</code> (and <code>price</code> for the limit order) to open a position it will also require a <code>triggerPrice</code> for a stop loss order (with a limit <code>price</code> if it's a stop loss limit order) and/or a <code>triggerPrice</code> for a take profit order (with a limit <code>price</code> if it's a take profit limit order).</li> <li> <a href="#trailing-orders">Trailing Orders</a> – an order that is automatically adjusted relative to an open position, <code>trailingAmount</code> can be set to trail a specified quote amount behind the open position or <code>trailingPercent</code> can be set to trail a specified percent behind the open position, when the market price of the position is equal to the trailing order this results in entering a new position or exiting a position depending on if the trailing order has the <code>reduceOnly</code> parameter set to true or not.</li> </ul> <p>Placing an order always requires a <code>symbol</code> that the user has to specify (which market you want to trade).</p> <p>To place an order use the <code>createOrder</code> method. You can use the <code>id</code> from the returned unified <a href="#order-structure">order structure</a> to query the status and the state of the order later. If you need to place multiple orders simultaneously, you can check the availability of the <code>createOrders</code> method.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="createOrder (symbol, type, side, amount, price = undefined, params = {})"><pre><span class="pl-en">createOrder</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">type</span><span class="pl-kos">,</span> <span class="pl-s1">side</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">price</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="createOrders (orders, params = {}) // orders is a list in which each element contains a symbol, type, side, amount, price and params"><pre><span class="pl-en">createOrders</span> <span class="pl-kos">(</span><span class="pl-s1">orders</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c">// orders is a list in which each element contains a symbol, type, side, amount, price and params</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbol</strong> (String) <em>required</em> Unified CCXT market symbol <ul> <li>Make sure the symbol in question exists with the target exchange and is available for trading.</li> </ul> </li> <li> <strong>side</strong> <em>required</em> a string literal for the direction of your order. <strong>Unified sides:</strong> <ul> <li> <code>buy</code> give quote currency and receive base currency; for example, buying <code>BTC/USD</code> means that you will receive bitcoins for your dollars.</li> <li> <code>sell</code> give base currency and receive quote currency; for example, buying <code>BTC/USD</code> means that you will receive dollars for your bitcoins.</li> </ul> </li> <li> <strong>type</strong> a string literal type of order <strong>Unified types:</strong> <ul> <li> <a href="market-orders">market</a> not allowed by some exchanges, see <a href="#exchanges">their docs</a> for details</li> <li><a href="limit-orders">limit</a></li> <li>see #custom-order-params and #other-order-types for non-unified types</li> </ul> </li> <li> <strong>amount</strong>, how much of currency you want to trade usually, but not always, in units of the base currency of the trading pair symbol (the units for some exchanges are dependent on the side of the order: see their API docs for details.)</li> <li> <strong>price</strong> the price at which the order is to be fullfilled at in units of the quote currency (ignored in market orders)</li> <li> <strong>params</strong> (Dictionary) Extra parameters specific to the exchange API endpoint (e.g. <code>{"settle": "usdt"}</code>)</li> </ul> <p>Returns</p> <ul> <li>A successful order call returns a <a href="#order-structure">order structure</a> </li> </ul> <p><strong>Notes on createOrder</strong></p> <ul> <li>Some exchanges will allow to trade with limit orders only.</li> </ul> <p>Some fields from the returned order structure may be <code>undefined / None / null</code> if that information is not returned from the exchange API's response. The user is guaranteed that the <code>createOrder</code> method will return a unified <a href="#order-structure">order structure</a> that will contain at least the order <code>id</code> and the <code>info</code> (a raw response from the exchange "as is"):</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ 'id': 'string', // order id 'info': { ... }, // decoded original JSON response from the exchange as is }"><pre><span class="pl-kos">{</span> <span class="pl-s">'id'</span>: <span class="pl-s">'string'</span><span class="pl-kos">,</span> <span class="pl-c">// order id</span> <span class="pl-s">'info'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// decoded original JSON response from the exchange as is</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h5 class="heading-element">Common pitfalls</h5><a id="user-content-common-pitfalls" class="anchor" aria-label="Permalink: Common pitfalls" href="#common-pitfalls"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <ul> <li>There is a common error that happens when creating orders for contract markets:</li> </ul> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""must be greater than minimum amount precision of 1""><pre class="notranslate"><code>"must be greater than minimum amount precision of 1" </code></pre></div> <p>This error happens when the exchange is expecting a natural number of contracts (1,2,3, etc) in the <code>amount</code> argument of <code>createOrder</code>. The <a href="#market-structure">market structure</a> has a key called <code>contractSize</code>. Each contract is worth a certain amount of the base asset that is determined by the <code>contractSize</code>. The number of contracts multiplied by the <code>contractSize</code> is equal to the base amount. <code>Base amount = (contracts * contractSize)</code> so to derive the number of contracts you should enter in the <code>amount</code> argument you can solve for contracts: <code>contracts = (Base amount / contractSize)</code>.</p> <p>Here is an example of finding the <code>contractSize</code>:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="await exchange.loadMarkets() symbol = 'BTC/USDT:USDT' market = exchange.market(symbol) print(market['contractSize']) # Let's say you want to convert 0.5 BTC to the number of contracts: number_contracts = round((0.5 * 1) / market['contractSize'])"><pre><span class="pl-k">await</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">loadMarkets</span>() <span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-s">'BTC/USDT:USDT'</span> <span class="pl-s1">market</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">market</span>(<span class="pl-s1">symbol</span>) <span class="pl-en">print</span>(<span class="pl-s1">market</span>[<span class="pl-s">'contractSize'</span>]) <span class="pl-c"># Let's say you want to convert 0.5 BTC to the number of contracts:</span> <span class="pl-s1">number_contracts</span> <span class="pl-c1">=</span> <span class="pl-en">round</span>((<span class="pl-c1">0.5</span> <span class="pl-c1">*</span> <span class="pl-c1">1</span>) <span class="pl-c1">/</span> <span class="pl-s1">market</span>[<span class="pl-s">'contractSize'</span>])</pre></div> <div class="markdown-heading"><h4 class="heading-element">Limit Orders</h4><a id="user-content-limit-orders" class="anchor" aria-label="Permalink: Limit Orders" href="#limit-orders"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Limit orders placed on the order book of the exchange for a price specified by the trader. They are fullfilled(closed) when there are no orders in the same market at a better price, and another trader creates a <a href="market-orders">market order</a> or an opposite order for a price that matches or exceeds the price of the limit order.</p> <p>Limit orders may not be fully filled. This happens when the filling order is for a smaller amount than the amount specified by the limit order.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// camelCaseNotation exchange.createLimitSellOrder (symbol, amount, price, params) exchange.createLimitBuyOrder (symbol, amount, price, params) // underscore_notation exchange.create_limit_sell_order (symbol, amount, price, params) exchange.create_limit_buy_order (symbol, amount, price, params) // using general createLimitOrder and side = 'buy' or 'sell' exchange.createLimitOrder (symbol, side, amount, price, params) exchange.create_limit_order (symbol, side, amount, price, params) // using general createOrder, type = 'limit' and side = 'buy' or 'sell' exchange.createOrder (symbol, 'limit', side, amount, price, params) exchange.create_order (symbol, 'limit', side, amount, price, params)"><pre><span class="pl-c">// camelCaseNotation</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">createLimitSellOrder</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">price</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">createLimitBuyOrder</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">price</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span> <span class="pl-c">// underscore_notation</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">create_limit_sell_order</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">price</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">create_limit_buy_order</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">price</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span> <span class="pl-c">// using general createLimitOrder and side = 'buy' or 'sell'</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">createLimitOrder</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">side</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">price</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">create_limit_order</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">side</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">price</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span> <span class="pl-c">// using general createOrder, type = 'limit' and side = 'buy' or 'sell'</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">createOrder</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s">'limit'</span><span class="pl-kos">,</span> <span class="pl-s1">side</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">price</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">create_order</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s">'limit'</span><span class="pl-kos">,</span> <span class="pl-s1">side</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">price</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element">Market Orders</h4><a id="user-content-market-orders" class="anchor" aria-label="Permalink: Market Orders" href="#market-orders"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>also known as</em></p> <ul> <li>market price orders</li> <li>spot price orders</li> <li>instant orders</li> </ul> <p>Market orders are executed immediately by fulfilling one of more already existing orders from the ask side of the exchanges order book. The orders that your market order fulfills are chosen from th top of the order book stack, meaning your market order is fulfilled at the best price available. When placing a market order you don't need to specify the price of the order, and if the price is specified, it will be ignored.</p> <p>You are not guaranteed that the order will be executed for the price you observe prior to placing your order. There are multiple reasons for this, including:</p> <ul> <li> <p><strong>price slippage</strong> a slight change of the price for the traded market while your order is being executed. Reasons for price slippage include, but are not limited to</p> <ul> <li>networking roundtrip latency</li> <li>high loads on the exchange</li> <li>price volatility</li> </ul> </li> <li> <p><strong>unequivocal order sizes</strong> if a market order is for an amount that is larger than the size of the top order on the order book, then after the top order is filled, the market order will proceed to fill the next order in the order book, which means the market order is filled at multiple prices</p> </li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// camelCaseNotation exchange.createMarketSellOrder (symbol, amount, params) exchange.createMarketBuyOrder (symbol, amount, params) // underscore_notation exchange.create_market_sell_order (symbol, amount, params) exchange.create_market_buy_order (symbol, amount, params) // using general createMarketOrder and side = 'buy' or 'sell' exchange.createMarketOrder (symbol, side, amount, params) exchange.create_market_order (symbol, side, amount, params) // using general createOrder, type = 'market' and side = 'buy' or 'sell' exchange.createOrder (symbol, 'market', side, amount, ...) exchange.create_order (symbol, 'market', side, amount, ...)"><pre><span class="pl-c">// camelCaseNotation</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">createMarketSellOrder</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">createMarketBuyOrder</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span> <span class="pl-c">// underscore_notation</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">create_market_sell_order</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">create_market_buy_order</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span> <span class="pl-c">// using general createMarketOrder and side = 'buy' or 'sell'</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">createMarketOrder</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">side</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">create_market_order</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">side</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span> <span class="pl-c">// using general createOrder, type = 'market' and side = 'buy' or 'sell'</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">createOrder</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s">'market'</span><span class="pl-kos">,</span> <span class="pl-s1">side</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> ...<span class="pl-kos">)</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">create_order</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s">'market'</span><span class="pl-kos">,</span> <span class="pl-s1">side</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> ...<span class="pl-kos">)</span></pre></div> <p><strong>Note, that some exchanges will not accept market orders (they allow limit orders only).</strong> In order to detect programmatically if the exchange in question does support market orders or not, you can use the <code>.has['createMarketOrder']</code> exchange property:</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-32" class="anchor" aria-label="Permalink: Javascript" href="#javascript-32"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if (exchange.has['createMarketOrder']) { ... }"><pre><span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">has</span><span class="pl-kos">[</span><span class="pl-s">'createMarketOrder'</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> ... <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-32" class="anchor" aria-label="Permalink: Python" href="#python-32"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if exchange.has['createMarketOrder']: ..."><pre><span class="pl-k">if</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">has</span>[<span class="pl-s">'createMarketOrder'</span>]: ...</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-30" class="anchor" aria-label="Permalink: PHP" href="#php-30"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if ($exchange->has['createMarketOrder']) { ... }"><pre><span class="pl-k">if</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">has</span>[<span class="pl-s">'<span class="pl-s">createMarketOrder</span>'</span>]) { <span class="pl-c1">.</span>.<span class="pl-c1">.</span> }</pre></div> <div class="markdown-heading"><h4 class="heading-element">Market Buys</h4><a id="user-content-market-buys" class="anchor" aria-label="Permalink: Market Buys" href="#market-buys"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>In general, when placing a <code>market buy</code> or <code>market sell</code> order the user has to specify just the amount of the base currency to buy or sell. However, with some exchanges market buy orders implement a different approach to calculating the value of the order.</p> <p>Suppose you're trading BTC/USD and the current market price for BTC is over 9000 USD. For a market buy or market sell you could specify an <code>amount</code> of 2 BTC and that would result in <em>plus or minus</em> 18000 USD (more or less ;)) on your account, depending on the side of the order.</p> <p><strong>With market buys some exchanges require the total cost of the order in the quote currency!</strong> The logic behind it is simple, instead of taking the amount of base currency to buy or sell some exchanges operate with <em>"how much quote currency you want to spend on buying in total"</em>.</p> <p>To place a market buy order with those exchanges you would not specify an amount of 2 BTC, instead you should somehow specify the total cost of the order, that is, 18000 USD in this example. The exchanges that treat <code>market buy</code> orders in this way have an exchange-specific option <code>createMarketBuyOrderRequiresPrice</code> that allows specifying the total cost of a <code>market buy</code> order in two ways.</p> <p>The first is the default and if you specify the <code>price</code> along with the <code>amount</code> the total cost of the order would be calculated inside the lib from those two values with a simple multiplication (<code>cost = amount * price</code>). The resulting <code>cost</code> would be the amount in USD quote currency that will be spent on this particular market buy order.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// this example is oversimplified and doesn't show all the code that is // required to handle the errors and exchange metadata properly // it shows just the concept of placing a market buy order const exchange = new ccxt.cex ({ 'apiKey': YOUR_API_KEY, 'secret': 'YOUR_SECRET', // 'options': { // 'createMarketBuyOrderRequiresPrice': true, // default // }, }) ;(async () => { // when `createMarketBuyOrderRequiresPrice` is true, we can pass the price // so that the total cost of the order would be calculated inside the library // by multiplying the amount over price (amount * price) const symbol = 'BTC/USD' const amount = 2 // BTC const price = 9000 // USD // cost = amount * price = 2 * 9000 = 18000 (USD) // note that we don't use createMarketBuyOrder here, instead we use createOrder // createMarketBuyOrder will omit the price and will not work when // exchange.options['createMarketBuyOrderRequiresPrice'] = true const order = await exchange.createOrder (symbol, 'market', 'buy', amount, price) console.log (order) }) ()"><pre><span class="pl-c">// this example is oversimplified and doesn't show all the code that is</span> <span class="pl-c">// required to handle the errors and exchange metadata properly</span> <span class="pl-c">// it shows just the concept of placing a market buy order</span> <span class="pl-k">const</span> <span class="pl-s1">exchange</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">cex</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-s">'apiKey'</span>: <span class="pl-c1">YOUR_API_KEY</span><span class="pl-kos">,</span> <span class="pl-s">'secret'</span>: <span class="pl-s">'YOUR_SECRET'</span><span class="pl-kos">,</span> <span class="pl-c">// 'options': {</span> <span class="pl-c">// 'createMarketBuyOrderRequiresPrice': true, // default</span> <span class="pl-c">// },</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">;</span><span class="pl-kos">(</span><span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span> <span class="pl-c">// when `createMarketBuyOrderRequiresPrice` is true, we can pass the price</span> <span class="pl-c">// so that the total cost of the order would be calculated inside the library</span> <span class="pl-c">// by multiplying the amount over price (amount * price)</span> <span class="pl-k">const</span> <span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-s">'BTC/USD'</span> <span class="pl-k">const</span> <span class="pl-s1">amount</span> <span class="pl-c1">=</span> <span class="pl-c1">2</span> <span class="pl-c">// BTC</span> <span class="pl-k">const</span> <span class="pl-s1">price</span> <span class="pl-c1">=</span> <span class="pl-c1">9000</span> <span class="pl-c">// USD</span> <span class="pl-c">// cost = amount * price = 2 * 9000 = 18000 (USD)</span> <span class="pl-c">// note that we don't use createMarketBuyOrder here, instead we use createOrder</span> <span class="pl-c">// createMarketBuyOrder will omit the price and will not work when</span> <span class="pl-c">// exchange.options['createMarketBuyOrderRequiresPrice'] = true</span> <span class="pl-k">const</span> <span class="pl-s1">order</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">createOrder</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s">'market'</span><span class="pl-kos">,</span> <span class="pl-s">'buy'</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">price</span><span class="pl-kos">)</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">order</span><span class="pl-kos">)</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">(</span><span class="pl-kos">)</span></pre></div> <p>The second alternative is useful in cases when the user wants to calculate and specify the resulting total cost of the order himself. That can be done by setting the <code>createMarketBuyOrderRequiresPrice</code> option to <code>false</code> to switch it off:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const exchange = new ccxt.cex ({ 'apiKey': YOUR_API_KEY, 'secret': 'YOUR_SECRET', 'options': { 'createMarketBuyOrderRequiresPrice': false, // switch off }, }) // or, to switch it off later, after the exchange instantiation, you can do exchange.options['createMarketBuyOrderRequiresPrice'] = false ;(async () => { // when `createMarketBuyOrderRequiresPrice` is true, we can pass the price // so that the total cost of the order would be calculated inside the library // by multiplying the amount over price (amount * price) const symbol = 'BTC/USD' const amount = 2 // BTC const price = 9000 // USD cost = amount * price // ← instead of the amount cost goes ↓ here const order = await exchange.createMarketBuyOrder (symbol, cost) console.log (order) }) ()"><pre><span class="pl-k">const</span> <span class="pl-s1">exchange</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">cex</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-s">'apiKey'</span>: <span class="pl-c1">YOUR_API_KEY</span><span class="pl-kos">,</span> <span class="pl-s">'secret'</span>: <span class="pl-s">'YOUR_SECRET'</span><span class="pl-kos">,</span> <span class="pl-s">'options'</span>: <span class="pl-kos">{</span> <span class="pl-s">'createMarketBuyOrderRequiresPrice'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c">// switch off</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c">// or, to switch it off later, after the exchange instantiation, you can do</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">options</span><span class="pl-kos">[</span><span class="pl-s">'createMarketBuyOrderRequiresPrice'</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-c1">false</span> <span class="pl-kos">;</span><span class="pl-kos">(</span><span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span> <span class="pl-c">// when `createMarketBuyOrderRequiresPrice` is true, we can pass the price</span> <span class="pl-c">// so that the total cost of the order would be calculated inside the library</span> <span class="pl-c">// by multiplying the amount over price (amount * price)</span> <span class="pl-k">const</span> <span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-s">'BTC/USD'</span> <span class="pl-k">const</span> <span class="pl-s1">amount</span> <span class="pl-c1">=</span> <span class="pl-c1">2</span> <span class="pl-c">// BTC</span> <span class="pl-k">const</span> <span class="pl-s1">price</span> <span class="pl-c1">=</span> <span class="pl-c1">9000</span> <span class="pl-c">// USD</span> <span class="pl-s1">cost</span> <span class="pl-c1">=</span> <span class="pl-s1">amount</span> <span class="pl-c1">*</span> <span class="pl-s1">price</span> <span class="pl-c">// ← instead of the amount cost goes ↓ here</span> <span class="pl-k">const</span> <span class="pl-s1">order</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">createMarketBuyOrder</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">cost</span><span class="pl-kos">)</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">order</span><span class="pl-kos">)</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">(</span><span class="pl-kos">)</span></pre></div> <p>More about it:</p> <ul> <li><a href="https://github.com/ccxt/ccxt/issues/564#issuecomment-347458566">https://github.com/ccxt/ccxt/issues/564#issuecomment-347458566</a></li> <li><a href="https://github.com/ccxt/ccxt/issues/4914#issuecomment-478199357">https://github.com/ccxt/ccxt/issues/4914#issuecomment-478199357</a></li> <li><a href="https://github.com/ccxt/ccxt/issues/4799#issuecomment-470966769">https://github.com/ccxt/ccxt/issues/4799#issuecomment-470966769</a></li> <li><a href="https://github.com/ccxt/ccxt/issues/5197#issuecomment-496270785">https://github.com/ccxt/ccxt/issues/5197#issuecomment-496270785</a></li> </ul> <div class="markdown-heading"><h4 class="heading-element">Emulating Market Orders With Limit Orders</h4><a id="user-content-emulating-market-orders-with-limit-orders" class="anchor" aria-label="Permalink: Emulating Market Orders With Limit Orders" href="#emulating-market-orders-with-limit-orders"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>It is also possible to emulate a <code>market</code> order with a <code>limit</code> order.</p> <p><strong>WARNING this method can be risky due to high volatility, use it at your own risk and only use it when you know really well what you're doing!</strong></p> <p>Most of the time a <code>market sell</code> can be emulated with a <code>limit sell</code> at a very low price – the exchange will automatically make it a taker order for market price (the price that is currently in your best interest from the ones that are available in the order book). When the exchange detects that you're selling for a very low price it will automatically offer you the best buyer price available from the order book. That is effectively the same as placing a market sell order. Thus market orders can be emulated with limit orders (where missing).</p> <p>The opposite is also true – a <code>market buy</code> can be emulated with a <code>limit buy</code> for a very high price. Most exchanges will again close your order for best available price, that is, the market price.</p> <p>However, you should never rely on that entirely, <strong>ALWAYS test it with a small amount first!</strong> You can try that in their web interface first to verify the logic. You can sell the minimal amount at a specified limit price (an affordable amount to lose, just in case) and then check the actual filling price in trade history.</p> <div class="markdown-heading"><h4 class="heading-element">Limit Orders</h4><a id="user-content-limit-orders-1" class="anchor" aria-label="Permalink: Limit Orders" href="#limit-orders-1"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Limit price orders are also known as <em>limit orders</em>. Some exchanges accept limit orders only. Limit orders require a price (rate per unit) to be submitted with the order. The exchange will close limit orders if and only if market price reaches the desired level.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// camelCaseStyle exchange.createLimitBuyOrder (symbol, amount, price[, params]) exchange.createLimitSellOrder (symbol, amount, price[, params]) // underscore_style exchange.create_limit_buy_order (symbol, amount, price[, params]) exchange.create_limit_sell_order (symbol, amount, price[, params])"><pre><span class="pl-c">// camelCaseStyle</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">createLimitBuyOrder</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">price</span><span class="pl-kos">[</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">createLimitSellOrder</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">price</span><span class="pl-kos">[</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-c">// underscore_style</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">create_limit_buy_order</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">price</span><span class="pl-kos">[</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">create_limit_sell_order</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">price</span><span class="pl-kos">[</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">]</span><span class="pl-kos">)</span></pre></div> <p><a name="user-content-stop%20orders" id="user-content-stop orders"></a><a name="user-content-trigger%20orders" id="user-content-trigger orders"></a></p> <div class="markdown-heading"><h4 class="heading-element">Conditional Orders</h4><a id="user-content-conditional-orders" class="anchor" aria-label="Permalink: Conditional Orders" href="#conditional-orders"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Coming from traditional trading, the term "Stop order" has been a bit ambigious, so instead of it, in CCXT we use term "Trigger" order. When symbol's price reaches your "trigger"("stop") price, the order is activated as <code>market</code> or <code>limit</code> order, depending which one you had chosen.</p> <p>We have different classification of trigger orders:</p> <ol> <li>standalone <a href="#trigger-order">Trigger order</a> to buy/sell coin (open/close position)</li> <li>standalone <a href="#stop-loss-orders">Stop Loss</a> or <a href="#take-profit-orders">Take Profit</a> designed to close open positions.</li> <li>a Stop Loss or Take Profit order attached to a primary order (<a href="#stopLoss-and-takeProfit-orders-attached-to-a-position">Conditional Trigger Order</a>).</li> </ol> <div class="markdown-heading"><h5 class="heading-element">Trigger order</h5><a id="user-content-trigger-order" class="anchor" aria-label="Permalink: Trigger order" href="#trigger-order"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Traditional "stop" order (which you might see across exchanges' websites) is now called "trigger" order across CCXT library. Implemented by adding a <code>triggerPrice</code> parameter. They are independent basic trigger orders that can open or close a position.</p> <ul> <li>Typically, it is activated when price of the underlying asset/contract crosses the <code>triggerPrice</code> from <strong>any direction</strong>. However, some exchanges' API require to set <code>triggerDirection</code> too, which triggers order depending whether price is above or below <code>triggerPrice</code>. For example, if you want to trigger limit order (buy 0.1 <code>ETH</code> at limit price <code>1500</code>) once pair price crosses <code>1700</code>:</li> </ul> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-33" class="anchor" aria-label="Permalink: Javascript" href="#javascript-33"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const params = { 'triggerPrice': 1700, } const order = await exchange.createOrder ('ETH/USDT', 'market', 'buy', 0.1, 1500, params)"><pre><span class="pl-k">const</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-s">'triggerPrice'</span>: <span class="pl-c1">1700</span><span class="pl-kos">,</span> <span class="pl-kos">}</span> <span class="pl-k">const</span> <span class="pl-s1">order</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">createOrder</span> <span class="pl-kos">(</span><span class="pl-s">'ETH/USDT'</span><span class="pl-kos">,</span> <span class="pl-s">'market'</span><span class="pl-kos">,</span> <span class="pl-s">'buy'</span><span class="pl-kos">,</span> <span class="pl-c1">0.1</span><span class="pl-kos">,</span> <span class="pl-c1">1500</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-33" class="anchor" aria-label="Permalink: Python" href="#python-33"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="params = { 'triggerPrice': 1700, } order = exchange.create_order('ETH/USDT', 'market', 'buy', 0.1, 1500, params)"><pre><span class="pl-s1">params</span> <span class="pl-c1">=</span> { <span class="pl-s">'triggerPrice'</span>: <span class="pl-c1">1700</span>, } <span class="pl-s1">order</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">create_order</span>(<span class="pl-s">'ETH/USDT'</span>, <span class="pl-s">'market'</span>, <span class="pl-s">'buy'</span>, <span class="pl-c1">0.1</span>, <span class="pl-c1">1500</span>, <span class="pl-s1">params</span>)</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-31" class="anchor" aria-label="Permalink: PHP" href="#php-31"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$params = { 'triggerPrice': 1700, } $order = $exchange->create_order ('ETH/USDT', 'market', 'buy', 0.1, 1500, $params)"><pre><span class="pl-s1"><span class="pl-c1">$</span>params</span> = { <span class="pl-s">'<span class="pl-s">triggerPrice</span>'</span>: <span class="pl-c1">1700</span>, } <span class="pl-s1"><span class="pl-c1">$</span>order</span> = <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">create_order</span> (<span class="pl-s">'<span class="pl-s">ETH/USDT</span>'</span>, <span class="pl-s">'<span class="pl-s">market</span>'</span>, <span class="pl-s">'<span class="pl-s">buy</span>'</span>, <span class="pl-c1">0.1</span>, <span class="pl-c1">1500</span>, <span class="pl-s1"><span class="pl-c1">$</span>params</span>)</pre></div> <p><a name="user-content-trigger-direction" id="user-content-trigger-direction"></a> Typically, exchange automatically determines <code>triggerPrice</code>'s direction (whether it is "above" or "below" current price), however, some exchanges require that you provide <code>triggerDirection</code> with either <code>ascending</code> or <code>descending</code> values:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="params = { 'triggerPrice': 1700, 'triggerDirection': 'ascending', // order will be triggered when price goes upward and touches 1700 }"><pre class="notranslate"><code>params = { 'triggerPrice': 1700, 'triggerDirection': 'ascending', // order will be triggered when price goes upward and touches 1700 } </code></pre></div> <p>Note, you can also add <code>reduceOnly: true</code> param to the trigger order (with a possible <code>triggerDirection: 'ascending/descending'</code> param), so it would act as "stop-loss" or "take-profit" order. However, for some exchanges we support "stop-loss" and "take-profit" trigger order types, which automatically involve <code>reduceOnly</code> and <code>triggerDirection</code> handling (see them below).</p> <div class="markdown-heading"><h5 class="heading-element">Stop Loss Orders</h5><a id="user-content-stop-loss-orders" class="anchor" aria-label="Permalink: Stop Loss Orders" href="#stop-loss-orders"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The same as Trigger Orders, but the direction matters. Implemented by specifying a <code>stopLossPrice</code> parameter (for the stop loss triggerPrice), and also automatically implemented <code>triggerDirection</code> on behalf of user, so instead of regular Trigger Order, you can use this as an alternative.</p> <p>Suppose you entered a long position (you bought) at 1000 and want to protect yourself from losses from a possible price drop below 700. You would place a stop loss order with triggerPrice at 700. For that stop loss order either you would specify a limit price or it will be executed at market price.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" | price | amount ----|---------------- | 1500 | 200 | 1400 | 300 a | 1300 | 100 s | 1200 | 200 k | 1100 | 300 | 1000 | 100 <--- you bought to enter a long position here at 1000 | 900 | 100 ----|---------------- last price is 900 | 800 | 100 | 700 | 200 <------- you place a stop loss order here at 700 <----------------------+ b | 600 | 100 when your stopLossPrice is reached from above | i | 500 | 300 it will close your position at market price below 700 ----------------+ d | 400 | 200 <- or it will be executed at your limit price lower that stopLossPrice -+ | 300 | 100 | 200 | 100"><pre class="notranslate"><code> | price | amount ----|---------------- | 1500 | 200 | 1400 | 300 a | 1300 | 100 s | 1200 | 200 k | 1100 | 300 | 1000 | 100 <--- you bought to enter a long position here at 1000 | 900 | 100 ----|---------------- last price is 900 | 800 | 100 | 700 | 200 <------- you place a stop loss order here at 700 <----------------------+ b | 600 | 100 when your stopLossPrice is reached from above | i | 500 | 300 it will close your position at market price below 700 ----------------+ d | 400 | 200 <- or it will be executed at your limit price lower that stopLossPrice -+ | 300 | 100 | 200 | 100 </code></pre></div> <p>Suppose you entered a short position (you sold) at 700 and want to protect yourself from losses from a possible price pump above 1300. You would place a stop loss order with triggerPrice at 1300. For that stop loss order either you would specify a limit price or it will be executed at market price.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" | price | amount ----|---------------- | 1500 | 200 | 1400 | 300 <------------------------------------------------------------------------+ a | 1300 | 100 <------ you place a stop loss order here at 1300 <---------------------+ | s | 1200 | 200 when your stopLossPrice is reached from below | | k | 1100 | 300 it will close your position at market price above 1300 --------------+ | | 1000 | 100 or it will be executed at your limit price higher than stopLossPrice -+ | 900 | 100 ----|---------------- last price is 900 (you sold at 700) | 800 | 100 | 700 | 200 <--- you sold to enter a short position here at 700 b | 600 | 100 i | 500 | 300 d | 400 | 200 | 300 | 100 | 200 | 100"><pre class="notranslate"><code> | price | amount ----|---------------- | 1500 | 200 | 1400 | 300 <------------------------------------------------------------------------+ a | 1300 | 100 <------ you place a stop loss order here at 1300 <---------------------+ | s | 1200 | 200 when your stopLossPrice is reached from below | | k | 1100 | 300 it will close your position at market price above 1300 --------------+ | | 1000 | 100 or it will be executed at your limit price higher than stopLossPrice -+ | 900 | 100 ----|---------------- last price is 900 (you sold at 700) | 800 | 100 | 700 | 200 <--- you sold to enter a short position here at 700 b | 600 | 100 i | 500 | 300 d | 400 | 200 | 300 | 100 | 200 | 100 </code></pre></div> <p>Stop Loss orders are activated when the price of the underlying asset/contract:</p> <ul> <li>drops below the <code>stopLossPrice</code> from above, for sell orders. (eg: to close a long position, and avoid further losses)</li> <li>rises above the <code>stopLossPrice</code> from below, for buy orders (eg: to close a short position, and avoid further losses)</li> </ul> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-34" class="anchor" aria-label="Permalink: Javascript" href="#javascript-34"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// for a stop loss order const params = { 'stopLossPrice': 55.45, // your stop loss price } const order = await exchange.createOrder (symbol, type, side, amount, price, params)"><pre><span class="pl-c">// for a stop loss order</span> <span class="pl-k">const</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-s">'stopLossPrice'</span>: <span class="pl-c1">55.45</span><span class="pl-kos">,</span> <span class="pl-c">// your stop loss price</span> <span class="pl-kos">}</span> <span class="pl-k">const</span> <span class="pl-s1">order</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">createOrder</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">type</span><span class="pl-kos">,</span> <span class="pl-s1">side</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">price</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-34" class="anchor" aria-label="Permalink: Python" href="#python-34"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# for a stop loss order params = { 'stopLossPrice': 55.45, # your stop loss price } order = exchange.create_order (symbol, type, side, amount, price, params)"><pre><span class="pl-c"># for a stop loss order</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> { <span class="pl-s">'stopLossPrice'</span>: <span class="pl-c1">55.45</span>, <span class="pl-c"># your stop loss price</span> } <span class="pl-s1">order</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">create_order</span> (<span class="pl-s1">symbol</span>, <span class="pl-s1">type</span>, <span class="pl-s1">side</span>, <span class="pl-s1">amount</span>, <span class="pl-s1">price</span>, <span class="pl-s1">params</span>)</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-32" class="anchor" aria-label="Permalink: PHP" href="#php-32"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// for a stop loss order $params = { 'stopLossPrice': 55.45, // your stop loss price } $order = $exchange->create_order ($symbol, $type, $side, $amount, $price, $params);"><pre><span class="pl-c">// for a stop loss order</span> <span class="pl-s1"><span class="pl-c1">$</span>params</span> = { <span class="pl-s">'<span class="pl-s">stopLossPrice</span>'</span>: <span class="pl-c1">55.45</span>, <span class="pl-c">// your stop loss price</span> } <span class="pl-s1"><span class="pl-c1">$</span>order</span> = <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">create_order</span> (<span class="pl-s1"><span class="pl-c1">$</span>symbol</span>, <span class="pl-s1"><span class="pl-c1">$</span>type</span>, <span class="pl-s1"><span class="pl-c1">$</span>side</span>, <span class="pl-s1"><span class="pl-c1">$</span>amount</span>, <span class="pl-s1"><span class="pl-c1">$</span>price</span>, <span class="pl-s1"><span class="pl-c1">$</span>params</span>);</pre></div> <div class="markdown-heading"><h5 class="heading-element">Take Profit Orders</h5><a id="user-content-take-profit-orders" class="anchor" aria-label="Permalink: Take Profit Orders" href="#take-profit-orders"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The same as Stop Loss Orders, but the direction matters. Implemented by specifying a <code>takeProfitPrice</code> parameter (for the take profit triggerPrice).</p> <p>Suppose you entered a long position (you bought) at 1000 and want to get your profits from a possible price pump above 1300. You would place a take profit order with triggerPrice at 1300. For that take profit order either you would specify a limit price or it will be executed at market price.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" | price | amount ----|---------------- | 1500 | 200 | 1400 | 300 <------------------------------------------------------------------------------+ a | 1300 | 100 <--- it will close your position at market price above 1300 | s | 1200 | 200 when your takeProfitPrice is reached from below | k | 1100 | 300 or it will be executed at your limit price higher than your takeProfitPrice -+ | 1000 | 100 <- you bought to enter a long position here at 1000 | 900 | 100 ----|---------------- last price is 900 | 800 | 100 | 700 | 200 b | 600 | 100 i | 500 | 300 d | 400 | 200 | 300 | 100 | 200 | 100"><pre class="notranslate"><code> | price | amount ----|---------------- | 1500 | 200 | 1400 | 300 <------------------------------------------------------------------------------+ a | 1300 | 100 <--- it will close your position at market price above 1300 | s | 1200 | 200 when your takeProfitPrice is reached from below | k | 1100 | 300 or it will be executed at your limit price higher than your takeProfitPrice -+ | 1000 | 100 <- you bought to enter a long position here at 1000 | 900 | 100 ----|---------------- last price is 900 | 800 | 100 | 700 | 200 b | 600 | 100 i | 500 | 300 d | 400 | 200 | 300 | 100 | 200 | 100 </code></pre></div> <p>Suppose you entered a short position (you sold) at 700 and want to get your profits from a possible price drop below 600. You would place a take profit order with triggerPrice at 600. For that take profit order either you would specify a limit price or it will be executed at market price.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" | price | amount ----|---------------- | 1500 | 200 | 1400 | 300 a | 1300 | 100 s | 1200 | 200 k | 1100 | 300 | 1000 | 100 | 900 | 100 ----|---------------- last price is 900 (you sold at 700) | 800 | 100 | 700 | 200 <--- you sold to enter a short position here at 700 b | 600 | 100 <------ you place a take profit order here at 600 i | 500 | 300 when your takeProfitPrice is reached from above d | 400 | 200 it will be close your position at market price below 600 | 300 | 100 <- or it will be executed at your limit price lower than your takeProfitPrice | 200 | 100"><pre class="notranslate"><code> | price | amount ----|---------------- | 1500 | 200 | 1400 | 300 a | 1300 | 100 s | 1200 | 200 k | 1100 | 300 | 1000 | 100 | 900 | 100 ----|---------------- last price is 900 (you sold at 700) | 800 | 100 | 700 | 200 <--- you sold to enter a short position here at 700 b | 600 | 100 <------ you place a take profit order here at 600 i | 500 | 300 when your takeProfitPrice is reached from above d | 400 | 200 it will be close your position at market price below 600 | 300 | 100 <- or it will be executed at your limit price lower than your takeProfitPrice | 200 | 100 </code></pre></div> <p>Take Profit orders are activated when the price of the underlying:</p> <ul> <li>rises above the <code>takeProfitPrice</code> from below, for sell orders (eg: to close a long position, at a profit)</li> <li>drops below the <code>takeProfitPrice</code> from above, for buy orders (eg: to close a short position, at a profit)</li> </ul> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-35" class="anchor" aria-label="Permalink: Javascript" href="#javascript-35"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// for a take profit order const params = { 'takeProfitPrice': 120.45, // your take profit price } const order = await exchange.createOrder (symbol, type, side, amount, price, params)"><pre><span class="pl-c">// for a take profit order</span> <span class="pl-k">const</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-s">'takeProfitPrice'</span>: <span class="pl-c1">120.45</span><span class="pl-kos">,</span> <span class="pl-c">// your take profit price</span> <span class="pl-kos">}</span> <span class="pl-k">const</span> <span class="pl-s1">order</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">createOrder</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">type</span><span class="pl-kos">,</span> <span class="pl-s1">side</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">price</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-35" class="anchor" aria-label="Permalink: Python" href="#python-35"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# for a take profit order params = { 'takeProfitPrice': 120.45, # your take profit price } order = exchange.create_order (symbol, type, side, amount, price, params)"><pre><span class="pl-c"># for a take profit order</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> { <span class="pl-s">'takeProfitPrice'</span>: <span class="pl-c1">120.45</span>, <span class="pl-c"># your take profit price</span> } <span class="pl-s1">order</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">create_order</span> (<span class="pl-s1">symbol</span>, <span class="pl-s1">type</span>, <span class="pl-s1">side</span>, <span class="pl-s1">amount</span>, <span class="pl-s1">price</span>, <span class="pl-s1">params</span>)</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-33" class="anchor" aria-label="Permalink: PHP" href="#php-33"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// for a take profit order $params = { 'takeProfitPrice': 120.45, // your take profit price } $order = $exchange->create_order ($symbol, $type, $side, $amount, $price, $params);"><pre><span class="pl-c">// for a take profit order</span> <span class="pl-s1"><span class="pl-c1">$</span>params</span> = { <span class="pl-s">'<span class="pl-s">takeProfitPrice</span>'</span>: <span class="pl-c1">120.45</span>, <span class="pl-c">// your take profit price</span> } <span class="pl-s1"><span class="pl-c1">$</span>order</span> = <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">create_order</span> (<span class="pl-s1"><span class="pl-c1">$</span>symbol</span>, <span class="pl-s1"><span class="pl-c1">$</span>type</span>, <span class="pl-s1"><span class="pl-c1">$</span>side</span>, <span class="pl-s1"><span class="pl-c1">$</span>amount</span>, <span class="pl-s1"><span class="pl-c1">$</span>price</span>, <span class="pl-s1"><span class="pl-c1">$</span>params</span>);</pre></div> <div class="markdown-heading"><h4 class="heading-element">StopLoss And TakeProfit Orders Attached To A Position</h4><a id="user-content-stoploss-and-takeprofit-orders-attached-to-a-position" class="anchor" aria-label="Permalink: StopLoss And TakeProfit Orders Attached To A Position" href="#stoploss-and-takeprofit-orders-attached-to-a-position"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><strong>Take Profit</strong> / <strong>Stop Loss</strong> Orders which are tied to a position-opening primary order. Implemented by supplying a dictionary parameters for <code>stopLoss</code> and <code>takeProfit</code> describing each respectively.</p> <ul> <li>By default stopLoss and takeProfit orders will be the same magnitude as primary order but in the opposite direction.</li> <li>Attached trigger orders are conditional on the primary order being executed.</li> <li>Not supported by all exchanges.</li> <li>Both <code>stopLoss</code> and <code>takeProfit</code> or either can be supplied, this depends on exchange.</li> </ul> <p><em>Note: This is still under unification and is work in progress</em></p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-36" class="anchor" aria-label="Permalink: Javascript" href="#javascript-36"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const params = { 'stopLoss': { 'triggerPrice': 101.25, 'type': 'limit', // or 'market', this field is not necessary if limit price is specified 'price': 100.33, // limit price for a limit stop loss order }, 'takeProfit': { 'triggerPrice': 150.75, 'type': 'market', // or 'limit', this field is not necessary if limit price is specified // no limit price for a market take profit order // 'price': 160.33, // this field is not necessary for a market take profit order } } const order = await exchange.createOrder (symbol, type, side, amount, price, params)"><pre><span class="pl-k">const</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-s">'stopLoss'</span>: <span class="pl-kos">{</span> <span class="pl-s">'triggerPrice'</span>: <span class="pl-c1">101.25</span><span class="pl-kos">,</span> <span class="pl-s">'type'</span>: <span class="pl-s">'limit'</span><span class="pl-kos">,</span> <span class="pl-c">// or 'market', this field is not necessary if limit price is specified</span> <span class="pl-s">'price'</span>: <span class="pl-c1">100.33</span><span class="pl-kos">,</span> <span class="pl-c">// limit price for a limit stop loss order</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'takeProfit'</span>: <span class="pl-kos">{</span> <span class="pl-s">'triggerPrice'</span>: <span class="pl-c1">150.75</span><span class="pl-kos">,</span> <span class="pl-s">'type'</span>: <span class="pl-s">'market'</span><span class="pl-kos">,</span> <span class="pl-c">// or 'limit', this field is not necessary if limit price is specified</span> <span class="pl-c">// no limit price for a market take profit order</span> <span class="pl-c">// 'price': 160.33, // this field is not necessary for a market take profit order</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-k">const</span> <span class="pl-s1">order</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">createOrder</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">type</span><span class="pl-kos">,</span> <span class="pl-s1">side</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">price</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-36" class="anchor" aria-label="Permalink: Python" href="#python-36"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="symbol = 'ETH/BTC' type = 'limit' # or 'market' side = 'buy' amount = 123.45 # your amount price = 115.321 # your price params = { 'stopLoss': { 'triggerPrice': 101.25, 'type': 'limit', # or 'market', this field is not necessary if limit price is specified 'price': 100.33, # limit price for a limit stop loss order }, 'takeProfit': { 'triggerPrice': 150.75, 'type': 'market', # or 'limit', this field is not necessary if limit price is specified # no limit price for a market take profit order # 'price': 160.33, # this field is not necessary for a market take profit order } } order = exchange.create_order (symbol, type, side, amount, price, params)"><pre><span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-s">'ETH/BTC'</span> <span class="pl-s1">type</span> <span class="pl-c1">=</span> <span class="pl-s">'limit'</span> <span class="pl-c"># or 'market'</span> <span class="pl-s1">side</span> <span class="pl-c1">=</span> <span class="pl-s">'buy'</span> <span class="pl-s1">amount</span> <span class="pl-c1">=</span> <span class="pl-c1">123.45</span> <span class="pl-c"># your amount</span> <span class="pl-s1">price</span> <span class="pl-c1">=</span> <span class="pl-c1">115.321</span> <span class="pl-c"># your price</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> { <span class="pl-s">'stopLoss'</span>: { <span class="pl-s">'triggerPrice'</span>: <span class="pl-c1">101.25</span>, <span class="pl-s">'type'</span>: <span class="pl-s">'limit'</span>, <span class="pl-c"># or 'market', this field is not necessary if limit price is specified</span> <span class="pl-s">'price'</span>: <span class="pl-c1">100.33</span>, <span class="pl-c"># limit price for a limit stop loss order</span> }, <span class="pl-s">'takeProfit'</span>: { <span class="pl-s">'triggerPrice'</span>: <span class="pl-c1">150.75</span>, <span class="pl-s">'type'</span>: <span class="pl-s">'market'</span>, <span class="pl-c"># or 'limit', this field is not necessary if limit price is specified</span> <span class="pl-c"># no limit price for a market take profit order</span> <span class="pl-c"># 'price': 160.33, # this field is not necessary for a market take profit order</span> } } <span class="pl-s1">order</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">create_order</span> (<span class="pl-s1">symbol</span>, <span class="pl-s1">type</span>, <span class="pl-s1">side</span>, <span class="pl-s1">amount</span>, <span class="pl-s1">price</span>, <span class="pl-s1">params</span>)</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-34" class="anchor" aria-label="Permalink: PHP" href="#php-34"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$symbol = 'ETH/BTC'; $type = 'limit'; // or 'market' $side = 'buy'; $amount = 123.45; // your amount $price = 115.321; // your price $params = { 'stopLoss': { 'triggerPrice': 101.25, 'type': 'limit', // or 'market', this field is not necessary if limit price is specified 'price': 100.33, // limit price for a limit stop loss order }, 'takeProfit': { 'triggerPrice': 150.75, 'type': 'market', // or 'limit', this field is not necessary if limit price is specified // no limit price for a market take profit order // 'price': 160.33, // this field is not necessary for a market take profit order } } $order = $exchange->create_order ($symbol, $type, $side, $amount, $price, $params);"><pre><span class="pl-s1"><span class="pl-c1">$</span>symbol</span> = <span class="pl-s">'<span class="pl-s">ETH/BTC</span>'</span>; <span class="pl-s1"><span class="pl-c1">$</span>type</span> = <span class="pl-s">'<span class="pl-s">limit</span>'</span>; <span class="pl-c">// or 'market'</span> <span class="pl-s1"><span class="pl-c1">$</span>side</span> = <span class="pl-s">'<span class="pl-s">buy</span>'</span>; <span class="pl-s1"><span class="pl-c1">$</span>amount</span> = <span class="pl-c1">123.45</span>; <span class="pl-c">// your amount</span> <span class="pl-s1"><span class="pl-c1">$</span>price</span> = <span class="pl-c1">115.321</span>; <span class="pl-c">// your price</span> <span class="pl-s1"><span class="pl-c1">$</span>params</span> = { <span class="pl-s">'<span class="pl-s">stopLoss</span>': {<span class="pl-s"></span></span> <span class="pl-s"><span class="pl-s"> </span>'</span>triggerPrice': <span class="pl-c1">101.25</span>, <span class="pl-s">'<span class="pl-s">type</span>':<span class="pl-s"> </span>'limit', <span class="pl-c">// or 'market', this field is not necessary if limit price is specified</span><span class="pl-s"></span></span> <span class="pl-s"><span class="pl-s"> </span>'</span>price': <span class="pl-c1">100.33</span>, <span class="pl-c">// limit price for a limit stop loss order</span> }, <span class="pl-s">'<span class="pl-s">takeProfit</span>': {<span class="pl-s"></span></span> <span class="pl-s"><span class="pl-s"> </span>'</span>triggerPrice': <span class="pl-c1">150.75</span>, <span class="pl-s">'<span class="pl-s">type</span>':<span class="pl-s"> </span>'</span>market', <span class="pl-c">// or 'limit', this field is not necessary if limit price is specified</span> <span class="pl-c">// no limit price for a market take profit order</span> <span class="pl-c">// 'price': 160.33, // this field is not necessary for a market take profit order</span> } } <span class="pl-s1"><span class="pl-c1">$</span>order</span> = <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">create_order</span> (<span class="pl-s1"><span class="pl-c1">$</span>symbol</span>, <span class="pl-s1"><span class="pl-c1">$</span>type</span>, <span class="pl-s1"><span class="pl-c1">$</span>side</span>, <span class="pl-s1"><span class="pl-c1">$</span>amount</span>, <span class="pl-s1"><span class="pl-c1">$</span>price</span>, <span class="pl-s1"><span class="pl-c1">$</span>params</span>);</pre></div> <p>For exchanges, where it is not possible to use attached SL &TP, after submitting an entry order, you can immediatelly submit another order (even though position might not be open yet) with <code>triggerPrice</code> and <code>reduceOnly: true</code> params, so it can still act as a stoploss order for your upcoming position (note, this approach might not work for some exchanges).</p> <div class="markdown-heading"><h4 class="heading-element">Trailing Orders</h4><a id="user-content-trailing-orders" class="anchor" aria-label="Permalink: Trailing Orders" href="#trailing-orders"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><strong>Trailing</strong> Orders trail behind an open position. Implemented by supplying float parameters for <code>trailingPercent</code> or <code>trailingAmount</code>.</p> <ul> <li>A trailing order continually adjusts the order price at a fixed percent or fixed quote amount away from the current market price.</li> <li>A trailing order trails behind a position as it moves in one direction, but not in the opposite direction.</li> <li>If the position value rises, the trailing order changes, but if the position value drops the trailing order stays the same until the order is executed.</li> <li>A trailing order can be placed independently after opening a position.</li> <li>Implemented by filling in either the <code>trailingPercent</code> or <code>trailingAmount</code> parameter depending on the exchange.</li> <li>The price argument can be used as the <code>trailingTriggerPrice</code>, and the type argument can be used to differentiate between limit and market trailing orders if needed.</li> </ul> <p><em>Not supported by all exchanges.</em></p> <p><em>Note: This is still under unification and is a work in progress</em></p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-37" class="anchor" aria-label="Permalink: Javascript" href="#javascript-37"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="symbol = 'BTC/USDT:USDT'; type = 'market'; side = 'sell'; amount = 1.0; price = undefined; const params = { 'trailingPercent': 1.0, // percentage away from the current market price 1.0 is equal to 1% // 'trailingAmount': 100.0, // quote amount away from the current market price // 'trailingTriggerPrice': 44500.0, // the price to trigger activating a trailing stop order // 'reduceOnly': true, // set to true if you want to close a position, set to false if you want to open a new position } const order = await exchange.createOrder (symbol, type, side, amount, price, params)"><pre><span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-s">'BTC/USDT:USDT'</span><span class="pl-kos">;</span> <span class="pl-s1">type</span> <span class="pl-c1">=</span> <span class="pl-s">'market'</span><span class="pl-kos">;</span> <span class="pl-s1">side</span> <span class="pl-c1">=</span> <span class="pl-s">'sell'</span><span class="pl-kos">;</span> <span class="pl-s1">amount</span> <span class="pl-c1">=</span> <span class="pl-c1">1.0</span><span class="pl-kos">;</span> <span class="pl-s1">price</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-s">'trailingPercent'</span>: <span class="pl-c1">1.0</span><span class="pl-kos">,</span> <span class="pl-c">// percentage away from the current market price 1.0 is equal to 1%</span> <span class="pl-c">// 'trailingAmount': 100.0, // quote amount away from the current market price</span> <span class="pl-c">// 'trailingTriggerPrice': 44500.0, // the price to trigger activating a trailing stop order</span> <span class="pl-c">// 'reduceOnly': true, // set to true if you want to close a position, set to false if you want to open a new position</span> <span class="pl-kos">}</span> <span class="pl-k">const</span> <span class="pl-s1">order</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">createOrder</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">type</span><span class="pl-kos">,</span> <span class="pl-s1">side</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">price</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-37" class="anchor" aria-label="Permalink: Python" href="#python-37"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="symbol = 'BTC/USDT:USDT' type = 'market' side = 'sell' amount = 1.0 price = None params = { 'trailingPercent': 1.0, # percentage away from the current market price 1.0 is equal to 1% # 'trailingAmount': 100.0, # quote amount away from the current market price # 'trailingTriggerPrice': 44500.0, # the price to trigger activating a trailing stop order # 'reduceOnly': True, # set to True if you want to close a position, set to False if you want to open a new position } order = exchange.create_order (symbol, type, side, amount, price, params)"><pre><span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-s">'BTC/USDT:USDT'</span> <span class="pl-s1">type</span> <span class="pl-c1">=</span> <span class="pl-s">'market'</span> <span class="pl-s1">side</span> <span class="pl-c1">=</span> <span class="pl-s">'sell'</span> <span class="pl-s1">amount</span> <span class="pl-c1">=</span> <span class="pl-c1">1.0</span> <span class="pl-s1">price</span> <span class="pl-c1">=</span> <span class="pl-c1">None</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> { <span class="pl-s">'trailingPercent'</span>: <span class="pl-c1">1.0</span>, <span class="pl-c"># percentage away from the current market price 1.0 is equal to 1%</span> <span class="pl-c"># 'trailingAmount': 100.0, # quote amount away from the current market price</span> <span class="pl-c"># 'trailingTriggerPrice': 44500.0, # the price to trigger activating a trailing stop order</span> <span class="pl-c"># 'reduceOnly': True, # set to True if you want to close a position, set to False if you want to open a new position</span> } <span class="pl-s1">order</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">create_order</span> (<span class="pl-s1">symbol</span>, <span class="pl-s1">type</span>, <span class="pl-s1">side</span>, <span class="pl-s1">amount</span>, <span class="pl-s1">price</span>, <span class="pl-s1">params</span>)</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-35" class="anchor" aria-label="Permalink: PHP" href="#php-35"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$symbol = 'BTC/USDT:USDT'; $type = 'market'; $side = 'sell'; $amount = 1.0; $price = null; $params = { 'trailingPercent': 1.0, // percentage away from the current market price 1.0 is equal to 1% // 'trailingAmount': 100.0, // quote amount away from the current market price // 'trailingTriggerPrice': 44500.0, // the price to trigger activating a trailing stop order // 'reduceOnly': true, // set to true if you want to close a position, set to false if you want to open a new position } $order = $exchange->create_order ($symbol, $type, $side, $amount, $price, $params);"><pre><span class="pl-s1"><span class="pl-c1">$</span>symbol</span> = <span class="pl-s">'<span class="pl-s">BTC/USDT:USDT</span>'</span>; <span class="pl-s1"><span class="pl-c1">$</span>type</span> = <span class="pl-s">'<span class="pl-s">market</span>'</span>; <span class="pl-s1"><span class="pl-c1">$</span>side</span> = <span class="pl-s">'<span class="pl-s">sell</span>'</span>; <span class="pl-s1"><span class="pl-c1">$</span>amount</span> = <span class="pl-c1">1.0</span>; <span class="pl-s1"><span class="pl-c1">$</span>price</span> = <span class="pl-c1">null</span>; <span class="pl-s1"><span class="pl-c1">$</span>params</span> = { <span class="pl-s">'<span class="pl-s">trailingPercent</span>'</span>: <span class="pl-c1">1.0</span>, <span class="pl-c">// percentage away from the current market price 1.0 is equal to 1%</span> <span class="pl-c">// 'trailingAmount': 100.0, // quote amount away from the current market price</span> <span class="pl-c">// 'trailingTriggerPrice': 44500.0, // the price to trigger activating a trailing stop order</span> <span class="pl-c">// 'reduceOnly': true, // set to true if you want to close a position, set to false if you want to open a new position</span> } <span class="pl-s1"><span class="pl-c1">$</span>order</span> = <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">create_order</span> (<span class="pl-s1"><span class="pl-c1">$</span>symbol</span>, <span class="pl-s1"><span class="pl-c1">$</span>type</span>, <span class="pl-s1"><span class="pl-c1">$</span>side</span>, <span class="pl-s1"><span class="pl-c1">$</span>amount</span>, <span class="pl-s1"><span class="pl-c1">$</span>price</span>, <span class="pl-s1"><span class="pl-c1">$</span>params</span>);</pre></div> <div class="markdown-heading"><h4 class="heading-element">Custom Order Params</h4><a id="user-content-custom-order-params" class="anchor" aria-label="Permalink: Custom Order Params" href="#custom-order-params"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Some exchanges allow you to specify optional parameters for your order. You can pass your optional parameters and override your query with an associative array using the <code>params</code> argument to your unified API call. All custom params are exchange-specific, of course, and aren't interchangeable, do not expect those custom params for one exchange to work with another exchange.</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-38" class="anchor" aria-label="Permalink: Javascript" href="#javascript-38"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// use a custom order type bitfinex.createLimitSellOrder ('BTC/USD', 1, 10, { 'type': 'trailing-stop' })"><pre><span class="pl-c">// use a custom order type</span> <span class="pl-s1">bitfinex</span><span class="pl-kos">.</span><span class="pl-en">createLimitSellOrder</span> <span class="pl-kos">(</span><span class="pl-s">'BTC/USD'</span><span class="pl-kos">,</span> <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">10</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-s">'type'</span>: <span class="pl-s">'trailing-stop'</span> <span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-38" class="anchor" aria-label="Permalink: Python" href="#python-38"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# add a custom order flag kraken.create_market_buy_order('BTC/USD', 1, {'trading_agreement': 'agree'})"><pre><span class="pl-c"># add a custom order flag</span> <span class="pl-s1">kraken</span>.<span class="pl-c1">create_market_buy_order</span>(<span class="pl-s">'BTC/USD'</span>, <span class="pl-c1">1</span>, {<span class="pl-s">'trading_agreement'</span>: <span class="pl-s">'agree'</span>})</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-36" class="anchor" aria-label="Permalink: PHP" href="#php-36"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// add custom user id to your order $hitbtc->create_order ('BTC/USD', 'limit', 'buy', 1, 3000, array ('clientOrderId' => '123'));"><pre><span class="pl-c">// add custom user id to your order</span> <span class="pl-s1"><span class="pl-c1">$</span>hitbtc</span>-><span class="pl-en">create_order</span> (<span class="pl-s">'<span class="pl-s">BTC/USD</span>'</span>, <span class="pl-s">'<span class="pl-s">limit</span>'</span>, <span class="pl-s">'<span class="pl-s">buy</span>'</span>, <span class="pl-c1">1</span>, <span class="pl-c1">3000</span>, <span class="pl-en">array</span> (<span class="pl-s">'<span class="pl-s">clientOrderId</span>'</span> => <span class="pl-s">'<span class="pl-s">123</span>'</span>));</pre></div> <div class="markdown-heading"><h5 class="heading-element">User-defined <code>clientOrderId</code> </h5><a id="user-content-user-defined-clientorderid" class="anchor" aria-label="Permalink: User-defined clientOrderId" href="#user-defined-clientorderid"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- this part of the unified API is currenty a work in progress - there may be some issues and missing implementations here and there - contributions, pull requests and feedback appreciated"><pre lang="text" class="notranslate"><code>- this part of the unified API is currenty a work in progress - there may be some issues and missing implementations here and there - contributions, pull requests and feedback appreciated </code></pre></div> <p>The user can specify a custom <code>clientOrderId</code> field can be set upon placing orders with the <code>params</code>. Using the <code>clientOrderId</code> one can later distinguish between own orders. This is only available for the exchanges that do support <code>clientOrderId</code> at this time. For the exchanges that don't support it will either throw an error upon supplying the <code>clientOrderId</code> or will ignore it setting the <code>clientOrderId</code> to <code>undefined/None/null</code>.</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-39" class="anchor" aria-label="Permalink: Javascript" href="#javascript-39"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="exchange.createOrder (symbol, type, side, amount, price, { 'clientOrderId': 'Hello', })"><pre><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">createOrder</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">type</span><span class="pl-kos">,</span> <span class="pl-s1">side</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">price</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-s">'clientOrderId'</span>: <span class="pl-s">'Hello'</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-39" class="anchor" aria-label="Permalink: Python" href="#python-39"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="exchange.create_order(symbol, type, side, amount, price, { 'clientOrderId': 'World', })"><pre><span class="pl-s1">exchange</span>.<span class="pl-c1">create_order</span>(<span class="pl-s1">symbol</span>, <span class="pl-s1">type</span>, <span class="pl-s1">side</span>, <span class="pl-s1">amount</span>, <span class="pl-s1">price</span>, { <span class="pl-s">'clientOrderId'</span>: <span class="pl-s">'World'</span>, })</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-37" class="anchor" aria-label="Permalink: PHP" href="#php-37"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$exchange->create_order($symbol, $type, $side, $amount, $price, array( 'clientOrderId' => 'Foobar', ))"><pre><span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">create_order</span>(<span class="pl-s1"><span class="pl-c1">$</span>symbol</span>, <span class="pl-s1"><span class="pl-c1">$</span>type</span>, <span class="pl-s1"><span class="pl-c1">$</span>side</span>, <span class="pl-s1"><span class="pl-c1">$</span>amount</span>, <span class="pl-s1"><span class="pl-c1">$</span>price</span>, <span class="pl-en">array</span>( <span class="pl-s">'<span class="pl-s">clientOrderId</span>'</span> => <span class="pl-s">'<span class="pl-s">Foobar</span>'</span>, ))</pre></div> <div class="markdown-heading"><h3 class="heading-element">Editing Orders</h3><a id="user-content-editing-orders" class="anchor" aria-label="Permalink: Editing Orders" href="#editing-orders"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>To edit an order, you can use the <code>editOrder</code> method</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="editOrder (id, symbol, type, side, amount, price = undefined, params = {})"><pre><span class="pl-en">editOrder</span> <span class="pl-kos">(</span><span class="pl-s1">id</span><span class="pl-kos">,</span> <span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">type</span><span class="pl-kos">,</span> <span class="pl-s1">side</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">price</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>id</strong> (String) <em>required</em> Order id (e.g. <code>1645807945000</code>)</li> <li> <strong>symbol</strong> (String) <em>required</em> Unified CCXT market symbol</li> <li> <strong>side</strong> (String) <em>required</em> the direction of your order. <strong>Unified sides:</strong> <ul> <li> <code>buy</code> give quote currency and receive base currency; for example, buying <code>BTC/USD</code> means that you will receive bitcoins for your dollars.</li> <li> <code>sell</code> give base currency and receive quote currency; for example, buying <code>BTC/USD</code> means that you will receive dollars for your bitcoins.</li> </ul> </li> <li> <strong>type</strong> (String) <em>required</em> type of order <strong>Unified types:</strong> <ul> <li> <a href="market-orders"><code>market</code></a> not allowed by some exchanges, see <a href="#exchanges">their docs</a> for details</li> <li><a href="limit-orders"><code>limit</code></a></li> <li>see #custom-order-params and #other-order-types for non-unified types</li> </ul> </li> <li> <strong>amount</strong> (Number) <em>required</em> how much of currency you want to trade usually, but not always, in units of the base currency of the trading pair symbol (the units for some exchanges are dependent on the side of the order: see their API docs for details.)</li> <li> <strong>price</strong> (Float) the price at which the order is to be fullfilled at in units of the quote currency (ignored in market orders)</li> <li> <strong>params</strong> (Dictionary) Extra parameters specific to the exchange API endpoint (e.g. <code>{"settle": "usdt"}</code>)</li> </ul> <p>Returns</p> <ul> <li>An <a href="#order-structure">order structure</a> </li> </ul> <div class="markdown-heading"><h3 class="heading-element">Canceling Orders</h3><a id="user-content-canceling-orders" class="anchor" aria-label="Permalink: Canceling Orders" href="#canceling-orders"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>To cancel an existing order use</p> <ul> <li> <code>cancelOrder ()</code> for a single order</li> <li> <code>cancelOrders ()</code> for multiple orders</li> <li> <code>cancelAllOrders ()</code> for all open orders</li> <li> <code>cancelAllOrdersAfter ()</code> for all open orders after the given timeout</li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="cancelOrder (id, symbol = undefined, params = {})"><pre><span class="pl-en">cancelOrder</span> <span class="pl-kos">(</span><span class="pl-s1">id</span><span class="pl-kos">,</span> <span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>id</strong> (String) <em>required</em> Order id (e.g. <code>1645807945000</code>)</li> <li> <strong>symbol</strong> (String) Unified CCXT market symbol <strong>required</strong> on some exchanges (e.g. <code>"BTC/USDT"</code>)</li> <li> <strong>params</strong> (Dictionary) Extra parameters specific to the exchange API endpoint (e.g. <code>{"settle": "usdt"}</code>)</li> </ul> <p>Returns</p> <ul> <li>An <a href="#order-structure">order structure</a> </li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="cancelOrders (ids, symbol = undefined, params = {})"><pre><span class="pl-en">cancelOrders</span> <span class="pl-kos">(</span><span class="pl-s1">ids</span><span class="pl-kos">,</span> <span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>ids</strong> ([String]) <em>required</em> Order ids (e.g. <code>1645807945000</code>)</li> <li> <strong>symbol</strong> (String) Unified CCXT market symbol <strong>required</strong> on some exchanges (e.g. <code>"BTC/USDT"</code>)</li> <li> <strong>params</strong> (Dictionary) Extra parameters specific to the exchange API endpoint (e.g. <code>{"settle": "usdt"}</code>)</li> </ul> <p>Returns</p> <ul> <li>An array of <a href="#order-structure">order structures</a> </li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="async cancelAllOrders (symbol = undefined, params = {})"><pre><span class="pl-en">async</span> <span class="pl-s1">cancelAllOrders</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbol</strong> (String) Unified CCXT market symbol <strong>required</strong> on some exchanges (e.g. <code>"BTC/USDT"</code>)</li> <li> <strong>params</strong> (Dictionary) Extra parameters specific to the exchange API endpoint (e.g. <code>{"settle": "usdt"}</code>)</li> </ul> <p>Returns</p> <ul> <li>An array of <a href="#order-structure">order structures</a> </li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="async cancelAllOrdersAfter (timeout, params = {})"><pre><span class="pl-en">async</span> <span class="pl-s1">cancelAllOrdersAfter</span> <span class="pl-kos">(</span><span class="pl-s1">timeout</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>timeout</strong> (number) countdown time in milliseconds <strong>required</strong> on some exchanges, 0 represents cancel the timer (e.g. <code>10</code>\ )</li> <li> <strong>params</strong> (Dictionary) Extra parameters specific to the exchange API endpoint (e.g. <code>{"type": "spot"}</code>\ )</li> </ul> <p>Returns</p> <ul> <li>An object</li> </ul> <div class="markdown-heading"><h4 class="heading-element">Exceptions Upon Canceling Orders</h4><a id="user-content-exceptions-upon-canceling-orders" class="anchor" aria-label="Permalink: Exceptions Upon Canceling Orders" href="#exceptions-upon-canceling-orders"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The <code>cancelOrder()</code> is usually used on open orders only. However, it may happen that your order gets executed (filled and closed) before your cancel-request comes in, so a cancel-request might hit an already-closed order.</p> <p>A cancel-request might also throw a <code>OperationFailed</code> indicating that the order might or might not have been canceled successfully and whether you need to retry or not. Consecutive calls to <code>cancelOrder()</code> may hit an already canceled order as well.</p> <p>As such, <code>cancelOrder()</code> can throw an <code>OrderNotFound</code> exception in these cases:</p> <ul> <li>canceling an already-closed order</li> <li>canceling an already-canceled order</li> </ul> <div class="markdown-heading"><h2 class="heading-element">My Trades</h2><a id="user-content-my-trades" class="anchor" aria-label="Permalink: My Trades" href="#my-trades"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- this part of the unified API is currenty a work in progress - there may be some issues and missing implementations here and there - contributions, pull requests and feedback appreciated"><pre lang="text" class="notranslate"><code>- this part of the unified API is currenty a work in progress - there may be some issues and missing implementations here and there - contributions, pull requests and feedback appreciated </code></pre></div> <div class="markdown-heading"><h3 class="heading-element">How Orders Are Related To Trades</h3><a id="user-content-how-orders-are-related-to-trades" class="anchor" aria-label="Permalink: How Orders Are Related To Trades" href="#how-orders-are-related-to-trades"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>A trade is also often called <code>a fill</code>. Each trade is a result of order execution. Note, that orders and trades have a one-to-many relationship: an execution of one order may result in several trades. However, when one order matches another opposing order, the pair of two matching orders yields one trade. Thus, when an order matches multiple opposing orders, this yields multiple trades, one trade per each pair of matched orders.</p> <p>To put it shortly, an order can contain <em>one or more</em> trades. Or, in other words, an order can be <em>filled</em> with one or more trades.</p> <p>For example, an orderbook can have the following orders (whatever trading symbol or pair it is):</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" | price | amount ----|---------------- a | 1.200 | 200 s | 1.100 | 300 k | 0.900 | 100 ----|---------------- b | 0.800 | 100 i | 0.700 | 200 d | 0.500 | 100"><pre lang="text" class="notranslate"><code> | price | amount ----|---------------- a | 1.200 | 200 s | 1.100 | 300 k | 0.900 | 100 ----|---------------- b | 0.800 | 100 i | 0.700 | 200 d | 0.500 | 100 </code></pre></div> <p>All specific numbers above aren't real, this is just to illustrate the way orders and trades are related in general.</p> <p>A seller decides to place a sell limit order on the ask side for a price of 0.700 and an amount of 150.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" | price | amount ----|---------------- ↓ a | 1.200 | 200 ↓ s | 1.100 | 300 ↓ k | 0.900 | 100 ↓ ----|---------------- ↓ b | 0.800 | 100 ↓ sell 150 for 0.700 i | 0.700 | 200 -------------------- d | 0.500 | 100"><pre lang="text" class="notranslate"><code> | price | amount ----|---------------- ↓ a | 1.200 | 200 ↓ s | 1.100 | 300 ↓ k | 0.900 | 100 ↓ ----|---------------- ↓ b | 0.800 | 100 ↓ sell 150 for 0.700 i | 0.700 | 200 -------------------- d | 0.500 | 100 </code></pre></div> <p>As the price and amount of the incoming sell (ask) order cover more than one bid order (orders <code>b</code> and <code>i</code>), the following sequence of events usually happens within an exchange engine very quickly, but not immediately:</p> <ol> <li> <p>Order <code>b</code> is matched against the incoming sell because their prices intersect. Their volumes <em>"mutually annihilate"</em> each other, so, the bidder gets 100 for a price of 0.800. The seller (asker) will have their sell order partially filled by bid volume 100 for a price of 0.800. Note that for the filled part of the order the seller gets a better price than he asked for initially. He asked for 0.7 at least but got 0.8 instead which is even better for the seller. Most conventional exchanges fill orders for the best price available.</p> </li> <li> <p>A trade is generated for the order <code>b</code> against the incoming sell order. That trade <em>"fills"</em> the entire order <code>b</code> and most of the sell order. One trade is generated per each pair of matched orders, whether the amount was filled completely or partially. In this example the seller amount (100) fills order <code>b</code> completely (closes the order <code>b</code>) and also fills the selling order partially (leaves it open in the orderbook).</p> </li> <li> <p>Order <code>b</code> now has a status of <code>closed</code> and a filled volume of 100. It contains one trade against the selling order. The selling order has an <code>open</code> status and a filled volume of 100. It contains one trade against order <code>b</code>. Thus each order has just one fill-trade so far.</p> </li> <li> <p>The incoming sell order has a filled amount of 100 and has yet to fill the remaining amount of 50 from its initial amount of 150 in total.</p> </li> </ol> <p>The intermediate state of the orderbook is now (order <code>b</code> is <code>closed</code> and is not in the orderbook anymore):</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" | price | amount ----|---------------- ↓ a | 1.200 | 200 ↓ s | 1.100 | 300 ↓ k | 0.900 | 100 ↓ ----|---------------- ↓ sell remaining 50 for 0.700 i | 0.700 | 200 ----------------------------- d | 0.500 | 100"><pre lang="text" class="notranslate"><code> | price | amount ----|---------------- ↓ a | 1.200 | 200 ↓ s | 1.100 | 300 ↓ k | 0.900 | 100 ↓ ----|---------------- ↓ sell remaining 50 for 0.700 i | 0.700 | 200 ----------------------------- d | 0.500 | 100 </code></pre></div> <ol start="5"> <li> <p>Order <code>i</code> is matched against the remaining part of incoming sell, because their prices intersect. The amount of buying order <code>i</code> which is 200 completely annihilates the remaining sell amount of 50. The order <code>i</code> is filled partially by 50, but the rest of its volume, namely the remaining amount of 150 will stay in the orderbook. The selling order, however, is fulfilled completely by this second match.</p> </li> <li> <p>A trade is generated for the order <code>i</code> against the incoming sell order. That trade partially fills order <code>i</code>. And completes the filling of the sell order. Again, this is just one trade for a pair of matched orders.</p> </li> <li> <p>Order <code>i</code> now has a status of <code>open</code>, a filled amount of 50, and a remaining amount of 150. It contains one filling trade against the selling order. The selling order has a <code>closed</code> status now and it has completely filled its total initial amount of 150. However, it contains two trades, the first against order <code>b</code> and the second against order <code>i</code>. Thus each order can have one or more filling trades, depending on how their volumes were matched by the exchange engine.</p> </li> </ol> <p>After the above sequence takes place, the updated orderbook will look like this.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" | price | amount ----|---------------- a | 1.200 | 200 s | 1.100 | 300 k | 0.900 | 100 ----|---------------- i | 0.700 | 150 d | 0.500 | 100"><pre lang="text" class="notranslate"><code> | price | amount ----|---------------- a | 1.200 | 200 s | 1.100 | 300 k | 0.900 | 100 ----|---------------- i | 0.700 | 150 d | 0.500 | 100 </code></pre></div> <p>Notice that the order <code>b</code> has disappeared, the selling order also isn't there. All closed and fully-filled orders disappear from the orderbook. The order <code>i</code> which was filled partially and still has a remaining volume and an <code>open</code> status, is still there.</p> <div class="markdown-heading"><h3 class="heading-element">Personal Trades</h3><a id="user-content-personal-trades" class="anchor" aria-label="Permalink: Personal Trades" href="#personal-trades"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Most of unified methods will return either a single object or a plain array (a list) of objects (trades). However, very few exchanges (if any at all) will return all trades at once. Most often their APIs <code>limit</code> output to a certain number of most recent objects. <strong>YOU CANNOT GET ALL OBJECTS SINCE THE BEGINNING OF TIME TO THE PRESENT MOMENT IN JUST ONE CALL</strong>. Practically, very few exchanges will tolerate or allow that.</p> <p>As with all other unified methods for fetching historical data, the <code>fetchMyTrades</code> method accepts a <code>since</code> argument for <a href="#date-based-pagination">date-based pagination</a>. Just like with all other unified methods throughout the CCXT library, the <code>since</code> argument for <code>fetchMyTrades</code> must be an <strong>integer timestamp in milliseconds</strong>.</p> <p>To fetch historical trades, the user will need to traverse the data in portions or "pages" of objects. Pagination often implies <em>"fetching portions of data one by one"</em> in a loop.</p> <p>In many cases a <code>symbol</code> argument is required by the exchanges' APIs, therefore you have to loop over all symbols to get all your trades. If the <code>symbol</code> is missing and the exchange requires it then CCXT will throw an <code>ArgumentsRequired</code> exception to signal the requirement to the user. And then the <code>symbol</code> has to be specified. One of the approaches is to filter the relevant symbols from the list of all symbols by looking at non-zero balances as well as transactions (withdrawals and deposits). Also, the exchanges will have a limit on how far back in time you can go.</p> <p>In most cases users are <strong>required to use at least some type of <a href="#pagination">pagination</a></strong> in order to get the expected results consistently.</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-40" class="anchor" aria-label="Permalink: Javascript" href="#javascript-40"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// fetchMyTrades (symbol = undefined, since = undefined, limit = undefined, params = {}) if (exchange.has['fetchMyTrades']) { const trades = await exchange.fetchMyTrades (symbol, since, limit, params) }"><pre><span class="pl-c">// fetchMyTrades (symbol = undefined, since = undefined, limit = undefined, params = {})</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">has</span><span class="pl-kos">[</span><span class="pl-s">'fetchMyTrades'</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-s1">trades</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchMyTrades</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">since</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-40" class="anchor" aria-label="Permalink: Python" href="#python-40"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# fetch_my_trades(symbol=None, since=None, limit=None, params={}) if exchange.has['fetchMyTrades']: exchange.fetch_my_trades(symbol=None, since=None, limit=None, params={})"><pre><span class="pl-c"># fetch_my_trades(symbol=None, since=None, limit=None, params={})</span> <span class="pl-k">if</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">has</span>[<span class="pl-s">'fetchMyTrades'</span>]: <span class="pl-s1">exchange</span>.<span class="pl-c1">fetch_my_trades</span>(<span class="pl-s1">symbol</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">since</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">limit</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">params</span><span class="pl-c1">=</span>{})</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-38" class="anchor" aria-label="Permalink: PHP" href="#php-38"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// fetch_my_trades($symbol = null, $since = null, $limit = null, $params = array()) if ($exchange->has['fetchMyTrades']) { $trades = $exchange->fetch_my_trades($symbol, $since, $limit, $params); }"><pre><span class="pl-c">// fetch_my_trades($symbol = null, $since = null, $limit = null, $params = array())</span> <span class="pl-k">if</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">has</span>[<span class="pl-s">'<span class="pl-s">fetchMyTrades</span>'</span>]) { <span class="pl-s1"><span class="pl-c1">$</span>trades</span> = <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">fetch_my_trades</span>(<span class="pl-s1"><span class="pl-c1">$</span>symbol</span>, <span class="pl-s1"><span class="pl-c1">$</span>since</span>, <span class="pl-s1"><span class="pl-c1">$</span>limit</span>, <span class="pl-s1"><span class="pl-c1">$</span>params</span>); }</pre></div> <p>Returns ordered array <code>[]</code> of trades (most recent trade last).</p> <div class="markdown-heading"><h4 class="heading-element">Trade Structure</h4><a id="user-content-trade-structure" class="anchor" aria-label="Permalink: Trade Structure" href="#trade-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Trades denote the exchange of one currency for another, unlike <a href="#transaction-structure">transactions</a>, which denote a transfer of a given coin.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ 'info': { ... }, // the original decoded JSON as is 'id': '12345-67890:09876/54321', // string trade id 'timestamp': 1502962946216, // Unix timestamp in milliseconds 'datetime': '2017-08-17 12:42:48.000', // ISO8601 datetime with milliseconds 'symbol': 'ETH/BTC', // symbol 'order': '12345-67890:09876/54321', // string order id or undefined/None/null 'type': 'limit', // order type, 'market', 'limit' or undefined/None/null 'side': 'buy', // direction of the trade, 'buy' or 'sell' 'takerOrMaker': 'taker', // string, 'taker' or 'maker' 'price': 0.06917684, // float price in quote currency 'amount': 1.5, // amount of base currency 'cost': 0.10376526, // total cost, `price * amount`, 'fee': { // provided by exchange or calculated by ccxt 'cost': 0.0015, // float 'currency': 'ETH', // usually base currency for buys, quote currency for sells 'rate': 0.002, // the fee rate (if available) }, 'fees': [ // an array of fees if paid in multiple currencies { // if provided by exchange or calculated by ccxt 'cost': 0.0015, // float 'currency': 'ETH', // usually base currency for buys, quote currency for sells 'rate': 0.002, // the fee rate (if available) }, ], }"><pre><span class="pl-kos">{</span> <span class="pl-s">'info'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// the original decoded JSON as is</span> <span class="pl-s">'id'</span>: <span class="pl-s">'12345-67890:09876/54321'</span><span class="pl-kos">,</span> <span class="pl-c">// string trade id</span> <span class="pl-s">'timestamp'</span>: <span class="pl-c1">1502962946216</span><span class="pl-kos">,</span> <span class="pl-c">// Unix timestamp in milliseconds</span> <span class="pl-s">'datetime'</span>: <span class="pl-s">'2017-08-17 12:42:48.000'</span><span class="pl-kos">,</span> <span class="pl-c">// ISO8601 datetime with milliseconds</span> <span class="pl-s">'symbol'</span>: <span class="pl-s">'ETH/BTC'</span><span class="pl-kos">,</span> <span class="pl-c">// symbol</span> <span class="pl-s">'order'</span>: <span class="pl-s">'12345-67890:09876/54321'</span><span class="pl-kos">,</span> <span class="pl-c">// string order id or undefined/None/null</span> <span class="pl-s">'type'</span>: <span class="pl-s">'limit'</span><span class="pl-kos">,</span> <span class="pl-c">// order type, 'market', 'limit' or undefined/None/null</span> <span class="pl-s">'side'</span>: <span class="pl-s">'buy'</span><span class="pl-kos">,</span> <span class="pl-c">// direction of the trade, 'buy' or 'sell'</span> <span class="pl-s">'takerOrMaker'</span>: <span class="pl-s">'taker'</span><span class="pl-kos">,</span> <span class="pl-c">// string, 'taker' or 'maker'</span> <span class="pl-s">'price'</span>: <span class="pl-c1">0.06917684</span><span class="pl-kos">,</span> <span class="pl-c">// float price in quote currency</span> <span class="pl-s">'amount'</span>: <span class="pl-c1">1.5</span><span class="pl-kos">,</span> <span class="pl-c">// amount of base currency</span> <span class="pl-s">'cost'</span>: <span class="pl-c1">0.10376526</span><span class="pl-kos">,</span> <span class="pl-c">// total cost, `price * amount`,</span> <span class="pl-s">'fee'</span>: <span class="pl-kos">{</span> <span class="pl-c">// provided by exchange or calculated by ccxt</span> <span class="pl-s">'cost'</span>: <span class="pl-c1">0.0015</span><span class="pl-kos">,</span> <span class="pl-c">// float</span> <span class="pl-s">'currency'</span>: <span class="pl-s">'ETH'</span><span class="pl-kos">,</span> <span class="pl-c">// usually base currency for buys, quote currency for sells</span> <span class="pl-s">'rate'</span>: <span class="pl-c1">0.002</span><span class="pl-kos">,</span> <span class="pl-c">// the fee rate (if available)</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'fees'</span>: <span class="pl-kos">[</span> <span class="pl-c">// an array of fees if paid in multiple currencies</span> <span class="pl-kos">{</span> <span class="pl-c">// if provided by exchange or calculated by ccxt</span> <span class="pl-s">'cost'</span>: <span class="pl-c1">0.0015</span><span class="pl-kos">,</span> <span class="pl-c">// float</span> <span class="pl-s">'currency'</span>: <span class="pl-s">'ETH'</span><span class="pl-kos">,</span> <span class="pl-c">// usually base currency for buys, quote currency for sells</span> <span class="pl-s">'rate'</span>: <span class="pl-c1">0.002</span><span class="pl-kos">,</span> <span class="pl-c">// the fee rate (if available)</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-kos">}</span></pre></div> <ul> <li>The work on <code>'fee'</code> and <code>'fees'</code> info is still in progress, fee info may be missing partially or entirely, depending on the exchange capabilities.</li> <li>The <code>fee</code> currency may be different from both traded currencies (for example, an ETH/BTC order with fees in USD).</li> <li>The <code>cost</code> of the trade means <code>amount * price</code>. It is the total <em>quote</em> volume of the trade (whereas <code>amount</code> is the <em>base</em> volume). The cost field itself is there mostly for convenience and can be deduced from other fields.</li> <li>The <code>cost</code> of the trade is a <em>"gross"</em> value. That is the value pre-fee, and the fee has to be applied afterwards.</li> </ul> <div class="markdown-heading"><h3 class="heading-element">Trades By Order Id</h3><a id="user-content-trades-by-order-id" class="anchor" aria-label="Permalink: Trades By Order Id" href="#trades-by-order-id"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-41" class="anchor" aria-label="Permalink: Javascript" href="#javascript-41"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// fetchOrderTrades (id, symbol = undefined, since = undefined, limit = undefined, params = {}) if (exchange.has['fetchOrderTrades']) { const trades = await exchange.fetchOrderTrades (orderId, symbol, since, limit, params) }"><pre><span class="pl-c">// fetchOrderTrades (id, symbol = undefined, since = undefined, limit = undefined, params = {})</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">has</span><span class="pl-kos">[</span><span class="pl-s">'fetchOrderTrades'</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-s1">trades</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchOrderTrades</span> <span class="pl-kos">(</span><span class="pl-s1">orderId</span><span class="pl-kos">,</span> <span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">since</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-41" class="anchor" aria-label="Permalink: Python" href="#python-41"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# fetch_order_trades(id, symbol=None, since=None, limit=None, params={}) if exchange.has['fetchOrderTrades']: exchange.fetch_order_trades(order_id, symbol=None, since=None, limit=None, params={})"><pre><span class="pl-c"># fetch_order_trades(id, symbol=None, since=None, limit=None, params={})</span> <span class="pl-k">if</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">has</span>[<span class="pl-s">'fetchOrderTrades'</span>]: <span class="pl-s1">exchange</span>.<span class="pl-c1">fetch_order_trades</span>(<span class="pl-s1">order_id</span>, <span class="pl-s1">symbol</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">since</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">limit</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">params</span><span class="pl-c1">=</span>{})</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-39" class="anchor" aria-label="Permalink: PHP" href="#php-39"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// fetch_order_trades ($id, $symbol = null, $since = null, $limit = null, $params = array()) if ($exchange->has['fetchOrderTrades']) { $trades = $exchange->fetch_order_trades($order_id, $symbol, $since, $limit, $params); }"><pre><span class="pl-c">// fetch_order_trades ($id, $symbol = null, $since = null, $limit = null, $params = array())</span> <span class="pl-k">if</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">has</span>[<span class="pl-s">'<span class="pl-s">fetchOrderTrades</span>'</span>]) { <span class="pl-s1"><span class="pl-c1">$</span>trades</span> = <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">fetch_order_trades</span>(<span class="pl-s1"><span class="pl-c1">$</span>order_id</span>, <span class="pl-s1"><span class="pl-c1">$</span>symbol</span>, <span class="pl-s1"><span class="pl-c1">$</span>since</span>, <span class="pl-s1"><span class="pl-c1">$</span>limit</span>, <span class="pl-s1"><span class="pl-c1">$</span>params</span>); }</pre></div> <div class="markdown-heading"><h2 class="heading-element">Ledger</h2><a id="user-content-ledger" class="anchor" aria-label="Permalink: Ledger" href="#ledger"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The ledger is simply the history of changes, actions done by the user or operations that altered the user's balance in any way, that is, the history of movements of all funds from/to all accounts of the user which includes</p> <ul> <li>deposits and withdrawals (funding)</li> <li>amounts incoming and outcoming in result of a trade or an order</li> <li>trading fees</li> <li>transfers between accounts</li> <li>rebates, cashbacks and other types of events that are subject to accounting.</li> </ul> <p>Data on ledger entries can be retrieved using</p> <ul> <li> <code>fetchLedgerEntry ()</code> for a ledger entry</li> <li> <code>fetchLedger ( code )</code> for multiple ledger entries of the same currency</li> <li> <code>fetchLedger ()</code> for all ledger entries</li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchLedgerEntry (id, code = undefined, params = {})"><pre><span class="pl-en">fetchLedgerEntry</span> <span class="pl-kos">(</span><span class="pl-s1">id</span><span class="pl-kos">,</span> <span class="pl-s1">code</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>id</strong> (String) <em>required</em> Ledger entry id</li> <li> <strong>code</strong> (String) Unified CCXT currency code, required (e.g. <code>"USDT"</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"type": "deposit"}</code>)</li> </ul> <p>Returns</p> <ul> <li>A <a href="#ledger-entry-structure">ledger entry structure</a> </li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="async fetchLedger (code = undefined, since = undefined, limit = undefined, params = {})"><pre><span class="pl-en">async</span> <span class="pl-s1">fetchLedger</span> <span class="pl-kos">(</span><span class="pl-s1">code</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>code</strong> (String) Unified CCXT currency code; <em>required</em> if fetching all ledger entries for all assets at once is not supported (e.g. <code>"USDT"</code>)</li> <li> <strong>since</strong> (Integer) Timestamp (ms) of the earliest time to retrieve withdrawals for (e.g. <code>1646940314000</code>)</li> <li> <strong>limit</strong> (Integer) The number of <a href="#ledger-entry-structure">ledger entry structures</a> to retrieve (e.g. <code>5</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>An array of <a href="#ledger-entry-structure">ledger entry structures</a> </li> </ul> <div class="markdown-heading"><h3 class="heading-element">Ledger Entry Structure</h3><a id="user-content-ledger-entry-structure" class="anchor" aria-label="Permalink: Ledger Entry Structure" href="#ledger-entry-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ 'id': 'hqfl-f125f9l2c9', // string id of the ledger entry, e.g. an order id 'direction': 'out', // or 'in' 'account': '06d4ab58-dfcd-468a', // string id of the account if any 'referenceId': 'bf7a-d4441fb3fd31', // string id of the trade, transaction, etc... 'referenceAccount': '3146-4286-bb71', // string id of the opposite account (if any) 'type': 'trade', // string, reference type, see below 'currency': 'BTC', // string, unified currency code, 'ETH', 'USDT'... 'amount': 123.45, // absolute number, float (does not include the fee) 'timestamp': 1544582941735, // milliseconds since epoch time in UTC 'datetime': "2018-12-12T02:49:01.735Z", // string of timestamp, ISO8601 'before': 0, // amount of currency on balance before 'after': 0, // amount of currency on balance after 'status': 'ok', // 'ok, 'pending', 'canceled' 'fee': { // object or undefined 'cost': 54.321, // absolute number on top of the amount 'currency': 'ETH', // string, unified currency code, 'ETH', 'USDT'... }, 'info': { ... }, // raw ledger entry as is from the exchange }"><pre><span class="pl-kos">{</span> <span class="pl-s">'id'</span>: <span class="pl-s">'hqfl-f125f9l2c9'</span><span class="pl-kos">,</span> <span class="pl-c">// string id of the ledger entry, e.g. an order id</span> <span class="pl-s">'direction'</span>: <span class="pl-s">'out'</span><span class="pl-kos">,</span> <span class="pl-c">// or 'in'</span> <span class="pl-s">'account'</span>: <span class="pl-s">'06d4ab58-dfcd-468a'</span><span class="pl-kos">,</span> <span class="pl-c">// string id of the account if any</span> <span class="pl-s">'referenceId'</span>: <span class="pl-s">'bf7a-d4441fb3fd31'</span><span class="pl-kos">,</span> <span class="pl-c">// string id of the trade, transaction, etc...</span> <span class="pl-s">'referenceAccount'</span>: <span class="pl-s">'3146-4286-bb71'</span><span class="pl-kos">,</span> <span class="pl-c">// string id of the opposite account (if any)</span> <span class="pl-s">'type'</span>: <span class="pl-s">'trade'</span><span class="pl-kos">,</span> <span class="pl-c">// string, reference type, see below</span> <span class="pl-s">'currency'</span>: <span class="pl-s">'BTC'</span><span class="pl-kos">,</span> <span class="pl-c">// string, unified currency code, 'ETH', 'USDT'...</span> <span class="pl-s">'amount'</span>: <span class="pl-c1">123.45</span><span class="pl-kos">,</span> <span class="pl-c">// absolute number, float (does not include the fee)</span> <span class="pl-s">'timestamp'</span>: <span class="pl-c1">1544582941735</span><span class="pl-kos">,</span> <span class="pl-c">// milliseconds since epoch time in UTC</span> <span class="pl-s">'datetime'</span>: <span class="pl-s">"2018-12-12T02:49:01.735Z"</span><span class="pl-kos">,</span> <span class="pl-c">// string of timestamp, ISO8601</span> <span class="pl-s">'before'</span>: <span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-c">// amount of currency on balance before</span> <span class="pl-s">'after'</span>: <span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-c">// amount of currency on balance after</span> <span class="pl-s">'status'</span>: <span class="pl-s">'ok'</span><span class="pl-kos">,</span> <span class="pl-c">// 'ok, 'pending', 'canceled'</span> <span class="pl-s">'fee'</span>: <span class="pl-kos">{</span> <span class="pl-c">// object or undefined</span> <span class="pl-s">'cost'</span>: <span class="pl-c1">54.321</span><span class="pl-kos">,</span> <span class="pl-c">// absolute number on top of the amount</span> <span class="pl-s">'currency'</span>: <span class="pl-s">'ETH'</span><span class="pl-kos">,</span> <span class="pl-c">// string, unified currency code, 'ETH', 'USDT'...</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'info'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// raw ledger entry as is from the exchange</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h4 class="heading-element">Notes On Ledger Entry Structure</h4><a id="user-content-notes-on-ledger-entry-structure" class="anchor" aria-label="Permalink: Notes On Ledger Entry Structure" href="#notes-on-ledger-entry-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The type of the ledger entry is the type of the operation associated with it. If the amount comes due to a sell order, then it is associated with a corresponding trade type ledger entry, and the referenceId will contain associated trade id (if the exchange in question provides it). If the amount comes out due to a withdrawal, then is associated with a corresponding transaction.</p> <ul> <li><code>trade</code></li> <li><code>transaction</code></li> <li><code>fee</code></li> <li><code>rebate</code></li> <li><code>cashback</code></li> <li><code>referral</code></li> <li><code>transfer</code></li> <li><code>airdrop</code></li> <li><code>whatever</code></li> <li>...</li> </ul> <p>The <code>referenceId</code> field holds the id of the corresponding event that was registered by adding a new item to the ledger.</p> <p>The <code>status</code> field is there to support for exchanges that include pending and canceled changes in the ledger. The ledger naturally represents the actual changes that have taken place, therefore the status is <code>'ok'</code> in most cases.</p> <p>The ledger entry type can be associated with a regular trade or a funding transaction (deposit or withdrawal) or an internal <code>transfer</code> between two accounts of the same user. If the ledger entry is associated with an internal transfer, the <code>account</code> field will contain the id of the account that is being altered with the ledger entry in question. The <code>referenceAccount</code> field will contain the id of the opposite account the funds are transferred to/from, depending on the <code>direction</code> (<code>'in'</code> or <code>'out'</code>).</p> <div class="markdown-heading"><h2 class="heading-element">Deposit</h2><a id="user-content-deposit" class="anchor" aria-label="Permalink: Deposit" href="#deposit"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>In order to deposit cryptocurrency funds to an exchange you must get an address from the exchange for the currency you want to deposit using <code>fetchDepositAddress</code>. You can then call the <code>withdraw</code> method with the specified currency and address.</p> <p>To deposit fiat currency on an exchange you can use the <code>deposit</code> method with data retrieved from the <code>fetchDepositMethodId</code> method. <em>this deposit feature is currently supported on coinbase only, feel free to report any issues you find</em></p> <ul> <li><code>deposit ()</code></li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="deposit (id, code = undefined, params = {})"><pre><span class="pl-en">deposit</span> <span class="pl-kos">(</span><span class="pl-s1">id</span><span class="pl-kos">,</span> <span class="pl-s1">code</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>id</strong> (String) <em>required</em> Deposit id</li> <li> <strong>code</strong> (String) Fiat currency code, required (e.g. <code>"USD"</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"account": "fiat"}</code>)</li> </ul> <p>Returns</p> <ul> <li> <p>A <a href="#transaction-structure">transaction structure</a></p> </li> <li> <p><code>fetchDepositMethodId ()</code></p> </li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchDepositMethodId (id, params = {})"><pre><span class="pl-en">fetchDepositMethodId</span> <span class="pl-kos">(</span><span class="pl-s1">id</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>id</strong> (String) <em>required</em> Deposit id</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"account": "fiat"}</code>)</li> </ul> <p>Returns</p> <ul> <li> <p>A <a href="#deposit-id-structure">deposit id structure</a></p> </li> <li> <p><code>fetchDepositMethodIds ()</code></p> </li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchDepositMethodIds (params = {})"><pre><span class="pl-en">fetchDepositMethodIds</span> <span class="pl-kos">(</span><span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"account": "fiat"}</code>)</li> </ul> <p>Returns</p> <ul> <li>An array of <a href="#deposit-id-structure">deposit id structures</a> </li> </ul> <div class="markdown-heading"><h3 class="heading-element">Deposit Id Structure</h3><a id="user-content-deposit-id-structure" class="anchor" aria-label="Permalink: Deposit Id Structure" href="#deposit-id-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The deposit id structure returned from <code>fetchDepositMethodId</code>, <code>fetchDepositMethodIds</code> look like this:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ 'info': {}, // raw unparsed data as returned from the exchange 'id': '75ab52ff-f25t', // the deposit id 'currency': 'USD', // fiat currency 'verified': true, // whether funding through this id is verified or not 'tag': 'from credit card', // tag / memo / name of funding source }"><pre><span class="pl-kos">{</span> <span class="pl-s">'info'</span>: <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// raw unparsed data as returned from the exchange</span> <span class="pl-s">'id'</span>: <span class="pl-s">'75ab52ff-f25t'</span><span class="pl-kos">,</span> <span class="pl-c">// the deposit id</span> <span class="pl-s">'currency'</span>: <span class="pl-s">'USD'</span><span class="pl-kos">,</span> <span class="pl-c">// fiat currency</span> <span class="pl-s">'verified'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c">// whether funding through this id is verified or not</span> <span class="pl-s">'tag'</span>: <span class="pl-s">'from credit card'</span><span class="pl-kos">,</span> <span class="pl-c">// tag / memo / name of funding source</span> <span class="pl-kos">}</span></pre></div> <p>Data on deposits made to an account can be retrieved using</p> <ul> <li> <code>fetchDeposit ()</code> for a single deposit</li> <li> <code>fetchDeposits ( code )</code> for multiple deposits of the same currency</li> <li> <code>fetchDeposits ()</code> for all deposits to an account</li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchDeposit (id, code = undefined, params = {})"><pre><span class="pl-en">fetchDeposit</span> <span class="pl-kos">(</span><span class="pl-s1">id</span><span class="pl-kos">,</span> <span class="pl-s1">code</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>id</strong> (String) <em>required</em> Deposit id</li> <li> <strong>code</strong> (String) Unified CCXT currency code, required (e.g. <code>"USDT"</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"network": "TRX"}</code>)</li> </ul> <p>Returns</p> <ul> <li>A <a href="#transaction-structure">transaction structure</a> </li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchDeposits (code = undefined, since = undefined, limit = undefined, params = {})"><pre><span class="pl-en">fetchDeposits</span> <span class="pl-kos">(</span><span class="pl-s1">code</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>code</strong> (String) Unified CCXT currency code (e.g. <code>"USDT"</code>)</li> <li> <strong>since</strong> (Integer) Timestamp (ms) of the earliest time to retrieve deposits for (e.g. <code>1646940314000</code>)</li> <li> <strong>limit</strong> (Integer) The number of <a href="#transaction-structure">transaction structures</a> to retrieve (e.g. <code>5</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>An array of <a href="#transaction-structure">transaction structures</a> </li> </ul> <div class="markdown-heading"><h2 class="heading-element">Withdrawal</h2><a id="user-content-withdrawal" class="anchor" aria-label="Permalink: Withdrawal" href="#withdrawal"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The <code>withdraw</code> method can be used to withdraw funds from an account</p> <p>Some exchanges require a manual approval of each withdrawal by means of 2FA (2-factor authentication). In order to approve your withdrawal you usually have to either click their secret link in your email inbox or enter a Google Authenticator code or an Authy code on their website to verify that withdrawal transaction was requested intentionally.</p> <p>In some cases you can also use the withdrawal id to check withdrawal status later (whether it succeeded or not) and to submit 2FA confirmation codes, where this is supported by the exchange. See <a href="#exchanges">their docs</a> for details.</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-42" class="anchor" aria-label="Permalink: Javascript" href="#javascript-42"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="withdraw (code, amount, address, tag = undefined, params = {})"><pre><span class="pl-en">withdraw</span> <span class="pl-kos">(</span><span class="pl-s1">code</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">address</span><span class="pl-kos">,</span> <span class="pl-s1">tag</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-42" class="anchor" aria-label="Permalink: Python" href="#python-42"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="withdraw(code, amount, address, tag=None, params={})"><pre><span class="pl-en">withdraw</span>(<span class="pl-s1">code</span>, <span class="pl-s1">amount</span>, <span class="pl-s1">address</span>, <span class="pl-s1">tag</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">params</span><span class="pl-c1">=</span>{})</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-40" class="anchor" aria-label="Permalink: PHP" href="#php-40"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="withdraw ($code, $amount, $address, $tag = null, $params = array ())"><pre><span class="pl-en">withdraw</span> (<span class="pl-s1"><span class="pl-c1">$</span>code</span>, <span class="pl-s1"><span class="pl-c1">$</span>amount</span>, <span class="pl-s1"><span class="pl-c1">$</span>address</span>, <span class="pl-s1"><span class="pl-c1">$</span>tag</span> = <span class="pl-c1">null</span>, <span class="pl-s1"><span class="pl-c1">$</span>params</span> = <span class="pl-en">array</span> ())</pre></div> <p>Parameters</p> <ul> <li> <strong>code</strong> (String) <em>required</em> Unified CCXT currency code (e.g. <code>"USDT"</code>)</li> <li> <strong>amount</strong> (Float) <em>required</em> The amount of currency to withdraw (e.g. <code>20</code>)</li> <li> <strong>address</strong> (String) <em>required</em> The recipient address of the withdrawal (e.g. <code>"TEY6qjnKDyyq5jDc3DJizWLCdUySrpQ4yp"</code>)</li> <li> <strong>tag</strong> (String) Required for some networks (e.g. <code>"52055"</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"network": "TRX"}</code>)</li> </ul> <p>Returns</p> <ul> <li>A <a href="#transaction-structure">transaction structure</a> </li> </ul> <hr> <p>Data on withdrawals made to an account can be retrieved using</p> <ul> <li> <code>fetchWithdrawal ()</code> for a single withdrawal</li> <li> <code>fetchWithdrawals ( code )</code> for multiple withdrawals of the same currency</li> <li> <code>fetchWithdrawals ()</code> for all withdrawals from an account</li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchWithdrawal (id, code = undefined, params = {})"><pre><span class="pl-en">fetchWithdrawal</span> <span class="pl-kos">(</span><span class="pl-s1">id</span><span class="pl-kos">,</span> <span class="pl-s1">code</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>id</strong> (String) <em>required</em> Withdrawal id</li> <li> <strong>code</strong> (String) Unified CCXT currency code (e.g. <code>"USDT"</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"network": "TRX"}</code>)</li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchWithdrawals (code = undefined, since = undefined, limit = undefined, params = {})"><pre><span class="pl-en">fetchWithdrawals</span> <span class="pl-kos">(</span><span class="pl-s1">code</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>code</strong> (String) Unified CCXT currency code (e.g. <code>"USDT"</code>)</li> <li> <strong>since</strong> (Integer) Timestamp (ms) of the earliest time to retrieve withdrawals for (e.g. <code>1646940314000</code>)</li> <li> <strong>limit</strong> (Integer) The number of <a href="#transaction-structure">transaction structures</a> to retrieve (e.g. <code>5</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>An array of <a href="#transaction-structure">transaction structures</a> </li> </ul> <div class="markdown-heading"><h3 class="heading-element">Deposit And Withdrawal Networks</h3><a id="user-content-deposit-and-withdrawal-networks" class="anchor" aria-label="Permalink: Deposit And Withdrawal Networks" href="#deposit-and-withdrawal-networks"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>It is also possible to pass the parameters as the fourth argument with or without a specified tag</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-43" class="anchor" aria-label="Permalink: Javascript" href="#javascript-43"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="withdraw (code, amount, address, { tag, network: 'ETH' })"><pre><span class="pl-en">withdraw</span> <span class="pl-kos">(</span><span class="pl-s1">code</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">address</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> tag<span class="pl-kos">,</span> <span class="pl-c1">network</span>: <span class="pl-s">'ETH'</span> <span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-43" class="anchor" aria-label="Permalink: Python" href="#python-43"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="withdraw(code, amount, address, { 'tag': tag, 'network': 'ETH' })"><pre><span class="pl-en">withdraw</span>(<span class="pl-s1">code</span>, <span class="pl-s1">amount</span>, <span class="pl-s1">address</span>, { <span class="pl-s">'tag'</span>: <span class="pl-s1">tag</span>, <span class="pl-s">'network'</span>: <span class="pl-s">'ETH'</span> })</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-41" class="anchor" aria-label="Permalink: PHP" href="#php-41"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="withdraw ($code, $amount, $address, array( 'tag' => tag, 'network' -> 'ETH' ));"><pre><span class="pl-en">withdraw</span> (<span class="pl-s1"><span class="pl-c1">$</span>code</span>, <span class="pl-s1"><span class="pl-c1">$</span>amount</span>, <span class="pl-s1"><span class="pl-c1">$</span>address</span>, <span class="pl-en">array</span>( <span class="pl-s">'<span class="pl-s">tag</span>'</span> => tag, <span class="pl-s">'<span class="pl-s">network</span>'</span> -> <span class="pl-s">'<span class="pl-s">ETH</span>'</span> ));</pre></div> <p>The following aliases of <code>network</code> allow for withdrawing crypto on multiple chains</p> <table role="table"> <thead> <tr> <th align="center">Currency</th> <th align="center">Network</th> </tr> </thead> <tbody> <tr> <td align="center">ETH</td> <td align="center">ERC20</td> </tr> <tr> <td align="center">TRX</td> <td align="center">TRC20</td> </tr> <tr> <td align="center">BSC</td> <td align="center">BEP20</td> </tr> <tr> <td align="center">BNB</td> <td align="center">BEP2</td> </tr> <tr> <td align="center">HT</td> <td align="center">HECO</td> </tr> <tr> <td align="center">OMNI</td> <td align="center">OMNI</td> </tr> </tbody> </table> <p>You may set the value of <code>exchange.withdraw ('USDT', 100, 'TVJ1fwyJ1a8JbtUxZ8Km95sDFN9jhLxJ2D', { 'network': 'TRX' })</code> in order to withdraw USDT on the TRON chain, or 'BSC' to withdraw USDT on Binance Smart Chain. In the table above BSC and BEP20 are equivalent aliases, so it doesn't matter which one you use as they both will achieve the same effect.</p> <div class="markdown-heading"><h3 class="heading-element">Transaction Structure</h3><a id="user-content-transaction-structure" class="anchor" aria-label="Permalink: Transaction Structure" href="#transaction-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Transactions denote a transfer of a given coin, unlike <a href="#trade-structure">trades</a>, which denote the exchange of one currency for another.</p> <ul> <li><em>deposit structure</em></li> <li><em>withdrawal structure</em></li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ 'info': { ... }, // the JSON response from the exchange as is 'id': '123456', // exchange-specific transaction id, string 'txid': '0x68bfb29821c50ca35ef3762f887fd3211e4405aba1a94e448a4f218b850358f0', 'timestamp': 1534081184515, // timestamp in milliseconds 'datetime': '2018-08-12T13:39:44.515Z', // ISO8601 string of the timestamp 'addressFrom': '0x38b1F8644ED1Dbd5DcAedb3610301Bf5fa640D6f', // sender 'address': '0x02b0a9b7b4cDe774af0f8e47cb4f1c2ccdEa0806', // "from" or "to" 'addressTo': '0x304C68D441EF7EB0E2c056E836E8293BD28F8129', // receiver 'tagFrom', '0xabcdef', // "tag" or "memo" or "payment_id" associated with the sender 'tag': '0xabcdef' // "tag" or "memo" or "payment_id" associated with the address 'tagTo': '0xhijgklmn', // "tag" or "memo" or "payment_id" associated with the receiver 'type': 'deposit', // 'withdrawal' or 'transfer', string 'amount': 1.2345, // float (does not include the fee) 'currency': 'ETH', // a common unified currency code, string 'status': 'pending', // 'ok', 'failed', 'canceled', string 'updated': undefined, // UTC timestamp of most recent status change in ms 'comment': 'a comment or message defined by the user if any', 'fee': { // the entire fee structure may be undefined 'currency': 'ETH', // a unified fee currency code 'cost': 0.1234, // float 'rate': undefined, // approximately, fee['cost'] / amount, float }, }"><pre><span class="pl-kos">{</span> <span class="pl-s">'info'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// the JSON response from the exchange as is</span> <span class="pl-s">'id'</span>: <span class="pl-s">'123456'</span><span class="pl-kos">,</span> <span class="pl-c">// exchange-specific transaction id, string</span> <span class="pl-s">'txid'</span>: <span class="pl-s">'0x68bfb29821c50ca35ef3762f887fd3211e4405aba1a94e448a4f218b850358f0'</span><span class="pl-kos">,</span> <span class="pl-s">'timestamp'</span>: <span class="pl-c1">1534081184515</span><span class="pl-kos">,</span> <span class="pl-c">// timestamp in milliseconds</span> <span class="pl-s">'datetime'</span>: <span class="pl-s">'2018-08-12T13:39:44.515Z'</span><span class="pl-kos">,</span> <span class="pl-c">// ISO8601 string of the timestamp</span> <span class="pl-s">'addressFrom'</span>: <span class="pl-s">'0x38b1F8644ED1Dbd5DcAedb3610301Bf5fa640D6f'</span><span class="pl-kos">,</span> <span class="pl-c">// sender</span> <span class="pl-s">'address'</span>: <span class="pl-s">'0x02b0a9b7b4cDe774af0f8e47cb4f1c2ccdEa0806'</span><span class="pl-kos">,</span> <span class="pl-c">// "from" or "to"</span> <span class="pl-s">'addressTo'</span>: <span class="pl-s">'0x304C68D441EF7EB0E2c056E836E8293BD28F8129'</span><span class="pl-kos">,</span> <span class="pl-c">// receiver</span> <span class="pl-s">'tagFrom'</span><span class="pl-kos">,</span> <span class="pl-s">'0xabcdef'</span><span class="pl-kos">,</span> <span class="pl-c">// "tag" or "memo" or "payment_id" associated with the sender</span> <span class="pl-s">'tag'</span>: <span class="pl-s">'0xabcdef'</span> <span class="pl-c">// "tag" or "memo" or "payment_id" associated with the address</span> <span class="pl-s">'tagTo'</span>: <span class="pl-s">'0xhijgklmn'</span><span class="pl-kos">,</span> <span class="pl-c">// "tag" or "memo" or "payment_id" associated with the receiver</span> <span class="pl-s">'type'</span>: <span class="pl-s">'deposit'</span><span class="pl-kos">,</span> <span class="pl-c">// 'withdrawal' or 'transfer', string</span> <span class="pl-s">'amount'</span>: <span class="pl-c1">1.2345</span><span class="pl-kos">,</span> <span class="pl-c">// float (does not include the fee)</span> <span class="pl-s">'currency'</span>: <span class="pl-s">'ETH'</span><span class="pl-kos">,</span> <span class="pl-c">// a common unified currency code, string</span> <span class="pl-s">'status'</span>: <span class="pl-s">'pending'</span><span class="pl-kos">,</span> <span class="pl-c">// 'ok', 'failed', 'canceled', string</span> <span class="pl-s">'updated'</span>: <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-c">// UTC timestamp of most recent status change in ms</span> <span class="pl-s">'comment'</span>: <span class="pl-s">'a comment or message defined by the user if any'</span><span class="pl-kos">,</span> <span class="pl-s">'fee'</span>: <span class="pl-kos">{</span> <span class="pl-c">// the entire fee structure may be undefined</span> <span class="pl-s">'currency'</span>: <span class="pl-s">'ETH'</span><span class="pl-kos">,</span> <span class="pl-c">// a unified fee currency code</span> <span class="pl-s">'cost'</span>: <span class="pl-c1">0.1234</span><span class="pl-kos">,</span> <span class="pl-c">// float</span> <span class="pl-s">'rate'</span>: <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-c">// approximately, fee['cost'] / amount, float</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h4 class="heading-element">Notes On Transaction Structure</h4><a id="user-content-notes-on-transaction-structure" class="anchor" aria-label="Permalink: Notes On Transaction Structure" href="#notes-on-transaction-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <ul> <li> <code>addressFrom</code> or <code>addressTo</code> may be <code>undefined/None/null</code>, if the exchange in question does not specify all sides of the transaction</li> <li>The semantics of the <code>address</code> field is exchange-specific. In some cases it can contain the address of the sender, in other cases it may contain the address of the receiver. The actual value depends on the exchange.</li> <li>The <code>updated</code> field is the UTC timestamp in milliseconds of the most recent change of status of that funding operation, be it <code>withdrawal</code> or <code>deposit</code>. It is necessary if you want to track your changes in time, beyond a static snapshot. For example, if the exchange in question reports <code>created_at</code> and <code>confirmed_at</code> for a transaction, then the <code>updated</code> field will take the value of <code>Math.max (created_at, confirmed_at)</code>, that is, the timestamp of the most recent change of the status.</li> <li>The <code>updated</code> field may be <code>undefined/None/null</code> in certain exchange-specific cases.</li> <li>The <code>fee</code> substructure may be missing, if not supplied within the reply coming from the exchange.</li> <li>The <code>comment</code> field may be <code>undefined/None/null</code>, otherwise it will contain a message or note defined by the user upon creating the transaction.</li> <li>Be careful when handling the <code>tag</code> and the <code>address</code>. The <code>tag</code> is <strong>NOT an arbitrary user-defined string</strong> of your choice! You cannot send user messages and comments in the <code>tag</code>. The purpose of the <code>tag</code> field is to address your wallet properly, so it must be correct. You should only use the <code>tag</code> received from the exchange you're working with, otherwise your transaction might never arrive to its destination.</li> <li>The <code>type</code> field may be <code>deposit/withdrawal</code> or, in some cases (when the exchange's endpoint returns both internal transfers and blockchain transactions, e.g. <code>ccxt.coinlist</code>), could be <code>transfer</code>.</li> </ul> <div class="markdown-heading"><h3 class="heading-element">fetchDeposits Examples</h3><a id="user-content-fetchdeposits-examples" class="anchor" aria-label="Permalink: fetchDeposits Examples" href="#fetchdeposits-examples"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-44" class="anchor" aria-label="Permalink: Javascript" href="#javascript-44"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// fetchDeposits (code = undefined, since = undefined, limit = undefined, params = {}) if (exchange.has['fetchDeposits']) { const deposits = await exchange.fetchDeposits (code, since, limit, params) } else { throw new Error (exchange.id + ' does not have the fetchDeposits method') }"><pre><span class="pl-c">// fetchDeposits (code = undefined, since = undefined, limit = undefined, params = {})</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">has</span><span class="pl-kos">[</span><span class="pl-s">'fetchDeposits'</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-s1">deposits</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchDeposits</span> <span class="pl-kos">(</span><span class="pl-s1">code</span><span class="pl-kos">,</span> <span class="pl-s1">since</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span> <span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span> <span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-v">Error</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">id</span> <span class="pl-c1">+</span> <span class="pl-s">' does not have the fetchDeposits method'</span><span class="pl-kos">)</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-44" class="anchor" aria-label="Permalink: Python" href="#python-44"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# fetch_deposits(code = None, since = None, limit = None, params = {}) if exchange.has['fetchDeposits']: deposits = exchange.fetch_deposits(code, since, limit, params) else: raise Exception (exchange.id + ' does not have the fetch_deposits method')"><pre><span class="pl-c"># fetch_deposits(code = None, since = None, limit = None, params = {})</span> <span class="pl-k">if</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">has</span>[<span class="pl-s">'fetchDeposits'</span>]: <span class="pl-s1">deposits</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">fetch_deposits</span>(<span class="pl-s1">code</span>, <span class="pl-s1">since</span>, <span class="pl-s1">limit</span>, <span class="pl-s1">params</span>) <span class="pl-k">else</span>: <span class="pl-k">raise</span> <span class="pl-en">Exception</span> (<span class="pl-s1">exchange</span>.<span class="pl-c1">id</span> <span class="pl-c1">+</span> <span class="pl-s">' does not have the fetch_deposits method'</span>)</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-42" class="anchor" aria-label="Permalink: PHP" href="#php-42"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// fetch_deposits ($code = null, $since = null, $limit = null, $params = {}) if ($exchange->has['fetchDeposits']) { $deposits = $exchange->fetch_deposits ($code, $since, $limit, $params); } else { throw new Exception ($exchange->id . ' does not have the fetch_deposits method'); }"><pre><span class="pl-c">// fetch_deposits ($code = null, $since = null, $limit = null, $params = {})</span> <span class="pl-k">if</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">has</span>[<span class="pl-s">'<span class="pl-s">fetchDeposits</span>'</span>]) { <span class="pl-s1"><span class="pl-c1">$</span>deposits</span> = <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">fetch_deposits</span> (<span class="pl-s1"><span class="pl-c1">$</span>code</span>, <span class="pl-s1"><span class="pl-c1">$</span>since</span>, <span class="pl-s1"><span class="pl-c1">$</span>limit</span>, <span class="pl-s1"><span class="pl-c1">$</span>params</span>); } <span class="pl-k">else</span> { <span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-v">Exception</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">id</span> . <span class="pl-s">'<span class="pl-s"> does not have the fetch_deposits method</span>'</span>); }</pre></div> <div class="markdown-heading"><h3 class="heading-element">fetchWithdrawals Examples</h3><a id="user-content-fetchwithdrawals-examples" class="anchor" aria-label="Permalink: fetchWithdrawals Examples" href="#fetchwithdrawals-examples"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-45" class="anchor" aria-label="Permalink: Javascript" href="#javascript-45"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// fetchWithdrawals (code = undefined, since = undefined, limit = undefined, params = {}) if (exchange.has['fetchWithdrawals']) { const withdrawals = await exchange.fetchWithdrawals (code, since, limit, params) } else { throw new Error (exchange.id + ' does not have the fetchWithdrawals method') }"><pre><span class="pl-c">// fetchWithdrawals (code = undefined, since = undefined, limit = undefined, params = {})</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">has</span><span class="pl-kos">[</span><span class="pl-s">'fetchWithdrawals'</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-s1">withdrawals</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchWithdrawals</span> <span class="pl-kos">(</span><span class="pl-s1">code</span><span class="pl-kos">,</span> <span class="pl-s1">since</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span> <span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span> <span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-v">Error</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">id</span> <span class="pl-c1">+</span> <span class="pl-s">' does not have the fetchWithdrawals method'</span><span class="pl-kos">)</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-45" class="anchor" aria-label="Permalink: Python" href="#python-45"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# fetch_withdrawals(code = None, since = None, limit = None, params = {}) if exchange.has['fetchWithdrawals']: withdrawals = exchange.fetch_withdrawals(code, since, limit, params) else: raise Exception (exchange.id + ' does not have the fetch_withdrawals method')"><pre><span class="pl-c"># fetch_withdrawals(code = None, since = None, limit = None, params = {})</span> <span class="pl-k">if</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">has</span>[<span class="pl-s">'fetchWithdrawals'</span>]: <span class="pl-s1">withdrawals</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">fetch_withdrawals</span>(<span class="pl-s1">code</span>, <span class="pl-s1">since</span>, <span class="pl-s1">limit</span>, <span class="pl-s1">params</span>) <span class="pl-k">else</span>: <span class="pl-k">raise</span> <span class="pl-en">Exception</span> (<span class="pl-s1">exchange</span>.<span class="pl-c1">id</span> <span class="pl-c1">+</span> <span class="pl-s">' does not have the fetch_withdrawals method'</span>)</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-43" class="anchor" aria-label="Permalink: PHP" href="#php-43"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// fetch_withdrawals ($code = null, $since = null, $limit = null, $params = {}) if ($exchange->has['fetchWithdrawals']) { $withdrawals = $exchange->fetch_withdrawals ($code, $since, $limit, $params); } else { throw new Exception ($exchange->id . ' does not have the fetch_withdrawals method'); }"><pre><span class="pl-c">// fetch_withdrawals ($code = null, $since = null, $limit = null, $params = {})</span> <span class="pl-k">if</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">has</span>[<span class="pl-s">'<span class="pl-s">fetchWithdrawals</span>'</span>]) { <span class="pl-s1"><span class="pl-c1">$</span>withdrawals</span> = <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">fetch_withdrawals</span> (<span class="pl-s1"><span class="pl-c1">$</span>code</span>, <span class="pl-s1"><span class="pl-c1">$</span>since</span>, <span class="pl-s1"><span class="pl-c1">$</span>limit</span>, <span class="pl-s1"><span class="pl-c1">$</span>params</span>); } <span class="pl-k">else</span> { <span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-v">Exception</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">id</span> . <span class="pl-s">'<span class="pl-s"> does not have the fetch_withdrawals method</span>'</span>); }</pre></div> <div class="markdown-heading"><h3 class="heading-element">fetchTransactions Examples</h3><a id="user-content-fetchtransactions-examples" class="anchor" aria-label="Permalink: fetchTransactions Examples" href="#fetchtransactions-examples"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-46" class="anchor" aria-label="Permalink: Javascript" href="#javascript-46"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// fetchTransactions (code = undefined, since = undefined, limit = undefined, params = {}) if (exchange.has['fetchTransactions']) { const transactions = await exchange.fetchTransactions (code, since, limit, params) } else { throw new Error (exchange.id + ' does not have the fetchTransactions method') }"><pre><span class="pl-c">// fetchTransactions (code = undefined, since = undefined, limit = undefined, params = {})</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">has</span><span class="pl-kos">[</span><span class="pl-s">'fetchTransactions'</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-s1">transactions</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchTransactions</span> <span class="pl-kos">(</span><span class="pl-s1">code</span><span class="pl-kos">,</span> <span class="pl-s1">since</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span> <span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span> <span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-v">Error</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">id</span> <span class="pl-c1">+</span> <span class="pl-s">' does not have the fetchTransactions method'</span><span class="pl-kos">)</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-46" class="anchor" aria-label="Permalink: Python" href="#python-46"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# fetch_transactions(code = None, since = None, limit = None, params = {}) if exchange.has['fetchTransactions']: transactions = exchange.fetch_transactions(code, since, limit, params) else: raise Exception (exchange.id + ' does not have the fetch_transactions method')"><pre><span class="pl-c"># fetch_transactions(code = None, since = None, limit = None, params = {})</span> <span class="pl-k">if</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">has</span>[<span class="pl-s">'fetchTransactions'</span>]: <span class="pl-s1">transactions</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">fetch_transactions</span>(<span class="pl-s1">code</span>, <span class="pl-s1">since</span>, <span class="pl-s1">limit</span>, <span class="pl-s1">params</span>) <span class="pl-k">else</span>: <span class="pl-k">raise</span> <span class="pl-en">Exception</span> (<span class="pl-s1">exchange</span>.<span class="pl-c1">id</span> <span class="pl-c1">+</span> <span class="pl-s">' does not have the fetch_transactions method'</span>)</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-44" class="anchor" aria-label="Permalink: PHP" href="#php-44"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// fetch_transactions ($code = null, $since = null, $limit = null, $params = {}) if ($exchange->has['fetchTransactions']) { $transactions = $exchange->fetch_transactions ($code, $since, $limit, $params); } else { throw new Exception ($exchange->id . ' does not have the fetch_transactions method'); }"><pre><span class="pl-c">// fetch_transactions ($code = null, $since = null, $limit = null, $params = {})</span> <span class="pl-k">if</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">has</span>[<span class="pl-s">'<span class="pl-s">fetchTransactions</span>'</span>]) { <span class="pl-s1"><span class="pl-c1">$</span>transactions</span> = <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">fetch_transactions</span> (<span class="pl-s1"><span class="pl-c1">$</span>code</span>, <span class="pl-s1"><span class="pl-c1">$</span>since</span>, <span class="pl-s1"><span class="pl-c1">$</span>limit</span>, <span class="pl-s1"><span class="pl-c1">$</span>params</span>); } <span class="pl-k">else</span> { <span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-v">Exception</span> (<span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">id</span> . <span class="pl-s">'<span class="pl-s"> does not have the fetch_transactions method</span>'</span>); }</pre></div> <div class="markdown-heading"><h2 class="heading-element">Deposit Addresses</h2><a id="user-content-deposit-addresses" class="anchor" aria-label="Permalink: Deposit Addresses" href="#deposit-addresses"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The address for depositing can be either an already existing address that was created previously with the exchange or it can be created upon request. In order to see which of the two methods are supported, check the <code>exchange.has['fetchDepositAddress']</code> and <code>exchange.has['createDepositAddress']</code> properties.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchDepositAddress (code, params = {}) createDepositAddress (code, params = {})"><pre><span class="pl-en">fetchDepositAddress</span> <span class="pl-kos">(</span><span class="pl-s1">code</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-en">createDepositAddress</span> <span class="pl-kos">(</span><span class="pl-s1">code</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>code</strong> (String) <em>required</em> Unified CCXT currency code (e.g. <code>"USDT"</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>an <a href="#address-structure">address structure</a> </li> </ul> <hr> <p>Some exchanges may also have a method for fetching multiple deposit addresses at once or all of them at once.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchDepositAddresses (codes = undefined, params = {})"><pre><span class="pl-en">fetchDepositAddresses</span> <span class="pl-kos">(</span><span class="pl-s1">codes</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>code</strong> ([String]) Array of unified CCXT currency codes. May or may not be required depending on the exchange (e.g. <code>["USDT", "BTC"]</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>an array of <a href="#address-structure">address structures</a> </li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchDepositAddressesByNetwork (code, params = {})"><pre><span class="pl-en">fetchDepositAddressesByNetwork</span> <span class="pl-kos">(</span><span class="pl-s1">code</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>code</strong> (String) <em>required</em> Unified CCXT currency code (e.g. <code>"USDT"</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>an array of <a href="#address-structure">address structures</a> </li> </ul> <div class="markdown-heading"><h3 class="heading-element">Address Structure</h3><a id="user-content-address-structure" class="anchor" aria-label="Permalink: Address Structure" href="#address-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The address structures returned from <code>fetchDepositAddress</code>, <code>fetchDepositAddresses</code>, <code>fetchDepositAddressesByNetwork</code> and <code>createDepositAddress</code> look like this:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ 'info': response, // raw unparsed data as returned from the exchange 'currency': 'USDC', // currency code 'network': 'ERC20', // a deposit/withdraw networks, ERC20, TRC20, BSC20 (see below) 'address': '0x', // blockchain address in terms of the requested currency and network 'tag': undefined, // tag / memo / paymentId for particular currencies (XRP, XMR, ...) }"><pre><span class="pl-kos">{</span> <span class="pl-s">'info'</span>: <span class="pl-s1">response</span><span class="pl-kos">,</span> <span class="pl-c">// raw unparsed data as returned from the exchange</span> <span class="pl-s">'currency'</span>: <span class="pl-s">'USDC'</span><span class="pl-kos">,</span> <span class="pl-c">// currency code</span> <span class="pl-s">'network'</span>: <span class="pl-s">'ERC20'</span><span class="pl-kos">,</span> <span class="pl-c">// a deposit/withdraw networks, ERC20, TRC20, BSC20 (see below)</span> <span class="pl-s">'address'</span>: <span class="pl-s">'0x'</span><span class="pl-kos">,</span> <span class="pl-c">// blockchain address in terms of the requested currency and network</span> <span class="pl-s">'tag'</span>: <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-c">// tag / memo / paymentId for particular currencies (XRP, XMR, ...)</span> <span class="pl-kos">}</span></pre></div> <p>With certain currencies, like AEON, BTS, GXS, NXT, SBD, STEEM, STR, XEM, XLM, XMR, XRP, an additional argument <code>tag</code> is usually required by exchanges. Other currencies will have the <code>tag</code> set to <code>undefined / None / null</code>. The tag is a memo or a message or a payment id that is attached to a withdrawal transaction. The tag is mandatory for those currencies and it identifies the recipient user account.</p> <p>Be careful when specifying the <code>tag</code> and the <code>address</code>. The <code>tag</code> is <strong>NOT an arbitrary user-defined string</strong> of your choice! You cannot send user messages and comments in the <code>tag</code>. The purpose of the <code>tag</code> field is to address your wallet properly, so it must be correct. You should only use the <code>tag</code> received from the exchange you're working with, otherwise your transaction might never arrive to its destination.</p> <p><strong>The <code>network</code> field is relatively new, it may be <code>undefined / None / null</code> or missing entirely in certain cases (with some exchanges), but will be added everywhere eventually. It is still in the process of unification.</strong></p> <div class="markdown-heading"><h2 class="heading-element">Transfers</h2><a id="user-content-transfers" class="anchor" aria-label="Permalink: Transfers" href="#transfers"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The <code>transfer</code> method makes internal transfers of funds between accounts on the same exchange. This can include subaccounts or accounts of different types (<code>spot</code>, <code>margin</code>, <code>future</code>, ...). If an exchange is separated on CCXT into a spot and futures class (e.g. <code>binanceusdm</code>, <code>kucoinfutures</code>, ...), then the method <code>transferIn</code> may be available to transfer funds into the futures account, and the method <code>transferOut</code> may be available to transfer funds out of the futures account</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="transfer (code, amount, fromAccount, toAccount, params = {})"><pre><span class="pl-en">transfer</span> <span class="pl-kos">(</span><span class="pl-s1">code</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">fromAccount</span><span class="pl-kos">,</span> <span class="pl-s1">toAccount</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>code</strong> (String) Unified CCXT currency code (e.g. <code>"USDT"</code>)</li> <li> <strong>amount</strong> (Float) The amount of currency to transfer (e.g. <code>10.5</code>)</li> <li> <strong>fromAccount</strong> (String) The account to transfer funds from.</li> <li> <strong>toAccount</strong> (String) The account to transfer funds to.</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> <li> <strong>params.symbol</strong> (String) Market symbol when transfering to or from a margin account (e.g. <code>'BTC/USDT'</code>)</li> </ul> <div class="markdown-heading"><h3 class="heading-element">Account Types</h3><a id="user-content-account-types" class="anchor" aria-label="Permalink: Account Types" href="#account-types"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><code>fromAccount</code> and <code>toAccount</code> can accept the exchange account id or one of the following unified values:</p> <ul> <li> <code>funding</code> <em>for some exchanges <code>funding</code> and <code>spot</code> are the same account</em> </li> <li> <code>main</code> <em>for some exchanges that allow for subaccounts</em> </li> <li><code>spot</code></li> <li><code>margin</code></li> <li><code>future</code></li> <li><code>swap</code></li> <li><code>lending</code></li> </ul> <p>You can retrieve all the account types by selecting the keys from `exchange.options['accountsByType']</p> <p>Some exchanges allow transfers to email addresses, phone numbers or to other users by user id.</p> <p>Returns</p> <ul> <li>A <a href="#transfer-structure">transfer structure</a> </li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="transferIn (code, amount, params = {}) transferOut (code, amount, params = {})"><pre><span class="pl-en">transferIn</span> <span class="pl-kos">(</span><span class="pl-s1">code</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-en">transferOut</span> <span class="pl-kos">(</span><span class="pl-s1">code</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>code</strong> (String) Unified CCXT currency code (e.g. <code>"USDT"</code>)</li> <li> <strong>amount</strong> (Float) The amount of currency to transfer (e.g. <code>10.5</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>A <a href="#transfer-structure">transfer structure</a> </li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchTransfers (code = undefined, since = undefined, limit = undefined, params = {})"><pre><span class="pl-en">fetchTransfers</span> <span class="pl-kos">(</span><span class="pl-s1">code</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>code</strong> (String) Unified CCXT currency code (e.g. <code>"USDT"</code>)</li> <li> <strong>since</strong> (Integer) Timestamp (ms) of the earliest time to retrieve transfers for (e.g. <code>1646940314000</code>)</li> <li> <strong>limit</strong> (Integer) The number of <a href="#transfer-structure">transfer structures</a> to retrieve (e.g. <code>5</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>An array of <a href="#transfer-structure">transfer structures</a> </li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchTransfer (id, since = undefined, limit = undefined, params = {})"><pre><span class="pl-en">fetchTransfer</span> <span class="pl-kos">(</span><span class="pl-s1">id</span><span class="pl-kos">,</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>id</strong> (String) tranfer id (e.g. <code>"12345"</code>)</li> <li> <strong>since</strong> (Integer) Timestamp (ms) of the earliest time to retrieve transfers for (e.g. <code>1646940314000</code>)</li> <li> <strong>limit</strong> (Integer) The number of <a href="#transfer-structure">transfer structures</a> to retrieve (e.g. <code>5</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>A <a href="#transfer-structure">transfer structure</a> </li> </ul> <div class="markdown-heading"><h3 class="heading-element">Transfer Structure</h3><a id="user-content-transfer-structure" class="anchor" aria-label="Permalink: Transfer Structure" href="#transfer-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ info: { ... }, id: "93920432048", timestamp: 1646764072000, datetime: "2022-03-08T18:27:52.000Z", currency: "USDT", amount: 11.31, fromAccount: "spot", toAccount: "future", status: "ok" }"><pre><span class="pl-kos">{</span> <span class="pl-c1">info</span>: <span class="pl-kos">{</span> ...<span class="pl-s1"></span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">id</span>: <span class="pl-s">"93920432048"</span><span class="pl-kos">,</span> <span class="pl-c1">timestamp</span>: <span class="pl-c1">1646764072000</span><span class="pl-kos">,</span> <span class="pl-c1">datetime</span>: <span class="pl-s">"2022-03-08T18:27:52.000Z"</span><span class="pl-kos">,</span> <span class="pl-c1">currency</span>: <span class="pl-s">"USDT"</span><span class="pl-kos">,</span> <span class="pl-c1">amount</span>: <span class="pl-c1">11.31</span><span class="pl-kos">,</span> <span class="pl-c1">fromAccount</span>: <span class="pl-s">"spot"</span><span class="pl-kos">,</span> <span class="pl-c1">toAccount</span>: <span class="pl-s">"future"</span><span class="pl-kos">,</span> <span class="pl-c1">status</span>: <span class="pl-s">"ok"</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Fees</h2><a id="user-content-fees" class="anchor" aria-label="Permalink: Fees" href="#fees"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><strong>This section of the Unified CCXT API is under development.</strong></p> <p>Fees are often grouped into two categories:</p> <ul> <li>Trading fees. Trading fee is the amount payable to the exchange, usually a percentage of volume traded (filled).</li> <li>Transaction fees. The amount payable to the exchange upon depositing and withdrawing as well as the underlying crypto transaction fees (tx fees).</li> </ul> <p>Because the fee structure can depend on the actual volume of currencies traded by the user, the fees can be account-specific. Methods to work with account-specific fees:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchTradingFee (symbol, params = {}) fetchTradingFees (params = {}) fetchDepositWithdrawFees (codes = undefined, params = {}) fetchDepositWithdrawFee (code, params = {})"><pre><span class="pl-en">fetchTradingFee</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-en">fetchTradingFees</span> <span class="pl-kos">(</span><span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-en">fetchDepositWithdrawFees</span> <span class="pl-kos">(</span><span class="pl-s1">codes</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-en">fetchDepositWithdrawFee</span> <span class="pl-kos">(</span><span class="pl-s1">code</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>The fee methods will return a unified fee structure, which is often present with orders and trades as well. The fee structure is a common format for representing the fee info throughout the library. Fee structures are usually indexed by market or currency.</p> <p>Because this is still a work in progress, some or all of methods and info described in this section may be missing with this or that exchange.</p> <p><strong>DO NOT use the <code>.fees</code> property of the exchange instance as most often it contains the predefined/hardcoded info. Actual fees should only be accessed from markets and currencies.</strong></p> <p><strong>NOTE: Previously we used fetchTransactionFee(s) to fetch the transaction fees, which are now DEPRECATED and these functions have been replace by fetchDepositWithdrawFee(s)</strong></p> <p>You call <code>fetchTradingFee</code> / <code>fetchTradingFees</code> to fetch the trading fees, <code>fetchDepositWithdrawFee</code> / <code>fetchDepositWithdrawFees</code> to fetch the deposit & withdraw fees.</p> <div class="markdown-heading"><h3 class="heading-element">Fee Structure</h3><a id="user-content-fee-structure" class="anchor" aria-label="Permalink: Fee Structure" href="#fee-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Orders, private trades, transactions and ledger entries may define the following info in their <code>fee</code> field:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ 'currency': 'BTC', // the unified fee currency code 'rate': percentage, // the fee rate, 0.05% = 0.0005, 1% = 0.01, ... 'cost': feePaid, // the fee cost (amount * fee rate) }"><pre><span class="pl-kos">{</span> <span class="pl-s">'currency'</span>: <span class="pl-s">'BTC'</span><span class="pl-kos">,</span> <span class="pl-c">// the unified fee currency code</span> <span class="pl-s">'rate'</span>: <span class="pl-s1">percentage</span><span class="pl-kos">,</span> <span class="pl-c">// the fee rate, 0.05% = 0.0005, 1% = 0.01, ...</span> <span class="pl-s">'cost'</span>: <span class="pl-s1">feePaid</span><span class="pl-kos">,</span> <span class="pl-c">// the fee cost (amount * fee rate)</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Fee Schedule</h3><a id="user-content-fee-schedule" class="anchor" aria-label="Permalink: Fee Schedule" href="#fee-schedule"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchTradingFees (params = {})"><pre><span class="pl-en">fetchTradingFees</span> <span class="pl-kos">(</span><span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ 'withdraw': { 'BTC': 0.00001, 'ETH': 0.001, 'LTC': 0.0003, }, 'deposit': { 'BTC': 0, }, 'info': { ... }, }"><pre><span class="pl-kos">{</span> <span class="pl-s">'withdraw'</span>: <span class="pl-kos">{</span> <span class="pl-s">'BTC'</span>: <span class="pl-c1">0.00001</span><span class="pl-kos">,</span> <span class="pl-s">'ETH'</span>: <span class="pl-c1">0.001</span><span class="pl-kos">,</span> <span class="pl-s">'LTC'</span>: <span class="pl-c1">0.0003</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'deposit'</span>: <span class="pl-kos">{</span> <span class="pl-s">'BTC'</span>: <span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'info'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">}</span></pre></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchDepositWithdrawFees (codes, params = {})"><pre><span class="pl-en">fetchDepositWithdrawFees</span> <span class="pl-kos">(</span><span class="pl-s1">codes</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ 'BTC': { 'withdraw': { 'fee': 0.0005, 'percentage': false }, 'deposit': { 'fee': undefined, 'percentage': undefined }, 'networks': { 'BTC': { 'deposit': { 'fee': undefined, 'percentage': undefined }, 'withdraw': { 'fee': 0.0005, 'percentage': false } } }, 'info': { ... }, }, ... }"><pre><span class="pl-kos">{</span> <span class="pl-s">'BTC'</span>: <span class="pl-kos">{</span> <span class="pl-s">'withdraw'</span>: <span class="pl-kos">{</span> <span class="pl-s">'fee'</span>: <span class="pl-c1">0.0005</span><span class="pl-kos">,</span> <span class="pl-s">'percentage'</span>: <span class="pl-c1">false</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'deposit'</span>: <span class="pl-kos">{</span> <span class="pl-s">'fee'</span>: <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s">'percentage'</span>: <span class="pl-c1">undefined</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'networks'</span>: <span class="pl-kos">{</span> <span class="pl-s">'BTC'</span>: <span class="pl-kos">{</span> <span class="pl-s">'deposit'</span>: <span class="pl-kos">{</span> <span class="pl-s">'fee'</span>: <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s">'percentage'</span>: <span class="pl-c1">undefined</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'withdraw'</span>: <span class="pl-kos">{</span> <span class="pl-s">'fee'</span>: <span class="pl-c1">0.0005</span><span class="pl-kos">,</span> <span class="pl-s">'percentage'</span>: <span class="pl-c1">false</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'info'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> ... <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Trading Fees</h3><a id="user-content-trading-fees" class="anchor" aria-label="Permalink: Trading Fees" href="#trading-fees"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Trading fees are properties of markets. Most often trading fees are loaded into the markets by the <code>fetchMarkets</code> call. Sometimes, however, the exchanges serve fees from different endpoints.</p> <p>The <code>calculateFee</code> method can be used to precalculate trading fees that will be paid. <strong>WARNING! This method is experimental, unstable and may produce incorrect results in certain cases.</strong> You should only use it with caution. Actual fees may be different from the values returned from <code>calculateFee</code>, this is just for precalculation. Do not rely on precalculated values, because market conditions change frequently. It is difficult to know in advance whether your order will be a market taker or maker.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" calculateFee (symbol, type, side, amount, price, takerOrMaker = 'taker', params = {})"><pre> <span class="pl-en">calculateFee</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">type</span><span class="pl-kos">,</span> <span class="pl-s1">side</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">price</span><span class="pl-kos">,</span> <span class="pl-s1">takerOrMaker</span> <span class="pl-c1">=</span> <span class="pl-s">'taker'</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>The <code>calculateFee</code> method will return a unified fee structure with precalculated fees for an order with specified params.</p> <p>Accessing trading fee rates should be done via <a href="#fee-schedule"><code>fetchTradingFees</code></a> which is the recommended approach. If that method is not supported by exchange, then via the <code>.markets</code> property, like so:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="exchange.markets['ETH/BTC']['taker'] // taker fee rate for ETH/BTC exchange.markets['BTC/USD']['maker'] // maker fee rate for BTC/USD"><pre><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">markets</span><span class="pl-kos">[</span><span class="pl-s">'ETH/BTC'</span><span class="pl-kos">]</span><span class="pl-kos">[</span><span class="pl-s">'taker'</span><span class="pl-kos">]</span> <span class="pl-c">// taker fee rate for ETH/BTC</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">markets</span><span class="pl-kos">[</span><span class="pl-s">'BTC/USD'</span><span class="pl-kos">]</span><span class="pl-kos">[</span><span class="pl-s">'maker'</span><span class="pl-kos">]</span> <span class="pl-c">// maker fee rate for BTC/USD</span></pre></div> <p>The markets stored under the <code>.markets</code> property may contain additional fee related information:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ 'taker': 0.002, // taker fee rate, 0.002 = 0.2% 'maker': 0.0016, // maker fee rate, 0.0016 = 0.16% 'percentage': true, // whether the taker and maker fee rate is a multiplier or a fixed flat amount 'tierBased': false, // whether the fee depends on your trading tier (your trading volume) 'tiers': { 'taker': [ [0, 0.0026], // tupple (trade volume in USD, taker fee) ordered by increasing volume [50000, 0.0024], ... ], 'maker': [ [0, 0.0016], // tupple (trade volume in USD, maker fee) ordered by increasing volume [50000, 0.0014], ... ], }, }"><pre><span class="pl-kos">{</span> <span class="pl-s">'taker'</span>: <span class="pl-c1">0.002</span><span class="pl-kos">,</span> <span class="pl-c">// taker fee rate, 0.002 = 0.2%</span> <span class="pl-s">'maker'</span>: <span class="pl-c1">0.0016</span><span class="pl-kos">,</span> <span class="pl-c">// maker fee rate, 0.0016 = 0.16%</span> <span class="pl-s">'percentage'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c">// whether the taker and maker fee rate is a multiplier or a fixed flat amount</span> <span class="pl-s">'tierBased'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c">// whether the fee depends on your trading tier (your trading volume)</span> <span class="pl-s">'tiers'</span>: <span class="pl-kos">{</span> <span class="pl-s">'taker'</span>: <span class="pl-kos">[</span> <span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-c1">0.0026</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-c">// tupple (trade volume in USD, taker fee) ordered by increasing volume</span> <span class="pl-kos">[</span><span class="pl-c1">50000</span><span class="pl-kos">,</span> <span class="pl-c1">0.0024</span><span class="pl-kos">]</span><span class="pl-kos">,</span> ... <span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-s">'maker'</span>: <span class="pl-kos">[</span> <span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-c1">0.0016</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-c">// tupple (trade volume in USD, maker fee) ordered by increasing volume</span> <span class="pl-kos">[</span><span class="pl-c1">50000</span><span class="pl-kos">,</span> <span class="pl-c1">0.0014</span><span class="pl-kos">]</span><span class="pl-kos">,</span> ... <span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">}</span></pre></div> <p><strong>WARNING! fee related information is experimental, unstable and may only be partial available or not at all.</strong></p> <p>Maker fees are paid when you provide liquidity to the exchange i.e. you <em>market-make</em> an order and someone else fills it. Maker fees are usually lower than taker fees. Similarly, taker fees are paid when you <em>take</em> liquidity from the exchange and fill someone else's order.</p> <p>Fees can be negative, this is very common amongst derivative exchanges. A negative fee means the exchange will pay a rebate (reward) to the user for the trading.</p> <p>Also, some exchanges might not specify fees as percentage of volume, check the <code>percentage</code> field of the market to be sure.</p> <div class="markdown-heading"><h4 class="heading-element">Trading Fee Schedule</h4><a id="user-content-trading-fee-schedule" class="anchor" aria-label="Permalink: Trading Fee Schedule" href="#trading-fee-schedule"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Some exchanges have an endpoint for fetching the trading fee schedule, this is mapped to the unified methods <code>fetchTradingFees</code>, and <code>fetchTradingFee</code></p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchTradingFee (symbol, params = {})"><pre><span class="pl-en">fetchTradingFee</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbol</strong> (String) <em>required</em> Unified market symbol (e.g. <code>"BTC/USDT"</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"currency": "quote"}</code>)</li> </ul> <p>Returns</p> <ul> <li>A <a href="#trading-fee-structure">trading fee structure</a> </li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchTradingFees (params = {})"><pre><span class="pl-en">fetchTradingFees</span> <span class="pl-kos">(</span><span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"currency": "quote"}</code>)</li> </ul> <p>Returns</p> <ul> <li>An array of <a href="#trading-fee-structure">trading fee structures</a> </li> </ul> <div class="markdown-heading"><h4 class="heading-element">Trading Fee Structure</h4><a id="user-content-trading-fee-structure" class="anchor" aria-label="Permalink: Trading Fee Structure" href="#trading-fee-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ 'ETH/BTC': { 'maker': 0.001, 'taker': 0.002, 'info': { ... }, 'symbol': 'ETH/BTC', }, 'LTC/BTC': { 'maker': 0.001, 'taker': 0.002, 'info': { ... }, 'symbol': 'LTC/BTC', }, }"><pre><span class="pl-kos">{</span> <span class="pl-s">'ETH/BTC'</span>: <span class="pl-kos">{</span> <span class="pl-s">'maker'</span>: <span class="pl-c1">0.001</span><span class="pl-kos">,</span> <span class="pl-s">'taker'</span>: <span class="pl-c1">0.002</span><span class="pl-kos">,</span> <span class="pl-s">'info'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'symbol'</span>: <span class="pl-s">'ETH/BTC'</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'LTC/BTC'</span>: <span class="pl-kos">{</span> <span class="pl-s">'maker'</span>: <span class="pl-c1">0.001</span><span class="pl-kos">,</span> <span class="pl-s">'taker'</span>: <span class="pl-c1">0.002</span><span class="pl-kos">,</span> <span class="pl-s">'info'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'symbol'</span>: <span class="pl-s">'LTC/BTC'</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Transaction Fees</h3><a id="user-content-transaction-fees" class="anchor" aria-label="Permalink: Transaction Fees" href="#transaction-fees"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Transaction fees are properties of currencies (account balance).</p> <p>Accessing transaction fee rates should be done via the <code>.currencies</code> property. This aspect is not unified yet and is subject to change.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="exchange.currencies['ETH']['fee'] // tx/withdrawal fee rate for ETH exchange.currencies['BTC']['fee'] // tx/withdrawal fee rate for BTC"><pre><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">currencies</span><span class="pl-kos">[</span><span class="pl-s">'ETH'</span><span class="pl-kos">]</span><span class="pl-kos">[</span><span class="pl-s">'fee'</span><span class="pl-kos">]</span> <span class="pl-c">// tx/withdrawal fee rate for ETH</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">currencies</span><span class="pl-kos">[</span><span class="pl-s">'BTC'</span><span class="pl-kos">]</span><span class="pl-kos">[</span><span class="pl-s">'fee'</span><span class="pl-kos">]</span> <span class="pl-c">// tx/withdrawal fee rate for BTC</span></pre></div> <div class="markdown-heading"><h4 class="heading-element">Transaction Fee Schedule</h4><a id="user-content-transaction-fee-schedule" class="anchor" aria-label="Permalink: Transaction Fee Schedule" href="#transaction-fee-schedule"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Some exchanges have an endpoint for fetching the transaction fee schedule, this is mapped to the unified methods</p> <ul> <li> <code>fetchTransactionFee ()</code> for a single transaction fee schedule</li> <li> <code>fetchTransactionFees ()</code> for all transaction fee schedules</li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchTransactionFee (code, params = {})"><pre><span class="pl-en">fetchTransactionFee</span> <span class="pl-kos">(</span><span class="pl-s1">code</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>code</strong> (String) <em>required</em> Unified CCXT currency code, required (e.g. <code>"USDT"</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"type": "deposit"}</code>)</li> <li> <strong>params.network</strong> (String) Specify unified CCXT network (e.g. <code>{"network": "TRC20"}</code>)</li> </ul> <p>Returns</p> <ul> <li>A <a href="#transaction-fee-structure">transaction fee structure</a> </li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchTransactionFees (codes = undefined, params = {})"><pre><span class="pl-en">fetchTransactionFees</span> <span class="pl-kos">(</span><span class="pl-s1">codes</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"type": "deposit"}</code>)</li> </ul> <p>Returns</p> <ul> <li>An array of <a href="#transaction-fee-structure">transaction fee structures</a> </li> </ul> <div class="markdown-heading"><h4 class="heading-element">Transaction Fee Structure</h4><a id="user-content-transaction-fee-structure" class="anchor" aria-label="Permalink: Transaction Fee Structure" href="#transaction-fee-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ 'withdraw': { 'BTC': 0.00001, 'ETH': 0.001, 'LTC': 0.0003, }, 'deposit': { 'BTC': 0, }, 'info': { ... }, }"><pre><span class="pl-kos">{</span> <span class="pl-s">'withdraw'</span>: <span class="pl-kos">{</span> <span class="pl-s">'BTC'</span>: <span class="pl-c1">0.00001</span><span class="pl-kos">,</span> <span class="pl-s">'ETH'</span>: <span class="pl-c1">0.001</span><span class="pl-kos">,</span> <span class="pl-s">'LTC'</span>: <span class="pl-c1">0.0003</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'deposit'</span>: <span class="pl-kos">{</span> <span class="pl-s">'BTC'</span>: <span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'info'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Borrow Interest</h2><a id="user-content-borrow-interest" class="anchor" aria-label="Permalink: Borrow Interest" href="#borrow-interest"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <ul> <li>margin only</li> </ul> <p>To trade with leverage in spot or margin markets, currency must be borrowed as a loan. This borrowed currency must be payed back with interest. To obtain the amount of interest that has accrued you can use the <code>fetchBorrowInterest</code> method</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchBorrowInterest (code = undefined, symbol = undefined, since = undefined, limit = undefined, params = {})"><pre><span class="pl-en">fetchBorrowInterest</span> <span class="pl-kos">(</span><span class="pl-s1">code</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>code</strong> (String) The unified currency code for the currency of the interest (e.g. <code>"USDT"</code>)</li> <li> <strong>symbol</strong> (String) The market symbol of an isolated margin market, if undefined, the interest for cross margin markets is returned (e.g. <code>"BTC/USDT:USDT"</code>)</li> <li> <strong>since</strong> (Integer) Timestamp (ms) of the earliest time to receive interest records for (e.g. <code>1646940314000</code>)</li> <li> <strong>limit</strong> (Integer) The number of <a href="#borrow-interest-structure">borrow interest structures</a> to retrieve (e.g. <code>5</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>An array of <a href="#borrow-interest-structure">borrow interest structures</a> </li> </ul> <div class="markdown-heading"><h3 class="heading-element">Borrow Interest Structure</h3><a id="user-content-borrow-interest-structure" class="anchor" aria-label="Permalink: Borrow Interest Structure" href="#borrow-interest-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ info: { ... } // Unparsed exchange response symbol: 'BTC/USDT', // The market that the interest was accrued in currency: 'USDT', // The currency of the interest interest: 0.00004842, // The amount of interest that was charged interestRate: 0.0002, // The borrow interest rate amountBorrowed: 5.81, // The amount of currency that was borrowed marginMode: 'cross', // The margin mode of the borrowed amount timestamp: 1648699200000, // The timestamp that the interest was charged datetime: '2022-03-31T04:00:00.000Z', // The datetime that the interest was charged }"><pre><span class="pl-kos">{</span> info: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span> <span class="pl-c">// Unparsed exchange response</span> <span class="pl-s1">symbol</span>: <span class="pl-s">'BTC/USDT'</span><span class="pl-kos">,</span> <span class="pl-c">// The market that the interest was accrued in</span> <span class="pl-s1">currency</span>: <span class="pl-s">'USDT'</span><span class="pl-kos">,</span> <span class="pl-c">// The currency of the interest</span> <span class="pl-s1">interest</span>: <span class="pl-c1">0.00004842</span><span class="pl-kos">,</span> <span class="pl-c">// The amount of interest that was charged</span> <span class="pl-s1">interestRate</span>: <span class="pl-c1">0.0002</span><span class="pl-kos">,</span> <span class="pl-c">// The borrow interest rate</span> <span class="pl-s1">amountBorrowed</span>: <span class="pl-c1">5.81</span><span class="pl-kos">,</span> <span class="pl-c">// The amount of currency that was borrowed</span> <span class="pl-s1">marginMode</span>: <span class="pl-s">'cross'</span><span class="pl-kos">,</span> <span class="pl-c">// The margin mode of the borrowed amount</span> <span class="pl-s1">timestamp</span>: <span class="pl-c1">1648699200000</span><span class="pl-kos">,</span> <span class="pl-c">// The timestamp that the interest was charged</span> <span class="pl-s1">datetime</span>: <span class="pl-s">'2022-03-31T04:00:00.000Z'</span><span class="pl-kos">,</span> <span class="pl-c">// The datetime that the interest was charged</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Borrow And Repay Margin</h2><a id="user-content-borrow-and-repay-margin" class="anchor" aria-label="Permalink: Borrow And Repay Margin" href="#borrow-and-repay-margin"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>margin only</em></p> <p>To borrow and repay currency as a margin loan use <code>borrowCrossMargin</code>, <code>borrowIsolatedMargin</code>, <code>repayCrossMargin</code> and <code>repayIsolatedMargin</code>.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="borrowCrossMargin (code, amount, params = {}) repayCrossMargin (code, amount, params = {})"><pre><span class="pl-en">borrowCrossMargin</span> <span class="pl-kos">(</span><span class="pl-s1">code</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-en">repayCrossMargin</span> <span class="pl-kos">(</span><span class="pl-s1">code</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>code</strong> (String) <em>required</em> The unified currency code for the currency to be borrowed or repaid (e.g. <code>"USDT"</code>)</li> <li> <strong>amount</strong> (Float) <em>required</em> The amount of margin to borrow or repay (e.g. <code>20.92</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"rate": 0.002}</code>)</li> </ul> <p>Returns</p> <ul> <li>A <a href="#margin-loan-structure">margin loan structure</a> </li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="borrowIsolatedMargin (symbol, code, amount, params = {}) repayIsolatedMargin (symbol, code, amount, params = {})"><pre><span class="pl-en">borrowIsolatedMargin</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">code</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-en">repayIsolatedMargin</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">code</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbol</strong> (String) <em>required</em> The unified CCXT market symbol of an isolated margin market (e.g. <code>"BTC/USDT"</code>)</li> <li> <strong>code</strong> (String) <em>required</em> The unified currency code for the currency to be borrowed or repaid (e.g. <code>"USDT"</code>)</li> <li> <strong>amount</strong> (Float) <em>required</em> The amount of margin to borrow or repay (e.g. <code>20.92</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"rate": 0.002}</code>)</li> </ul> <p>Returns</p> <ul> <li>A <a href="#margin-loan-structure">margin loan structure</a> </li> </ul> <div class="markdown-heading"><h3 class="heading-element">Margin Loan Structure</h3><a id="user-content-margin-loan-structure" class="anchor" aria-label="Permalink: Margin Loan Structure" href="#margin-loan-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ id: '1234323', // integer, the transaction id currency: 'USDT', // string, the currency that is borrowed or repaid amount: 5.81, // float, the amount of currency that was borrowed or repaid symbol: 'BTC/USDT:USDT', // string, unified market symbol timestamp: 1648699200000, // integer, the timestamp of when the transaction was made datetime: '2022-03-31T04:00:00.000Z', // string, the datetime of when the transaction was made info: { ... } // Unparsed exchange response }"><pre><span class="pl-kos">{</span> <span class="pl-c1">id</span>: <span class="pl-s">'1234323'</span><span class="pl-kos">,</span> <span class="pl-c">// integer, the transaction id</span> <span class="pl-c1">currency</span>: <span class="pl-s">'USDT'</span><span class="pl-kos">,</span> <span class="pl-c">// string, the currency that is borrowed or repaid</span> <span class="pl-c1">amount</span>: <span class="pl-c1">5.81</span><span class="pl-kos">,</span> <span class="pl-c">// float, the amount of currency that was borrowed or repaid</span> <span class="pl-c1">symbol</span>: <span class="pl-s">'BTC/USDT:USDT'</span><span class="pl-kos">,</span> <span class="pl-c">// string, unified market symbol</span> <span class="pl-c1">timestamp</span>: <span class="pl-c1">1648699200000</span><span class="pl-kos">,</span> <span class="pl-c">// integer, the timestamp of when the transaction was made</span> <span class="pl-c1">datetime</span>: <span class="pl-s">'2022-03-31T04:00:00.000Z'</span><span class="pl-kos">,</span> <span class="pl-c">// string, the datetime of when the transaction was made</span> <span class="pl-c1">info</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span> <span class="pl-c">// Unparsed exchange response</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Margin</h2><a id="user-content-margin" class="anchor" aria-label="Permalink: Margin" href="#margin"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>margin and contract only</em></p> <p>Note: through the manual we use term "collateral" which means current margin balance, but do not confuse it with "initial margin" or "maintenance margin":</p> <ul> <li> <code>collateral (current margin balance) = initial margin + realized & unrealized profit</code>.</li> </ul> <p>For example, when you had opened an isolated position with <strong>50$</strong> initial margin and the position has unrealized profit of <strong>-15$</strong>, then your position's <strong>collateral</strong> will be <strong>35$</strong>. However, if we take that Maintenance Margin requirement (to keep the position open) by exchange hints <strong>$25</strong> for that position, then your collateral should not drop below it, otherwise the position will be liquidated.</p> <p>To increase, reduce or set your margin balance (collateral) in an open leveraged position, use <code>addMargin</code>, <code>reduceMargin</code> and <code>setMargin</code> respectively. This is kind of like adjusting the amount of leverage you're using with a position that's already open.</p> <p>Some scenarios to use these methods include</p> <ul> <li>if the trade is going against you, you can add margin to, reducing the risk of liquidation</li> <li>if your trade is going well you can reduce your position's margin balance and take profits</li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="addMargin (symbol, amount, params = {}) reduceMargin (symbol, amount, params = {}) setMargin (symbol, amount, params = {})"><pre><span class="pl-en">addMargin</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-en">reduceMargin</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-en">setMargin</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbol</strong> (String) <em>required</em> Unified CCXT market symbol (e.g. <code>"BTC/USDT:USDT"</code>)</li> <li> <strong>amount</strong> (String) <em>required</em> Amount of margin to add or reduce (e.g. <code>20</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"leverage": 5}</code>)</li> </ul> <p>Returns</p> <ul> <li>a <a href="#margin-structure">margin structure</a> </li> </ul> <p>You can fetch the history of margin adjustments made using the methods above or automatically by the exchange using the following method</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchMarginAdjustmentHistory (symbol = undefined, type = undefined, since = undefined, limit = undefined, params = {})"><pre><span class="pl-en">fetchMarginAdjustmentHistory</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">type</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbol</strong> (String) Unified CCXT market symbol (e.g. <code>"BTC/USDT:USDT"</code>)</li> <li> <strong>type</strong> (String) "add" or "reduce"</li> <li> <strong>since</strong> (Integer) Timestamp (ms) of the earliest time to retrieve margin adjustments for for (e.g. <code>1646940314000</code>)</li> <li> <strong>limit</strong> (Integer) The number of <a href="#margin-structure">margin structures</a> to retrieve (e.g. <code>5</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"auto": true}</code>)</li> </ul> <p>Returns</p> <ul> <li>a <a href="#margin-structure">margin structure</a> </li> </ul> <div class="markdown-heading"><h3 class="heading-element">Margin Structure</h3><a id="user-content-margin-structure" class="anchor" aria-label="Permalink: Margin Structure" href="#margin-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ info: { ... }, type: 'add', // 'add', 'reduce', 'set' amount: 1, // amount added, reduced, or set total: 2, // total margin or undefined if not specified by the exchange code: 'USDT', symbol: 'XRP/USDT:USDT', status: 'ok' }"><pre><span class="pl-kos">{</span> <span class="pl-c1">info</span>: <span class="pl-kos">{</span> ...<span class="pl-s1"></span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">type</span>: <span class="pl-s">'add'</span><span class="pl-kos">,</span> <span class="pl-c">// 'add', 'reduce', 'set'</span> <span class="pl-c1">amount</span>: <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c">// amount added, reduced, or set</span> <span class="pl-c1">total</span>: <span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-c">// total margin or undefined if not specified by the exchange</span> <span class="pl-c1">code</span>: <span class="pl-s">'USDT'</span><span class="pl-kos">,</span> <span class="pl-c1">symbol</span>: <span class="pl-s">'XRP/USDT:USDT'</span><span class="pl-kos">,</span> <span class="pl-c1">status</span>: <span class="pl-s">'ok'</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Set Margin Mode</h2><a id="user-content-set-margin-mode" class="anchor" aria-label="Permalink: Set Margin Mode" href="#set-margin-mode"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>margin and contract only</em></p> <p>Updates the type of margin used to be either</p> <ul> <li> <code>cross</code> One account is used to share collateral between markets. Margin is taken from total account balance to avoid liquidation when needed.</li> <li> <code>isolated</code> Each market, keeps collateral in a separate account</li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="setMarginMode (marginMode, symbol = undefined, params = {})"><pre><span class="pl-en">setMarginMode</span> <span class="pl-kos">(</span><span class="pl-s1">marginMode</span><span class="pl-kos">,</span> <span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>marginMode</strong> (String) <em>required</em> the type of margin used <strong>Unified margin types:</strong> <ul> <li><code>"cross"</code></li> <li><code>"isolated"</code></li> </ul> </li> <li> <strong>symbol</strong> (String) Unified CCXT market symbol (e.g. <code>"BTC/USDT:USDT"</code>) <em>required</em> on most exchanges. Is not required when the margin mode is not specific to a market</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"leverage": 5}</code>)</li> </ul> <p>Returns</p> <ul> <li>response from the exchange</li> </ul> <div class="markdown-heading"><h3 class="heading-element">Exchanges Without setMarginMode</h3><a id="user-content-exchanges-without-setmarginmode" class="anchor" aria-label="Permalink: Exchanges Without setMarginMode" href="#exchanges-without-setmarginmode"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Common reasons for why an exchange might have</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="exchange.has['setMarginMode'] == false"><pre><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">has</span><span class="pl-kos">[</span><span class="pl-s">'setMarginMode'</span><span class="pl-kos">]</span> <span class="pl-c1">==</span> <span class="pl-c1">false</span></pre></div> <p>include</p> <ul> <li>the exchange does not offer leveraged trading</li> <li>the exchange only offers one of <code>cross</code> or <code>isolated</code> margin modes, but does not offer both</li> <li>margin mode must be set using an exchange specific parameter within <code>params</code> when using <code>createOrder</code> </li> </ul> <div class="markdown-heading"><h3 class="heading-element">Notes On Suppressed Errors For setMarginMode</h3><a id="user-content-notes-on-suppressed-errors-for-setmarginmode" class="anchor" aria-label="Permalink: Notes On Suppressed Errors For setMarginMode" href="#notes-on-suppressed-errors-for-setmarginmode"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Some exchange apis return an error response when a request is sent to set the margin mode to the mode that it is already set to (e.g. Sending a request to set the margin mode to <code>cross</code> for the market <code>BTC/USDT:USDT</code> when the account already has <code>BTC/USDT:USDT</code> set to use cross margin). CCXT doesn't see this as an error because the end result is what the user wanted, so the error is suppressed and the error result is returned as an object.</p> <p>e.g.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ code: -4046, msg: 'No need to change margin type.' }"><pre><span class="pl-kos">{</span> <span class="pl-c1">code</span>: <span class="pl-c1">-</span><span class="pl-c1">4046</span><span class="pl-kos">,</span> <span class="pl-c1">msg</span>: <span class="pl-s">'No need to change margin type.'</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Notes On The marginMode Parameter</h3><a id="user-content-notes-on-the-marginmode-parameter" class="anchor" aria-label="Permalink: Notes On The marginMode Parameter" href="#notes-on-the-marginmode-parameter"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Some methods allow the usage of a <code>marginMode</code> parameter that can be set to either <code>cross</code> or <code>isolated</code>. This can be useful for specifying the <code>marginMode</code> directly within the methods params, for use with spot margin or contract markets. To specify a spot margin market, you need to use a unified spot symbol or set the market type to spot, while setting the marginMode parameter to <code>cross</code> or <code>isolated</code>.</p> <p>Create a Spot Margin Order:</p> <p><em>Use a unified spot symbol, while setting the marginMode parameter.</em></p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-47" class="anchor" aria-label="Permalink: Javascript" href="#javascript-47"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const params = { 'marginMode': 'isolated', // or 'cross' } const order = await exchange.createOrder ('ETH/USDT', 'market', 'buy', 0.1, 1500, params)"><pre><span class="pl-k">const</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-s">'marginMode'</span>: <span class="pl-s">'isolated'</span><span class="pl-kos">,</span> <span class="pl-c">// or 'cross'</span> <span class="pl-kos">}</span> <span class="pl-k">const</span> <span class="pl-s1">order</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">createOrder</span> <span class="pl-kos">(</span><span class="pl-s">'ETH/USDT'</span><span class="pl-kos">,</span> <span class="pl-s">'market'</span><span class="pl-kos">,</span> <span class="pl-s">'buy'</span><span class="pl-kos">,</span> <span class="pl-c1">0.1</span><span class="pl-kos">,</span> <span class="pl-c1">1500</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-47" class="anchor" aria-label="Permalink: Python" href="#python-47"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="params = { 'marginMode': 'isolated', # or 'cross' } order = exchange.create_order ('ETH/USDT', 'market', 'buy', 0.1, 1500, params)"><pre><span class="pl-s1">params</span> <span class="pl-c1">=</span> { <span class="pl-s">'marginMode'</span>: <span class="pl-s">'isolated'</span>, <span class="pl-c"># or 'cross'</span> } <span class="pl-s1">order</span> <span class="pl-c1">=</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">create_order</span> (<span class="pl-s">'ETH/USDT'</span>, <span class="pl-s">'market'</span>, <span class="pl-s">'buy'</span>, <span class="pl-c1">0.1</span>, <span class="pl-c1">1500</span>, <span class="pl-s1">params</span>)</pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-45" class="anchor" aria-label="Permalink: PHP" href="#php-45"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$params = { 'marginMode': 'isolated', // or 'cross' } $order = $exchange->create_order ('ETH/USDT', 'market', 'buy', 0.1, 1500, $params);"><pre><span class="pl-s1"><span class="pl-c1">$</span>params</span> = { <span class="pl-s">'<span class="pl-s">marginMode</span>':<span class="pl-s"> </span>'</span>isolated', <span class="pl-c">// or 'cross'</span> } <span class="pl-s1"><span class="pl-c1">$</span>order</span> = <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">create_order</span> (<span class="pl-s">'<span class="pl-s">ETH/USDT</span>'</span>, <span class="pl-s">'<span class="pl-s">market</span>'</span>, <span class="pl-s">'<span class="pl-s">buy</span>'</span>, <span class="pl-c1">0.1</span>, <span class="pl-c1">1500</span>, <span class="pl-s1"><span class="pl-c1">$</span>params</span>);</pre></div> <div class="markdown-heading"><h2 class="heading-element">Fetch Margin Mode</h2><a id="user-content-fetch-margin-mode" class="anchor" aria-label="Permalink: Fetch Margin Mode" href="#fetch-margin-mode"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>margin and contract only</em></p> <p>The <code>fetchMarginMode()</code> method can be used to obtain the set margin mode for a market. The <code>fetchMarginModes()</code> method can be used to obtain the set margin mode for multiple markets at once.</p> <p>You can access the set margin mode by using:</p> <ul> <li> <code>fetchMarginMode()</code> (single symbol)</li> <li> <code>fetchMarginModes([symbol1, symbol2, ...])</code> (multiple symbols)</li> <li> <code>fetchMarginModes()</code> (all market symbols)</li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchMarginMode(symbol, params = {})"><pre><span class="pl-en">fetchMarginMode</span><span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbol</strong> (String) <em>required</em> A unified CCXT symbol (e.g. <code>"BTC/USDT:USDT"</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"subType": "linear"}</code>)</li> </ul> <p>Returns</p> <ul> <li>a <a href="#margin-mode-structure">margin-mode-structure</a> </li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchMarginModes(symbols = undefined, params = {})"><pre><span class="pl-en">fetchMarginModes</span><span class="pl-kos">(</span><span class="pl-s1">symbols</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbols</strong> ([String]) A list of unified CCXT symbols (e.g. <code>[ "BTC/USDT:USDT" ]</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"subType": "linear"}</code>)</li> </ul> <p>Returns</p> <ul> <li>an array of <a href="#margin-mode-structure">margin-mode-structures</a> </li> </ul> <div class="markdown-heading"><h3 class="heading-element">Margin Mode Structure</h3><a id="user-content-margin-mode-structure" class="anchor" aria-label="Permalink: Margin Mode Structure" href="#margin-mode-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ "info": { ... } // response from the exchange "symbol": "BTC/USDT:USDT", // unified market symbol "marginMode": "cross", // the margin mode either cross or isolated }"><pre><span class="pl-kos">{</span> <span class="pl-s">"info"</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span> <span class="pl-c">// response from the exchange</span> <span class="pl-s">"symbol"</span>: <span class="pl-s">"BTC/USDT:USDT"</span><span class="pl-kos">,</span> <span class="pl-c">// unified market symbol</span> <span class="pl-s">"marginMode"</span>: <span class="pl-s">"cross"</span><span class="pl-kos">,</span> <span class="pl-c">// the margin mode either cross or isolated</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Set Leverage</h2><a id="user-content-set-leverage" class="anchor" aria-label="Permalink: Set Leverage" href="#set-leverage"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>margin and contract only</em></p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="setLeverage (leverage, symbol = undefined, params = {})"><pre><span class="pl-en">setLeverage</span> <span class="pl-kos">(</span><span class="pl-s1">leverage</span><span class="pl-kos">,</span> <span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>leverage</strong> (Integer) <em>required</em> The desired leverage</li> <li> <strong>symbol</strong> (String) Unified CCXT market symbol (e.g. <code>"BTC/USDT:USDT"</code>) <em>required</em> on most exchanges. Is not required when leverage is not specific to a market (e.g. If leverage is set for the account and not per market)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"marginMode": "cross"}</code>)</li> </ul> <p>Returns</p> <ul> <li>response from the exchange</li> </ul> <div class="markdown-heading"><h2 class="heading-element">Leverage</h2><a id="user-content-leverage" class="anchor" aria-label="Permalink: Leverage" href="#leverage"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>margin and contract only</em></p> <p>The <code>fetchLeverage()</code> method can be used to obtain the set leverage for a market. The <code>fetchLeverages()</code> method can be used to obtain the set leverage for multiple markets at once.</p> <p>You can access the set leverage by using:</p> <ul> <li> <code>fetchLeverage()</code> (single symbol)</li> <li> <code>fetchLeverages([symbol1, symbol2, ...])</code> (multiple symbols)</li> <li> <code>fetchLeverages()</code> (all market symbols)</li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchLeverage(symbol, params = {})"><pre><span class="pl-en">fetchLeverage</span><span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbol</strong> (String) <em>required</em> A unified CCXT symbol (e.g. <code>"BTC/USDT:USDT"</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"marginMode": "cross"}</code>)</li> </ul> <p>Returns</p> <ul> <li>a <a href="#leverage-structure">leverage-structure</a> </li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchLeverages(symbols = undefined, params = {})"><pre><span class="pl-en">fetchLeverages</span><span class="pl-kos">(</span><span class="pl-s1">symbols</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbols</strong> ([String]) A list of unified CCXT symbols (e.g. <code>[ "BTC/USDT:USDT" ]</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"marginMode": "cross"}</code>)</li> </ul> <p>Returns</p> <ul> <li>an array of <a href="#leverage-structure">leverage-structures</a> </li> </ul> <div class="markdown-heading"><h3 class="heading-element">Leverage Structure</h3><a id="user-content-leverage-structure" class="anchor" aria-label="Permalink: Leverage Structure" href="#leverage-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ "info": { ... } // response from the exchange "symbol": "BTC/USDT:USDT", // unified market symbol "marginMode": "cross", // the margin mode either cross or isolated "longLeverage": 100, // the set leverage for a long position "shortLeverage": 75, // the set leverage for a short position }"><pre><span class="pl-kos">{</span> <span class="pl-s">"info"</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span> <span class="pl-c">// response from the exchange</span> <span class="pl-s">"symbol"</span>: <span class="pl-s">"BTC/USDT:USDT"</span><span class="pl-kos">,</span> <span class="pl-c">// unified market symbol</span> <span class="pl-s">"marginMode"</span>: <span class="pl-s">"cross"</span><span class="pl-kos">,</span> <span class="pl-c">// the margin mode either cross or isolated</span> <span class="pl-s">"longLeverage"</span>: <span class="pl-c1">100</span><span class="pl-kos">,</span> <span class="pl-c">// the set leverage for a long position</span> <span class="pl-s">"shortLeverage"</span>: <span class="pl-c1">75</span><span class="pl-kos">,</span> <span class="pl-c">// the set leverage for a short position</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Contract Trading</h2><a id="user-content-contract-trading" class="anchor" aria-label="Permalink: Contract Trading" href="#contract-trading"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>This can include futures with a set expiry date, perpetual swaps with funding payments, and inverse futures or swaps. Information about the positions can be served from different endpoints depending on the exchange. In the case that there are multiple endpoints serving different types of derivatives CCXT will default to just loading the "linear" (as oppose to the "inverse") contracts or the "swap" (as opposed to the "future") contracts.</p> <div class="markdown-heading"><h3 class="heading-element">Positions</h3><a id="user-content-positions" class="anchor" aria-label="Permalink: Positions" href="#positions"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>contract only</em></p> <p>To get information about positions currently held in contract markets, use</p> <ul> <li>fetchPosition () // for a single market</li> <li>fetchPositions () // for all positions</li> <li>fetchAccountPositions () // TODO</li> <li>fetchPositionHistory () // for single historical position</li> <li>fetchPositionsHistory () // for historical positions</li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchPosition (symbol, params = {}) // for a single market"><pre><span class="pl-en">fetchPosition</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c">// for a single market</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbol</strong> (String) <em>required</em> Unified CCXT market symbol (e.g. <code>"BTC/USDT:USDT"</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>A <a href="#position-structure">position structure</a> </li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchPositions (symbols = undefined, params = {}) fetchAccountPositions (symbols = undefined, params = {})"><pre><span class="pl-en">fetchPositions</span> <span class="pl-kos">(</span><span class="pl-s1">symbols</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-en">fetchAccountPositions</span> <span class="pl-kos">(</span><span class="pl-s1">symbols</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbols</strong> ([String]) Unified CCXT market symbols, do not set to retrieve all positions (e.g. <code>["BTC/USDT:USDT"]</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>An array of <a href="#position-structure">position structures</a> </li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchPositionHistory (symbol = undefined, since = undefined, limit = undefined, params = {})"><pre><span class="pl-en">fetchPositionHistory</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbol</strong> ([String]) Unified CCXT market symbols, do not set to retrieve all positions (e.g. <code>["BTC/USDT:USDT"]</code>)</li> <li> <strong>since</strong> (Integer) Timestamp (ms) of the earliest time to retrieve positions for (e.g. <code>1646940314000</code>)</li> <li> <strong>limit</strong> (Integer) The number of <a href="#position-structure">position structures</a> to retrieve (e.g. <code>5</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>An array of <a href="#position-structure">position structures</a> </li> </ul> <div class="markdown-heading"><h4 class="heading-element">Position Structure</h4><a id="user-content-position-structure" class="anchor" aria-label="Permalink: Position Structure" href="#position-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ 'info': { ... }, // json response returned from the exchange as is 'id': '1234323', // string, position id to reference the position, similar to an order id 'symbol': 'BTC/USD', // uppercase string literal of a pair of currencies 'timestamp': 1607723554607, // integer unix time since 1st Jan 1970 in milliseconds 'datetime': '2020-12-11T21:52:34.607Z', // ISO8601 representation of the unix time above 'isolated': true, // boolean, whether or not the position is isolated, as opposed to cross where margin is added automatically 'hedged': false, // boolean, whether or not the position is hedged, i.e. if trading in the opposite direction will close this position or make a new one 'side': 'long', // string, long or short 'contracts': 5, // float, number of contracts bought, aka the amount or size of the position 'contractSize': 100, // float, the size of one contract in quote units 'entryPrice': 20000, // float, the average entry price of the position 'markPrice': 20050, // float, a price that is used for funding calculations 'notional': 100000, // float, the value of the position in the settlement currency 'leverage': 100, // float, the leverage of the position, related to how many contracts you can buy with a given amount of collateral 'collateral': 5300, // float, the maximum amount of collateral that can be lost, affected by pnl 'initialMargin': 5000, // float, the amount of collateral that is locked up in this position 'maintenanceMargin': 1000, // float, the mininum amount of collateral needed to avoid being liquidated 'initialMarginPercentage': 0.05, // float, the initialMargin as a percentage of the notional 'maintenanceMarginPercentage': 0.01, // float, the maintenanceMargin as a percentage of the notional 'unrealizedPnl': 300, // float, the difference between the market price and the entry price times the number of contracts, can be negative 'liquidationPrice': 19850, // float, the price at which collateral becomes less than maintenanceMargin 'marginMode': 'cross', // string, can be cross or isolated 'percentage': 3.32, // float, represents unrealizedPnl / initialMargin * 100 }"><pre><span class="pl-kos">{</span> <span class="pl-s">'info'</span>: <span class="pl-kos">{</span> ... <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// json response returned from the exchange as is</span> <span class="pl-s">'id'</span>: <span class="pl-s">'1234323'</span><span class="pl-kos">,</span> <span class="pl-c">// string, position id to reference the position, similar to an order id</span> <span class="pl-s">'symbol'</span>: <span class="pl-s">'BTC/USD'</span><span class="pl-kos">,</span> <span class="pl-c">// uppercase string literal of a pair of currencies</span> <span class="pl-s">'timestamp'</span>: <span class="pl-c1">1607723554607</span><span class="pl-kos">,</span> <span class="pl-c">// integer unix time since 1st Jan 1970 in milliseconds</span> <span class="pl-s">'datetime'</span>: <span class="pl-s">'2020-12-11T21:52:34.607Z'</span><span class="pl-kos">,</span> <span class="pl-c">// ISO8601 representation of the unix time above</span> <span class="pl-s">'isolated'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c">// boolean, whether or not the position is isolated, as opposed to cross where margin is added automatically</span> <span class="pl-s">'hedged'</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c">// boolean, whether or not the position is hedged, i.e. if trading in the opposite direction will close this position or make a new one</span> <span class="pl-s">'side'</span>: <span class="pl-s">'long'</span><span class="pl-kos">,</span> <span class="pl-c">// string, long or short</span> <span class="pl-s">'contracts'</span>: <span class="pl-c1">5</span><span class="pl-kos">,</span> <span class="pl-c">// float, number of contracts bought, aka the amount or size of the position</span> <span class="pl-s">'contractSize'</span>: <span class="pl-c1">100</span><span class="pl-kos">,</span> <span class="pl-c">// float, the size of one contract in quote units</span> <span class="pl-s">'entryPrice'</span>: <span class="pl-c1">20000</span><span class="pl-kos">,</span> <span class="pl-c">// float, the average entry price of the position</span> <span class="pl-s">'markPrice'</span>: <span class="pl-c1">20050</span><span class="pl-kos">,</span> <span class="pl-c">// float, a price that is used for funding calculations</span> <span class="pl-s">'notional'</span>: <span class="pl-c1">100000</span><span class="pl-kos">,</span> <span class="pl-c">// float, the value of the position in the settlement currency</span> <span class="pl-s">'leverage'</span>: <span class="pl-c1">100</span><span class="pl-kos">,</span> <span class="pl-c">// float, the leverage of the position, related to how many contracts you can buy with a given amount of collateral</span> <span class="pl-s">'collateral'</span>: <span class="pl-c1">5300</span><span class="pl-kos">,</span> <span class="pl-c">// float, the maximum amount of collateral that can be lost, affected by pnl</span> <span class="pl-s">'initialMargin'</span>: <span class="pl-c1">5000</span><span class="pl-kos">,</span> <span class="pl-c">// float, the amount of collateral that is locked up in this position</span> <span class="pl-s">'maintenanceMargin'</span>: <span class="pl-c1">1000</span><span class="pl-kos">,</span> <span class="pl-c">// float, the mininum amount of collateral needed to avoid being liquidated</span> <span class="pl-s">'initialMarginPercentage'</span>: <span class="pl-c1">0.05</span><span class="pl-kos">,</span> <span class="pl-c">// float, the initialMargin as a percentage of the notional</span> <span class="pl-s">'maintenanceMarginPercentage'</span>: <span class="pl-c1">0.01</span><span class="pl-kos">,</span> <span class="pl-c">// float, the maintenanceMargin as a percentage of the notional</span> <span class="pl-s">'unrealizedPnl'</span>: <span class="pl-c1">300</span><span class="pl-kos">,</span> <span class="pl-c">// float, the difference between the market price and the entry price times the number of contracts, can be negative</span> <span class="pl-s">'liquidationPrice'</span>: <span class="pl-c1">19850</span><span class="pl-kos">,</span> <span class="pl-c">// float, the price at which collateral becomes less than maintenanceMargin</span> <span class="pl-s">'marginMode'</span>: <span class="pl-s">'cross'</span><span class="pl-kos">,</span> <span class="pl-c">// string, can be cross or isolated</span> <span class="pl-s">'percentage'</span>: <span class="pl-c1">3.32</span><span class="pl-kos">,</span> <span class="pl-c">// float, represents unrealizedPnl / initialMargin * 100</span> <span class="pl-kos">}</span></pre></div> <p>Positions allow you to borrow money from an exchange to go long or short on an market. Some exchanges require you to pay a funding fee to keep the position open.</p> <p>When you go long on a position you are betting that the price will be higher in the future and that the price will never be less than the <code>liquidationPrice</code>.</p> <p>As the price of the underlying index changes so does the unrealisedPnl and as a consequence the amount of collateral you have left in the position (since you can only close it at market price or worse). At some price you will have zero collateral left, this is called the "bust" or "zero" price. Beyond this point, if the price goes in the opposite direction far enough, the collateral of the position will drop below the <code>maintenanceMargin</code>. The maintenanceMargin acts as a safety buffer between your position and negative collateral, a scenario where the exchange incurs losses on your behalf. To protect itself the exchange will swiftly liquidate your position if and when this happens. Even if the price returns back above the liquidationPrice you will not get your money back since the exchange sold all the <code>contracts</code> you bought at market. In other words the maintenanceMargin is a hidden fee to borrow money.</p> <p>It is recommended to use the <code>maintenanceMargin</code> and <code>initialMargin</code> instead of the <code>maintenanceMarginPercentage</code> and <code>initialMarginPercentage</code> since these tend to be more accurate. The maintenanceMargin might be calculated from other factors outside of the maintenanceMarginPercentage including the funding rate and taker fees, for example on <a href="https://futures.kucoin.com/contract/detail" rel="nofollow">kucoin</a>.</p> <p>An inverse contract will allow you to go long or short on BTC/USD by putting up BTC as collateral. Our API for inverse contracts is the same as for linear contracts. The amounts in an inverse contracts are quoted as if they were traded USD/BTC, however the price is still quoted terms of BTC/USD. The formula for the profit and loss of a inverse contract is <code>(1/markPrice - 1/price) * contracts</code>. The profit and loss and collateral will now be quoted in BTC, and the number of contracts are quoted in USD.</p> <div class="markdown-heading"><h4 class="heading-element">Closing Positions</h4><a id="user-content-closing-positions" class="anchor" aria-label="Permalink: Closing Positions" href="#closing-positions"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>contract only</em></p> <p>To quickly close open positions with a market order, use</p> <ul> <li>closePosition (symbol) // for a single market</li> <li>closeAllPositions (symbol) // for all positions</li> </ul> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="closePosition (symbol: string, side: OrderSide = undefined, params = {}): Promise<Order>"><pre><span class="pl-en">closePosition</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span>: <span class="pl-s1">string</span><span class="pl-kos">,</span> <span class="pl-s1">side</span>: <span class="pl-v">OrderSide</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span>: <span class="pl-v">Promise</span><span class="pl-c1"><</span><span class="pl-smi">Order</span><span class="pl-c1">></span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbol</strong> (String) <em>required</em> Unified CCXT market symbol (e.g. <code>"BTC/USDT:USDT"</code>)</li> <li> <strong>side</strong> <em>optional</em> a string literal for the direction of your order. Some exchanges require it. <strong>Unified sides:</strong> <ul> <li> <code>buy</code> give quote currency and receive base currency; for example, buying <code>BTC/USD</code> means that you will receive bitcoins for your dollars.</li> <li> <code>sell</code> give base currency and receive quote currency; for example, buying <code>BTC/USD</code> means that you will receive dollars for your bitcoins.</li> </ul> </li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>An <a href="#order-structure">order structure</a> </li> </ul> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="closeAllPositions (params = {}): Promise<Position[]>"><pre><span class="pl-en">closeAllPositions</span> <span class="pl-kos">(</span><span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span>: <span class="pl-v">Promise</span><span class="pl-c1"><</span><span class="pl-smi">Position</span><span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-c1">></span></pre></div> <p>Parameters</p> <ul> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>A list of <a href="#order-structure">order structures</a> </li> </ul> <div class="markdown-heading"><h2 class="heading-element">Set Position Mode</h2><a id="user-content-set-position-mode" class="anchor" aria-label="Permalink: Set Position Mode" href="#set-position-mode"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>margin and contract only</em></p> <p>Method used for setting position mode:</p> <ul> <li> <code>true</code> - sets to <strong>hedged</strong> mode</li> <li> <code>false</code> - sets to <strong>one-way</strong> mode</li> </ul> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="set_position_mode (false, symbol = undefined, params = {})"><pre><span class="pl-en">set_position_mode</span> <span class="pl-kos">(</span><span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>hedged</strong> (String) <em>required</em> hedged-mode value: <ul> <li><code>true</code></li> <li><code>false</code></li> </ul> </li> <li> <strong>symbol</strong> (String) Unified CCXT market symbol (e.g. <code>"BTC/USDT:USDT"</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint</li> </ul> <p>Returns</p> <ul> <li>response from the exchange</li> </ul> <div class="markdown-heading"><h4 class="heading-element">Liquidation Price</h4><a id="user-content-liquidation-price" class="anchor" aria-label="Permalink: Liquidation Price" href="#liquidation-price"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>It is the price at which the <code>initialMargin + unrealized = collateral = maintenanceMargin</code>. The price has gone in the opposite direction of your position to the point where the is only maintenanceMargin collateral left and if it goes any further the position will have negative collateral.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// if long (liquidationPrice - price) * contracts = maintenanceMargin // if short (price - liquidationPrice) * contracts = maintenanceMargin // if inverse long (1/liquidationPrice - 1/price) * contracts = maintenanceMargin // if inverse short (1/price - 1/liquidationPrice) * contracts = maintenanceMargin"><pre><span class="pl-c">// if long</span> <span class="pl-kos">(</span><span class="pl-s1">liquidationPrice</span> <span class="pl-c1">-</span> <span class="pl-s1">price</span><span class="pl-kos">)</span> <span class="pl-c1">*</span> <span class="pl-s1">contracts</span> <span class="pl-c1">=</span> <span class="pl-en">maintenanceMargin</span> <span class="pl-c">// if short</span> <span class="pl-kos">(</span><span class="pl-s1">price</span> <span class="pl-c1">-</span> <span class="pl-s1">liquidationPrice</span><span class="pl-kos">)</span> <span class="pl-c1">*</span> <span class="pl-s1">contracts</span> <span class="pl-c1">=</span> <span class="pl-en">maintenanceMargin</span> <span class="pl-c">// if inverse long</span> <span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-c1">/</span><span class="pl-s1">liquidationPrice</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span><span class="pl-c1">/</span><span class="pl-s1">price</span><span class="pl-kos">)</span> <span class="pl-c1">*</span> <span class="pl-s1">contracts</span> <span class="pl-c1">=</span> <span class="pl-en">maintenanceMargin</span> <span class="pl-c">// if inverse short</span> <span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-c1">/</span><span class="pl-s1">price</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span><span class="pl-c1">/</span><span class="pl-s1">liquidationPrice</span><span class="pl-kos">)</span> <span class="pl-c1">*</span> <span class="pl-s1">contracts</span> <span class="pl-c1">=</span> <span class="pl-s1">maintenanceMargin</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Funding History</h3><a id="user-content-funding-history" class="anchor" aria-label="Permalink: Funding History" href="#funding-history"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><em>contract only</em></p> <p>Perpetual swap (also known as perpetual future) contracts maintain a market price that mirrors the price of the asset they are based on because funding fees are exchanged between traders who hold positions in perpetual swap markets.</p> <p>If the contract is being traded at a price that is higher than the price of the asset they represent, then traders in long positions pay a funding fee to traders in short positions at specific times of day, which encourages more traders to enter short positions prior to these times.</p> <p>If the contract is being traded at a price that is lower than the price of the asset they represent, then traders in short positions pay a funding fee to traders in long positions at specific times of day, which encourages more traders to enter long positions prior to these times.</p> <p>These fees are usually exchanged between traders with no commission going to the exchange</p> <p>The <code>fetchFundingHistory</code> method can be used to retrieve an accounts history of funding fees paid or received</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchFundingHistory (symbol = undefined, since = undefined, limit = undefined, params = {})"><pre><span class="pl-en">fetchFundingHistory</span> <span class="pl-kos">(</span><span class="pl-s1">symbol</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>symbol</strong> (String) Unified CCXT market symbol (e.g. <code>"BTC/USDT:USDT"</code>)</li> <li> <strong>since</strong> (Integer) Timestamp (ms) of the earliest time to retrieve funding history for (e.g. <code>1646940314000</code>)</li> <li> <strong>limit</strong> (Integer) The number of <a href="#funding-history-structure">funding history structures</a> to retrieve (e.g. <code>5</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"endTime": 1645807945000}</code>)</li> </ul> <p>Returns</p> <ul> <li>An array of <a href="#funding-history-structure">funding history structures</a> </li> </ul> <div class="markdown-heading"><h4 class="heading-element">Funding History Structure</h4><a id="user-content-funding-history-structure" class="anchor" aria-label="Permalink: Funding History Structure" href="#funding-history-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ info: { ... }, symbol: "XRP/USDT:USDT", code: "USDT", timestamp: 1646954920000, datetime: "2022-03-08T16:00:00.000Z", id: "1520286109858180", amount: -0.027722 }"><pre><span class="pl-kos">{</span> <span class="pl-c1">info</span>: <span class="pl-kos">{</span> ...<span class="pl-s1"></span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">symbol</span>: <span class="pl-s">"XRP/USDT:USDT"</span><span class="pl-kos">,</span> <span class="pl-c1">code</span>: <span class="pl-s">"USDT"</span><span class="pl-kos">,</span> <span class="pl-c1">timestamp</span>: <span class="pl-c1">1646954920000</span><span class="pl-kos">,</span> <span class="pl-c1">datetime</span>: <span class="pl-s">"2022-03-08T16:00:00.000Z"</span><span class="pl-kos">,</span> <span class="pl-c1">id</span>: <span class="pl-s">"1520286109858180"</span><span class="pl-kos">,</span> <span class="pl-c1">amount</span>: <span class="pl-c1">-</span><span class="pl-c1">0.027722</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Conversion</h3><a id="user-content-conversion" class="anchor" aria-label="Permalink: Conversion" href="#conversion"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>The <code>fetchConvertQuote</code> method can be used to retrieve a quote that can be used for a conversion trade. The quote usually needs to be used within a certain timeframe specified by the exchange for the convert trade to execute successfully.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchConvertQuote (fromCode, toCode, amount = undefined, params = {})"><pre><span class="pl-en">fetchConvertQuote</span> <span class="pl-kos">(</span><span class="pl-s1">fromCode</span><span class="pl-kos">,</span> <span class="pl-s1">toCode</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>fromCode</strong> (String) <em>required</em> The unified currency code for the currency to convert from (e.g. <code>"USDT"</code>)</li> <li> <strong>toCode</strong> (String) <em>required</em> The unified currency code for the currency to be converted into (e.g. <code>"USDC"</code>)</li> <li> <strong>amount</strong> (Float) Amount to convert in units of the from currency (e.g. <code>20.0</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"toAmount": 2.9722}</code>)</li> </ul> <p>Returns</p> <ul> <li>A <a href="#conversion-structure">conversion structure</a> </li> </ul> <p>The <code>createConvertTrade</code> method can be used to create a conversion trade order using the id retrieved from fetchConvertQuote. The quote usually needs to be used within a certain timeframe specified by the exchange for the convert trade to execute successfully.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="createConvertTrade (id, fromCode, toCode, amount = undefined, params = {})"><pre><span class="pl-en">createConvertTrade</span> <span class="pl-kos">(</span><span class="pl-s1">id</span><span class="pl-kos">,</span> <span class="pl-s1">fromCode</span><span class="pl-kos">,</span> <span class="pl-s1">toCode</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>id</strong> (String) <em>required</em> Conversion quote id (e.g. <code>1645807945000</code>)</li> <li> <strong>fromCode</strong> (String) <em>required</em> The unified currency code for the currency to convert from (e.g. <code>"USDT"</code>)</li> <li> <strong>toCode</strong> (String) <em>required</em> The unified currency code for the currency to be converted into (e.g. <code>"USDC"</code>)</li> <li> <strong>amount</strong> (Float) Amount to convert in units of the from currency (e.g. <code>20.0</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"toAmount": 2.9722}</code>)</li> </ul> <p>Returns</p> <ul> <li>A <a href="#conversion-structure">conversion structure</a> </li> </ul> <p>The <code>fetchConvertTrade</code> method can be used to fetch a specific conversion trade using the trades id.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchConvertTrade (id, code = undefined, params = {})"><pre><span class="pl-en">fetchConvertTrade</span> <span class="pl-kos">(</span><span class="pl-s1">id</span><span class="pl-kos">,</span> <span class="pl-s1">code</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>id</strong> (String) <em>required</em> Conversion trade id (e.g. <code>"80794187SDHJ25"</code>)</li> <li> <strong>code</strong> (String) The unified currency code of the conversion trade (e.g. <code>"USDT"</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"toAmount": 2.9722}</code>)</li> </ul> <p>Returns</p> <ul> <li>A <a href="#conversion-structure">conversion structure</a> </li> </ul> <p>The <code>fetchConvertTradeHistory</code> method can be used to fetch the conversion history for a specified currency code.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fetchConvertTradeHistory (code = undefined, since = undefined, limit = undefined, params = {})"><pre><span class="pl-en">fetchConvertTradeHistory</span> <span class="pl-kos">(</span><span class="pl-s1">code</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">since</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">limit</span> <span class="pl-c1">=</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p>Parameters</p> <ul> <li> <strong>code</strong> (String) The unified currency code to fetch conversion trade history for (e.g. <code>"USDT"</code>)</li> <li> <strong>since</strong> (Integer) Timestamp of the earliest conversion (e.g. <code>1645807945000</code>)</li> <li> <strong>limit</strong> (Integer) The maximum number of conversion structures to retrieve (e.g. <code>10</code>)</li> <li> <strong>params</strong> (Dictionary) Parameters specific to the exchange API endpoint (e.g. <code>{"toAmount": 2.9722}</code>)</li> </ul> <p>Returns</p> <ul> <li>An array of <a href="#conversion-structure">conversion structures</a> </li> </ul> <div class="markdown-heading"><h4 class="heading-element">Conversion Structure</h4><a id="user-content-conversion-structure" class="anchor" aria-label="Permalink: Conversion Structure" href="#conversion-structure"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ info: { ... }, timestamp: 1646954920000, datetime: "2022-03-08T16:00:00.000Z", id: "1520286109858180", fromCurrency: "USDT", fromAmount: 3.0, toCurrency: "USDC", toAmount: 2.9722, price: 0.97, fee: 0.0 }"><pre><span class="pl-kos">{</span> <span class="pl-c1">info</span>: <span class="pl-kos">{</span> ...<span class="pl-s1"></span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">timestamp</span>: <span class="pl-c1">1646954920000</span><span class="pl-kos">,</span> <span class="pl-c1">datetime</span>: <span class="pl-s">"2022-03-08T16:00:00.000Z"</span><span class="pl-kos">,</span> <span class="pl-c1">id</span>: <span class="pl-s">"1520286109858180"</span><span class="pl-kos">,</span> <span class="pl-c1">fromCurrency</span>: <span class="pl-s">"USDT"</span><span class="pl-kos">,</span> <span class="pl-c1">fromAmount</span>: <span class="pl-c1">3.0</span><span class="pl-kos">,</span> <span class="pl-c1">toCurrency</span>: <span class="pl-s">"USDC"</span><span class="pl-kos">,</span> <span class="pl-c1">toAmount</span>: <span class="pl-c1">2.9722</span><span class="pl-kos">,</span> <span class="pl-c1">price</span>: <span class="pl-c1">0.97</span><span class="pl-kos">,</span> <span class="pl-c1">fee</span>: <span class="pl-c1">0.0</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Proxy</h2><a id="user-content-proxy" class="anchor" aria-label="Permalink: Proxy" href="#proxy"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>In some specific cases you may want a proxy, when:</p> <ul> <li>Exchange is not available in your location</li> <li>Your IP is forbidden by exchange</li> <li>You experience random restriction by exchange, like <a href="#ddos-protection-by-cloudflare-incapsula">DDoS protection by Cloudflare</a> </li> </ul> <p>However, beware that each added intermediary might add some latency to requests.</p> <p><strong>Note for Go users:</strong> After setting any proxy property, you must call <code>UpdateProxySettings()</code> to apply the changes:</p> <div class="highlight highlight-source-go notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="exchange := ccxt.NewBinance(nil) exchange.ProxyUrl = "http://your-proxy-url:8080" exchange.UpdateProxySettings() // Required in Go to apply proxy settings"><pre><span class="pl-s1">exchange</span> <span class="pl-c1">:=</span> <span class="pl-s1">ccxt</span>.<span class="pl-c1">NewBinance</span>(<span class="pl-c1">nil</span>) <span class="pl-s1">exchange</span>.<span class="pl-c1">ProxyUrl</span> <span class="pl-c1">=</span> <span class="pl-s">"http://your-proxy-url:8080"</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">UpdateProxySettings</span>() <span class="pl-c">// Required in Go to apply proxy settings</span></pre></div> <p>However be aware that each added intermediary might add some latency to requests.</p> <div class="markdown-heading"><h3 class="heading-element">Supported proxy types</h3><a id="user-content-supported-proxy-types" class="anchor" aria-label="Permalink: Supported proxy types" href="#supported-proxy-types"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>CCXT supports the following proxy types (note, each of them also have <a href="#using-proxy-callbacks">callback support</a>):</p> <div class="markdown-heading"><h4 class="heading-element">proxyUrl</h4><a id="user-content-proxyurl" class="anchor" aria-label="Permalink: proxyUrl" href="#proxyurl"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>This property prepends an url to API requests. It might be useful for simple redirection or <a href="#cors-access-control-allow-origin">bypassing CORS browser restriction</a>.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ex = ccxt.binance(); ex.proxyUrl = 'YOUR_PROXY_URL';"><pre class="notranslate"><code>ex = ccxt.binance(); ex.proxyUrl = 'YOUR_PROXY_URL'; </code></pre></div> <p>while 'YOUR_PROXY_URL' could be like (use the slash accordingly):</p> <ul> <li><code>https://cors-anywhere.herokuapp.com/</code></li> <li><code>http://127.0.0.1:8080/</code></li> <li><code>http://your-website.com/sample-script.php?url=</code></li> <li>etc</li> </ul> <p>So requests will be made to i.e. <code>https://cors-anywhere.herokuapp.com/https://exchange.xyz/api/endpoint</code>. ( You can also have a small proxy script running on your device/webserver to use it in <code>.proxyUrl</code> - "sample-local-proxy-server" in <a href="https://github.com/ccxt/ccxt/tree/master/examples">examples folder</a>).</p> <p>This approach works <strong>only for REST</strong> requests, but not for websocket connections. ((<em>How to test if your proxy works</em>))[#test-if-your-proxy-works]</p> <div class="markdown-heading"><h4 class="heading-element">httpProxy and httpsProxy</h4><a id="user-content-httpproxy-and-httpsproxy" class="anchor" aria-label="Permalink: httpProxy and httpsProxy" href="#httpproxy-and-httpsproxy"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>To set a real http(s) proxy for your scripts, you need to have an access to a remote <a href="https://stackoverflow.com/q/10440690/2377343" rel="nofollow">http or https proxy</a>, so calls will be made directly to the target exchange, tunneled through your proxy server:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ex.httpProxy = 'http://1.2.3.4:8080/'; // or ex.httpsProxy = 'http://1.2.3.4:8080/';"><pre class="notranslate"><code>ex.httpProxy = 'http://1.2.3.4:8080/'; // or ex.httpsProxy = 'http://1.2.3.4:8080/'; </code></pre></div> <p>This approach only affects <strong>non-websocket</strong> requests of ccxt. To route CCXT's WebSockets connections through proxy, you need to specifically set <code>wsProxy</code> (or <code>wssProxy</code>) property, in addition to the <code>httpProxy</code> (or <code>httpsProxy</code>), so your script should be like:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ex.httpProxy = 'http://1.2.3.4:8080/'; ex.wsProxy = 'http://1.2.3.4:8080/';"><pre class="notranslate"><code>ex.httpProxy = 'http://1.2.3.4:8080/'; ex.wsProxy = 'http://1.2.3.4:8080/'; </code></pre></div> <p>So, both connections (HTTP & WS) would go through proxies. ((<em>How to test if your proxy works</em>))[#test-if-your-proxy-works]</p> <div class="markdown-heading"><h4 class="heading-element">socksProxy</h4><a id="user-content-socksproxy" class="anchor" aria-label="Permalink: socksProxy" href="#socksproxy"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>You can also use <a href="https://www.google.com/search?q=what+is+socks+proxy" rel="nofollow">socks proxy</a> with the following format:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// from protocols: socks, socks5, socks5h ex.socksProxy = 'socks5://1.2.3.4:8080/'; ex.wsSocksProxy = 'socks://1.2.3.4:8080/';"><pre class="notranslate"><code>// from protocols: socks, socks5, socks5h ex.socksProxy = 'socks5://1.2.3.4:8080/'; ex.wsSocksProxy = 'socks://1.2.3.4:8080/'; </code></pre></div> <p>((<em>How to test if your proxy works</em>))[#test-if-your-proxy-works]</p> <div class="markdown-heading"><h4 class="heading-element">Test if your proxy works</h4><a id="user-content-test-if-your-proxy-works" class="anchor" aria-label="Permalink: Test if your proxy works" href="#test-if-your-proxy-works"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>After setting any of the above listed proxy properties in your ccxt snippet, you can test whether it works by pinging some IP echoing websites - check a "proxy-usage" file in <a href="https://github.com/ccxt/ccxt/blob/master/examples/">examples</a>.</p> <div class="markdown-heading"><h4 class="heading-element">using proxy callbacks</h4><a id="user-content-using-proxy-callbacks" class="anchor" aria-label="Permalink: using proxy callbacks" href="#using-proxy-callbacks"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>**Instead of setting a property, you can also use callbacks <code>proxyUrlCallback, http(s)ProxyCallback, socksProxyCallback</code>:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="myEx.proxyUrlCallback = function (url, method, headers, body) { ... return 'http://1.2.3.4/'; }"><pre class="notranslate"><code>myEx.proxyUrlCallback = function (url, method, headers, body) { ... return 'http://1.2.3.4/'; } </code></pre></div> <div class="markdown-heading"><h3 class="heading-element">extra proxy related details</h3><a id="user-content-extra-proxy-related-details" class="anchor" aria-label="Permalink: extra proxy related details" href="#extra-proxy-related-details"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="markdown-heading"><h4 class="heading-element">userAgent</h4><a id="user-content-useragent" class="anchor" aria-label="Permalink: userAgent" href="#useragent"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>If you need for special cases, you can override <code>userAgent</code> property like:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="exchange.userAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)...'"><pre class="notranslate"><code>exchange.userAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)...' </code></pre></div> <div class="markdown-heading"><h4 class="heading-element">custom proxy agents</h4><a id="user-content-custom-proxy-agents" class="anchor" aria-label="Permalink: custom proxy agents" href="#custom-proxy-agents"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Depending your programming language, you can set custom proxy agents.</p> <ul> <li>For JS, see <a href="https://github.com/ccxt/ccxt/blob/master/examples/js/custom-proxy-agent-for-js.js">this example</a> </li> <li>For Python, see the following examples: <a href="https://github.com/ccxt/ccxt/blob/master/examples/py/proxies-for-synchronous-python.py">proxies-for-synchronous-python</a>, <a href="https://github.com/ccxt/ccxt/blob/master/examples/py/proxy-asyncio-aiohttp-python-3.py">proxy-asyncio-aiohttp-python-3</a>, <a href="https://github.com/ccxt/ccxt/blob/master/examples/py/proxy-asyncio-aiohttp-socks.py">proxy-asyncio-aiohttp-socks</a>, <a href="https://github.com/ccxt/ccxt/blob/master/examples/py/proxy-sync-python-requests-2-and-3.py">proxy-sync-python-requests-2-and-3</a> </li> </ul> <div class="markdown-heading"><h4 class="heading-element">CORS (Access-Control-Allow-Origin)</h4><a id="user-content-cors-access-control-allow-origin" class="anchor" aria-label="Permalink: CORS (Access-Control-Allow-Origin)" href="#cors-access-control-allow-origin"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>CORS (known as <a href="https://en.wikipedia.org/wiki/Cross-origin_resource_sharing" rel="nofollow">Cross-Origin Resource Sharing</a>) affects mostly browsers and is the cause of the well-know warning <code>No 'Access-Control-Allow-Origin' header is present on the requested resource</code>. It happens when a script (running in a browser) makes a request to a 3rd party domain (by default such requests are blocked, unless the target domain explicitly allows it). So, in such cases you will need to communicate with a "CORS" proxy, which would redirect requests (as opposed to direct browser-side request) to the target exchange. To set a CORS proxy, you can run <a href="https://github.com/ccxt/ccxt/blob/master/examples/">sample-local-proxy-server-with-cors</a> example file and in ccxt set the <a href="#proxyUrl"><code>.proxyUrl</code></a> property to route requests through cors/proxy server.</p> <div class="markdown-heading"><h2 class="heading-element">String Math</h2><a id="user-content-string-math" class="anchor" aria-label="Permalink: String Math" href="#string-math"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Some users might want to control how CCXT handles arithmetic operations. Even though it uses numeric types by default, users can switch to fixed-point math using string types. This can be done by:</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-48" class="anchor" aria-label="Permalink: Javascript" href="#javascript-48"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const ex = new ccxt.coinbase (); ex.number = String ; // String | Number"><pre><span class="pl-k">const</span> <span class="pl-s1">ex</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">coinbase</span> <span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">ex</span><span class="pl-kos">.</span><span class="pl-c1">number</span> <span class="pl-c1">=</span> <span class="pl-v">String</span> <span class="pl-kos">;</span> <span class="pl-c">// String | Number</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-48" class="anchor" aria-label="Permalink: Python" href="#python-48"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ex = ccxt.coinbase() ex.number = str # str | float"><pre><span class="pl-s1">ex</span> <span class="pl-c1">=</span> <span class="pl-s1">ccxt</span>.<span class="pl-c1">coinbase</span>() <span class="pl-s1">ex</span>.<span class="pl-c1">number</span> <span class="pl-c1">=</span> <span class="pl-s1">str</span> <span class="pl-c"># str | float</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-46" class="anchor" aria-label="Permalink: PHP" href="#php-46"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ex = new ccxt\\coinbase(); $ex->number = 'strval'; // 'strval' | 'floatval'"><pre><span class="pl-s1"><span class="pl-c1">$</span>ex</span> = <span class="pl-k">new</span> <span class="pl-v">ccxt</span>\\<span class="pl-v">coinbase</span>(); <span class="pl-s1"><span class="pl-c1">$</span>ex</span>-><span class="pl-c1">number</span> = <span class="pl-s">'<span class="pl-s">strval</span>'</span>; <span class="pl-c">// 'strval' | 'floatval'</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>C#</strong></h4><a id="user-content-c" class="anchor" aria-label="Permalink: C#" href="#c"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="var ex = new ccxt.coinbase(); ex.number = typeof(String); // typeof(String) | typeof(float)"><pre><span class="pl-k">var</span> <span class="pl-s1">ex</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-s1">coinbase</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">ex</span><span class="pl-kos">.</span><span class="pl-s1">number</span> <span class="pl-c1">=</span> <span class="pl-k">typeof</span><span class="pl-kos">(</span><span class="pl-smi">String</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// typeof(String) | typeof(float)</span></pre></div> <div class="markdown-heading"><h1 class="heading-element">Error Handling</h1><a id="user-content-error-handling" class="anchor" aria-label="Permalink: Error Handling" href="#error-handling"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <ul> <li><a href="#retry-mechanism">Retry Mechanism</a></li> <li><a href="#exception-hierarchy">Exception Hierarchy</a></li> <li><a href="#exchangeerror">ExchangeError</a></li> <li><a href="#operationfailed">OperationFailed</a></li> <li><a href="#ddosprotection">DDoSProtection</a></li> <li><a href="#ratelimitexceeded">RateLimitExceeded</a></li> <li><a href="#requesttimeout">RequestTimeout</a></li> <li><a href="#requesttimeout">RequestTimeout</a></li> <li><a href="#exchangenotavailable">ExchangeNotAvailable</a></li> <li><a href="#invalidnonce">InvalidNonce</a></li> </ul> <p>The error handling with CCXT is done with the exception mechanism that is natively available with all languages.</p> <p>To handle the errors you should add a <code>try</code> block around the call to a unified method and catch the exceptions like you would normally do with your language:</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-49" class="anchor" aria-label="Permalink: Javascript" href="#javascript-49"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// try to call a unified method try { const response = await exchange.fetchTicker ('ETH/BTC') console.log (response) } catch (e) { // if the exception is thrown, it is "caught" and can be handled here // the handling reaction depends on the type of the exception // and on the purpose or business logic of your application if (e instanceof ccxt.NetworkError) { console.log (exchange.id, 'fetchTicker failed due to a network error:', e.message) // retry or whatever } else if (e instanceof ccxt.ExchangeError) { console.log (exchange.id, 'fetchTicker failed due to exchange error:', e.message) // retry or whatever } else { console.log (exchange.id, 'fetchTicker failed with:', e.message) // retry or whatever } }"><pre><span class="pl-c">// try to call a unified method</span> <span class="pl-k">try</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-s1">response</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-en">fetchTicker</span> <span class="pl-kos">(</span><span class="pl-s">'ETH/BTC'</span><span class="pl-kos">)</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">response</span><span class="pl-kos">)</span> <span class="pl-kos">}</span> <span class="pl-k">catch</span> <span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-c">// if the exception is thrown, it is "caught" and can be handled here</span> <span class="pl-c">// the handling reaction depends on the type of the exception</span> <span class="pl-c">// and on the purpose or business logic of your application</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">e</span> <span class="pl-k">instanceof</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">NetworkError</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">id</span><span class="pl-kos">,</span> <span class="pl-s">'fetchTicker failed due to a network error:'</span><span class="pl-kos">,</span> <span class="pl-s1">e</span><span class="pl-kos">.</span><span class="pl-c1">message</span><span class="pl-kos">)</span> <span class="pl-c">// retry or whatever</span> <span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">e</span> <span class="pl-k">instanceof</span> <span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">ExchangeError</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">id</span><span class="pl-kos">,</span> <span class="pl-s">'fetchTicker failed due to exchange error:'</span><span class="pl-kos">,</span> <span class="pl-s1">e</span><span class="pl-kos">.</span><span class="pl-c1">message</span><span class="pl-kos">)</span> <span class="pl-c">// retry or whatever</span> <span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">exchange</span><span class="pl-kos">.</span><span class="pl-c1">id</span><span class="pl-kos">,</span> <span class="pl-s">'fetchTicker failed with:'</span><span class="pl-kos">,</span> <span class="pl-s1">e</span><span class="pl-kos">.</span><span class="pl-c1">message</span><span class="pl-kos">)</span> <span class="pl-c">// retry or whatever</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-49" class="anchor" aria-label="Permalink: Python" href="#python-49"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# try to call a unified method try: response = await exchange.fetch_order_book('ETH/BTC') print(response) except ccxt.NetworkError as e: print(exchange.id, 'fetch_order_book failed due to a network error:', str(e)) # retry or whatever except ccxt.ExchangeError as e: print(exchange.id, 'fetch_order_book failed due to exchange error:', str(e)) # retry or whatever except Exception as e: print(exchange.id, 'fetch_order_book failed with:', str(e)) # retry or whatever"><pre><span class="pl-c"># try to call a unified method</span> <span class="pl-k">try</span>: <span class="pl-s1">response</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">fetch_order_book</span>(<span class="pl-s">'ETH/BTC'</span>) <span class="pl-en">print</span>(<span class="pl-s1">response</span>) <span class="pl-k">except</span> <span class="pl-s1">ccxt</span>.<span class="pl-c1">NetworkError</span> <span class="pl-k">as</span> <span class="pl-s1">e</span>: <span class="pl-en">print</span>(<span class="pl-s1">exchange</span>.<span class="pl-c1">id</span>, <span class="pl-s">'fetch_order_book failed due to a network error:'</span>, <span class="pl-en">str</span>(<span class="pl-s1">e</span>)) <span class="pl-c"># retry or whatever</span> <span class="pl-k">except</span> <span class="pl-s1">ccxt</span>.<span class="pl-c1">ExchangeError</span> <span class="pl-k">as</span> <span class="pl-s1">e</span>: <span class="pl-en">print</span>(<span class="pl-s1">exchange</span>.<span class="pl-c1">id</span>, <span class="pl-s">'fetch_order_book failed due to exchange error:'</span>, <span class="pl-en">str</span>(<span class="pl-s1">e</span>)) <span class="pl-c"># retry or whatever</span> <span class="pl-k">except</span> <span class="pl-v">Exception</span> <span class="pl-k">as</span> <span class="pl-s1">e</span>: <span class="pl-en">print</span>(<span class="pl-s1">exchange</span>.<span class="pl-c1">id</span>, <span class="pl-s">'fetch_order_book failed with:'</span>, <span class="pl-en">str</span>(<span class="pl-s1">e</span>)) <span class="pl-c"># retry or whatever</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-47" class="anchor" aria-label="Permalink: PHP" href="#php-47"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// try to call a unified method try { $response = $exchange->fetch_trades('ETH/BTC'); print_r($response); } catch (\ccxt\NetworkError $e) { echo $exchange->id . ' fetch_trades failed due to a network error: ' . $e->getMessage () . "\n"; // retry or whatever } catch (\ccxt\ExchangeError $e) { echo $exchange->id . ' fetch_trades failed due to exchange error: ' . $e->getMessage () . "\n"; // retry or whatever } catch (Exception $e) { echo $exchange->id . ' fetch_trades failed with: ' . $e->getMessage () . "\n"; // retry or whatever }"><pre><span class="pl-c">// try to call a unified method</span> <span class="pl-k">try</span> { <span class="pl-s1"><span class="pl-c1">$</span>response</span> = <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-en">fetch_trades</span>(<span class="pl-s">'<span class="pl-s">ETH/BTC</span>'</span>); <span class="pl-en">print_r</span>(<span class="pl-s1"><span class="pl-c1">$</span>response</span>); } <span class="pl-k">catch</span> (<span class="pl-smi">\<span class="pl-v">ccxt</span>\<span class="pl-smi">NetworkError</span></span> <span class="pl-s1"><span class="pl-c1">$</span>e</span>) { <span class="pl-k">echo</span> <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">id</span> . <span class="pl-s">'<span class="pl-s"> fetch_trades failed due to a network error: </span>'</span> . <span class="pl-s1"><span class="pl-c1">$</span>e</span>-><span class="pl-en">getMessage</span> () . <span class="pl-s">"\n"</span>; <span class="pl-c">// retry or whatever</span> } <span class="pl-k">catch</span> (<span class="pl-smi">\<span class="pl-v">ccxt</span>\<span class="pl-smi">ExchangeError</span></span> <span class="pl-s1"><span class="pl-c1">$</span>e</span>) { <span class="pl-k">echo</span> <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">id</span> . <span class="pl-s">'<span class="pl-s"> fetch_trades failed due to exchange error: </span>'</span> . <span class="pl-s1"><span class="pl-c1">$</span>e</span>-><span class="pl-en">getMessage</span> () . <span class="pl-s">"\n"</span>; <span class="pl-c">// retry or whatever</span> } <span class="pl-k">catch</span> (<span class="pl-smi"><span class="pl-smi">Exception</span></span> <span class="pl-s1"><span class="pl-c1">$</span>e</span>) { <span class="pl-k">echo</span> <span class="pl-s1"><span class="pl-c1">$</span>exchange</span>-><span class="pl-c1">id</span> . <span class="pl-s">'<span class="pl-s"> fetch_trades failed with: </span>'</span> . <span class="pl-s1"><span class="pl-c1">$</span>e</span>-><span class="pl-en">getMessage</span> () . <span class="pl-s">"\n"</span>; <span class="pl-c">// retry or whatever</span> }</pre></div> <div class="markdown-heading"><h2 class="heading-element">Retry Mechanism</h2><a id="user-content-retry-mechanism" class="anchor" aria-label="Permalink: Retry Mechanism" href="#retry-mechanism"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>When dealing with HTTP requests, it's important to understand that requests might fail for various reasons. Common causes of these failures include the server being unavailable, network instability, or temporary server issues. To handle such scenarios gracefully, CCXT provide an option to automatically retry failed requests. You can set the value of <code>maxRetriesOnFailure</code> and <code>maxRetriesOnFailureDelay</code> to configure the number of retries and the delay between retries, example:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="exchange.options['maxRetriesOnFailure'] = 3 # if we get an error like the ones mentioned above we will retry up to three times per request exchange.options['maxRetriesOnFailureDelay'] = 1000 # we will wait 1000ms (1s) between retries"><pre><span class="pl-s1">exchange</span>.<span class="pl-c1">options</span>[<span class="pl-s">'maxRetriesOnFailure'</span>] <span class="pl-c1">=</span> <span class="pl-c1">3</span> <span class="pl-c"># if we get an error like the ones mentioned above we will retry up to three times per request</span> <span class="pl-s1">exchange</span>.<span class="pl-c1">options</span>[<span class="pl-s">'maxRetriesOnFailureDelay'</span>] <span class="pl-c1">=</span> <span class="pl-c1">1000</span> <span class="pl-c"># we will wait 1000ms (1s) between retries</span></pre></div> <p>It's important to highlight that only server/network-related issues will be part of the retry mechanism; if the user gets an error due to <code>InsufficientFunds</code> or <code>InvalidOrder,</code> the request will not be repeated.</p> <div class="markdown-heading"><h2 class="heading-element">Exception Hierarchy</h2><a id="user-content-exception-hierarchy" class="anchor" aria-label="Permalink: Exception Hierarchy" href="#exception-hierarchy"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>All exceptions are derived from the base BaseError exception, which, in its turn, is defined in the ccxt library like so:</p> <div class="markdown-heading"><h4 class="heading-element"><strong>Javascript</strong></h4><a id="user-content-javascript-50" class="anchor" aria-label="Permalink: Javascript" href="#javascript-50"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="class BaseError extends Error { constructor () { super () // a workaround to make `instanceof BaseError` work in ES5 this.constructor = BaseError this.__proto__ = BaseError.prototype } }"><pre><span class="pl-k">class</span> <span class="pl-v">BaseError</span> <span class="pl-k">extends</span> <span class="pl-v">Error</span> <span class="pl-kos">{</span> <span class="pl-en">constructor</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">super</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c">// a workaround to make `instanceof BaseError` work in ES5</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">constructor</span> <span class="pl-c1">=</span> <span class="pl-v">BaseError</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">__proto__</span> <span class="pl-c1">=</span> <span class="pl-v">BaseError</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>Python</strong></h4><a id="user-content-python-50" class="anchor" aria-label="Permalink: Python" href="#python-50"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="class BaseError (Exception): pass"><pre><span class="pl-k">class</span> <span class="pl-v">BaseError</span> (<span class="pl-v">Exception</span>): <span class="pl-k">pass</span></pre></div> <div class="markdown-heading"><h4 class="heading-element"><strong>PHP</strong></h4><a id="user-content-php-48" class="anchor" aria-label="Permalink: PHP" href="#php-48"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="class BaseError extends \Exception {}"><pre><span class="pl-k">class</span> BaseError <span class="pl-k">extends</span> \Exception {}</pre></div> <p>The exception inheritance hierarchy lives in this file: <a href="https://github.com/ccxt/ccxt/blob/master/ts/src/base/errorHierarchy.ts">https://github.com/ccxt/ccxt/blob/master/ts/src/base/errorHierarchy.ts</a> , and visually can be outlined like shown below:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="+ BaseError | +---+ ExchangeError | | | +---+ OperationRejected | | | +---+ BadRequest | | | | | +---+ BadSymbol | | | +---+ AuthenticationError | | | | | +---+ PermissionDenied | | | | | +---+ AccountSuspended | | | +---+ ArgumentsRequired | | | +---+ BadResponse | | | | | +---+ NullResponse | | | +---+ InsufficientFunds | | | +---+ InvalidAddress | | | | | +---+ AddressPending | | | +---+ InvalidOrder | | | | | +---+ OrderNotFound | | | | | +---+ OrderNotCached | | | | | +---+ CancelPending | | | | | +---+ OrderImmediatelyFillable | | | | | +---+ OrderNotFillable | | | | | +---+ DuplicateOrderId | | | +---+ NotSupported | | +---+ OperationFailed (recoverable) | +---+ NetworkError (recoverable) | +---+ InvalidNonce | +---+ RequestTimeout | +---+ ExchangeNotAvailable | | | +---+ OnMaintenance | +---+ RateLimitExceeded | +---+ DDoSProtection"><pre lang="text" class="notranslate"><code>+ BaseError | +---+ ExchangeError | | | +---+ OperationRejected | | | +---+ BadRequest | | | | | +---+ BadSymbol | | | +---+ AuthenticationError | | | | | +---+ PermissionDenied | | | | | +---+ AccountSuspended | | | +---+ ArgumentsRequired | | | +---+ BadResponse | | | | | +---+ NullResponse | | | +---+ InsufficientFunds | | | +---+ InvalidAddress | | | | | +---+ AddressPending | | | +---+ InvalidOrder | | | | | +---+ OrderNotFound | | | | | +---+ OrderNotCached | | | | | +---+ CancelPending | | | | | +---+ OrderImmediatelyFillable | | | | | +---+ OrderNotFillable | | | | | +---+ DuplicateOrderId | | | +---+ NotSupported | | +---+ OperationFailed (recoverable) | +---+ NetworkError (recoverable) | +---+ InvalidNonce | +---+ RequestTimeout | +---+ ExchangeNotAvailable | | | +---+ OnMaintenance | +---+ RateLimitExceeded | +---+ DDoSProtection </code></pre></div> <p>The <code>BaseError</code> class is a generic root error class for all sorts of errors, including accessibility and request/response mismatch. If you don't need to catch any specific subclass of exceptions, you can just use <code>BaseError</code>, where all exception types are being caught.</p> <p>From <code>BaseError</code> derives two different families of errors: <code>OperationFailed</code> and <code>ExchangeError</code> (they also have their specific sub-types, as explained below).</p> <div class="markdown-heading"><h3 class="heading-element">OperationFailed</h3><a id="user-content-operationfailed" class="anchor" aria-label="Permalink: OperationFailed" href="#operationfailed"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p><a name="user-content-networkerror" id="user-content-networkerror"></a></p> <p>An <code>OperationFailed</code> might happen when user sends <strong>correctly constructed & valid request</strong> to exchange, but a non-deterministic problem occurred:</p> <ul> <li>maintenance ongoing</li> <li>internet/network connectivitiy issues</li> <li>DDoS protections</li> <li>"Server busy, try again"...</li> </ul> <p>Such exceptions are temporary and re-trying the request again might be enough. However, if the error still happens, then it may indicate some persistent problem with the exchange or with your connection.</p> <p><code>OperationFailed</code> has the following sub-types: <code>RequestTimeout</code>,<code>DDoSProtection</code> (includes sub-type <code>RateLimitExceeded</code>), <code>ExchangeNotAvailable</code>, <code>InvalidNonce</code>.</p> <div class="markdown-heading"><h4 class="heading-element">DDoSProtection</h4><a id="user-content-ddosprotection" class="anchor" aria-label="Permalink: DDoSProtection" href="#ddosprotection"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>This exception is thrown in cases when cloud/hosting services (Cloudflare, Incapsula or etc..) limits requests from user/region/location or when the exchange API restricts user because of making abnormal requests. This exception also contains specific sub-type exception <code>RateLimitExceeded</code>, which directly means that user makes much frequent requests than tolerated by exchange API engine.</p> <div class="markdown-heading"><h4 class="heading-element">RequestTimeout</h4><a id="user-content-requesttimeout" class="anchor" aria-label="Permalink: RequestTimeout" href="#requesttimeout"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>This exception is raised when the connection with the exchange fails or data is not fully received in a specified amount of time. This is controlled by the exchange's <code>.timeout</code> property. When a <code>RequestTimeout</code> is raised, the user doesn't know the outcome of a request (whether it was accepted by the exchange server or not).</p> <p>Thus it's advised to handle this type of exception in the following manner:</p> <ul> <li>for fetching requests it is safe to retry the call</li> <li>for a request to <code>cancelOrder()</code> a user is required to retry the same call the second time. A subsequent retry to <code>cancelOrder()</code> will return one of the following possible results: <ul> <li>a request is completed successfully, meaning the order has been properly canceled now</li> <li>an <code>OrderNotFound</code> exception is raised, which means the order was either already canceled on the first attempt or has been executed (filled and closed) in the meantime between the two attempts.</li> </ul> </li> <li>if a request to <code>createOrder()</code> fails with a <code>RequestTimeout</code> the user should: <ul> <li>call <code>fetchOrders()</code>, <code>fetchOpenOrders()</code>, <code>fetchClosedOrders()</code> to check if the request to place the order has succeeded and the order is now open</li> <li>if the order is not <code>'open'</code> the user should <code>fetchBalance()</code> to check if the balance has changed since the order was created on the first run and then was filled and closed by the time of the second check.</li> </ul> </li> </ul> <div class="markdown-heading"><h4 class="heading-element">ExchangeNotAvailable</h4><a id="user-content-exchangenotavailable" class="anchor" aria-label="Permalink: ExchangeNotAvailable" href="#exchangenotavailable"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>This type of exception is thrown when the underlying exchange is unreachable. The ccxt library also throws this error if it detects any of the following keywords in response:</p> <ul> <li><code>offline</code></li> <li><code>unavailable</code></li> <li><code>busy</code></li> <li><code>retry</code></li> <li><code>wait</code></li> <li><code>maintain</code></li> <li><code>maintenance</code></li> <li><code>maintenancing</code></li> </ul> <div class="markdown-heading"><h4 class="heading-element">InvalidNonce</h4><a id="user-content-invalidnonce" class="anchor" aria-label="Permalink: InvalidNonce" href="#invalidnonce"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>Raised when your nonce is less than the previous nonce used with your keypair, as described in the <a href="#authentication">Authentication</a> section. This type of exception is thrown in these cases (in order of precedence for checking):</p> <ul> <li>You are not rate-limiting your requests or sending too many of them too often.</li> <li>Your API keys are not fresh and new (have been used with some different software or script already, just always create a new keypair when you add this or that exchange).</li> <li>The same keypair is shared across multiple instances of the exchange class (for example, in a multithreaded environment or in separate processes).</li> <li>Your system clock is out of synch. System time should be synched with UTC in a non-DST timezone at a rate of once every ten minutes or even more frequently because of the clock drifting. <strong>Enabling time synch in Windows is usually not enough!</strong> You have to set it up with the OS Registry (Google <em>"time synch frequency"</em> for your OS).</li> </ul> <div class="markdown-heading"><h3 class="heading-element">ExchangeError</h3><a id="user-content-exchangeerror" class="anchor" aria-label="Permalink: ExchangeError" href="#exchangeerror"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>In contrast to <code>OperationFailed</code>, the <code>ExchangeError</code> is mostly happening when the request is impossible to succeed (because of factors listed below), so even if you retry the same request hundreds of times, they will still fail, because the request is being made incorrectly.</p> <p>Possible reasons for this exception:</p> <ul> <li>endpoint is switched off by the exchange</li> <li>symbol not found on the exchange</li> <li>required parameter is missing</li> <li>the format of parameters is incorrect</li> <li>some problem happening on user-side that needs to be fixed</li> </ul> <p><code>ExchangeError</code> has the following sub-type exceptions:</p> <ul> <li> <code>NotSupported</code>: when the endpoint/operation is not offered or supported by the exchange API.</li> <li> <code>BadRequest</code>: user sends an <strong>incorrectly</strong> constructed request/parameter/action that is invalid/unallowed (i.e.: "invalid number", "forbidden symbol", "size beyond min/max limits", "incorrect precision", etc). Retrying would not help in this case, the request needs to be fixed/adjusted first.</li> <li> <code>OperationRejected</code> - user sends a <strong>correctly</strong> constructed request (that should be accepted by the exchange in a typical case), but some deterministic factor prevents your request to succeed. For example, your current account status might not allow it (i.e. "please close existing positions before changing the leverage", "too many pending orders", "your account in wrong position/margin mode") or at the give moment symbol is not tradable (i.e. "MarketClosed") or some explained factors, where you need to take a specific action (i.e. change some setting at first, or wait till specific moment). So, once again: <a href="#operationfailed"><strong>OperationFailed</strong></a> can be blindly re-tried and should success, while <code>OperationRejected</code> is a failure that depends on specific exact factors that need to be considered, before request can be retried.</li> <li> <code>AuthenticationError</code>: when an exchange requires one of the API credentials that you've missed to specify, or when there's a mistake in the keypair or an outdated nonce. Most of the time you need <code>apiKey</code> and <code>secret</code>, sometimes you also need <code>uid</code> and/or <code>password</code> if exchange API requires it.</li> <li> <code>PermissionDenied</code>: when there's no access for specified action or insufficient permissions on the specified <code>apiKey</code>.</li> <li> <code>InsufficientFunds</code>: when you don't have enough currency on your account balance to place an order.</li> <li> <code>InvalidAddress</code>: when encountering a bad funding address or a funding address shorter than <code>.minFundingAddressLength</code> (10 characters by default) in a call to <code>fetchDepositAddress</code>, <code>createDepositAddress</code> or <code>withdraw</code>.</li> <li> <code>InvalidOrder</code>: the base class for all exceptions related to the unified order API.</li> <li> <code>OrderNotFound</code>: when you are trying to fetch or cancel a non-existent order.</li> </ul> <div class="markdown-heading"><h1 class="heading-element">Troubleshooting</h1><a id="user-content-troubleshooting" class="anchor" aria-label="Permalink: Troubleshooting" href="#troubleshooting"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p>In case you experience any difficulty connecting to a particular exchange, do the following in order of precedence:</p> <ul> <li>Make sure that you have the most recent version of ccxt. Never trust your package installer (whether it is <code>npm</code>, <code>pip</code> or <code>composer</code>), instead always check your <strong>actual (real) runtime version number</strong> by running this code in your environment: <div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="console.log (ccxt.version) // JavaScript"><pre><span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span> <span class="pl-kos">(</span><span class="pl-s1">ccxt</span><span class="pl-kos">.</span><span class="pl-c1">version</span><span class="pl-kos">)</span> <span class="pl-c">// JavaScript</span></pre></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="print('CCXT version:', ccxt.__version__) # Python"><pre><span class="pl-en">print</span>(<span class="pl-s">'CCXT version:'</span>, <span class="pl-s1">ccxt</span>.<span class="pl-c1">__version__</span>) <span class="pl-c"># Python</span></pre></div> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="echo "CCXT v." . \ccxt\Exchange::VERSION . "\n"; // PHP"><pre><span class="pl-k">echo</span> <span class="pl-s">"<span class="pl-s">CCXT v.</span>"</span> . \<span class="pl-v">ccxt</span>\Exchange::<span class="pl-c1">VERSION</span> . <span class="pl-s">"\n"</span>; <span class="pl-c">// PHP</span></pre></div> </li> <li>Check the <a href="https://github.com/ccxt/ccxt/issues">Issues</a> or <a href="#announcements">Announcements</a> for recent updates.</li> <li>Make sure you have not turned off <a href="#rate-limit">rate-limiter with <code>enableRateLimit: false</code></a> (If anyone has custom rate-limit solution built, ensure it does not misbehave).</li> <li>If you use ccxt's proxy functionality, ensure it does not misbehave.</li> <li>Turn <code>verbose = true</code> to get more detail about it! <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="exchange = ccxt.binance() exchange.load_markets() exchange.verbose = True # for less noise, you can set that after `load_markets`, but if the error happens during `load_markets` then place this line before it # ... your codes here ..."><pre class="notranslate"><code>exchange = ccxt.binance() exchange.load_markets() exchange.verbose = True # for less noise, you can set that after `load_markets`, but if the error happens during `load_markets` then place this line before it # ... your codes here ... </code></pre></div> Your <a href="https://github.com/ccxt/ccxt/wiki/FAQ#what-is-required-to-get-help">code to reproduce the issue + verbose output is required</a> in order to get help.</li> <li>Python people can turn on DEBUG logging level with a standard pythonic logger, by adding these two lines to the beginning of their code: <div class="highlight highlight-source-python notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import logging logging.basicConfig(level=logging.DEBUG)"><pre><span class="pl-k">import</span> <span class="pl-s1">logging</span> <span class="pl-s1">logging</span>.<span class="pl-c1">basicConfig</span>(<span class="pl-s1">level</span><span class="pl-c1">=</span><span class="pl-s1">logging</span>.<span class="pl-c1">DEBUG</span>)</pre></div> </li> <li>Use verbose mode to make sure that the used API credentials correspond to the keys you intend to use. Make sure there's no confusion of keypairs.</li> <li><strong>Try a fresh new keypair if possible.</strong></li> <li>Read the answers to Frequently Asked Questions: <a href="https://github.com/ccxt/ccxt/wiki/FAQ">https://github.com/ccxt/ccxt/wiki/FAQ</a> </li> <li>Check the permissions on the keypair with the exchange website!</li> <li>Check your nonce. If you used your API keys with other software, you most likely should <a href="#overriding-the-nonce">override your nonce function</a> to match your previous nonce value. A nonce usually can be easily reset by generating a new unused keypair. If you are getting nonce errors with an existing key, try with a new API key that hasn't been used yet.</li> <li>Check your request rate if you are getting nonce errors. Your private requests should not follow one another quickly. You should not send them one after another in a split second or in short time. The exchange will most likely ban you if you don't make a delay before sending each new request. In other words, you should not hit their rate limit by sending unlimited private requests too frequently. Add a delay to your subsequent requests or enable the built-in rate-limiter, like shown in the long-poller <a href="https://github.com/ccxt/ccxt/tree/master/examples">examples</a>, also <a href="#order-book--market-depth">here</a>.</li> <li>Read the <a href="https://github.com/ccxt/ccxt/wiki/Exchanges">docs for your exchange</a> and compare your verbose output to the docs.</li> <li>Check your connectivity with the exchange by accessing it with your browser.</li> <li>Check your connection with the exchange through a <a href="#proxy">proxy</a>.</li> <li>Try accesing the exchange from a different computer or a remote server, to see if this is a local or global issue with the exchange.</li> <li>Check if there were any news from the exchange recently regarding downtime for maintenance. Some exchanges go offline for updates regularly (like once a week).</li> <li>Make sure that your system time in sync with the rest of the world's clocks since otherwise you may get invalid nonce errors.</li> </ul> <p><strong>Further Notes:</strong></p> <ul> <li>Use the <code>verbose = true</code> option or instantiate your troublesome exchange with <code>new ccxt.exchange ({ 'verbose': true })</code> to see the HTTP requests and responses in details. The verbose output will also be of use for us to debug it if you submit an issue on GitHub.</li> <li>Use DEBUG logging in Python!</li> <li>Some exchanges are not available in certain countries, using a <a href="#proxy">proxy</a> might be the solution in such cases.</li> <li>If you are getting authentication errors or <em>'invalid keys'</em> errors, those are most likely due to a nonce issue.</li> <li>Some exchanges do not state it clearly if they fail to authenticate your request. In those circumstances they might respond with an exotic error code, like HTTP 502 Bad Gateway Error or something that's even less related to the actual cause of the error.</li> </ul> </div> <div id="wiki-footer" class="mt-5 mb-0 wiki-footer gollum-markdown-content"> <div class="Box Box--condensed color-bg-subtle color-shadow-small"> <div class="Box-body markdown-body"> <p><em>(If the page is not being rendered for you, you can refer to the mirror at <a href="https://docs.ccxt.com/" rel="nofollow">https://docs.ccxt.com/</a>)</em></p> </div> </div> </div> </div> </div> <div style="min-width: 0" data-view-component="true" class="Layout-sidebar"> <div class="wiki-rightbar"> <nav id="wiki-pages-box" class="mb-4 wiki-pages-box js-wiki-pages-box" aria-labelledby="wiki-pages-box-heading"> <div class="Box Box--condensed color-shadow-small"> <div class="Box-header px-2 py-1 js-wiki-toggle-collapse" style="cursor: pointer"> <h3 class="Box-title d-flex flex-items-center" id="wiki-pages-box-heading"> <button id="icon-button-2918982d-f344-4e58-b5f4-0a359de82fac" aria-labelledby="tooltip-ab46d75e-c1a2-47bb-8244-09e82d82a744" type="button" data-view-component="true" class="Button Button--iconOnly Button--invisible Button--small js-wiki-sidebar-pages-toggle-chevron "> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down Button-visual"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path> </svg> </button><tool-tip id="tooltip-ab46d75e-c1a2-47bb-8244-09e82d82a744" for="icon-button-2918982d-f344-4e58-b5f4-0a359de82fac" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">Toggle table of contents</tool-tip> <span>Pages <span title="15" data-view-component="true" class="Counter Counter--primary">15</span></span> </h3> </div> <div class="d-none js-wiki-sidebar-toggle-display"> <div class="filter-bar"> <input type="text" id="wiki-pages-filter" class="form-control input-sm input-block js-filterable-field" placeholder="Find a page…" aria-label="Find a page…"> </div> <ul class="m-0 p-0 list-style-none" data-filterable-for="wiki-pages-filter" data-filterable-type="substring" data-pjax> <li class="Box-row px-2 py-2"> <details class="details-reset" > <summary> <div class="d-flex flex-items-start"> <div class="p-2 mt-n1 mb-n1 ml-n1 btn btn-octicon js-wiki-sidebar-toc-toggle-chevron-button "> <span hidden="hidden" data-view-component="true"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" data-view-component="true" class="js-wiki-sidebar-toc-spinner mr-0 v-align-text-bottom anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" fill="none" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /> </svg> <span class="sr-only">Loading</span> </span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down js-wiki-sidebar-toc-toggle-chevron mr-0"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path> </svg> </div> <span data-view-component="true" class="Truncate"> <a href="/ccxt/ccxt/wiki" data-view-component="true" class="Truncate-text text-bold py-1">Home</a> </span> </div> </summary> <include-fragment class="js-wiki-sidebar-toc-fragment" loading="lazy" src="https://github.com/ccxt/ccxt/wiki/Home/_toc"> </include-fragment> </details> </li> <li class="Box-row px-2 py-2"> <details class="details-reset" > <summary> <div class="d-flex flex-items-start"> <div class="p-2 mt-n1 mb-n1 ml-n1 btn btn-octicon js-wiki-sidebar-toc-toggle-chevron-button "> <span hidden="hidden" data-view-component="true"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" data-view-component="true" class="js-wiki-sidebar-toc-spinner mr-0 v-align-text-bottom anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" fill="none" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /> </svg> <span class="sr-only">Loading</span> </span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down js-wiki-sidebar-toc-toggle-chevron mr-0"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path> </svg> </div> <span data-view-component="true" class="Truncate"> <a href="/ccxt/ccxt/wiki/ccxt.pro" data-view-component="true" class="Truncate-text text-bold py-1">ccxt.pro</a> </span> </div> </summary> <include-fragment class="js-wiki-sidebar-toc-fragment" loading="lazy" src="https://github.com/ccxt/ccxt/wiki/ccxt.pro/_toc"> </include-fragment> </details> </li> <li class="Box-row px-2 py-2"> <details class="details-reset" > <summary> <div class="d-flex flex-items-start"> <div class="p-2 mt-n1 mb-n1 ml-n1 btn btn-octicon js-wiki-sidebar-toc-toggle-chevron-button "> <span hidden="hidden" data-view-component="true"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" data-view-component="true" class="js-wiki-sidebar-toc-spinner mr-0 v-align-text-bottom anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" fill="none" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /> </svg> <span class="sr-only">Loading</span> </span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down js-wiki-sidebar-toc-toggle-chevron mr-0"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path> </svg> </div> <span data-view-component="true" class="Truncate"> <a href="/ccxt/ccxt/wiki/ccxt.pro.install" data-view-component="true" class="Truncate-text text-bold py-1">ccxt.pro.install</a> </span> </div> </summary> <include-fragment class="js-wiki-sidebar-toc-fragment" loading="lazy" src="https://github.com/ccxt/ccxt/wiki/ccxt.pro.install/_toc"> </include-fragment> </details> </li> <li class="Box-row px-2 py-2"> <details class="details-reset" > <summary> <div class="d-flex flex-items-start"> <div class="p-2 mt-n1 mb-n1 ml-n1 btn btn-octicon js-wiki-sidebar-toc-toggle-chevron-button "> <span hidden="hidden" data-view-component="true"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" data-view-component="true" class="js-wiki-sidebar-toc-spinner mr-0 v-align-text-bottom anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" fill="none" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /> </svg> <span class="sr-only">Loading</span> </span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down js-wiki-sidebar-toc-toggle-chevron mr-0"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path> </svg> </div> <span data-view-component="true" class="Truncate"> <a href="/ccxt/ccxt/wiki/ccxt.pro.manual" data-view-component="true" class="Truncate-text text-bold py-1">ccxt.pro.manual</a> </span> </div> </summary> <include-fragment class="js-wiki-sidebar-toc-fragment" loading="lazy" src="https://github.com/ccxt/ccxt/wiki/ccxt.pro.manual/_toc"> </include-fragment> </details> </li> <li class="Box-row px-2 py-2"> <details class="details-reset" > <summary> <div class="d-flex flex-items-start"> <div class="p-2 mt-n1 mb-n1 ml-n1 btn btn-octicon js-wiki-sidebar-toc-toggle-chevron-button "> <span hidden="hidden" data-view-component="true"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" data-view-component="true" class="js-wiki-sidebar-toc-spinner mr-0 v-align-text-bottom anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" fill="none" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /> </svg> <span class="sr-only">Loading</span> </span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down js-wiki-sidebar-toc-toggle-chevron mr-0"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path> </svg> </div> <span data-view-component="true" class="Truncate"> <a href="/ccxt/ccxt/wiki/Certification" data-view-component="true" class="Truncate-text text-bold py-1">Certification</a> </span> </div> </summary> <include-fragment class="js-wiki-sidebar-toc-fragment" loading="lazy" src="https://github.com/ccxt/ccxt/wiki/Certification/_toc"> </include-fragment> </details> </li> <li class="Box-row px-2 py-2"> <details class="details-reset" > <summary> <div class="d-flex flex-items-start"> <div class="p-2 mt-n1 mb-n1 ml-n1 btn btn-octicon js-wiki-sidebar-toc-toggle-chevron-button "> <span hidden="hidden" data-view-component="true"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" data-view-component="true" class="js-wiki-sidebar-toc-spinner mr-0 v-align-text-bottom anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" fill="none" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /> </svg> <span class="sr-only">Loading</span> </span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down js-wiki-sidebar-toc-toggle-chevron mr-0"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path> </svg> </div> <span data-view-component="true" class="Truncate"> <a href="/ccxt/ccxt/wiki/CLI" data-view-component="true" class="Truncate-text text-bold py-1">CLI</a> </span> </div> </summary> <include-fragment class="js-wiki-sidebar-toc-fragment" loading="lazy" src="https://github.com/ccxt/ccxt/wiki/CLI/_toc"> </include-fragment> </details> </li> <li class="Box-row px-2 py-2"> <details class="details-reset" > <summary> <div class="d-flex flex-items-start"> <div class="p-2 mt-n1 mb-n1 ml-n1 btn btn-octicon js-wiki-sidebar-toc-toggle-chevron-button "> <span hidden="hidden" data-view-component="true"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" data-view-component="true" class="js-wiki-sidebar-toc-spinner mr-0 v-align-text-bottom anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" fill="none" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /> </svg> <span class="sr-only">Loading</span> </span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down js-wiki-sidebar-toc-toggle-chevron mr-0"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path> </svg> </div> <span data-view-component="true" class="Truncate"> <a href="/ccxt/ccxt/wiki/Exchange-Markets" data-view-component="true" class="Truncate-text text-bold py-1">Exchange Markets</a> </span> </div> </summary> <include-fragment class="js-wiki-sidebar-toc-fragment" loading="lazy" src="https://github.com/ccxt/ccxt/wiki/Exchange-Markets/_toc"> </include-fragment> </details> </li> <li class="Box-row px-2 py-2"> <details class="details-reset" > <summary> <div class="d-flex flex-items-start"> <div class="p-2 mt-n1 mb-n1 ml-n1 btn btn-octicon js-wiki-sidebar-toc-toggle-chevron-button "> <span hidden="hidden" data-view-component="true"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" data-view-component="true" class="js-wiki-sidebar-toc-spinner mr-0 v-align-text-bottom anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" fill="none" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /> </svg> <span class="sr-only">Loading</span> </span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down js-wiki-sidebar-toc-toggle-chevron mr-0"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path> </svg> </div> <span data-view-component="true" class="Truncate"> <a href="/ccxt/ccxt/wiki/Exchange-Markets-By-Country" data-view-component="true" class="Truncate-text text-bold py-1">Exchange Markets By Country</a> </span> </div> </summary> <include-fragment class="js-wiki-sidebar-toc-fragment" loading="lazy" src="https://github.com/ccxt/ccxt/wiki/Exchange-Markets-By-Country/_toc"> </include-fragment> </details> </li> <li class="Box-row px-2 py-2"> <details class="details-reset" > <summary> <div class="d-flex flex-items-start"> <div class="p-2 mt-n1 mb-n1 ml-n1 btn btn-octicon js-wiki-sidebar-toc-toggle-chevron-button "> <span hidden="hidden" data-view-component="true"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" data-view-component="true" class="js-wiki-sidebar-toc-spinner mr-0 v-align-text-bottom anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" fill="none" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /> </svg> <span class="sr-only">Loading</span> </span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down js-wiki-sidebar-toc-toggle-chevron mr-0"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path> </svg> </div> <span data-view-component="true" class="Truncate"> <a href="/ccxt/ccxt/wiki/FAQ" data-view-component="true" class="Truncate-text text-bold py-1">FAQ</a> </span> </div> </summary> <include-fragment class="js-wiki-sidebar-toc-fragment" loading="lazy" src="https://github.com/ccxt/ccxt/wiki/FAQ/_toc"> </include-fragment> </details> </li> <li class="Box-row px-2 py-2"> <details class="details-reset" > <summary> <div class="d-flex flex-items-start"> <div class="p-2 mt-n1 mb-n1 ml-n1 btn btn-octicon js-wiki-sidebar-toc-toggle-chevron-button "> <span hidden="hidden" data-view-component="true"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" data-view-component="true" class="js-wiki-sidebar-toc-spinner mr-0 v-align-text-bottom anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" fill="none" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /> </svg> <span class="sr-only">Loading</span> </span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down js-wiki-sidebar-toc-toggle-chevron mr-0"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path> </svg> </div> <span data-view-component="true" class="Truncate"> <a href="/ccxt/ccxt/wiki/Install" data-view-component="true" class="Truncate-text text-bold py-1">Install</a> </span> </div> </summary> <include-fragment class="js-wiki-sidebar-toc-fragment" loading="lazy" src="https://github.com/ccxt/ccxt/wiki/Install/_toc"> </include-fragment> </details> </li> <li class="Box-row px-2 py-2"> <details class="details-reset" open> <summary> <div class="d-flex flex-items-start"> <div class="p-2 mt-n1 mb-n1 ml-n1 btn btn-octicon js-wiki-sidebar-toc-toggle-chevron-button "> <span hidden="hidden" data-view-component="true"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" data-view-component="true" class="js-wiki-sidebar-toc-spinner mr-0 v-align-text-bottom anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" fill="none" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /> </svg> <span class="sr-only">Loading</span> </span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down js-wiki-sidebar-toc-toggle-chevron js-wiki-sidebar-toc-toggle-chevron-open mr-0"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path> </svg> </div> <span data-view-component="true" class="Truncate"> <a href="/ccxt/ccxt/wiki/Manual" data-view-component="true" class="Truncate-text text-bold py-1">Manual</a> </span> </div> </summary> <ul class="list-style-none mx-4 px-1"> <li class="my-2" style="padding-left: 12px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#overview">Overview</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#social">Social</a> </li> <li class="my-2" style="padding-left: 12px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#exchanges">Exchanges</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#instantiation">Instantiation</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php">PHP</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-1">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-1">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-1">PHP</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#features">Features</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#overriding-exchange-properties-upon-instantiation">Overriding Exchange Properties Upon Instantiation</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-2">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-2">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-2">PHP</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#overriding-exchange-methods">Overriding Exchange Methods</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-3">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-3">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-3">PHP</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#testnets-and-sandbox-environments">Testnets And Sandbox Environments</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-4">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-4">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-4">PHP</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#exchange-structure">Exchange Structure</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#exchange-properties">Exchange Properties</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#exchange-metadata">Exchange Metadata</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#rate-limit">Rate Limit</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-5">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-5">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-5">PHP</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#notes-on-rate-limiter">Notes On Rate Limiter</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#one-rate-limiter-per-each-exchange-instance">One Rate Limiter Per Each Exchange Instance</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#ddos-protection-by-cloudflare--incapsula">DDoS Protection By Cloudflare / Incapsula</a> </li> <li class="my-2" style="padding-left: 12px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#markets">Markets</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#currency-structure">Currency Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#network-structure">Network Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#market-structure">Market Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#active-status">Active Status</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#precision-and-limits">Precision And Limits</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#notes-on-precision-and-limits">Notes On Precision And Limits</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#methods-for-formatting-decimals">Methods For Formatting Decimals</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#precision-mode">Precision Mode</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#padding-mode">Padding Mode</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#formatting-to-precision">Formatting To Precision</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-6">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-6">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-6">PHP</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-7">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-7">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-7">PHP</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-8">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-8">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-8">PHP</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#loading-markets">Loading Markets</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-9">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-9">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-9">PHP</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#symbols-and-market-ids">Symbols And Market Ids</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#methods-for-markets-and-currencies">Methods For Markets And Currencies</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-10">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-10">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-10">PHP</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#naming-consistency">Naming Consistency</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#notes-on-naming-consistency">Notes On Naming Consistency</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#questions-on-naming-consistency">Questions On Naming Consistency</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#consistency-of-base-and-quote-currencies">Consistency Of Base And Quote Currencies</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#contract-naming-conventions">Contract Naming Conventions</a> </li> <li class="my-2" style="padding-left: 60px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#future">Future</a> </li> <li class="my-2" style="padding-left: 60px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#perpetual-swap-perpetual-future">Perpetual Swap (Perpetual Future)</a> </li> <li class="my-2" style="padding-left: 60px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#option">Option</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#unified-networks">Unified Networks</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#market-cache-force-reload">Market Cache Force Reload</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-11">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-11">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-11">PHP</a> </li> <li class="my-2" style="padding-left: 12px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#implicit-api">Implicit API</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#api-methods--endpoints">API Methods / Endpoints</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#implicit-api-methods">Implicit API Methods</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#publicprivate-api">Public/Private API</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#synchronous-vs-asynchronous-calls">Synchronous vs Asynchronous Calls</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-12">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-12">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-12">PHP</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#returned-json-objects">Returned JSON Objects</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#passing-parameters-to-api-methods">Passing Parameters To API Methods</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#api-method-naming-conventions">API Method Naming Conventions</a> </li> <li class="my-2" style="padding-left: 12px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#unified-api">Unified API</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#overriding-unified-api-params">Overriding Unified API Params</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-13">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-13">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-13">PHP</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#pagination">Pagination</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#automatic-pagination">Automatic Pagination</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#pagination-params">Pagination params</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#examples">Examples</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#working-with-datetimes-and-timestamps">Working With Datetimes And Timestamps</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#date-based-pagination">Date-based Pagination</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-14">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-14">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-14">PHP</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#id-based-pagination">id-based Pagination</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-15">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-15">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-15">PHP</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#pagenumber-based-cursor-pagination">Pagenumber-based (Cursor) Pagination</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-16">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-16">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-16">PHP</a> </li> <li class="my-2" style="padding-left: 12px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#public-api">Public API</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#order-book">Order Book</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#fetchorderbook-examples">fetchOrderBook Examples</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-17">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-17">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-17">PHP</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#order-book-structure">Order Book Structure</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#notes-on-order-book-structure">Notes On Order Book Structure</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#market-depth">Market Depth</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-18">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-18">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-18">PHP</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#market-price">Market Price</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-19">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-19">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-19">PHP</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#price-tickers">Price Tickers</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#a-single-ticker-for-one-symbol">A Single Ticker For One Symbol</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#multiple-tickers-for-all-or-many-symbols">Multiple Tickers For All Or Many Symbols</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#ticker-structure">Ticker Structure</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#notes-on-ticker-structure">Notes On Ticker Structure</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#individually-by-symbol">Individually By Symbol</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-20">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-20">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-20">PHP</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#all-at-once">All At Once</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-21">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-21">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-21">PHP</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-22">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-22">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-22">PHP</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#ohlcv-candlestick-charts">OHLCV Candlestick Charts</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-23">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-23">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-23">PHP</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#get-raw-ohlcv-response">Get raw OHLCV response</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-24">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-24">Python</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#notes-on-latency">Notes On Latency</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#ohlcv-structure">OHLCV Structure</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#mark-index-and-premiumindex-candlestick-charts">Mark, Index and PremiumIndex Candlestick Charts</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-25">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-25">Python</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#ohlcv-emulation">OHLCV Emulation</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#public-trades">Public Trades</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#typescript">Typescript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-26">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-24">PHP</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#exchange-time">Exchange Time</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#exchange-status">Exchange Status</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#exchange-status-structure">Exchange Status Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#borrow-rates">Borrow Rates</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#isolated-borrow-rate-structure">Isolated Borrow Rate Structure</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#borrow-rate-structure">Borrow Rate Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#borrow-rate-history">Borrow Rate History</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#leverage-tiers">Leverage Tiers</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#leverage-tiers-structure">Leverage Tiers Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#funding-rate">Funding Rate</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#funding-interval">Funding Interval</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#funding-rate-structure">Funding Rate Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#funding-rate-history">Funding Rate History</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#funding-rate-history-structure">Funding Rate History Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#open-interest">Open Interest</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#open-interest-history">Open Interest History</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#open-interest-structure">Open Interest Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#historical-volatility">Historical Volatility</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#volatility-structure">Volatility Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#underlying-assets">Underlying Assets</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#underlying-assets-structure">Underlying Assets Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#settlement-history">Settlement History</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#settlement-history-structure">Settlement History Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#liquidations">Liquidations</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#liquidation-structure">Liquidation Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#greeks">Greeks</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#greeks-structure">Greeks Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#option-chain">Option Chain</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#option-chain-structure">Option Chain Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#long-short-ratio">Long Short Ratio</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#long-short-ratio-structure">Long Short Ratio Structure</a> </li> <li class="my-2" style="padding-left: 12px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#private-api">Private API</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#authentication">Authentication</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#api-keys-setup">API Keys Setup</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#required-credentials">Required Credentials</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#credential-validation">Credential Validation</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-26">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-27">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-25">PHP</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#configuring-api-keys">Configuring API Keys</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-27">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-28">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-26">PHP</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#api-key-permissions">API Key Permissions</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#sign-in">Sign In</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-28">Javascript</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#overriding-the-nonce">Overriding The Nonce</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#accounts">Accounts</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#accounts-structure">Accounts Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#account-balance">Account Balance</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#balance-structure">Balance Structure</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-29">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-29">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-27">PHP</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#orders">Orders</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#querying-orders">Querying Orders</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-30">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-30">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-28">PHP</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#understanding-the-orders-api-design">Understanding The Orders API Design</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#querying-multiple-orders-and-trades">Querying Multiple Orders And Trades</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#by-order-id">By Order Id</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-31">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-31">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-29">PHP</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#all-orders">All Orders</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#open-orders">Open Orders</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#closed-orders">Closed Orders</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#order-structure">Order Structure</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#timeinforce">timeInForce</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#placing-orders">Placing Orders</a> </li> <li class="my-2" style="padding-left: 60px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#common-pitfalls">Common pitfalls</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#limit-orders">Limit Orders</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#market-orders">Market Orders</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-32">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-32">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-30">PHP</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#market-buys">Market Buys</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#emulating-market-orders-with-limit-orders">Emulating Market Orders With Limit Orders</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#limit-orders-1">Limit Orders</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#conditional-orders">Conditional Orders</a> </li> <li class="my-2" style="padding-left: 60px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#trigger-order">Trigger order</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-33">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-33">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-31">PHP</a> </li> <li class="my-2" style="padding-left: 60px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#stop-loss-orders">Stop Loss Orders</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-34">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-34">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-32">PHP</a> </li> <li class="my-2" style="padding-left: 60px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#take-profit-orders">Take Profit Orders</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-35">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-35">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-33">PHP</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#stoploss-and-takeprofit-orders-attached-to-a-position">StopLoss And TakeProfit Orders Attached To A Position</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-36">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-36">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-34">PHP</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#trailing-orders">Trailing Orders</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-37">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-37">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-35">PHP</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#custom-order-params">Custom Order Params</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-38">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-38">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-36">PHP</a> </li> <li class="my-2" style="padding-left: 60px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#user-defined-clientorderid">User-defined clientOrderId</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-39">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-39">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-37">PHP</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#editing-orders">Editing Orders</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#canceling-orders">Canceling Orders</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#exceptions-upon-canceling-orders">Exceptions Upon Canceling Orders</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#my-trades">My Trades</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#how-orders-are-related-to-trades">How Orders Are Related To Trades</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#personal-trades">Personal Trades</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-40">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-40">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-38">PHP</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#trade-structure">Trade Structure</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#trades-by-order-id">Trades By Order Id</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-41">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-41">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-39">PHP</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#ledger">Ledger</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#ledger-entry-structure">Ledger Entry Structure</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#notes-on-ledger-entry-structure">Notes On Ledger Entry Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#deposit">Deposit</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#deposit-id-structure">Deposit Id Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#withdrawal">Withdrawal</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-42">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-42">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-40">PHP</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#deposit-and-withdrawal-networks">Deposit And Withdrawal Networks</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-43">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-43">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-41">PHP</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#transaction-structure">Transaction Structure</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#notes-on-transaction-structure">Notes On Transaction Structure</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#fetchdeposits-examples">fetchDeposits Examples</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-44">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-44">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-42">PHP</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#fetchwithdrawals-examples">fetchWithdrawals Examples</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-45">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-45">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-43">PHP</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#fetchtransactions-examples">fetchTransactions Examples</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-46">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-46">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-44">PHP</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#deposit-addresses">Deposit Addresses</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#address-structure">Address Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#transfers">Transfers</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#account-types">Account Types</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#transfer-structure">Transfer Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#fees">Fees</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#fee-structure">Fee Structure</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#fee-schedule">Fee Schedule</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#trading-fees">Trading Fees</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#trading-fee-schedule">Trading Fee Schedule</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#trading-fee-structure">Trading Fee Structure</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#transaction-fees">Transaction Fees</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#transaction-fee-schedule">Transaction Fee Schedule</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#transaction-fee-structure">Transaction Fee Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#borrow-interest">Borrow Interest</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#borrow-interest-structure">Borrow Interest Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#borrow-and-repay-margin">Borrow And Repay Margin</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#margin-loan-structure">Margin Loan Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#margin">Margin</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#margin-structure">Margin Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#set-margin-mode">Set Margin Mode</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#exchanges-without-setmarginmode">Exchanges Without setMarginMode</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#notes-on-suppressed-errors-for-setmarginmode">Notes On Suppressed Errors For setMarginMode</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#notes-on-the-marginmode-parameter">Notes On The marginMode Parameter</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-47">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-47">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-45">PHP</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#fetch-margin-mode">Fetch Margin Mode</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#margin-mode-structure">Margin Mode Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#set-leverage">Set Leverage</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#leverage">Leverage</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#leverage-structure">Leverage Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#contract-trading">Contract Trading</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#positions">Positions</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#position-structure">Position Structure</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#closing-positions">Closing Positions</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#set-position-mode">Set Position Mode</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#liquidation-price">Liquidation Price</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#funding-history">Funding History</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#funding-history-structure">Funding History Structure</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#conversion">Conversion</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#conversion-structure">Conversion Structure</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#proxy">Proxy</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#supported-proxy-types">Supported proxy types</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#proxyurl">proxyUrl</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#httpproxy-and-httpsproxy">httpProxy and httpsProxy</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#socksproxy">socksProxy</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#test-if-your-proxy-works">Test if your proxy works</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#using-proxy-callbacks">using proxy callbacks</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#extra-proxy-related-details">extra proxy related details</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#useragent">userAgent</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#custom-proxy-agents">custom proxy agents</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#cors-access-control-allow-origin">CORS (Access-Control-Allow-Origin)</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#string-math">String Math</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-48">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-48">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-46">PHP</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#c">C#</a> </li> <li class="my-2" style="padding-left: 12px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#error-handling">Error Handling</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-49">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-49">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-47">PHP</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#retry-mechanism">Retry Mechanism</a> </li> <li class="my-2" style="padding-left: 24px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#exception-hierarchy">Exception Hierarchy</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#javascript-50">Javascript</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#python-50">Python</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#php-48">PHP</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#operationfailed">OperationFailed</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#ddosprotection">DDoSProtection</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#requesttimeout">RequestTimeout</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#exchangenotavailable">ExchangeNotAvailable</a> </li> <li class="my-2" style="padding-left: 48px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#invalidnonce">InvalidNonce</a> </li> <li class="my-2" style="padding-left: 36px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#exchangeerror">ExchangeError</a> </li> <li class="my-2" style="padding-left: 12px;"> <a class="Link--primary" data-analytics-event="{"category":"Wiki","action":"toc_click","label":null}" href="/ccxt/ccxt/wiki/Manual#troubleshooting">Troubleshooting</a> </li> </ul> </details> </li> <li class="Box-row px-2 py-2"> <details class="details-reset" > <summary> <div class="d-flex flex-items-start"> <div class="p-2 mt-n1 mb-n1 ml-n1 btn btn-octicon js-wiki-sidebar-toc-toggle-chevron-button "> <span hidden="hidden" data-view-component="true"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" data-view-component="true" class="js-wiki-sidebar-toc-spinner mr-0 v-align-text-bottom anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" fill="none" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /> </svg> <span class="sr-only">Loading</span> </span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down js-wiki-sidebar-toc-toggle-chevron mr-0"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path> </svg> </div> <span data-view-component="true" class="Truncate"> <a href="/ccxt/ccxt/wiki/Requirements" data-view-component="true" class="Truncate-text text-bold py-1">Requirements</a> </span> </div> </summary> <include-fragment class="js-wiki-sidebar-toc-fragment" loading="lazy" src="https://github.com/ccxt/ccxt/wiki/Requirements/_toc"> </include-fragment> </details> </li> <li class="Box-row px-2 py-2"> <details class="details-reset" > <summary> <div class="d-flex flex-items-start"> <div class="p-2 mt-n1 mb-n1 ml-n1 btn btn-octicon js-wiki-sidebar-toc-toggle-chevron-button "> <span hidden="hidden" data-view-component="true"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" data-view-component="true" class="js-wiki-sidebar-toc-spinner mr-0 v-align-text-bottom anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" fill="none" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /> </svg> <span class="sr-only">Loading</span> </span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down js-wiki-sidebar-toc-toggle-chevron mr-0"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path> </svg> </div> <span data-view-component="true" class="Truncate"> <a href="/ccxt/ccxt/wiki/Spec" data-view-component="true" class="Truncate-text text-bold py-1">Spec</a> </span> </div> </summary> <include-fragment class="js-wiki-sidebar-toc-fragment" loading="lazy" src="https://github.com/ccxt/ccxt/wiki/Spec/_toc"> </include-fragment> </details> </li> <li class="Box-row px-2 py-2"> <details class="details-reset" > <summary> <div class="d-flex flex-items-start"> <div class="p-2 mt-n1 mb-n1 ml-n1 btn btn-octicon js-wiki-sidebar-toc-toggle-chevron-button "> <span hidden="hidden" data-view-component="true"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" data-view-component="true" class="js-wiki-sidebar-toc-spinner mr-0 v-align-text-bottom anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" fill="none" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /> </svg> <span class="sr-only">Loading</span> </span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down js-wiki-sidebar-toc-toggle-chevron mr-0"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path> </svg> </div> <span data-view-component="true" class="Truncate"> <a href="/ccxt/ccxt/wiki/Stats" data-view-component="true" class="Truncate-text text-bold py-1">Stats</a> </span> </div> </summary> <include-fragment class="js-wiki-sidebar-toc-fragment" loading="lazy" src="https://github.com/ccxt/ccxt/wiki/Stats/_toc"> </include-fragment> </details> </li> <li class="Box-row px-2 py-2"> <details class="details-reset" > <summary> <div class="d-flex flex-items-start"> <div class="p-2 mt-n1 mb-n1 ml-n1 btn btn-octicon js-wiki-sidebar-toc-toggle-chevron-button "> <span hidden="hidden" data-view-component="true"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" data-view-component="true" class="js-wiki-sidebar-toc-spinner mr-0 v-align-text-bottom anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" fill="none" /> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" /> </svg> <span class="sr-only">Loading</span> </span> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down js-wiki-sidebar-toc-toggle-chevron mr-0"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path> </svg> </div> <span data-view-component="true" class="Truncate"> <a href="/ccxt/ccxt/wiki/Verification" data-view-component="true" class="Truncate-text text-bold py-1">Verification</a> </span> </div> </summary> <include-fragment class="js-wiki-sidebar-toc-fragment" loading="lazy" src="https://github.com/ccxt/ccxt/wiki/Verification/_toc"> </include-fragment> </details> </li> </ul> </div> </div> </nav> <div class="gollum-markdown-content"> <div class="Box Box--condensed mb-4"> <div class="Box-body wiki-custom-sidebar markdown-body"> <div class="markdown-heading"><h4 align="center" class="heading-element">CCXT Pro Documentation</h4><a id="user-content-ccxt-pro-documentation" class="anchor" aria-label="Permalink: CCXT Pro Documentation" href="#ccxt-pro-documentation"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p> <a href="https://ccxt.pro" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/75616612-373fb280-5b64-11ea-8e72-2fddcdd75b02.png" alt="CCXT Pro"></a></p> <p align="center"> <a href="https://ccxt.pro" rel="nofollow">https://ccxt.pro</a><br> <a href="ccxt.pro.manual#exchanges">Exchanges</a><br> <a href="ccxt.pro.install">Install</a><br> <a href="ccxt.pro">Manual</a> </p> <hr> <div class="markdown-heading"><h4 align="center" class="heading-element">CCXT Documentation</h4><a id="user-content-ccxt-documentation" class="anchor" aria-label="Permalink: CCXT Documentation" href="#ccxt-documentation"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p> <a href="https://ccxt.trade" rel="nofollow"><img src="https://user-images.githubusercontent.com/1294454/112665445-2008ec80-8e6c-11eb-9647-623a347ddade.png" alt="CCXT"></a></p> <ul> <li><a href="https://github.com/ccxt/ccxt/wiki/Exchange-Markets">Supported Exchanges</a></li> <li><a href="https://github.com/ccxt/ccxt/wiki/Exchange-Markets-By-Country">Exchanges By Country</a></li> <li><a href="https://github.com/ccxt/ccxt/wiki/Install">Install</a></li> <li> <a href="https://github.com/ccxt/ccxt/wiki/Manual">Manual</a> <ul> <li><a href="https://github.com/ccxt/ccxt/wiki/Manual#overview">Architecture Overview</a></li> <li><a href="https://github.com/ccxt/ccxt/wiki/Manual#instantiation">Instantiation</a></li> <li><a href="https://github.com/ccxt/ccxt/wiki/Manual#exchange-structure">Exchange Structure</a></li> <li><a href="https://github.com/ccxt/ccxt/wiki/Manual#exchange-properties">Exchange Properties</a></li> <li><a href="https://github.com/ccxt/ccxt/wiki/Manual#markets">Markets</a></li> <li><a href="https://github.com/ccxt/ccxt/wiki/Manual#api-methods--endpoints">API Methods / Endpoints</a></li> <li><a href="https://github.com/ccxt/ccxt/wiki/Manual#market-data">Market Data</a></li> <li><a href="https://github.com/ccxt/ccxt/wiki/Manual#trading">Trading</a></li> </ul> </li> <li><a href="https://github.com/ccxt/ccxt/wiki/Manual#error-handling">Error Handling</a></li> <li><a href="https://github.com/ccxt/ccxt/wiki/Manual#troubleshooting">Troubleshooting</a></li> <li><a href="https://github.com/ccxt/ccxt/tree/master/examples">Examples</a></li> <li>Knowledge Base (wip)</li> <li><a href="https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md">Contributing</a></li> <li>API Reference (wip)</li> <li><a href="https://github.com/ccxt/ccxt/wiki/FAQ">Frequently Asked Questions</a></li> <li>New Exchanges <ul> <li><a href="https://github.com/ccxt/ccxt/wiki/Requirements">Requirements</a></li> <li><a href="https://github.com/ccxt/ccxt/wiki/Certification">Certification Program</a></li> </ul> </li> </ul> </div> </div> </div> <h5 class="mt-0 mb-2">Clone this wiki locally</h5> <div class="width-full input-group"> <input id="wiki-clone-url" type="text" data-autoselect class="form-control input-sm text-small color-fg-muted input-monospace" aria-label="Clone URL for this wiki" value="https://github.com/ccxt/ccxt.wiki.git" readonly> <span class="input-group-button"> <span data-view-component="true"> <clipboard-copy for="wiki-clone-url" aria-label="Copy to clipboard" type="button" data-view-component="true" class="rounded-left-0 border-left-0 Button--secondary Button--small Button"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path> </svg> <svg style="display: none;" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check color-fg-success"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> </clipboard-copy> <div aria-live="polite" aria-atomic="true" class="sr-only" data-clipboard-copy-feedback></div> </span> </span> </div> </div> </div> </div> </div> </div> </div> </turbo-frame> </main> </div> </div> <footer class="footer pt-8 pb-6 f6 color-fg-muted p-responsive" role="contentinfo" > <h2 class='sr-only'>Footer</h2> <div class="d-flex flex-justify-center flex-items-center flex-column-reverse flex-lg-row flex-wrap flex-lg-nowrap"> <div class="d-flex flex-items-center flex-shrink-0 mx-2"> <a aria-label="Homepage" title="GitHub" class="footer-octicon mr-2" href="https://github.com"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path d="M12 1C5.9225 1 1 5.9225 1 12C1 16.8675 4.14875 20.9787 8.52125 22.4362C9.07125 22.5325 9.2775 22.2025 9.2775 21.9137C9.2775 21.6525 9.26375 20.7862 9.26375 19.865C6.5 20.3737 5.785 19.1912 5.565 18.5725C5.44125 18.2562 4.905 17.28 4.4375 17.0187C4.0525 16.8125 3.5025 16.3037 4.42375 16.29C5.29 16.2762 5.90875 17.0875 6.115 17.4175C7.105 19.0812 8.68625 18.6137 9.31875 18.325C9.415 17.61 9.70375 17.1287 10.02 16.8537C7.5725 16.5787 5.015 15.63 5.015 11.4225C5.015 10.2262 5.44125 9.23625 6.1425 8.46625C6.0325 8.19125 5.6475 7.06375 6.2525 5.55125C6.2525 5.55125 7.17375 5.2625 9.2775 6.67875C10.1575 6.43125 11.0925 6.3075 12.0275 6.3075C12.9625 6.3075 13.8975 6.43125 14.7775 6.67875C16.8813 5.24875 17.8025 5.55125 17.8025 5.55125C18.4075 7.06375 18.0225 8.19125 17.9125 8.46625C18.6138 9.23625 19.04 10.2125 19.04 11.4225C19.04 15.6437 16.4688 16.5787 14.0213 16.8537C14.42 17.1975 14.7638 17.8575 14.7638 18.8887C14.7638 20.36 14.75 21.5425 14.75 21.9137C14.75 22.2025 14.9563 22.5462 15.5063 22.4362C19.8513 20.9787 23 16.8537 23 12C23 5.9225 18.0775 1 12 1Z"></path> </svg> </a> <span> © 2025 GitHub, Inc. </span> </div> <nav aria-label="Footer"> <h3 class="sr-only" id="sr-footer-heading">Footer navigation</h3> <ul class="list-style-none d-flex flex-justify-center flex-wrap mb-2 mb-lg-0" aria-labelledby="sr-footer-heading"> <li class="mx-2"> <a data-analytics-event="{"category":"Footer","action":"go to Terms","label":"text:terms"}" href="https://docs.github.com/site-policy/github-terms/github-terms-of-service" data-view-component="true" class="Link--secondary Link">Terms</a> </li> <li class="mx-2"> <a data-analytics-event="{"category":"Footer","action":"go to privacy","label":"text:privacy"}" href="https://docs.github.com/site-policy/privacy-policies/github-privacy-statement" data-view-component="true" class="Link--secondary Link">Privacy</a> </li> <li class="mx-2"> <a data-analytics-event="{"category":"Footer","action":"go to security","label":"text:security"}" href="https://github.com/security" data-view-component="true" class="Link--secondary Link">Security</a> </li> <li class="mx-2"> <a data-analytics-event="{"category":"Footer","action":"go to status","label":"text:status"}" href="https://www.githubstatus.com/" data-view-component="true" class="Link--secondary Link">Status</a> </li> <li class="mx-2"> <a data-analytics-event="{"category":"Footer","action":"go to docs","label":"text:docs"}" href="https://docs.github.com/" data-view-component="true" class="Link--secondary Link">Docs</a> </li> <li class="mx-2"> <a data-analytics-event="{"category":"Footer","action":"go to contact","label":"text:contact"}" href="https://support.github.com?tags=dotcom-footer" data-view-component="true" class="Link--secondary Link">Contact</a> </li> <li class="mx-2" > <cookie-consent-link> <button type="button" class="Link--secondary underline-on-hover border-0 p-0 color-bg-transparent" data-action="click:cookie-consent-link#showConsentManagement" data-analytics-event="{"location":"footer","action":"cookies","context":"subfooter","tag":"link","label":"cookies_link_subfooter_footer"}" > Manage cookies </button> </cookie-consent-link> </li> <li class="mx-2"> <cookie-consent-link> <button type="button" class="Link--secondary underline-on-hover border-0 p-0 color-bg-transparent" data-action="click:cookie-consent-link#showConsentManagement" data-analytics-event="{"location":"footer","action":"dont_share_info","context":"subfooter","tag":"link","label":"dont_share_info_link_subfooter_footer"}" > Do not share my personal information </button> </cookie-consent-link> </li> </ul> </nav> </div> </footer> <ghcc-consent id="ghcc" class="position-fixed bottom-0 left-0" style="z-index: 999999" data-initial-cookie-consent-allowed="" data-cookie-consent-required="false"></ghcc-consent> <div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button> You can’t perform that action at this time. </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details> </template> <div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div> </div> <template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path> </svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none m-2"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> </clipboard-copy> </div> </template> <template id="snippet-clipboard-copy-button-unpositioned"> <div class="zeroclipboard-container"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path> </svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> </clipboard-copy> </div> </template> </div> <div id="js-global-screen-reader-notice" class="sr-only mt-n1" aria-live="polite" aria-atomic="true" ></div> <div id="js-global-screen-reader-notice-assertive" class="sr-only mt-n1" aria-live="assertive" aria-atomic="true"></div> </body> </html>