Skip to content

Commit

Permalink
intial commit after refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
NIXBNT committed May 20, 2024
1 parent f1e0e06 commit 3ff0ab1
Show file tree
Hide file tree
Showing 15 changed files with 1,629 additions and 21 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export WEB3_FANTOM="FANTOM-API-KEY-HERE" // "public" can be used in place of a p
export WEB3_MANTLE="MANTLE-API-KEY-HERE"
export WEB3_LINEA="LINEA-API-KEY-HERE" //
export WEB3_SEI="SEI-API-KEY-HERE" //
export WEB3_TELOS="TELOS-API-KEY-HERE"

#******** For Development - not required to run bot ********#
export ETHERSCAN_TOKEN="ONLY_REQUIRED_IN_DEV"
Expand Down
63 changes: 57 additions & 6 deletions fastlane_bot/config/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ class ConfigNetwork(ConfigBase):
DEFAULT_MIN_PROFIT_GAS_TOKEN = Decimal("0.02")

IS_INJECT_POA_MIDDLEWARE = False
SUPPORTS_EIP1559 = True
# SUNDRY SECTION
#######################################################################################
COINGECKO_URL = "https://tokens.coingecko.com/uniswap/all.json"
Expand All @@ -277,6 +278,7 @@ class ConfigNetwork(ConfigBase):
NETWORK_MANTLE = S.NETWORK_MANTLE
NETWORK_LINEA = S.NETWORK_LINEA
NETWORK_SEI = S.NETWORK_SEI
NETWORK_TELOS = S.NETWORK_TELOS

# FLAGS
#######################################################################################
Expand All @@ -285,13 +287,18 @@ class ConfigNetwork(ConfigBase):
# HOOKS
#######################################################################################
@staticmethod
def gas_strategy(web3):
def gas_strategy(web3, supports_eip1559):
gas_price = web3.eth.gas_price # send `eth_gasPrice` request
max_priority_fee = web3.eth.max_priority_fee # send `eth_maxPriorityFeePerGas` request
return {
"maxFeePerGas": gas_price + max_priority_fee,
"maxPriorityFeePerGas": max_priority_fee
}
if supports_eip1559:
max_priority_fee = 0 #web3.eth.max_priority_fee # send `eth_maxPriorityFeePerGas` request
return {
"maxFeePerGas": gas_price + max_priority_fee,
"maxPriorityFeePerGas": max_priority_fee
}
else:
return {
"gasPrice": gas_price,
}

@classmethod
def new(cls, network=None):
Expand Down Expand Up @@ -320,6 +327,8 @@ def new(cls, network=None):
return _ConfigNetworkLinea(_direct=False)
elif network == cls.NETWORK_SEI:
return _ConfigNetworkSei(_direct=False)
elif network == cls.NETWORK_TELOS:
return _ConfigNetworkTelos(_direct=False)
elif network == cls.NETWORK_TENDERLY:
return _ConfigNetworkTenderly(_direct=False)
else:
Expand Down Expand Up @@ -818,6 +827,48 @@ class _ConfigNetworkSei(ConfigNetwork):
# Add any exchanges unique to the chain here
CHAIN_SPECIFIC_EXCHANGES = []

class _ConfigNetworkTelos(ConfigNetwork):
"""
Fastlane bot config -- network [Base Mainnet]
"""

NETWORK = S.NETWORK_TELOS
NETWORK_ID = "40"
NETWORK_NAME = "telos"
DEFAULT_PROVIDER = S.PROVIDER_ALCHEMY
RPC_ENDPOINT = "https://lb.drpc.org/ogrpc?network=telos&dkey="
WEB3_ALCHEMY_PROJECT_ID = os.environ.get("WEB3_TELOS")

