- Не могу зайти на Binance
- Не могу зайти на Binance
- 1. Самые частые причины проблем с входом
- 2. Аккаунт заморожен Binance
- 3. Другие причины
- Выводы
- Обход 2FA на Binance и потеря 200000$
- Change Log
- General Info
- General API Information
- LIMITS
- Endpoint Security Type
- SIGNED (TRADE and USER_DATA) Endpoint Security
- Timing security
- SIGNED Endpoint Examples for POST /fapi/v1/order
- Example 1: As a query string
- Example 2: As a request body
- Example 3: Mixed query string and request body
- Public Endpoints Info
- Terminology
- ENUM definitions
- Filters
- Symbol filters
- PRICE_FILTER
- LOT_SIZE
- MARKET_LOT_SIZE
- MAX_NUM_ORDERS
- PERCENT_PRICE
- Market Data Endpoints
- Test Connectivity
- Check Server time
- Exchange Information
- Order Book
- Recent Trades List
- Old Trades Lookup
- Compressed/Aggregate Trades List
- Kline/Candlestick Data
- Mark Price
- 24hr Ticker Price Change Statistics
- Symbol Price Ticker
- Symbol Order Book Ticker
- Websocket Market Streams
- Aggregate Trade Streams
- Mark Price Stream
- Kline/Candlestick Streams
- Individual Symbol Mini Ticker Stream
- Individual Symbol Ticker Streams
- Partial Book Depth Streams
- How to manage a local order book correctly
- Account/Trades Endpoints
- New Order (TRADE)
- Query Order (USER_DATA)
- Cancel Order (TRADE)
- Current Open Orders (USER_DATA)
- All Orders (USER_DATA)
- Account Information (USER_DATA)
- Position Information (USER_DATA)
- Account Trade List (USER_DATA)
- User Data Streams
- Start User Data Stream (USER_STREAM)
- Keepalive User Data Stream (USER_STREAM)
- Close User Data Stream (USER_STREAM)
- Event: Balance and Position Update
- Event: Order Update
- Error Codes
- 10xx — General Server or Network issues
- -1000 UNKNOWN
- -1001 DISCONNECTED
- -1002 UNAUTHORIZED
- -1003 TOO_MANY_REQUESTS
- -1004 DUPLICATE_IP
- -1005 NO_SUCH_IP
- -1006 UNEXPECTED_RESP
- -1007 TIMEOUT
- -1010 ERROR_MSG_RECEIVED
- -1011 NON_WHITE_LIST
- -1013 ILLEGAL_MESSAGE
- -1014 UNKNOWN_ORDER_COMPOSITION
- -1015 TOO_MANY_ORDERS
- -1016 SERVICE_SHUTTING_DOWN
- -1020 UNSUPPORTED_OPERATION
- -1021 INVALID_TIMESTAMP
- -1022 INVALID_SIGNATURE
- 11xx — Request issues
- -1100 ILLEGAL_CHARS
- -1101 TOO_MANY_PARAMETERS
- -1102 MANDATORY_PARAM_EMPTY_OR_MALFORMED
- -1103 UNKNOWN_PARAM
- -1104 UNREAD_PARAMETERS
- -1105 PARAM_EMPTY
- -1106 PARAM_NOT_REQUIRED
- -1108 BAD_ASSET
- -1109 BAD_ACCOUNT
- -1110 BAD_INSTRUMENT_TYPE
- -1111 BAD_PRECISION
- -1112 NO_DEPTH
- -1113 WITHDRAW_NOT_NEGATIVE
- -1114 TIF_NOT_REQUIRED
- -1115 INVALID_TIF
- -1116 INVALID_ORDER_TYPE
- -1117 INVALID_SIDE
- -1118 EMPTY_NEW_CL_ORD_ID
- -1119 EMPTY_ORG_CL_ORD_ID
- -1120 BAD_INTERVAL
- -1121 BAD_SYMBOL
- -1125 INVALID_LISTEN_KEY
- -1127 MORE_THAN_XX_HOURS
- -1128 OPTIONAL_PARAMS_BAD_COMBO
- -1130 INVALID_PARAMETER
- -2008 BAD_API_ID
- -2010 NEW_ORDER_REJECTED
- -2011 CANCEL_REJECTED
- -2013 NO_SUCH_ORDER
- -2014 BAD_API_KEY_FMT
- -2015 REJECTED_MBX_KEY
- -2016 NO_TRADING_WINDOW
- -4000 INVALID_ORDER_STATUS
- -4001 PRICE_LESS_THAN_ZERO
- -4002 PRICE_GREATER_THAN_MAX_PRICE
- -4003 QTY_LESS_THAN_ZERO
- -4004 QTY_LESS_THAN_MIN_QTY
- -4005 QTY_GREATER_THAN_MAX_QTY
- -4006 STOP_PRICE_LESS_THAN_ZERO
- -4006 STOP_PRICE_GREATER_THAN_MAX_PRICE
- Messages for -1010 ERROR_MSG_RECEIVED, -2010 NEW_ORDER_REJECTED, and -2011 CANCEL_REJECTED
Не могу зайти на Binance
Такое случается не часто, но по различным причинам вы можете столкнуться с проблемами входа на биржу Binance. В большинстве случаев не стоит сильно переживать, потому что все решаемо.
В сегодняшней статье мы ответим на вопрос что делать если я не могу зайти на Binance, каким образом лучше всего решить эту проблему.
Не могу зайти на Binance
Основными причинами почему вы не можете получить доступ к своему аккаунту могут быть:
1. Самые частые причины проблем с входом
- Проблемы в работе интерфейса биржи, различные технические ошибки, которые от вас не зависят — такие случаи уже были и остается только ждать пока разработчики все починят. Проверьте форумы и криптовалютные чаты, если это техническая проблема, то проблемы с входом будут не только у вас;
- Вы вводите неверный пароль или логин, проверьте не используется ли Caps-Lock и убедитесь, что вы набираете именно то, что нужно;
- Проблемы в браузере — проверьте включен ли JavaScript, а также очистите кэш браузера и Cookies, в некоторых случаях это может сработать;
- Попробуйте альтернативную ссылку для входа: https://www.binance.com/hw_login.html. Эта страница находится на том же сайте. Если не хотите открывать ссылку, просто перейдите на страницу входа обычным способом и допишите перед login три символа: _hw;
- Попробуйте использовать другое устройство, также попробуйте изменить DNS сервера для вашего компьютера на адреса Google, это 8.8.8.8 и 8.8.4.4;
- Не приходит SMS на Binance — для некоторых стран все еще встречается такая проблема. Единственное правильное решение здесь будет — использовать двухфакторную аутентификацию от Google. Об этом есть отдельная статья;
2. Аккаунт заморожен Binance
Если вы получаете при входе сообщение «Your account has been frozen» или «Your account has been locked» это означает что ваш аккаунт был заморожен. Такое случается когда биржа обнаруживает подозрительную активность в вашем аккаунте и таим способом его защищает.
Обратите внимание, что замороженный аккаунт можно будет восстановить не ранее чем через два часа после блокировки. Чтобы разблокировать аккаунт нажмите кнопку «Reactivate»:
На ваш Email будет отправлено письмо с подтверждением восстановления:
Затем надо будет перейти по ссылки, что придет в письме:
После этого система попросит вас ввести адрес пополнения Binance на который вы в последний раз пополняли счет биржи, например, ваш адрес пополнения Ethereum.
Этот адрес вы можете найти на бирже или кошельке, с которого отправляли транзакцию. Если вам не удастся правильно ввести этот адрес биржа задаст еще несколько вопросов. Если же вы не сможете на них ответить можно будет попробовать еще раз через два часа или написать в техподдержку.
На последнем шаге биржа может попросить вас пройти верификацию аккаунта загрузив ваше фото и фото загранпаспорта.
3. Другие причины
В любом случае если вам не удалось решить проблему выше перечисленными способами осталось написать в техническую поддержку биржи. Обычно они быстро отвечают и помогают пользователям. Сделать это можно на этой странице. Хоть и часть интерфейса по русски, писать надо по английски чтобы вам смогли понять.
Выводы
В этой статье мы рассмотрели что делать если вы не можете войти в свой аккаунт Binance. Не забывайте включить двухфакторную аутентификацию чтобы обезопасить свой аккаунт.
Если вы нашли ошибку, пожалуйста, выделите фрагмент текста и нажмите Ctrl+Enter.
Источник
Обход 2FA на Binance и потеря 200000$
Когда речь заходит про безопасность обычный пользователь интуитивно доверяет самым популярным сервисам настолько, что мыслей о своей безопасности не возникает: даже если речь идёт про деньги и многие годы потраченного времени на их зарабатывание. Речь идёт о недавнем взломе известного в русском сегменте среди крипто-трейдеров блогере на самой популярной крипто бирже Binance. Первые реакция и мысли от жертвы можете увидеть здесь.
С применением социальной инженерии блогер был заражён вирусом REDLINE распакованный код которого можно скачать отсюда, а оригинальный файл которым осуществлялось заражение здесь. Подключение вирус вёл по данным IP: 80.85.139.166:40955 и 188.119.113.239:39889. Оба IP принадлежат хостинг-провайдеру и находятся в ДЦ Нидерланд.
16 августа ночью была осуществлена кража сессии авторизации на Binance из браузера с ноутбука жертвы и исходя из логов IP на бирже (отсутствуют сторонние IP) вероятней всего с помощью backconnect-proxy установленном на компьютер жертвы через loader первичного вируса успешный и незаметный вход на саму биржу.
Для многих кража логинов и паролей и даже активных сессий из браузера не кажется чем-то существенным благодаря присутствию на бирже 2FA-подтверждений через ввод SMS/E-Mail кодов. Ведь действительно: каждый раз для вывода средств или перевода их кому либо Вам потребуется данное подтверждение. Но, с недавних пор на бирже появился NFT-market где люди могут покупать и продавать цифровые товары (графика) и как выяснилось на многих хакерских форумах почти сразу начали появляться предложения о «выводе» денег с балансов через данную уязвимость. В Google просто введя фразу «обход 2FA Binance» можно встретить действительно огромный выбор исполнителей.
Сам взлом как и кража средств была проведена очень простым и ироничным способом: хакер разместил NFT по цене 193000$ и просто купил его с аккаунта жертвы у самого себя. Для этого на бирже нет абсолютно никаких ограничений, подтверждений и попросту механизмов защиты. Далее по словам BInance деньги были выведены с биржи, а сам аккаунт как они предполагают был «взломан». Сразу же возникает вопрос как хакер обходил на чужом аккаунте всё те-же двухфакторные авторизации. Может аккаунты оформлены на поддельные документы и биржа не желает признать что её «верификация» не более чем «пук в муку»?
По некоторым данным доход биржи за год составил 200 млрд $ и как я считаю они не имеют права на такие глупые ошибки в своей политике безопасности. Ведь решение просто лежит на поверхности:
Для NFT должен быть отдельный счет, перевод средств на который только через 2FA (и за отсутствие данного решения бирже и их специалистам по безопасности по моему мнению должно быть стыдно)
Если обнаруживается 2 одинаковые активные сессии — последняя должна сбрасываться, а на первой должно появится уведомление об этом.
PIN для авторизации с новых IP на WEB-интерфейсе. Даже для активной сессии.
Моё мнение: Binance обязаны компенсировать все украденные деньги по простой причине: это не вина пользователя. И они в таких случаях обязались возвращать средства. Да, пользователь подхватил вирус, но, пользователь был уверен что вывод без 2FA не возможен. Это именно дыра в их безопасности. Потому Binance обязаны извинится за долгое отсутствие реакции, а так-же немедленно исправить данную уязвимость пересмотрев те дыры услуги по которым предоставляют все кому не лень. Для биржи с такими доходами не должно быть проблемой просто взять и «воспользоваться» услугами этих хакеров, обнаружить проблемы и исправить. Это говорит о многом.
Доверяйте, но проверяйте. Но если Вы далеки от этих дел и Вам не понятна суть проблемы:
Представьте свой банковский кабинет. За перевод средств с Вас спрашивают код. Вы защищёны ровно до того момента как не появится в банке магазин nft-картинок который Вы даже не открывали и не знаете что оно такое и как работает. В мобильных приложениях данного раздела попросту даже и нет, потому открыть и воспользоваться им можно только через веб интерфейс.
Вы не знаете ни что там, ни зачем оно надо. Вы просто пропустили эту инновацию и не знаете как она функционирует. Вы знаете что у биржи на аккаунте есть разные счета: спотовый, фьючерсный и несколько остальных один из которых «p2p» средства с которого можно выслать напрямую другому пользователю только с подтверждением. Мало того, между этими счетами нужно специально переводить деньги с одного раздела на другой. И так, Вы не используя nft маркет просто не подозреваете о том, что кто угодно может сделать картинку ценой в весь Ваш баланс и без всяких подтверждений купить это заполучив Вашу сессию. Повторюсь: купить nft — это тоже самое что просто перевести другому пользователю деньги. И для этого бинанс не создал даже отдельный внутренний кошелек, средства на который по логике безопасности должны были бы переводится с обычных счетов через 2fa. Потому-что повторяюсь: nft маркет позволяет ставить любую цену и получать оплату в полном размере.
У Вас не спросили нужен ли Вам этот маркет, не попросили никакой подтверждающей активации данного раздела при первом посещении, не спросили подтверждения на перевод средств на этот маркет и не выявили подозрительным внезапную продажу всех активов на спотовом рынке за доллары и покупку картинки на впервые открытом разделе биржи. Это максимально наплевательское отношение и искусственно созданная дыра от плохой проработки аспекта безопасности нововведения. Разве пользователь обязан изучать биржу каждые 5 минут на предмет обновлений, быть специалистом по безопасности чтобы выявлять дыру в логике работы нововведений? Я считаю нет. Одно дело когда взламывают и сливают деньги со всей биржи. Другое, когда биржа без спроса пользователя создает возможность обойти двойную авторизацию на которую рассчитывает пользователь.
Поймать троян можно множеством способов: начиная от личной невнимательности, заканчивая тем, что сплоиты могут Вас заразить через браузер просто при пассивном посещении любого сайта. Вас могут протроянить склейкой с полезным файлом или используя уязвимости в системе и Вы попросту здесь не виноваты. Вы просто были подключены к интернету и не выполняли никаких действий. Ваши пароли могут украсть расширения из официального магазина браузера. Потому Вы рассчитываете на то, что главные действия с деньгами будут требовать подтверждения 2fa даже если Вас взломают. И биржа получает с Вас комиссионные за каждую сделку. Она работает не на «добром слове», а значит беря деньги, должна их защищать. Может я чего-то не понимаю о справедливости?
Источник
Change Log
2019-09-20
New returned values in response to GET /fapi/v1/account:
maxWithdrawAmount , openOrderInitialMargin , positionInitialMargin
New returned values in response to GET /fapi/v1/positionRisk:
liquidationPrice
General Info
General API Information
- The base endpoint is: https://testnet.binancefuture.com
- All endpoints return either a JSON object or array.
- Data is returned in ascending order. Oldest first, newest last.
- All time and timestamp related fields are in milliseconds.
- HTTP 4XX return codes are used for for malformed requests; the issue is on the sender’s side.
- HTTP 429 return code is used when breaking a request rate limit.
- HTTP 418 return code is used when an IP has been auto-banned for continuing to send requests after receiving 429 codes.
- HTTP 5XX return codes are used for internal errors; the issue is on Binance’s side. It is important to NOT treat this as a failure operation; the execution status is UNKNOWN and could have been a success.
- Any endpoint can return an ERROR.
The error payload is as follows:
- Specific error codes and messages defined in Error Codes.
- For GET endpoints, parameters must be sent as a query string .
- For POST , PUT , and DELETE endpoints, the parameters may be sent as a query string or in the request body with content type application/x-www-form-urlencoded . You may mix parameters between both the query string and request body if you wish to do so.
- Parameters may be sent in any order.
- If a parameter sent in both the query string and request body , the query string parameter will be used.
LIMITS
- The /fapi/v1/exchangeInfo rateLimits array contains objects related to the exchange’s RAW_REQUEST , REQUEST_WEIGHT , and ORDER rate limits. These are further defined in the ENUM definitions section under Rate limiters (rateLimitType) .
- A 429 will be returned when either rate limit is violated.
- Each route has a weight which determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavier weight .
- Every request will contain a X-MBX-USED-WEIGHT header which has the current used weight for the IP for the current minute.
- When a 429 returned, it’s your obligation as an API to back off and not spam the API.
- Repeatedly violating rate limits and/or failing to back off after receiving 429 will result in an automated IP ban (http status 418 ).
- IP bans are tracked and scale in duration for repeat offenders, from 2 minutes to 3 days.
- A Retry-After header is sent with a 418 or 429 responses and will give the number of seconds required to wait, in the case of a 418 , to prevent a ban, or, in the case of a 429 , until the ban is over.
Endpoint Security Type
- Each endpoint has a security type that determines the how you will interact with it.
- API-keys are passed into the Rest API via the X-MBX-APIKEY header.
- API-keys and secret-keys are case sensitive.
- API-keys can be configured to only access certain types of secure endpoints. For example, one API-key could be used for TRADE only, while another API-key can access everything except for TRADE routes.
- By default, API-keys can access all secure routes.
Security Type | Description |
---|---|
NONE | Endpoint can be accessed freely. |
TRADE | Endpoint requires sending a valid API-Key and signature. |
USER_DATA | Endpoint requires sending a valid API-Key and signature. |
USER_STREAM | Endpoint requires sending a valid API-Key. |
MARKET_DATA | Endpoint requires sending a valid API-Key. |
- TRADE and USER_DATA endpoints are SIGNED endpoints.
SIGNED (TRADE and USER_DATA) Endpoint Security
- SIGNED endpoints require an additional parameter, signature , to be sent in the query string or request body .
- Endpoints use HMAC SHA256 signatures. The HMAC SHA256 signature is a keyed HMAC SHA256 operation. Use your secretKey as the key and totalParams as the value for the HMAC operation.
- The signature is not case sensitive.
- Please make sure the signature is the end part of your query string or request body .
- totalParams is defined as the query string concatenated with the request body .
Timing security
- A SIGNED endpoint also requires a parameter, timestamp , to be sent which should be the millisecond timestamp of when the request was created and sent.
- An additional parameter, recvWindow , may be sent to specify the number of milliseconds after timestamp the request is valid for. If recvWindow is not sent, it defaults to 5000.
Serious trading is about timing. Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers. With recvWindow , you can specify that the request must be processed within a certain number of milliseconds or be rejected by the server.
SIGNED Endpoint Examples for POST /fapi/v1/order
Here is a step-by-step example of how to send a vaild signed payload from the Linux command line using echo , openssl , and curl .
Key | Value |
---|---|
apiKey | vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A |
secretKey | NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j |
Parameter | Value |
---|---|
symbol | BTCUSDT |
side | BUY |
type | LIMIT |
timeInForce | GTC |
quantity | 1 |
price | 0.1 |
recvWindow | 5000 |
timestamp | 1499827319559 |
Example 1: As a query string
HMAC SHA256 signature:
queryString:
symbol=BTCUSDT
&side=BUY
&type=LIMIT
&timeInForce=GTC
&quantity=1
&price=0.1
&recvWindow=5000
×tamp=1499827319559
Example 2: As a request body
HMAC SHA256 signature:
requestBody:
symbol=BTCUSDT
&side=BUY
&type=LIMIT
&timeInForce=GTC
&quantity=1
&price=0.1
&recvWindow=5000
×tamp=1499827319559
Example 3: Mixed query string and request body
HMAC SHA256 signature:
- queryString: symbol=BTCUSDT&side=BUY&type=LIMIT&timeInForce=GTC
- requestBody: quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559
Note that the signature is different in example 3.
There is no & between «GTC» and «quantity=1».
Public Endpoints Info
Terminology
- base asset refers to the asset that is the quantity of a symbol.
- quote asset refers to the asset that is the price of a symbol.
ENUM definitions
Symbol type:
Order status (status):
Order types (orderTypes, type):
Order side (side):
Time in force (timeInForce):
- GTC — Good Till Cancel
- OC — Immediate or Cancel
- FOK — Fill or Kill
- GTX — Good Till Crossing (Post Only)
Kline/Candlestick chart intervals:
m -> minutes; h -> hours; d -> days; w -> weeks; M -> months
Rate limiters (rateLimitType)
Rate limit intervals (interval)
Filters
Filters define trading rules on a symbol or an exchange.
Symbol filters
PRICE_FILTER
The PRICE_FILTER defines the price rules for a symbol. There are 3 parts:
- minPrice defines the minimum price / stopPrice allowed; disabled on minPrice == 0.
- maxPrice defines the maximum price / stopPrice allowed; disabled on maxPrice == 0.
- tickSize defines the intervals that a price / stopPrice can be increased/decreased by; disabled on tickSize == 0.
Any of the above variables can be set to 0, which disables that rule in the price filter . In order to pass the price filter , the following must be true for price / stopPrice of the enabled rules:
- price >= minPrice
- price maxPrice
- ( price — minPrice ) % tickSize == 0
LOT_SIZE
The LOT_SIZE filter defines the quantity (aka «lots» in auction terms) rules for a symbol. There are 3 parts:
- minQty defines the minimum quantity allowed.
- maxQty defines the maximum quantity allowed.
- stepSize defines the intervals that a quantity can be increased/decreased by.
In order to pass the lot size , the following must be true for quantity :
- quantity >= minQty
- quantity maxQty
- ( quantity — minQty ) % stepSize == 0
MARKET_LOT_SIZE
The MARKET_LOT_SIZE filter defines the quantity (aka «lots» in auction terms) rules for MARKET orders on a symbol. There are 3 parts:
- minQty defines the minimum quantity allowed.
- maxQty defines the maximum quantity allowed.
- stepSize defines the intervals that a quantity can be increased/decreased by.
In order to pass the market lot size , the following must be true for quantity :
- quantity >= minQty
- quantity maxQty
- ( quantity — minQty ) % stepSize == 0
MAX_NUM_ORDERS
The MAX_NUM_ORDERS filter defines the maximum number of orders an account is allowed to have open on a symbol. Note that both «algo» orders and normal orders are counted for this filter.
PERCENT_PRICE
The PERCENT_PRICE filter defines valid range for a price based on the mark price.
In order to pass the percent price , the following must be true for price :
- price markPrice * multiplierUp
- price >= markPrice * multiplierDown
Market Data Endpoints
Test Connectivity
Test connectivity to the Rest API.
Weight: 1
Parameters: NONE
Check Server time
Test connectivity to the Rest API and get the current server time.
Weight: 1
Parameters: NONE
Exchange Information
Current exchange trading rules and symbol information
Weight: 1
Parameters: NONE
Order Book
Weight:
Adjusted based on the limit:
Limit | Weight |
---|---|
5, 10, 20, 50, 100 | 1 |
500 | 5 |
1000 | 10 |
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
limit | INT | NO | Default 100; max 1000. Valid limits:[5, 10, 20, 50, 100, 500, 1000] |
Recent Trades List
Get recent trades (up to last 500).
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
limit | INT | NO | Default 500; max 1000. |
Old Trades Lookup
Get older market historical trades.
Weight: 5
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
limit | INT | NO | Default 500; max 1000. |
fromId | LONG | NO | TradeId to fetch from. Default gets most recent trades. |
- X-MBX-APIKEY required
Compressed/Aggregate Trades List
Get compressed, aggregate trades. Trades that fill at the time, from the same order, with the same price will have the quantity aggregated.
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
fromId | LONG | NO | ID to get aggregate trades from INCLUSIVE. |
startTime | LONG | NO | Timestamp in ms to get aggregate trades from INCLUSIVE. |
endTime | LONG | NO | Timestamp in ms to get aggregate trades until INCLUSIVE. |
limit | INT | NO | Default 500; max 1000. |
- If both startTime and endTime are sent, time between startTime and endTime must be less than 1 hour.
- If fromId, startTime, and endTime are not sent, the most recent aggregate trades will be returned.
Kline/Candlestick Data
Kline/candlestick bars for a symbol. Klines are uniquely identified by their open time.
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
interval | ENUM | YES | |
startTime | LONG | NO | |
endTime | LONG | NO | |
limit | INT | NO | Default 500; max 1500. |
- If startTime and endTime are not sent, the most recent klines are returned.
Mark Price
Mark Price and Funding Rate
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES |
24hr Ticker Price Change Statistics
24 hour rolling window price change statistics.
Careful when accessing this with no symbol.
Weight:
1 for a single symbol;
40 when the symbol parameter is omitted
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | NO |
- If the symbol is not sent, tickers for all symbols will be returned in an array.
Symbol Price Ticker
Latest price for a symbol or symbols.
Weight:
1 for a single symbol;
2 when the symbol parameter is omitted
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | NO |
- If the symbol is not sent, prices for all symbols will be returned in an array.
Symbol Order Book Ticker
Best price/qty on the order book for a symbol or symbols.
Weight:
1 for a single symbol;
2 when the symbol parameter is omitted
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | NO |
- If the symbol is not sent, bookTickers for all symbols will be returned in an array.
Websocket Market Streams
- The base endpoint is: wss://testnet.binancefuture.com
- Streams can be access either in a single raw stream or a combined stream
- Raw streams are accessed at /ws/
- Combined streams are accessed at /stream?streams= / /
- Combined stream events are wrapped as follows:
- All symbols for streams are lowercase
- The websocket server will send a ping frame every 3 minutes. If the websocket server does not receive a pong frame back from the connection within a 10 minute period, the connection will be disconnected. Unsolicited pong frames are allowed.
Aggregate Trade Streams
The Aggregate Trade Streams push trade information that is aggregated for a single taker order every 100 milliseconds.
Stream Name:
@aggTrade
Mark Price Stream
Mark price for a single symbol pushed every 3 secends.
Stream Name:
@markPrice
Kline/Candlestick Streams
The Kline/Candlestick Stream push updates to the current klines/candlestick every 250 milliseconds (if existing).
Kline/Candlestick chart intervals:
m -> minutes; h -> hours; d -> days; w -> weeks; M -> months
Stream Name:
@kline_
Individual Symbol Mini Ticker Stream
24hr rolling window mini-ticker statistics for a single symbol pushed every 3 seconds. These are NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs before.
Stream Name:
@miniTicker
Individual Symbol Ticker Streams
24hr rollwing window ticker statistics for a single symbol pushed every 3 seconds. These are NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs before.
Stream Name:
@ticker
Partial Book Depth Streams
Bids and asks, pushed every 250 milliseconds (if existing)
Stream Name:
@depth
How to manage a local order book correctly
- Open a stream to wss://testnet.binancefuture.com/stream?streams=btcusdt@depth.
- Buffer the events you receive from the stream. For same price, latest received update covers the previous one.
- Get a depth snapshot from https://testnet.binancefuture.com/fapi/v1/depth?symbol=BTCUSDT&limit=1000 .
- Drop any event where u is lastUpdateId in the snapshot
- The first processed event should have U lastUpdateId AND u >= lastUpdateId
- While listening to the stream, each new event’s pu should be equal to the previous event’s u , otherwise initialize the process from step 3.
- The data in each event is the absolute quantity for a price level
- If the quantity is 0, remove the price level
- Receiving an event that removes a price level that is not in your local order book can happen and is normal.
Account/Trades Endpoints
New Order (TRADE)
POST /fapi/v1/order (HMAC SHA256)
Send in a new order.
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
side | ENUM | YES | |
type | ENUM | YES | |
timeInForce | ENUM | NO | |
quantity | DECIMAL | YES | |
price | DECIMAL | NO | |
newClientOrderId | STRING | NO | A unique id for the order. Automatically generated if not sent. |
stopPrice | DECIMAL | NO | Used with STOP orders. |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
Additional mandatory parameters based on type :
Type | Additional mandatory parameters |
---|---|
LIMIT | timeInForce , quantity , price |
MARKET | quantity |
STOP | quantity , price , stopPrice |
- Order with type MARKET , parameter timeInForce cannot be sent.
- Order with type STOP , parameter timeInForce can be sent ( default GTC ).
Query Order (USER_DATA)
GET /fapi/v1/order (HMAC SHA256)
Check an order’s status.
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
orderId | LONG | NO | |
origClientOrderId | STRING | NO | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- Either orderId or origClientOrderId must be sent.
Cancel Order (TRADE)
DELETE /fapi/v1/order (HMAC SHA256)
Cancel an active order.
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
orderId | LONG | NO | |
origClientOrderId | STRING | NO | Automatically generated by default. |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
Either orderId or origClientOrderId must be sent.
Current Open Orders (USER_DATA)
GET /fapi/v1/openOrders (HMAC SHA256)
Get all open orders on a symbol. Careful when accessing this with no symbol.
Weight: 1 for a single symbol; 40 when the symbol parameter is omitted
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | NO | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- If the symbol is not sent, orders for all symbols will be returned in an array.
All Orders (USER_DATA)
GET /fapi/v1/allOrders (HMAC SHA256)
Get all account orders; active, canceled, or filled.
Weight: 5 with symbol
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
orderId | LONG | NO | |
startTime | LONG | NO | |
endTime | LONG | NO | |
limit | INT | NO | Default 500; max 1000. |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
Notes:
- If orderId is set, it will get orders >= that orderId . Otherwise most recent orders are returned.
Account Information (USER_DATA)
GET /fapi/v1/account (HMAC SHA256)
Get current account information.
Weight: 5
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
recvWindow | LONG | NO | |
timestamp | LONG | YES |
Position Information (USER_DATA)
GET /fapi/v1/positionRisk (HMAC SHA256) Get current account information.
Weight: 5
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
recvWindow | LONG | NO | |
timestamp | LONG | YES |
Account Trade List (USER_DATA)
GET /fapi/v1/userTrades (HMAC SHA256)
Get trades for a specific account and symbol.
Weight: 5 with symbol
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
startTime | LONG | NO | |
endTime | LONG | NO | |
fromId | LONG | NO | TradeId to fetch from. Default gets most recent trades. |
limit | INT | NO | Default 500; max 1000. |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
Notes:
- If fromId is set, it will get orders >= that fromId . Otherwise most recent orders are returned.
User Data Streams
- The base API endpoint is: https://testnet.binancefuture.com
- A User Data Stream listenKey is valid for 30 minutes after creation.
- Doing a PUT on a listenKey will extend its validity for 30 minutes.
- Doing a DELETE on a listenKey will close the stream.
- The base websocket endpoint is: wss://testnet.binancefuture.com
- User Data Streams are accessed at /ws/
- User data stream payloads are not guaranteed to be in order during heavy periods; make sure to order your updates using E
Start User Data Stream (USER_STREAM)
POST /fapi/v1/listenKey (HMAC SHA256)
Start a new user data stream. The stream will close after 30 minutes unless a keepalive is sent.
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
recvWindow | LONG | NO | |
timestamp | LONG | YES |
Keepalive User Data Stream (USER_STREAM)
PUT /fapi/v1/listenKey (HMAC SHA256)
Keepalive a user data stream to prevent a time out. User data streams will close after 30 minutes. It’s recommended to send a ping about every 30 minutes.
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
recvWindow | LONG | NO | |
timestamp | LONG | YES |
Close User Data Stream (USER_STREAM)
DELETE /fapi/v1/listenKey (HMAC SHA256)
Close out a user data stream.
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
recvWindow | LONG | NO | |
timestamp | LONG | YES |
Event: Balance and Position Update
Event type is ACCOUNT_UPDATE .
When balance or position get updated, will push this event.
Event: Order Update
When new order created, order status changed will push such event. event type is ORDER_TRADE_UPDATE .
Side
Order Type
Execution Type
- NEW
- PARTIAL_FILL
- FILL
- CANCELED
- REJECTED
- CALCULATED — Liquidation Execution
- EXPIRED
- TRADE
- RESTATED
Order Status
- NEW
- PARTIALLY_FILLED
- FILLED
- CANCELED
- REPLACED
- STOPPED
- REJECTED
- EXPIRED
- NEW_INSURANCE — Liquidation with Insurance Fund
- NEW_ADL — Counterparty Liquidation`
Time in force
Error Codes
Here is the error JSON payload:
Errors consist of two parts: an error code and a message.
Codes are universal,but messages can vary.
10xx — General Server or Network issues
-1000 UNKNOWN
- An unknown error occured while processing the request.
-1001 DISCONNECTED
- Internal error; unable to process your request. Please try again.
-1002 UNAUTHORIZED
- You are not authorized to execute this request.
-1003 TOO_MANY_REQUESTS
- Too many requests queued.
- Too many requests; please use the websocket for live updates.
- Too many requests; current limit is %s requests per minute. Please use the websocket for live updates to avoid polling the API.
- Way too many requests; IP banned until %s. Please use the websocket for live updates to avoid bans.
-1004 DUPLICATE_IP
- This IP is already on the white list
-1005 NO_SUCH_IP
- No such IP has been white listed
-1006 UNEXPECTED_RESP
- An unexpected response was received from the message bus. Execution status unknown.
-1007 TIMEOUT
- Timeout waiting for response from backend server. Send status unknown; execution status unknown.
-1010 ERROR_MSG_RECEIVED
-1011 NON_WHITE_LIST
- This IP cannot access this route.
-1013 ILLEGAL_MESSAGE
-1014 UNKNOWN_ORDER_COMPOSITION
-1015 TOO_MANY_ORDERS
- Too many new orders.
- Too many new orders; current limit is %s orders per %s.
-1016 SERVICE_SHUTTING_DOWN
- This service is no longer available.
-1020 UNSUPPORTED_OPERATION
- This operation is not supported.
-1021 INVALID_TIMESTAMP
- Timestamp for this request is outside of the recvWindow.
- Timestamp for this request was 1000ms ahead of the server’s time.
-1022 INVALID_SIGNATURE
- Signature for this request is not valid.
11xx — Request issues
-1100 ILLEGAL_CHARS
- Illegal characters found in a parameter.
- Illegal characters found in parameter ‘%s’; legal range is ‘%s’.
-1101 TOO_MANY_PARAMETERS
- Too many parameters sent for this endpoint.
- Too many parameters; expected ‘%s’ and received ‘%s’.
- Duplicate values for a parameter detected.
-1102 MANDATORY_PARAM_EMPTY_OR_MALFORMED
- A mandatory parameter was not sent, was empty/null, or malformed.
- Mandatory parameter ‘%s’ was not sent, was empty/null, or malformed.
- Param ‘%s’ or ‘%s’ must be sent, but both were empty/null!
-1103 UNKNOWN_PARAM
-1104 UNREAD_PARAMETERS
- Not all sent parameters were read.
- Not all sent parameters were read; read ‘%s’ parameter(s) but was sent ‘%s’.
-1105 PARAM_EMPTY
- A parameter was empty.
- Parameter ‘%s’ was empty.
-1106 PARAM_NOT_REQUIRED
- A parameter was sent when not required.
- Parameter ‘%s’ sent when not required.
-1108 BAD_ASSET
-1109 BAD_ACCOUNT
-1110 BAD_INSTRUMENT_TYPE
-1111 BAD_PRECISION
- Precision is over the maximum defined for this asset.
-1112 NO_DEPTH
-1113 WITHDRAW_NOT_NEGATIVE
- Withdrawal amount must be negative.
-1114 TIF_NOT_REQUIRED
- TimeInForce parameter sent when not required.
-1115 INVALID_TIF
-1116 INVALID_ORDER_TYPE
-1117 INVALID_SIDE
-1118 EMPTY_NEW_CL_ORD_ID
-1119 EMPTY_ORG_CL_ORD_ID
- Original client order ID was empty.
-1120 BAD_INTERVAL
-1121 BAD_SYMBOL
-1125 INVALID_LISTEN_KEY
-1127 MORE_THAN_XX_HOURS
- Lookup interval is too big.
- More than %s hours between startTime and endTime.
-1128 OPTIONAL_PARAMS_BAD_COMBO
- Combination of optional parameters invalid.
-1130 INVALID_PARAMETER
- Invalid data sent for a parameter.
- Data sent for paramter ‘%s’ is not valid.
-2008 BAD_API_ID
-2010 NEW_ORDER_REJECTED
-2011 CANCEL_REJECTED
-2013 NO_SUCH_ORDER
-2014 BAD_API_KEY_FMT
-2015 REJECTED_MBX_KEY
- Invalid API-key, IP, or permissions for action.
-2016 NO_TRADING_WINDOW
- No trading window could be found for the symbol. Try ticker/24hrs instead.
-4000 INVALID_ORDER_STATUS
-4001 PRICE_LESS_THAN_ZERO
-4002 PRICE_GREATER_THAN_MAX_PRICE
-4003 QTY_LESS_THAN_ZERO
-4004 QTY_LESS_THAN_MIN_QTY
- Quantity less than min quantity.
-4005 QTY_GREATER_THAN_MAX_QTY
- Quantity greater than max quantity.
-4006 STOP_PRICE_LESS_THAN_ZERO
-4006 STOP_PRICE_GREATER_THAN_MAX_PRICE
- Stop price greater than max price.
Messages for -1010 ERROR_MSG_RECEIVED, -2010 NEW_ORDER_REJECTED, and -2011 CANCEL_REJECTED
This code is sent when an error has been returned by the matching engine. The following messages which will indicate the specific error:
Источник