Skip to content

Factory Deployment Flow ​

This diagram shows the complete pool deployment sequence via the PoolFactory contract.

Process Overview ​

The PoolFactory deploys a complete pool system in a single transaction:

  1. Deploy StructuredPool (BeaconProxy) - includes integrated credit line functionality
  2. Register pool in Registry
  3. Deploy Tranche (BeaconProxy)
  4. Deploy immutable Reserve (in Tranche constructor)
  5. Register tranche with pool

Gas Costs ​

ComponentTypeApproximate Gas
StructuredPoolBeaconProxy~200k gas
TrancheBeaconProxy~200k gas
ReserveNew Instance~1M gas
Total~1.4M gas

Key Points ​

  • Atomic Deployment: Everything deployed in single transaction
  • Gas Efficient: BeaconProxies save ~94% gas vs full contract deployments
  • Integrated Credit Line: StructuredPool includes built-in credit line management (no separate controller)
  • Immutable Custody: Reserve has no upgrade mechanism
  • Mass Upgradeable: StructuredPool and Tranche use BeaconProxy pattern
  • Timelock Protected: All beacon upgrades require 2-day timelock
  • Two-Party Auth: Upgrades require both PROTOCOL_ADMIN and TIMELOCK_ADMIN
  • Registry Integration: Immediate registration ensures consistency

Contract Upgradeability ​

ContractUpgradeablePatternNotes
StructuredPool✅ YesBeaconProxyMass upgrade via poolBeacon (includes credit line logic)
Tranche✅ YesBeaconProxyMass upgrade via trancheBeacon
Reserve❌ NoRegularImmutable custody contract

Upgrade Process ​

To upgrade any pool component:

  1. PROTOCOL_ADMIN schedules upgrade on the respective beacon (poolBeacon or trancheBeacon)
  2. Wait 2-day timelock period
  3. PROTOCOL_ADMIN executes upgrade
  4. All instances of that contract type are immediately upgraded

See Upgradeability Guide for detailed upgrade procedures.