Skip to content

Commit

Permalink
Fixed an issue in which bancor POL balances were not updated correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Lesigh-3100 committed Sep 29, 2023
1 parent 7439083 commit 1734022
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions fastlane_bot/data/tokens.csv
Original file line number Diff line number Diff line change
Expand Up @@ -4178,3 +4178,7 @@
4176,AURA-16bE,AURA,AURA,0x6047e101aaa9Ab9b02fe5Cbc1DD03c2C7C8516bE,18
4177,REMIO-Fdbc,REMIO,REMIO,0xa35Bd2246978Dfbb1980DFf8Ff0f5834335dFdbc,18
4178,RNB-e743,RNB,RNB,0x2A039B1D9bBDccBb91be28691b730ca893e5e743,18
4179,IOST-883b,IOST,IOST,0xf063Dc5160721A3c35A9A853a4498FFF32e9883b,18
4180,KOPE-52e5,KOPE,KOPE,0x15B479Fd41749d5e4aD7EE06F55c7360e54052e5,18
4181,NEAR-f6a4,NEAR,NEAR,0x85F17Cf997934a597031b2E18a9aB6ebD4B9f6a4,24
4182,BENT-C375,BENT,BENT,0x01597E397605Bf280674Bf292623460b4204C375,18
2 changes: 1 addition & 1 deletion fastlane_bot/events/multicall_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def _extract_pol_params_for_multicall(result: Any, pool_info: Dict, mgr: Any) ->
mgr.web3.eth.contract(abi=ERC20_ABI, address=tkn0_address))
if tkn0_address not in mgr.token_contracts:
mgr.token_contracts[tkn0_address] = tkn_contract
tkn_balance = tkn_contract.functions.balanceOf(tkn0_address).call()
tkn_balance = tkn_contract.functions.balanceOf(mgr.cfg.BANCOR_POL_ADDRESS).call()
result = {
"fee": "0.000",
"fee_float": 0.000,
Expand Down
9 changes: 6 additions & 3 deletions fastlane_bot/events/pools/bancor_pol.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,12 @@ def update_from_event(
if event_args["args"]["token"] == self.state["tkn0_address"] and event_type in [
"TokenTraded"
]:
data["tkn0_balance"] = (
self.state["tkn0_balance"] - event_args["args"]["amount"]
)
# *** Balance now updated from multicall ***
pass
# if self.state['last_updated_block'] < event_args['blockNumber']:
# data["y_0"] = (
# self.state["y_0"] - event_args["args"]["amount"]
# )

for key, value in data.items():
self.state[key] = value
Expand Down

0 comments on commit 1734022

Please sign in to comment.