Hello,
I’m trying to get the margin loan and repay histories with /sapi/v1/margin/loan and /sapi/v1/margin/repay.
The documentation says Set archived to true to query data from 6 months ago and that’s how we implemented our code to get historical data. Query up to 6 months ago with archived to true and switch to false for the recent data (less than 6 months).
However, we just noticed that for at least some users, some data that is more than 6 months old is not returned when archived is true but is returned when archived is false.
I don’t know if it’s for all accounts or just a subset.
Example with an account having the issue:
Query https://api.binance.com/sapi/v1/margin/loan with the following params {‘startTime’: 1621468800000, ‘endTime’: 1624060799999, ‘asset’: ‘USDT’, ‘size’: 100, ‘current’: 1, ‘archived’: ‘true’}
(May 20, 2021 0:00:00 to June 18, 2021 23:59:59.999)
The response most recent entry is 1622120641557 (May 27, 2021 13:04:01.557)
Query https://api.binance.com/sapi/v1/margin/loan with the following params {‘params’: {‘startTime’: 1621468800000, ‘endTime’: 1624060799999, ‘asset’: ‘USDT’, ‘size’: 100, ‘current’: 1, ‘archived’: False} (May 20, 2021 0:00:00 to June 18, 2021 23:59:59.999) - same date range more than 6 months ago
The response contains entries from 1622280126449 (May 29, 2021 9:22:06.449) to 1623366958537 (June 10, 2021 23:15:58.537)
A quick fix would be appreciated. In the meantime, we have no choice but query with archived set to both true and false for all time ranges.