Example #1
0
def distribute_from_whales(recipient, percentage=0.8):

    console.print(
        "[green] 🐋 Transferring assets from whales for {} assets... 🐋 [/green]".format(
            len(whale_registry.items())
        )
    )

    # Normal Transfers
    for key, whale_config in whale_registry.items():
        # Handle special cases after all standard distributions
        if whale_config.special:
            continue
        if key != "_pytestfixturefunction":
            console.print(" -> {}".format(key))
            distribute_from_whale(whale_config, recipient, percentage=0.8)

    # Special Transfers
    for key, whale_config in whale_registry.items():
        if not whale_config.special:
            continue
        if whale_config.action == WhaleRegistryAction.POPULATE_NEW_SUSHI_LP:
            # Populate LP pair and distribute
            # NOTE: Account should have been distributed both underlying components previously
            sushiswap = SushiswapSystem()
            sushiswap.addMaxLiquidity(
                whale_config.actionParams["token0"], whale_config.actionParams["token1"], recipient
            )
 def _distributeWant(self, users) -> None:
     digg = self.manager.badger.digg
     # Generate lp tokens for users.
     for user in users:
         sushiswap = SushiswapSystem()
         # Generate lp tokens.
         sushiswap.addMaxLiquidity(
             digg.token,
             registry.tokens.wbtc,
             user,
         )
 def _distributeWant(self, users) -> None:
     # Generate lp tokens for users.
     for user in users:
         # Mint ibBTC using sett lp tokens.
         self._mintIbBtc(user)
         sushiswap = SushiswapSystem()
         # Generate lp tokens.
         sushiswap.addMaxLiquidity(
             registry.tokens.ibbtc,
             registry.tokens.wbtc,
             user,
         )
Example #4
0
 def _distributeWant(self, users) -> None:
     claw = self.manager.badger.claw
     # Generate lp tokens for users.
     for user in users:
         # Mint some synthetic tokens.
         claw.mint(user)
         sushiswap = SushiswapSystem()
         # Generate lp tokens.
         sushiswap.addMaxLiquidity(
             claw.emp.tokenCurrency(),
             registry.tokens.usdc,
             user,
         )
    def post_vault_deploy_setup(self, deploy=True):
        """
        Deploy StakingRewardsSignalOnly for Digg Strategy
        Generate LP tokens and grant to deployer
        """
        if not deploy:
            return

        # Setup sushi reward allocations.
        sushiswap = SushiswapSystem()
        pid = sushiswap.add_chef_rewards(self.want)
        # Generate lp tokens.
        sushiswap.addMaxLiquidity(
            self.digg.token,
            registry.tokens.wbtc,
            self.deployer,
        )

        # Pass in LP token pool id to underlying strategy.
        self.params.pid = pid
Example #6
0
def distribute_from_whales(badger, recipient):

    console.print(
        "[green] 🐋 Transferring assets from whales for {} assets... 🐋 [/green]".format(
            len(whale_registry.items())
        )
    )

    # Normal Transfers
    for key, whale_config in whale_registry.items():
        # Handle special cases after all standard distributions
        if whale_config.special:
            continue
        if key != "_pytestfixturefunction":
            console.print(" -> {}".format(key))

            if whale_config.action == WhaleRegistryAction.DISTRIBUTE_FROM_CONTRACT:
                forceEther = ForceEther.deploy({"from": recipient})
                recipient.transfer(forceEther, Wei("1 ether"))
                forceEther.forceSend(whale_config.whale, {"from": recipient})

            token = interface.IERC20(whale_config.token)
            token.transfer(
                recipient,
                token.balanceOf(whale_config.whale) // 5,
                {"from": whale_config.whale},
            )

    # Special Transfers
    for key, whale_config in whale_registry.items():
        if not whale_config.special:
            continue
        if whale_config.action == WhaleRegistryAction.POPULATE_NEW_SUSHI_LP:
            # Populate LP pair and distribute
            # NOTE: Account should have been distributed both underlying components previously
            sushiswap = SushiswapSystem()
            sushiswap.addMaxLiquidity(
                whale_config.actionParams["token0"], whale_config.actionParams["token1"], recipient
            )