Skip to content

refactor: deploy self-collateralized markets without the EdgeFactory - #4

Merged
Seranged merged 1 commit into
masterfrom
chore/decouple-edge-factory-address
Aug 10, 2026
Merged

refactor: deploy self-collateralized markets without the EdgeFactory#4
Seranged merged 1 commit into
masterfrom
chore/decouple-edge-factory-address

Conversation

@kasperpawlowski

Copy link
Copy Markdown
Contributor

Summary

The EdgeFactory is deprecated: euler-xyz/euler-interfaces#226 removes its address from the address book, and euler-xyz/evk-periphery#430 drops the edgeFactory field from the PeripheryAddresses struct.

For this repo that means: a submodule bump alone is not sufficient — today (pinned submodule) the script still compiles but peripheryAddresses.edgeFactory deserializes to address(0) once the address book PR merges, and after a bump it stops compiling because the struct field is gone.

Rather than depending on the deprecated on-chain factory at all, this replicates its deployment flow inline for the two-vault self-collateralization case, using only contracts that stay in the address book:

  1. deploy the router via oracleRouterFactory, governed by the deployer
  2. reuse the escrowed collateral singleton via escrowedCollateralPerspective.singletonLookup, or deploy + verify it (same as EdgeFactory)
  3. deploy the borrowable vault (unit of account = the token), set IRM, liq cool-off (1s), max liq discount (15%), no hooks
  4. resolve both vaults in the router, renounce router governance
  5. set LTV and renounce vault governance

Parameters and ordering mirror EdgeFactory.deploy exactly.

Test plan

  • forge build clean
  • --dry-run against a fork before next use

The EdgeFactory is deprecated: its address is removed from the
euler-interfaces address book and the edgeFactory field is dropped from
the PeripheryAddresses struct in evk-periphery, so the script would
read address(0) today and stop compiling on the next submodule bump.

Instead of depending on the on-chain factory, replicate its deployment
flow directly: deploy the router via the (kept) oracle router factory,
reuse or create the escrowed collateral singleton vault via the (kept)
escrowed collateral perspective, deploy the borrowable vault, configure
LTV and renounce governance - identical parameters and ordering to
EdgeFactory.deploy for the two-vault case.
@kasperpawlowski
kasperpawlowski marked this pull request as ready for review August 10, 2026 14:56
@Seranged
Seranged merged commit 7426e39 into master Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants