Skip to content

Commit

Permalink
Remove Deleted Endpoint for Binance.com :(
Browse files Browse the repository at this point in the history
  • Loading branch information
Neal Chambers committed Jan 31, 2024
1 parent 140bce4 commit 0b668f9
Showing 1 changed file with 0 additions and 55 deletions.
55 changes: 0 additions & 55 deletions src/dali/plugin/input/rest/binance_com.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,61 +485,6 @@ def _process_gains(
current_start = now_time - 1 # int(locked_redemptions[0][_TIME]) + 1
current_end = now_time # current_start + _THIRTY_DAYS_IN_MS

# Old system Flexible Savings

# Reset window
current_start = self._start_time_ms
current_end = current_start + _THIRTY_DAYS_IN_MS

# We will step backward in time from the switch over
while current_start < earliest_record_epoch:
self._logger.debug("Pulling flexible saving from older api system from %s to %s", current_start, current_end)

flexible_saving = self._client.sapi_get_lending_union_interesthistory(
params=({_START_TIME: current_start, _END_TIME: current_end, _LENDING_TYPE: _DAILY, _SIZE: _INTEREST_SIZE_LIMIT})
)
# [
# {
# "asset": "BUSD",
# "interest": "0.00006408",
# "lendingType": "DAILY",
# "productName": "BUSD",
# "time": 1577233578000
# },
# {
# "asset": "USDT",
# "interest": "0.00687654",
# "lendingType": "DAILY",
# "productName": "USDT",
# "time": 1577233562000
# }
# ]
processing_result_list = []
for saving in flexible_saving:
self._logger.debug("Flexible Saving: %s", json.dumps(saving))
saving[_EN_INFO] = "Flexible Savings (OLD)"
saving[_ID] = Keyword.UNKNOWN.value
saving[_DIV_TIME] = saving[_TIME]
saving[_AMOUNT] = saving[_INTEREST_FIELD]
processing_result_list.append(self._process_gain(saving, Keyword.INTEREST))
old_savings = True

for processing_result in processing_result_list:
if processing_result is None:
continue
if processing_result.in_transactions:
in_transactions.extend(processing_result.in_transactions)

# if we returned the limit, we need to roll the window forward to the last time
if len(flexible_saving) < _INTEREST_SIZE_LIMIT:
current_start = current_end + 1
current_end = current_start + _THIRTY_DAYS_IN_MS
else:
current_start = int(flexible_saving[0][_TIME]) + 1
current_end = current_start + _THIRTY_DAYS_IN_MS

current_end = min(current_end, earliest_record_epoch)

if old_savings:
# Since we are making a guess at the cut off, there might be errors.
self._logger.warning(
Expand Down

0 comments on commit 0b668f9

Please sign in to comment.