Skip to main content

MigrationFactoryOwner

Overview​

MigrationFactoryOwner is an earlier, smaller version of HybridFactoryOwner. It uses the same admin-proxy pattern: ADMIN calls a wrapper, and the wrapper forwards the call to the Factory or to an LT, the market's vault contract. This page is for governance reviewers. It lists only the differences. HybridFactoryOwner documents the shared behavior.

Superseded Factory owners in Contract addresses lists the deployed MigrationFactoryOwner as superseded. The Factory admin (Factory.admin()) is HybridFactoryOwner.

The current LTMigrator uses HybridFactoryOwner, not this contract. The migrator calls lt_allocate_stablecoins(lt_to, limit) with a limit that is not 0. On MigrationFactoryOwner, only ADMIN can make that call, so a migrator cannot use this contract.

Differences from HybridFactoryOwner​

The two contracts differ in these points. In this table, the LEVAMM (contract AMM) is the market's leveraged AMM.

FeatureHybridFactoryOwnerMigrationFactoryOwner
Limit setterslimit_setters map and set_limit_setter(). A limit setter can raise the allocation of a live LT.None. Only ADMIN can call lt_allocate_stablecoins with a limit that is not 0.
95% floorEvery allocation is at least 0.95 · lp_price · collateral_amount.None. LT.allocate_stablecoins(limit) gets the limit as given.
lt_allocate_stablecoins(lt, 0) from ADMINSets disabled_lts[lt] and deallocates in the same call.Only sets disabled_lts[lt]. It does not deallocate.
Deallocation by another callerAny limit, on a disabled LT. The target is 95% of the LP-priced collateral.Only with limit == 0. Reverts with "Not disabled" if the LT is not disabled. The target is lp_price · collateral_amount, with no 95% factor.
@nonreentrant on lt_allocate_stablecoinsYesNo
LEVAMM fee wrapperlt_set_amm_fee(lt, fee)lt_set_amm_rate(lt, fee). The name differs from the LT method, but it also forwards to LT.set_amm_fee.
Other wrapperslt_distribute_borrower_fees, fill_staker_vpool, set_allocator, set_agg, set_flashNot present. Only HybridFactoryOwner has these wrappers.
EventsSetLimitSetterNone

In both contracts, a deallocation runs only if the target is below LT.stablecoin_allocated(). It reverts with "Not enough reserves" if the target is below 75% of the LEVAMM value (AMM.value_oracle().value).

Shared surface​

Both contracts have the immutables ADMIN, FACTORY, and STABLECOIN. Both also have the map disabled_lts(lt: address) -> bool. These functions behave the same in both:

  • transfer_ownership_back(), lt_set_rate(lt, rate), and lt_set_killed(lt, is_killed).
  • add_market(pool, fee, rate, debt_ceiling), set_fee_receiver(addr), set_implementations(amm, lt, virtual_pool, price_oracle, staker), and set_min_admin_fee(value).
  • The views lt_needs_withdraw(lt) -> uint256 and lt_in_factory(lt: address) -> bool. For what each view returns, read HybridFactoryOwner: Public views.

In MigrationFactoryOwner.vy, the map and the lt_in_factory view have these signatures:

disabled_lts: public(HashMap[LT, bool])

@external
@view
def lt_in_factory(lt: address) -> bool

Reverts​

MigrationFactoryOwner reverts with these strings.

StringFunctionCause
AccessEvery wrapperThe caller is not ADMIN. For lt_allocate_stablecoins, only when limit is not 0.
Not disabledlt_allocate_stablecoinslimit == 0 from a caller other than ADMIN, and the LT is not disabled.
Not enough reserveslt_allocate_stablecoinsDeallocation: lp_price · collateral_amount is below 75% of the LEVAMM value.
  • HybridFactoryOwner: the admin proxy with the larger function set, and the shared behavior.
  • LTMigrator: uses HybridFactoryOwner, not this contract.