Skip to content

Commit

Permalink
Merge branch 'main' into 204-add-prefix-option-to-file-paths-which-ar…
Browse files Browse the repository at this point in the history
…e-written-for-deployment-job-write-permissions
  • Loading branch information
mikewcasale authored Nov 15, 2023
2 parents e610ebc + 572a3a2 commit 92b6ffd
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 8 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@

## [Unreleased](https://github.com/bancorprotocol/fastlane-bot/tree/HEAD)

[Full Changelog](https://github.com/bancorprotocol/fastlane-bot/compare/v2.7.60...HEAD)
[Full Changelog](https://github.com/bancorprotocol/fastlane-bot/compare/v2.7.61...HEAD)

- Bug - ensure no precision or rounding error when generating trades through Carbon [\#201](https://github.com/bancorprotocol/fastlane-bot/issues/201)

- Add support for Graphene on Base [\#198](https://github.com/bancorprotocol/fastlane-bot/issues/198)
- Add addresses & handling to route through Graphene on Base [\#199](https://github.com/bancorprotocol/fastlane-bot/pull/199) ([Lesigh-3100](https://github.com/Lesigh-3100))

## [v2.7.61](https://github.com/bancorprotocol/fastlane-bot/tree/v2.7.61) (2023-11-14)

[Full Changelog](https://github.com/bancorprotocol/fastlane-bot/compare/v2.7.60...v2.7.61)

- Fix to use wei format for generating flashloans to avoid precision or rounding errors [\#202](https://github.com/bancorprotocol/fastlane-bot/pull/202) ([Lesigh-3100](https://github.com/Lesigh-3100))

Closed issues
Expand Down
2 changes: 1 addition & 1 deletion fastlane_bot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from .bot import CarbonBot as Bot, __VERSION__, __DATE__
from .config import Config, ConfigNetwork, ConfigDB, ConfigLogger, ConfigProvider

__version__ = '2.7.61'
__version__ = '2.7.62'



6 changes: 4 additions & 2 deletions fastlane_bot/config/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def get_fork_map(df: pd.DataFrame, fork_name: str) -> Dict:
fork = row[1][2]
contract_name = row[1][3]
address = row[1][4]
if fork in fork_name and contract_name == S.ROUTER_ADDRESS:
if fork in fork_name and contract_name in [S.ROUTER_ADDRESS, S.CARBON_CONTROLLER]:
fork_map[exchange_name] = address
return fork_map

Expand Down Expand Up @@ -480,9 +480,11 @@ class _ConfigNetworkBase(ConfigNetwork):
WEB3_ALCHEMY_PROJECT_ID = os.environ.get("WEB3_ALCHEMY_BASE")

network_df = get_multichain_addresses(network="coinbase_base")
FASTLANE_CONTRACT_ADDRESS = "0x8e6AF0013688e5ef92217f23895Ea822cD3051E8"
FASTLANE_CONTRACT_ADDRESS = "0x2f33499368C4239290B045e3A34DFFA2AeD2CA05"
MULTICALL_CONTRACT_ADDRESS = "0xcA11bde05977b3631167028862bE2a173976CA11"

CARBON_CONTROLLER_ADDRESS = GRAPHENE_CONTROLLER_ADDRESS = "0xfbF069Dbbf453C1ab23042083CFa980B3a672BbA"
CARBON_CONTROLLER_VOUCHER = GRAPHENE_CONTROLLER_VOUCHER = "0x907F03ae649581EBFF369a21C587cb8F154A0B84"
NATIVE_GAS_TOKEN_KEY = "ETH-EEeE"
WRAPPED_GAS_TOKEN_KEY = "WETH-0006"
STABLECOIN_KEY = "USDC-2913"
Expand Down
16 changes: 12 additions & 4 deletions fastlane_bot/config/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def __init__(self, network: ConfigNetwork, **kwargs):
address=network.BANCOR_V3_NETWORK_INFO_ADDRESS,
abi=BANCOR_V3_NETWORK_INFO_ABI,
)
if network.NETWORK in [N.NETWORK_BASE, N.NETWORK_ETHEREUM]:
self.CARBON_CONTROLLER_CONTRACT = self.w3.eth.contract(
address=network.CARBON_CONTROLLER_ADDRESS,
abi=CARBON_CONTROLLER_ABI,
Expand All @@ -108,15 +109,22 @@ def __init__(self, network: ConfigNetwork, **kwargs):
address=self.w3.toChecksumAddress(network.FASTLANE_CONTRACT_ADDRESS),
abi=FAST_LANE_CONTRACT_ABI,
)
reward_percent, max_profit = self.BANCOR_ARBITRAGE_CONTRACT.caller.rewards()

self.ARB_REWARD_PERCENTAGE = str(int(reward_percent) / 1000000)
self.ARB_MAX_PROFIT = str(int(max_profit) / (10 ** 18))
self.EXPECTED_GAS_MODIFIER = "0.85"
else:
self.CARBON_CONTROLLER_CONTRACT = None
self.BANCOR_ARBITRAGE_CONTRACT = None

if self.BANCOR_ARBITRAGE_CONTRACT is not None:
try:
reward_percent, max_profit = self.BANCOR_ARBITRAGE_CONTRACT.caller.rewards()
self.ARB_REWARD_PERCENTAGE = str(int(reward_percent) / 1000000)
self.ARB_MAX_PROFIT = 1000000 # This is no longer used
except:
self.ARB_REWARD_PERCENTAGE = "0.5"
else:
self.ARB_REWARD_PERCENTAGE = "0.5"

self.EXPECTED_GAS_MODIFIER = "0.85"
class _ConfigProviderTenderly(ConfigProvider):
"""
Fastlane bot config -- provider [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 @@ -40,6 +40,7 @@
FACTORY_ADDRESS = "FACTORY_ADDRESS"
ROUTER_ADDRESS = "ROUTER_ADDRESS"
CARBON_CONTROLLER_ADDRESS = "CARBON_CONTROLLER_ADDRESS"
CARBON_CONTROLLER = "CARBON_CONTROLLER"
BALANCER_VAULT_ADDRESS = "BALANCER_VAULT_ADDRESS"
UNISWAP_V2 = "uniswap_v2"
UNISWAP_V3 = "uniswap_v3"
Expand Down
3 changes: 3 additions & 0 deletions fastlane_bot/data/multichain_addresses.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
exchange_name,chain,fork,contract_name,address,fee,start_block
carbon_v1,ethereum,carbon_v1,CARBON_CONTROLLER,0xC537e898CD774e2dCBa3B14Ea6f34C93d5eA45e1,NA,17087375
carbon_v1,coinbase_base,carbon_v1,CARBON_CONTROLLER,0xfbF069Dbbf453C1ab23042083CFa980B3a672BbA,NA,17087375
graphene_v1,coinbase_base,carbon_v1,CARBON_CONTROLLER,0xfbF069Dbbf453C1ab23042083CFa980B3a672BbA,NA,17087375
uniswap_v2,ethereum,uniswap_v2,FACTORY_ADDRESS,0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f,0.003,10000835
uniswap_v2,ethereum,uniswap_v2,ROUTER_ADDRESS,0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D,0.003,
uniswap_v3,ethereum,uniswap_v3,FACTORY_ADDRESS,0x1F98431c8aD98523631AE4a59f267346ea31F984,NA,12369621
Expand Down
2 changes: 2 additions & 0 deletions fastlane_bot/helpers/routehandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@ def get_custom_address(
"""
if pool.exchange_name == self.ConfigObj.BANCOR_V2_NAME:
return pool.anchor
elif pool.exchange_name in self.ConfigObj.CARBON_V1_FORKS:
return self.ConfigObj.CARBON_CONTROLLER_MAPPING[pool.exchange_name]
elif pool.exchange_name in self.ConfigObj.UNI_V2_FORKS:
return self.ConfigObj.UNI_V2_ROUTER_MAPPING[pool.exchange_name]
elif pool.exchange_name in self.ConfigObj.CARBON_V1_FORKS:
Expand Down
1 change: 1 addition & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@
type=click.Choice(
[
"ethereum",
"coinbase_base"
]
),
)
Expand Down

0 comments on commit 92b6ffd

Please sign in to comment.