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.
| Feature | HybridFactoryOwner | MigrationFactoryOwner |
|---|---|---|
| Limit setters | limit_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% floor | Every 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 ADMIN | Sets disabled_lts[lt] and deallocates in the same call. | Only sets disabled_lts[lt]. It does not deallocate. |
| Deallocation by another caller | Any 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_stablecoins | Yes | No |
| LEVAMM fee wrapper | lt_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 wrappers | lt_distribute_borrower_fees, fill_staker_vpool, set_allocator, set_agg, set_flash | Not present. Only HybridFactoryOwner has these wrappers. |
| Events | SetLimitSetter | None |
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), andlt_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), andset_min_admin_fee(value).- The views
lt_needs_withdraw(lt) -> uint256andlt_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.
| String | Function | Cause |
|---|---|---|
Access | Every wrapper | The caller is not ADMIN. For lt_allocate_stablecoins, only when limit is not 0. |
Not disabled | lt_allocate_stablecoins | limit == 0 from a caller other than ADMIN, and the LT is not disabled. |
Not enough reserves | lt_allocate_stablecoins | Deallocation: lp_price · collateral_amount is below 75% of the LEVAMM value. |
Related
- HybridFactoryOwner: the admin proxy with the larger function set, and the shared behavior.
- LTMigrator: uses
HybridFactoryOwner, not this contract.