简体   繁体   English

使用 Python Coinbase API,我如何确定我的定价层(费用)?

[英]With the Python Coinbase API, how do I figure out my pricing tier (fees)?

I'm using the Python API for Coinbase Pro -- https://github.com/danpaquin/coinbasepro-python .我正在为 Coinbase Pro 使用 Python API -- https://github.com/danpaquin/coinbasepro-python Is there a programmatic way I can calculate what pricing tier I'm in prior to submitting an order?有没有一种程序化的方式可以让我在提交订单之前计算我所处的定价等级? I would like to get an idea of the fees before I place the order.我想在下订单之前了解一下费用。 I notice the authenticated client provides a way to get accounts我注意到经过身份验证的客户端提供了一种获取帐户的方法

accts = auth_client.get_accounts()

which returns accounts that look like the below它返回如下所示的帐户

{'id': 'f3af2ff9-15a9-4b09-bdce-2136baf413e1', 'currency': 'USD', 'balance': '6637.7288007189954500', 'hold': '
2003.9996462765652000', 'available': '4633.72915444243025', 'profile_id': 'cc15c482-e394-40a9-b183-6f456a67b188
', 'trading_enabled': True}

However their documentation suggests pricing tiers/fees are calculated based on trading volume, and I'm not sure a good way to programmatically figure that out.然而,他们的文档表明定价等级/费用是根据交易量计算的,我不确定以编程方式计算出这一点的好方法。

First, you may want to review the information you just posted as it seems there may be sensitive data contained within the post.首先,您可能需要查看刚刚发布的信息,因为帖子中可能包含敏感数据。 I'm not certain because I'm not familiar with the coinbase api.我不确定,因为我不熟悉 coinbase api。

Second, I'm pretty sure you can find a chart with the price-fee pairs in it.其次,我很确定您可以找到包含价格-费用对的图表。 See the link below.请参阅下面的链接。

https://help.coinbase.com/en/coinbase/trading-and-funding/pricing-and-fees/fees https://help.coinbase.com/en/coinbase/trading-and-funding/pricing-and-fees/fees

I don't know about the python api specifically but the exchange api does have a fees end point which looks at the trailing 30 day trade volume.我不知道 python api 的具体情况,但交易所 api 确实有一个费用端点,它查看过去 30 天的交易量。

if the python api doesn't have a hook for this, you can do it directly.如果 python api 没有这个钩子,你可以直接做。 You'll just have to understand how to sign the request (the value for "cb-access-sign": ) which is the bigger issue usually.您只需要了解如何签署请求( "cb-access-sign":的值:),这通常是更大的问题。

https://api.exchange.coinbase.com/fees https://api.exchange.coinbase.com/fees

install requests安装请求

$python -m pip install requests

code sample代码示例

import requests
url = "https://api.exchange.coinbase.com/fees"
headers = {
 "Accept": "application/json",
 "cb-access-key": "<your key>",
 "cb-access-passphrase": "<your passphrase>",
 "cb-access-sign": "<your signing hash>",
 "cb-access-timestamp": "<timestamp used in signing hash>"
}
response = requests.request("GET", url, headers=headers)
print(response.text)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何通过Coinbase Python API获得Litecoin价格? - How do I get Litecoin prices with Coinbase Python API? 如何在 python 中逐步计算罚金? - How do I calculate penalty fees incrementally in python? Javascript 或 Python - 我如何确定是白天还是黑夜? - Javascript or Python - How do I figure out if it's night or day? 我如何找出函数的命名参数在python中是什么 - How do I figure out what the named arguments to a function are in python 我无法弄清楚如何在Python中为散点图散布y轴上的空间 - I cannot figure out how to spread out the space on the y axis for my scatterplot in Python 为什么我需要为 Coinbase Pro API 添加额外的时间才能与 Python cbpro 库成功交易? - Why do I need to add extra time for Coinbase Pro API to get a succesful transaction with Python cbpro library? Coinbase Python API 上的分页 - Pagination on Coinbase Python API 我正在使用 python 3.9,但我不知道如何在我的 Windows 10 中安装 pyaudio - I am using python 3.9 and I can't figure out how to install pyaudio in my Windows 10 简单的 python 问题。 如何使我的列表中的值在输入中读取。 我知道这对你们来说可能太基础了,但我需要弄清楚 - Simple python question. How do I make the values in my list read in an input. I know this is prob too basic for u guys but I need to figure this out Django / Python API-如何确定方法期望接收的对象类? - Django/Python API - how can I figure out what class of object a method is expecting to receive?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM