示例#1
0
 def has_earn_threshold_override_active_chain(self, key):
     chain = network_manager.get_active_network()
     override = self.get_earn_threshold_override(chain, key)
     if override == 0:
         return False
     else:
         return True
示例#2
0
 def get_active_chain_run_interval(self, action):
     chain = network_manager.get_active_network()
     return self.get_run_interval(chain, action)
示例#3
0
 def get_active_chain_skipped_setts(self, action):
     chain = network_manager.get_active_network()
     return self.get_skipped_setts(chain, action)
示例#4
0
 def get_active_chain_earn_threshold_override(self, key):
     chain = network_manager.get_active_network()
     return self.get_earn_threshold_override(chain, key)
 def get_active_chain_registry(self) -> ChainRegistry:
     network_id = network_manager.get_active_network()
     if not self.has_registry(network_id):
         console.print(
             "[red]Chain ID {} not found[/red]".format(network_id))
     return self.get_registry(network_id)
示例#6
0
 def set_default_for_active_chain(self):
     chain = network_manager.get_active_network()
     if chain == "eth":
         self.set_default(self.exponentialScaling)
     elif chain == "bsc":
         self.set_default(self.bsc_static)
示例#7
0
from rich.console import Console
from scripts.systems.badger_system import BadgerSystem
from helpers.network import network_manager
from helpers.registry.eth_registry import (
    curve_registry,
    badger_registry,
    sushi_registry,
    digg_registry,
    harvest_registry,
    eth_registry,
)
from helpers.registry.bsc_registry import bsc_registry
import requests

console = Console()
curr_network = network_manager.get_active_network()


def get_tend_earnings_manager(badger: BadgerSystem, strategy: Contract,
                              key: str, overrides):
    """
    get the estimated profit from tending the strategy via the manager

    :param strategy: the strategy to be tended
    :param key: key for the strategy
    :param overrides: transaction overrides
    :return: profit in eth/bnb or 'skip' if the strategy can't be estimated
    """

    (token, token_address) = token_data(key, True)
    if not token or not token_address:
示例#8
0
    "native.badger",
    "native.sushiWbtcEth",
]

bscSettsToRun = [
    "native.pancakeBnbBtcb",
]

runTestSetts = True

networkSettsMap = {
    "eth": settsToRun,
    "bsc": bscSettsToRun,
}
# NB: This is expected to fail if the network ID does not exist.
baseSettsToRun = networkSettsMap[network_manager.get_active_network()]

settTestConfig = generate_sett_test_config(baseSettsToRun, runTestSetts)
diggSettTestConfig = generate_sett_test_config(diggSettsToRun, runTestSetts)
clawSettTestConfig = generate_sett_test_config(clawSettsToRun, runTestSetts)
clawSettSyntheticTestConfig = generate_sett_test_config(clawSettsSytheticTestsToRun, runTestSetts)


@pytest.fixture(scope="function", autouse=True)
def isolate(fn_isolation):
    # perform a chain rewind after completing each test, to ensure proper isolation
    # https://eth-brownie.readthedocs.io/en/v1.10.3/tests-pytest-intro.html#isolation-fixtures
    pass


# @pytest.fixture()