【问题标题】:Coinbase API: buy and sell prices are not as accurate as the spot priceCoinbase API:买卖价格不如现货价格准确
【发布时间】:2021-11-05 10:52:26
【问题描述】:

我需要帮助确定 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 没有准确的价格?

【问题讨论】:

  • 有什么理由不使用 cb pro api 吗?
  • @Travis 因为我不知道 .. 抱歉。你有任何示例代码或我正在尝试做的链接吗?
  • @Travis 谢谢你,但我不想检查加密货币的价格,也不想买或卖。

标签: python coinbase-api


【解决方案1】:

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

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

回答你的问题:

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

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

【讨论】:

    猜你喜欢
    • 2021-08-02
    • 2021-10-09
    • 2018-03-05
    • 1970-01-01
    • 1970-01-01
    • 2022-01-14
    • 2016-02-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多