Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Celo blockchain #698

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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_CELO="CELO-API-KEY-HERE" //

#******** For Development - not required to run bot ********#
export ETHERSCAN_TOKEN="ONLY_REQUIRED_IN_DEV"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export WEB3_FANTOM="api_key_here"
export WEB3_MANTLE="api_key_here"
export WEB3_LINEA="api_key_here"
export WEB3_SEI="api_key_here"
export WEB3_CELO="api_key_here"
```
**Note:** To use the Fantom public RPC, write "public" in place of the API key.

Expand Down
1 change: 0 additions & 1 deletion fastlane_bot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,6 @@ def _handle_trade_instructions(
routes=route_struct,
trade_instructions=split_calculated_trade_instructions,
)

maximize_last_trade_per_tkn(route_struct=route_struct_processed)

# Log the flashloan details
Expand Down
1 change: 1 addition & 0 deletions fastlane_bot/config/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@
"mantle": 0,
"linea": 0,
"sei": 2000,
"celo": 0,
}
46 changes: 45 additions & 1 deletion fastlane_bot/config/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ class ConfigNetwork(ConfigBase):
NETWORK_MANTLE = S.NETWORK_MANTLE
NETWORK_LINEA = S.NETWORK_LINEA
NETWORK_SEI = S.NETWORK_SEI
NETWORK_CELO = S.NETWORK_CELO

# FLAGS
#######################################################################################
Expand Down Expand Up @@ -319,7 +320,9 @@ def new(cls, network=None):
elif network == cls.NETWORK_LINEA:
return _ConfigNetworkLinea(_direct=False)
elif network == cls.NETWORK_SEI:
return _ConfigNetworkSei(_direct=False)
return _ConfigNetworkSei(_direct=False)
elif network == cls.NETWORK_CELO:
return _ConfigNetworkCelo(_direct=False)
elif network == cls.NETWORK_TENDERLY:
return _ConfigNetworkTenderly(_direct=False)
else:
Expand Down Expand Up @@ -821,6 +824,47 @@ class _ConfigNetworkSei(ConfigNetwork):
# Add any exchanges unique to the chain here
CHAIN_SPECIFIC_EXCHANGES = []

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

NETWORK = S.NETWORK_CELO
NETWORK_ID = "42220" #
NETWORK_NAME = "celo"
DEFAULT_PROVIDER = S.PROVIDER_ALCHEMY

RPC_ENDPOINT = "https://lb.drpc.org/ogrpc?network=celo&dkey="
WEB3_ALCHEMY_PROJECT_ID = os.environ.get("WEB3_CELO")

network_df = get_multichain_addresses(network=NETWORK_NAME)
FASTLANE_CONTRACT_ADDRESS = "0x8c05EA305235a67c7095a32Ad4a2Ee2688aDe636"
MULTICALL_CONTRACT_ADDRESS = "0xcA11bde05977b3631167028862bE2a173976CA11"

CARBON_CONTROLLER_ADDRESS = "0x6619871118D144c1c28eC3b23036FC1f0829ed3a"
CARBON_CONTROLLER_VOUCHER = "0x5E994Ac7d65d81f51a76e0bB5a236C6fDA8dBF9A"

NATIVE_GAS_TOKEN_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"
WRAPPED_GAS_TOKEN_ADDRESS = "0x471EcE3750Da237f93B8E339c536989b8978a438"
NATIVE_GAS_TOKEN_SYMBOL = "CELO"
WRAPPED_GAS_TOKEN_SYMBOL = "WCELO"
STABLECOIN_ADDRESS = "0xcebA9300f2b948710d2653dD7B07f33A8B32118C"

IS_INJECT_POA_MIDDLEWARE = True
# No Balancer fork with significant liquidity
BALANCER_VAULT_ADDRESS = "0x0000000000000000000000000000000000000000"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That address holds $14 total in tokens. I think it would be a mistake to include it as it provides no real value.


CHAIN_FLASHLOAN_TOKENS = {
WRAPPED_GAS_TOKEN_ADDRESS: "WCELO",
"0xcebA9300f2b948710d2653dD7B07f33A8B32118C": "USDC",
}
# Add any exchanges unique to the chain here
CHAIN_SPECIFIC_EXCHANGES = []

TAX_TOKENS = set([
])


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 @@ -24,6 +24,7 @@
NETWORK_BSC = "binance_smart_chain"
NETWORK_POLYGON = "polygon"
NETWORK_POLYGON_ZKEVM = "polygon_zkevm"
NETWORK_CELO = "celo"

DATABASE_SQLITE = "sqlite"
DATABASE_POSTGRES = "postgres"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exchange,address
1,466 changes: 1,466 additions & 0 deletions fastlane_bot/data/blockchain_data/celo/static_pool_data.csv

Large diffs are not rendered by default.

Loading
Loading