SUPPORTS_EIP1559 = False
GAS_ORACLE_ADDRESS = None
network_df = get_multichain_addresses(network=NETWORK_NAME)
FASTLANE_CONTRACT_ADDRESS = "0x8c05EA305235a67c7095a32Ad4a2Ee2688aDe636"
MULTICALL_CONTRACT_ADDRESS = "0xcA11bde05977b3631167028862bE2a173976CA11"
IS_NO_FLASHLOAN_AVAILABLE = False

CARBON_CONTROLLER_ADDRESS = (
GRAPHENE_CONTROLLER_ADDRESS
) = "0xb4A4f26eC3A4Fd405468A610ba811720Ecd9E4d4"
CARBON_CONTROLLER_VOUCHER = (
GRAPHENE_CONTROLLER_VOUCHER
) = "0xA1a058aEc4D7C4654E704e42E4E9C2f32871B44c"

NATIVE_GAS_TOKEN_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"
WRAPPED_GAS_TOKEN_ADDRESS = "0xD102cE6A4dB07D247fcc28F366A623Df0938CA9E"
NATIVE_GAS_TOKEN_SYMBOL = "TLOS"
WRAPPED_GAS_TOKEN_SYMBOL = "WTLOS"
STABLECOIN_ADDRESS = "0x8D97Cea50351Fb4329d591682b148D43a0C3611b"

# Balancer
BALANCER_VAULT_ADDRESS = "0xbccc4b4c6530F82FE309c5E845E50b5E9C89f2AD" # Symmetric

CHAIN_FLASHLOAN_TOKENS = {
"0xD102cE6A4dB07D247fcc28F366A623Df0938CA9E": "WTLOS",
"0x8D97Cea50351Fb4329d591682b148D43a0C3611b": "USDC",
}
# Add any exchanges unique to the chain here
CHAIN_SPECIFIC_EXCHANGES = []

class _ConfigNetworkTenderly(ConfigNetwork):
"""
Fastlane bot config -- network [Ethereum Tenderly]
Expand Down
1 change: 1 addition & 0 deletions fastlane_bot/config/selectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
NETWORK_FANTOM = "fantom"
NETWORK_LINEA = "linea"
NETWORK_SEI = "sei"
NETWORK_TELOS = "telos"
NETWORK_MANTLE = "mantle"
NETWORK_SCROLL = "scroll"
NETWORK_BSC = "binance_smart_chain"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
address,exchange
0x0B4D65DA21e71C873401a25D2A0b2ACDFDedadC7,archly_v2
0x24fAB125Eb14b7e288C1D8f74D368bc33e126D4B,archly_v2
0x526de6Ab61339Cb7B19520B3E2882E3aa3f28b03,archly_v2
0x5796F4CBC3124DCBcE43e296D45B25E0e3C25B59,archly_v2
0x62D076fAFa1091F667582935Eedc2d063F40Bf53,archly_v2
0x7337D2Fa74e9ad69CC7a584A458131b48034FeBd,archly_v2
0x743faFdef7c3f70Fd5CbA3F45a13BD7E55E41E9e,archly_v2
0x749E3304fee2aa3eD5B57e0099F371E68AE00a22,archly_v2
0x7D7256bcF9b79463D2709FedfAa6e57838138808,archly_v2
0x7b201BCbc425E4A87f9dbB2CC59e0246Af17cdde,archly_v2
0x9F707A63efEe09A71cbe2edB173ef17938955Eca,archly_v2
0xAb334F5f553056afC9399410eC7dAC63ddc0f0C0,archly_v2
0xD800a78893c204F35D2C567a27F73852f7be2972,archly_v2
0xe7F2AED9670933eDdc71634aAC0A13a187D4fE8f,archly_v2
0xea057987Eb08BE9AE9eB36BA1981C1D99b7e996A,archly_v2
0xeaF72F36d5100e1Ed52F03C53D133e26046439E8,archly_v2
0xf086aE7b932aE228027f5A46212a6E0B19c477f4,archly_v2
Loading

0 comments on commit 3ff0ab1

Please sign in to comment.