LagoonConfig
Documentation for eth_defi.erc_4626.vault_protocol.lagoon.deployment.LagoonConfig Python class.
- class LagoonConfig
Bases:
objectConfiguration for Lagoon vault deployment.
Captures all parameters needed to deploy a Lagoon vault except the chain connection (
web3) and deployer account.Can be passed to
deploy_automated_lagoon_vault()(single chain) ordeploy_multichain_lagoon_vault()(multiple chains).The optional
max_settlement_amountis a Guard safety policy, not a Lagoon vault initialisation parameter. It is therefore kept on this deployment configuration instead ofLagoonDeploymentParameters. When configured, deployment binds the Guard to the stock Lagoon v0.5 vault’s underlying token and pending-deposit Silo, and enables atomic post-call validation inTradingStrategyModuleV0.The safety feature controls gross underlying-token movement in one asset-manager settlement transaction and rate-limits non-zero calls. Deposit assets moving from the Silo to the Safe and redemption assets moving from the Safe to the vault are added rather than netted. The paired
settlement_cooldowndefaults to 24 hours so an asset manager cannot drain the vault with repeated individually valid non-zero calls. Empty settlements neither start nor wait for cooldown. The policy does not validate the NAV supplied to Lagoon. Safe governance can still settle directly without going through the asset-manager module.Attributes summary
Vault parameters (name, symbol, underlying token, fees)
Addresses of Safe multisig owners
Number of owner signatures required for Safe transactions
Primary asset manager kept for backwards compatibility.
Addresses that manage vault assets and execute trades.
Uniswap V2 deployment for router whitelisting
Uniswap V3 deployment for router/quoter whitelisting
Aave V3 deployment for lending whitelisting
Enable CowSwap settlement contract whitelisting
Enable Velora contract whitelisting
GMX perpetuals deployment for whitelisting
Lighter (zk-rollup perps DEX, Ethereum L1) deployment for whitelisting
CCTP V2 deployment for cross-chain USDC transfers
Allow any ERC-20 asset instead of explicit whitelist
Etherscan API key for contract verification
Block explorer for contract verification
Custom block explorer URL
Use Forge for contract deployment
Delay between contract deployments (seconds) for nonce propagation
ERC-4626 vaults to whitelist for deposit/withdrawal
Deploy only the guard, skip vault deployment
Reuse an existing vault (requires guard_only=True)
Reuse an existing Safe instead of deploying a new one
Vault contract ABI file path
Use BeaconProxyFactory for vault deployment
Deploy fresh Lagoon protocol (fee registry + vault implementation + factory)
Maximum gross Lagoon v0.5 settlement per asset-manager transaction.
Minimum delay between non-zero asset-manager Lagoon settlements.
Hypercore native vault addresses to whitelist (HyperEVM only).
ERC-20 token addresses to whitelist
CREATE2 salt for deterministic Safe address across chains
Override Safe ProxyFactory address (default: v1.4.1 canonical).
Isolated directory for forge cache and output artifacts.
Number of forge deploy retries on
"contract was not deployed"errors.When True, deploy only Safe + TradingStrategyModuleV0 guard (no vault).
Methods summary
__init__(parameters, safe_owners, safe_threshold)- parameters: eth_defi.erc_4626.vault_protocol.lagoon.deployment.LagoonDeploymentParameters
Vault parameters (name, symbol, underlying token, fees)
- safe_owners: list[eth_typing.evm.HexAddress | str]
Addresses of Safe multisig owners
- safe_threshold: int
Number of owner signatures required for Safe transactions
- asset_manager: Optional[eth_typing.evm.HexAddress]
Primary asset manager kept for backwards compatibility.
Deprecated in favour of
asset_managers. When both are provided,asset_managerswins.
- asset_managers: Optional[list[eth_typing.evm.HexAddress | str]]
Addresses that manage vault assets and execute trades.
All entries are whitelisted as guard senders. The first entry becomes the primary asset manager and is used as the Lagoon valuation manager unless
parameters.valuationManagerwas explicitly set.The main use case today is splitting permissions between FreqTrade and GMX trading keys while keeping the same Guard rights. Future automated trading or operational workflows may reuse the same mechanism.
- uniswap_v2: Optional[eth_defi.uniswap_v2.deployment.UniswapV2Deployment]
Uniswap V2 deployment for router whitelisting
- uniswap_v3: Optional[eth_defi.uniswap_v3.deployment.UniswapV3Deployment]
Uniswap V3 deployment for router/quoter whitelisting
- aave_v3: Optional[eth_defi.aave_v3.deployment.AaveV3Deployment]
Aave V3 deployment for lending whitelisting
- cowswap: bool
Enable CowSwap settlement contract whitelisting
- velora: bool
Enable Velora contract whitelisting
- gmx_deployment: Optional[eth_defi.gmx.whitelist.GMXDeployment]
GMX perpetuals deployment for whitelisting
- lighter_deployment: Optional[eth_defi.lighter.deployment.LighterDeployment]
Lighter (zk-rollup perps DEX, Ethereum L1) deployment for whitelisting
- cctp_deployment: Optional[eth_defi.cctp.whitelist.CCTPDeployment]
CCTP V2 deployment for cross-chain USDC transfers
- any_asset: bool
Allow any ERC-20 asset instead of explicit whitelist
- etherscan_api_key: Optional[str]
Etherscan API key for contract verification
- verifier: Optional[Literal['etherscan', 'blockscout', 'sourcify', 'oklink']]
Block explorer for contract verification
- verifier_url: Optional[str]
Custom block explorer URL
- use_forge: bool
Use Forge for contract deployment
- between_contracts_delay_seconds: float
Delay between contract deployments (seconds) for nonce propagation
- erc_4626_vaults: Optional[list[eth_defi.erc_4626.vault.ERC4626Vault]]
ERC-4626 vaults to whitelist for deposit/withdrawal
- guard_only: bool
Deploy only the guard, skip vault deployment
- existing_vault_address: Optional[Union[eth_typing.evm.HexAddress, str]]
Reuse an existing vault (requires guard_only=True)
- existing_safe_address: Optional[Union[eth_typing.evm.HexAddress, str]]
Reuse an existing Safe instead of deploying a new one
- vault_abi: str
Vault contract ABI file path
- factory_contract: bool
Use BeaconProxyFactory for vault deployment
- from_the_scratch: bool
Deploy fresh Lagoon protocol (fee registry + vault implementation + factory)
- max_settlement_amount: Optional[decimal.Decimal]
Maximum gross Lagoon v0.5 settlement per asset-manager transaction.
Expressed as a
Decimalin human-readable underlying token units; for example,Decimal("10000")means 10,000 USDC for a USDC vault. Deployment converts this value to raw token units using the underlying token’s onchaindecimals()value.Noneis the backwards-compatible default and keeps Lagoon settlement unlimited. Zero is a valid strict cap which permits only a settlement with zero measured asset movement.The cap is supported only for a stock Lagoon v0.5 vault executed through its paired
TradingStrategyModuleV0. It must not be set for a legacy Lagoon ABI or a satellite-chain configuration, because neither has the execution-aware vault settlement path needed to enforce the post-call balance check.
- settlement_cooldown: int
Minimum delay between non-zero asset-manager Lagoon settlements.
Expressed in seconds and enforced only when
max_settlement_amountis configured. The default is 24 hours. Empty settlements do not start or extend the cooldown and remain callable while it is active. The value must be positive because a zero cooldown would allow repeated non-zero below-cap calls and defeat the safety feature. Direct Safe governance calls bypass this module policy.
- hypercore_vaults: Optional[list[eth_typing.evm.HexAddress | str]]
Hypercore native vault addresses to whitelist (HyperEVM only). When set, also whitelists CoreWriter and CoreDepositWallet.
- assets: Optional[list[eth_typing.evm.HexAddress | str]]
ERC-20 token addresses to whitelist
- safe_salt_nonce: Optional[int]
CREATE2 salt for deterministic Safe address across chains
- safe_proxy_factory_address: Optional[Union[eth_typing.evm.HexAddress, str]]
Override Safe ProxyFactory address (default: v1.4.1 canonical). See Safe canonical deployments and Safe contract deployment docs.
- forge_cache_dir: Optional[pathlib.Path]
Isolated directory for forge cache and output artifacts. Allows concurrent forge deployments from the same source tree.
- deploy_retries: int
Number of forge deploy retries on
"contract was not deployed"errors. Only allowed on testnets. Default: 1 (no retries).
- satellite_chain: bool
When True, deploy only Safe + TradingStrategyModuleV0 guard (no vault). Used for satellite chains in multichain deployments where only the source chain needs a vault contract.
- __init__(parameters, safe_owners, safe_threshold, asset_manager=None, asset_managers=None, uniswap_v2=None, uniswap_v3=None, aave_v3=None, cowswap=False, velora=False, gmx_deployment=None, lighter_deployment=None, cctp_deployment=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, max_settlement_amount=None, settlement_cooldown=86400, hypercore_vaults=None, assets=None, safe_salt_nonce=None, safe_proxy_factory_address=None, forge_cache_dir=None, deploy_retries=1, satellite_chain=False)
- Parameters
parameters (eth_defi.erc_4626.vault_protocol.lagoon.deployment.LagoonDeploymentParameters) –
safe_owners (list[eth_typing.evm.HexAddress | str]) –
safe_threshold (int) –
asset_manager (Optional[eth_typing.evm.HexAddress]) –
asset_managers (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]) –
lighter_deployment (Optional[eth_defi.lighter.deployment.LighterDeployment]) –
cctp_deployment (Optional[eth_defi.cctp.whitelist.CCTPDeployment]) –
any_asset (bool) –
verifier (Optional[Literal['etherscan', 'blockscout', 'sourcify', 'oklink']]) –
use_forge (bool) –
between_contracts_delay_seconds (float) –
erc_4626_vaults (Optional[list[eth_defi.erc_4626.vault.ERC4626Vault]]) –
guard_only (bool) –
existing_vault_address (Optional[Union[eth_typing.evm.HexAddress, str]]) –
existing_safe_address (Optional[Union[eth_typing.evm.HexAddress, str]]) –
vault_abi (str) –
factory_contract (bool) –
from_the_scratch (bool) –
max_settlement_amount (Optional[decimal.Decimal]) –
settlement_cooldown (int) –
hypercore_vaults (Optional[list[eth_typing.evm.HexAddress | str]]) –
assets (Optional[list[eth_typing.evm.HexAddress | str]]) –
safe_proxy_factory_address (Optional[Union[eth_typing.evm.HexAddress, str]]) –
forge_cache_dir (Optional[pathlib.Path]) –
deploy_retries (int) –
satellite_chain (bool) –
- Return type
None