Skip to content

Commit

Permalink
Add config for Base network (#469)
Browse files Browse the repository at this point in the history
This PR adds some configuration info for the Base network
  • Loading branch information
harisang authored Dec 20, 2024
1 parent 50adfe0 commit d2b1e4a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
35 changes: 34 additions & 1 deletion src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,18 @@ def from_network(network: Network) -> RewardConfig:
service_fee_factor=service_fee_factor,
cow_bonding_pool=cow_bonding_pool,
)
case Network.BASE:
return RewardConfig(
reward_token_address=Address(
"0xc694a91e6b071bf030a18bd3053a7fe09b6dae69"
),
batch_reward_cap_upper=12 * 10**15,
batch_reward_cap_lower=10 * 10**15,
quote_reward_cow=6 * 10**18,
quote_reward_cap_native=2 * 10**14,
service_fee_factor=service_fee_factor,
cow_bonding_pool=cow_bonding_pool,
)
case _:
raise ValueError(f"No reward config set up for network {network}.")

Expand Down Expand Up @@ -116,6 +128,10 @@ def from_network(network: Network) -> ProtocolFeeConfig:
protocol_fee_safe = Address(
"0x451100Ffc88884bde4ce87adC8bB6c7Df7fACccd"
)
case Network.BASE:
protocol_fee_safe = Address(
"0x3c4DBcCf8d80D3d92B0d82197aebf52574ED1F3B"
)
case _:
raise ValueError(
f"No protocol fee config set up for network {network}."
Expand All @@ -138,7 +154,7 @@ class BufferAccountingConfig:
def from_network(network: Network) -> BufferAccountingConfig:
"""Initialize buffer accounting config for a given network."""
match network:
case Network.MAINNET | Network.GNOSIS | Network.ARBITRUM_ONE:
case Network.MAINNET | Network.GNOSIS | Network.ARBITRUM_ONE | Network.BASE:
include_slippage = True
case _:
raise ValueError(
Expand Down Expand Up @@ -184,6 +200,8 @@ def from_network(network: Network) -> DuneConfig:
dune_blockchain = "gnosis"
case Network.ARBITRUM_ONE:
dune_blockchain = "arbitrum"
case Network.BASE:
dune_blockchain = "base"
case _:
raise ValueError(f"No dune config set up for network {network}.")

Expand Down Expand Up @@ -275,6 +293,19 @@ def from_network(network: Network) -> PaymentConfig:
wrapped_eth_address = Address(
"0x82af49447d8a07e3bd95bd0d56f35241523fbab1"
)
case Network.BASE:
payment_network = EthereumNetwork.BASE_MAINNET
short_name = "base"

cow_token_address = Address(
"0xc694a91e6b071bf030a18bd3053a7fe09b6dae69"
)
wrapped_native_token_address = Web3.to_checksum_address(
"0x4200000000000000000000000000000000000006"
)
wrapped_eth_address = Address(
"0x4200000000000000000000000000000000000006"
)
case _:
raise ValueError(f"No payment config set up for network {network}.")

Expand Down Expand Up @@ -350,6 +381,8 @@ def from_network(network: Network) -> DataProcessingConfig:
bucket_size = 30000
case Network.ARBITRUM_ONE:
bucket_size = 1000000
case Network.BASE:
bucket_size = 50000
case _:
raise ValueError(
f"No buffer accounting config set up for network {network}."
Expand Down
3 changes: 3 additions & 0 deletions src/fetch/prices.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ def decimals(self) -> int:
# arbitrum tokens
Address("0xcb8b5cd20bdcaea9a010ac1f8d835824f5c87a04"): TokenId.COW,
Address("0x82af49447d8a07e3bd95bd0d56f35241523fbab1"): TokenId.ETH,
# base tokens
Address("0xc694a91e6b071bf030a18bd3053a7fe09b6dae69"): TokenId.COW,
Address("0x4200000000000000000000000000000000000006"): TokenId.ETH,
}


Expand Down

0 comments on commit d2b1e4a

Please sign in to comment.