我使用的是Coinbase Pro API Python SDK。我下了一个限购订单,就像。。。
import cbpro
...
self._get_auth_client(account).place_limit_order(product_id=formatted_name,
side='buy',
price=fiat_price,
size=amount)
当它被填充时,我得到的结果看起来像下面的
{
'id': '1eaa9934-ccef-489d-80d7-540e0b9ef62a',
'price': '64262.83000000',
'size': '0.01556109',
'product_id': 'BTC-USD',
'profile_id': 'bb05c122-e394-40a9-b183-60456a67b188',
'side': 'buy',
'type': 'limit',
'time_in_force': 'GTC',
'post_only': False,
'created_at': '2021-11-14T19:55:03.791866Z',
'done_at': '2021-11-14T19:55:08.990951Z',
'done_reason': 'filled',
'fill_fees': '1.5639532769270500',
'filled_size': '0.01556109',
'executed_value': '999.8760512847000000',
'status': 'done',
'settled': True
}
我不明白的是他们是如何计算";executed_value";?根据购买金额乘以价格减去费用,(64262.83000000*0.01556109-1.5639532769270500(,我认为执行价值为998.435728008,低于报告的金额。我错过了什么?
基于我对您的Buy API call
和Coinbase文档中的这句话的解释。
executed_value是累计匹配大小*价格,仅为出席2016-05-20之后的订单。
executed_value
似乎适合您的交易,因为executed_value
的输出没有考虑fill_fees
。
当您查询您的Order Book
时,您应该会看到从您的采购订单中提取的fill_fees
。
参考:https://help.coinbase.com/en/pro/trading-and-funding/orders/overview-of-order-types-and-settings-stop-limit-market