deploy_automated_lagoon_vault
Documentation for eth_defi.erc_4626.vault_protocol.lagoon.deployment.deploy_automated_lagoon_vault function.
- deploy_automated_lagoon_vault(*, web3, deployer, config=None, asset_manager=None, asset_managers=None, parameters=None, safe_owners=None, safe_threshold=None, uniswap_v2=None, uniswap_v3=None, aave_v3=None, cowswap=False, velora=False, gmx_deployment=None, cctp_deployment=None, hypercore_vaults=None, any_asset=False, etherscan_api_key=None, verifier=None, verifier_url=None, use_forge=False, between_contracts_delay_seconds=5.0, erc_4626_vaults=None, guard_only=False, existing_vault_address=None, existing_safe_address=None, vault_abi='lagoon/v0.5.0/Vault.json', factory_contract=True, from_the_scratch=False, assets=None, safe_salt_nonce=None, safe_proxy_factory_address=None)
Deploy a full Lagoon setup with a guard.
Lagoon automatised vault consists of
Safe multisig - we use 1.4.1 here
Vault module
Lagoon protocol smart contracts
TradingStrategyModuleV0 module enabling guarded automated trade executor for the Safe
For roles - The primary asset manager and Valuation Manager (Lagoon) are the same role - Multiple asset-manager keys may share the same Guard rights; today this
mainly supports separate FreqTrade and GMX trading keys, but other workflows may use the same pattern in the future
Any Safe must be deployed as 1-of-1 deployer address multisig and multisig holders changed after the deployment.
Warning
Because we need to mix Forge, Safe lib and Web3.py transaction nonce management becomes a madness.
Note
Deployer account must be manually removed from the Safe by new owners.
- Parameters
config (Optional[eth_defi.erc_4626.vault_protocol.lagoon.deployment.LagoonConfig]) – Pass a
LagoonConfigobject instead of individual kwargs. When provided, individual kwargs are ignored.guard_only (bool) – Deploy a new version of the guard smart contract and skip deploying the actual vault.
from_the_scratch (bool) –
Need to deloy a fee registry contract as well.
A new chain deployment.
safe_salt_nonce (Optional[int]) – If set, deploy the Safe using CREATE2 via the canonical SafeProxyFactory for a deterministic address. Use the same value across chains to get the same Safe address everywhere.
safe_proxy_factory_address (Optional[Union[eth_typing.evm.HexAddress, str]]) – Override the Safe ProxyFactory address. Defaults to the canonical v1.4.1 factory (
0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67). See Safe canonical deployments and Safe contract deployment docs.web3 (web3.main.Web3) –
deployer (Union[eth_account.signers.local.LocalAccount, eth_defi.hotwallet.HotWallet]) –
asset_manager (Optional[eth_typing.evm.HexAddress]) –
asset_managers (Optional[list[eth_typing.evm.HexAddress | str]]) –
parameters (Optional[eth_defi.erc_4626.vault_protocol.lagoon.deployment.LagoonDeploymentParameters]) –
safe_owners (Optional[list[eth_typing.evm.HexAddress | str]]) –
uniswap_v2 (Optional[eth_defi.uniswap_v2.deployment.UniswapV2Deployment]) –
uniswap_v3 (Optional[eth_defi.uniswap_v3.deployment.UniswapV3Deployment]) –
aave_v3 (Optional[eth_defi.aave_v3.deployment.AaveV3Deployment]) –
cowswap (bool) –
velora (bool) –
gmx_deployment (Optional[eth_defi.gmx.whitelist.GMXDeployment]) –
cctp_deployment (Optional[eth_defi.cctp.whitelist.CCTPDeployment]) –
hypercore_vaults (Optional[list[eth_typing.evm.HexAddress | str]]) –
any_asset (bool) –
etherscan_api_key (str) –
verifier (Optional[Literal['etherscan', 'blockscout', 'sourcify', 'oklink']]) –
erc_4626_vaults (Optional[list[eth_defi.erc_4626.vault.ERC4626Vault]]) –
existing_vault_address (Optional[Union[eth_typing.evm.HexAddress, str]]) –
existing_safe_address (Optional[Union[eth_typing.evm.HexAddress, str]]) –
assets (Optional[list[eth_typing.evm.HexAddress | str]]) –
- Return type
eth_defi.erc_4626.vault_protocol.lagoon.deployment.LagoonAutomatedDeployment