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, lighter_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, max_settlement_amount=None, settlement_cooldown=86400)

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.

Set max_settlement_amount to opt into the Lagoon v0.5 asset-manager settlement safety feature. The value is a Decimal in human-readable underlying-token units. Deployment discovers the stock v0.5 pending Silo, converts the value with the token’s actual decimals(), configures the paired module, and reads the complete onchain configuration back before continuing.

The cap is enforced atomically around an asset-manager call through TradingStrategyModuleV0. It measures the gross sum of deposits and redemptions, so opposite flows cannot evade the limit by netting. A rejected settlement reverts the complete Lagoon transaction. None preserves the historical unlimited settlement behaviour, while Decimal(0) permits only zero measured movement. Every successful non-zero call starts settlement_cooldown, which defaults to 24 hours, so the asset manager cannot drain the vault through repeated below-cap settlements. Empty settlements do not start, extend or wait for cooldown.

The amount check is per transaction and the cooldown rate-limits those transactions over time. It does not validate the NAV passed to Lagoon or restrict transactions signed directly by Safe governance. It requires the stock Lagoon v0.5 ABI and is unavailable on satellite chains, which have no Lagoon vault.

See the canonical Lagoon smart contract source for the underlying v0.5 settlement implementation.

Parameters
Return type

eth_defi.erc_4626.vault_protocol.lagoon.deployment.LagoonAutomatedDeployment