Coinbase API:买卖价格不如现货价格准确

Coinbase API: buy and sell prices are not as accurate as the spot price

我需要帮助来确定 API 调用是否有问题。

在python中使用coinbase提供的库我运行这段代码:

from coinbase.wallet.client import Client

client = Client(coinbase_API_key, coinbase_API_secret)

print(client.get_buy_price(currency_pair = 'SHIB-EUR'))
print(client.get_sell_price(currency_pair = 'SHIB-EUR'))
print(client.get_spot_price(currency_pair = 'SHIB-EUR'))

控制台给了我这些值:

{
  "amount": "0.00",
  "base": "SHIB",
  "currency": "EUR"
}
{
  "amount": "0.00",
  "base": "SHIB",
  "currency": "EUR"
}
{
  "amount": "0.000043788348",
  "base": "SHIB",
  "currency": "EUR"
}

是我做错了什么还是 API 没有准确的价格?

如果您想要价格,您可能只想使用 Ticker:

https://api.exchange.coinbase.com/products/SHIB-EUR/ticker

回答你的问题:

Am I doing something wrong or does the API not have accurate prices?

我认为 coinbase 在列出 shib 时存在一些问题,因为小数点后 9 位,所以可能包括 coinbase.com api 在内的所有问题都没有解决。或者,他们对在 .com 上显示准确价格并不过分感兴趣,因为无论如何他们都喜欢多收费用。