我使用ccxt从FTX提取。我的目的是找到该特定FTX地址的所有比特币沉积物的总和。当我尝试获得所有历史存款(超过1个月)时,问题就会发生。 FTX仅返回过去的1个月数据。
- 开始存款的开始日期= 2022年4月1日= 1648771200
- 假期存款末期= 2022年4月30日= 1651363199
- 预期的存款结束日期=现在= 1655033415
我尝试过的是:
-
fetchdeposit /strong>。正确的数据
返回 33 交易。
-
从4月1日起-30 APR = 失败。数据返回与
(1)。正确的数据应返回 3 交易。
-
从1月1日起 - 现在= 失败。数据返回与(1)相同。
正确的数据应返回 44 交易。
我知道分页限制了返回数据。但是,无论我尝试过,我总是只得到一个月的数据。缺少较旧的数据。
参考:
代码
def get_deposits(asset_name):
deposits_total = 0
deposits_count = 0
since = 1648771200
param = {"endTime": 1655033415}
deposits = exchange.fetch_deposits(asset_name, since, limit=None, params=param)
#This sum up all deposits if such deposit is made to specified deposit address
for item in deposits:
if item['addressTo'] == deposit_address[asset_name]:
deposits_total = deposits_total + item['amount']
deposits_count = deposits_count +1
print(item['datetime'])
return(deposits_total, deposits_count)
I use CCXT to fetchDeposits from FTX. My aim is to find the sum of all Bitcoin deposits to this specific FTX address. Problem happens when I try to get all historical deposits (older than 1 month). FTX only returns past 1 month data.
- Start date of deposit = 1 April 2022 = 1648771200
- Dummy end of deposit = 30 April 2022 = 1651363199
- Intended End date of deposit = now = 1655033415
What I've tried:
-
fetchDeposits from the past one month = successful. Correct data
returns 33 transactions.
-
fetchDeposits from 1 Apr - 30 Apr = fail. Data returns same as
(1). Correct data should return 3 transactions.
-
fetchDeposits from 1 Apr - now = fail. Data returns same as (1).
Correct data should return 44 transactions.
I'm aware of pagination which limits the returned data. However, no matter I've tried, I always get only past one month data. Older data is missing.
Reference:
Code
def get_deposits(asset_name):
deposits_total = 0
deposits_count = 0
since = 1648771200
param = {"endTime": 1655033415}
deposits = exchange.fetch_deposits(asset_name, since, limit=None, params=param)
#This sum up all deposits if such deposit is made to specified deposit address
for item in deposits:
if item['addressTo'] == deposit_address[asset_name]:
deposits_total = deposits_total + item['amount']
deposits_count = deposits_count +1
print(item['datetime'])
return(deposits_total, deposits_count)
发布评论
评论(1)
感谢Alex和Kroitor(在Github上)。
下面的代码应归功于KROOTOR(在GitHub上) https://github.com/github.com/ccxt/ccxt/问题/13806
检查正确性的最简单方法是使用
示例
比较
escrenceed_received_value
与ftx返回的值Thanks Alex and Kroitor(on Github).
Code below should credit to Kroitor (on Github) https://github.com/ccxt/ccxt/issues/13806
The easiest way to check the correctness is using
Example
https://chain.so/api/v2/get_address_received/DOGE/DM7Yo7YqPtgMsGgphX9RAZFXFhu6Kd6JTT
Compare
confirmed_received_value
with returned value from FTX