簡體   English   中英

幣安 API:APIError(code=-1111):精度超過為該資產定義的最大值。 Python

[英]Binance API: APIError(code=-1111): Precision is over the maximum defined for this asset. Python

我已經完成了一個程序,並且使用 ltcusdt 可以正常工作,但是使用例如 aaveusdt 會出現此錯誤,我不明白為什么。 有人可以解釋一下它們兩者之間的區別(兩對具有相同的小數位數,並且價格相似(200-100))我應該如何更改以及應該更改什么?

您必須為任何人提供您的代碼才能找出有關您的錯誤的任何具體信息,但基本上每一對都有自己的精度,大約 50000 美元的比特幣不會與大約 0.15 美元的 Doge 采用相同的小數

使用您從GET /api/v3/exchangeInfo端點獲得的響應,

 { "timezone": "UTC", "serverTime": 1565246363776, "rateLimits": [ { //These are defined in the `ENUM definitions` section under `Rate Limiters (rateLimitType)`. //All limits are optional } ], "exchangeFilters": [ //These are the defined filters in the `Filters` section. //All filters are optional. ], "symbols": [ { "symbol": "ETHBTC", "status": "TRADING", "baseAsset": "ETH", "baseAssetPrecision": 8, "quoteAsset": "BTC", "quotePrecision": 8, "quoteAssetPrecision": 8, "orderTypes": [ "LIMIT", "LIMIT_MAKER", "MARKET", "STOP_LOSS", "STOP_LOSS_LIMIT", "TAKE_PROFIT", "TAKE_PROFIT_LIMIT" ], "icebergAllowed": true, "ocoAllowed": true, "isSpotTradingAllowed": true, "isMarginTradingAllowed": true, "filters": [ //These are defined in the Filters section. //All filters are optional ], "permissions": [ "SPOT", "MARGIN" ] } ] }

您可以從鍵中獲得每個端點的精度

  • baseAssetPrecision
  • quotePrecision
  • quoteAssetPrecision
  • baseCommissionPrecision
  • quoteCommissionPrecision

CCXT也是一個開源庫,負責處理所有的精度和自動修剪數字,使它們不超過精度限制

ccxt/examplesrepo中有一個示例列表,這是手冊

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM