Skip to content

Commit

Permalink
update constants, add gas price, add tax token
Browse files Browse the repository at this point in the history
  • Loading branch information
NIXBNT committed May 22, 2024
1 parent 98f6105 commit 4513ef9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
2 changes: 2 additions & 0 deletions fastlane_bot/config/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"coinbase_base": 0,
"fantom": 0.0003,
"mantle": 0,
"telos": 0,
}

ETHEREUM = "ethereum"
Expand Down Expand Up @@ -46,4 +47,5 @@
"mantle": 0,
"linea": 0,
"sei": 0,
"telos": 0,
}
4 changes: 4 additions & 0 deletions fastlane_bot/config/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,10 @@ class _ConfigNetworkTelos(ConfigNetwork):
# Add any exchanges unique to the chain here
CHAIN_SPECIFIC_EXCHANGES = []

TAX_TOKENS = set([
"0x3E51e37350356B2D3ad84bD8146e48ac63E371a8", # BABYZAP
])

class _ConfigNetworkTenderly(ConfigNetwork):
"""
Fastlane bot config -- network [Ethereum Tenderly]
Expand Down
18 changes: 9 additions & 9 deletions fastlane_bot/helpers/txhelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def validate_and_submit_transaction(
if self.cfg.SUPPORTS_EIP1559:
gas_cost_wei = tx["gas"] * tx["maxFeePerGas"]
else:
gas_cost_wei = tx["gas"]
gas_cost_wei = tx["gas"] * tx["gasPrice"]
if self.cfg.network.GAS_ORACLE_ADDRESS:
gas_cost_wei += self.cfg.GAS_ORACLE_CONTRACT.caller.getL1Fee(raw_tx)

Expand All @@ -129,15 +129,15 @@ def validate_and_submit_transaction(
f"- Expected gain: {num_format(gas_gain_eth)} GAS token ({num_format(gas_gain_usd)} USD)\n"
)

if gas_gain_eth > gas_cost_eth:
self.cfg.logger.info(f"Sending transaction {dumps(tx, indent=4)}")
tx_hash = self.send_transaction(raw_tx)
self.cfg.logger.info(f"Waiting for transaction {tx_hash} receipt")
tx_receipt = self._wait_for_transaction_receipt(tx_hash)
self.cfg.logger.info(f"Transaction receipt: {dumps(tx_receipt, indent=4)}")
return tx_hash, tx_receipt
# if gas_gain_eth > gas_cost_eth:
self.cfg.logger.info(f"Sending transaction {dumps(tx, indent=4)}")
tx_hash = self.send_transaction(raw_tx)
self.cfg.logger.info(f"Waiting for transaction {tx_hash} receipt")
tx_receipt = self._wait_for_transaction_receipt(tx_hash)
self.cfg.logger.info(f"Transaction receipt: {dumps(tx_receipt, indent=4)}")
return tx_hash, tx_receipt

return None, None
# return None, None

def check_and_approve_tokens(self, tokens: List):
"""
Expand Down

0 comments on commit 4513ef9

Please sign in to comment.