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:
- https://docs.ccxt.com/en/latest/manual.html?highlight=fetchdeposit#deposit
- https://github.com/ccxt/ccxt/wiki/Manual#pagination
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)