Skip to content

Latest commit

 

History

History
56 lines (45 loc) · 2.88 KB

SIP-0073.md

File metadata and controls

56 lines (45 loc) · 2.88 KB
SIP Title Author Status Track Created
0073
Refactor Sovryn Protocol Interface with AMM
Ororo (@ororopickpocket), Tyrone Johnson (@tjcloa)
Ready for vote
Contract
2023-12-12

SIP-0073: Refactor Sovryn Protocol Interface with AMM

Issue

The contract SwapsImplSovrynSwap serves as an interface between Sovryn protocol functionality and the Sovryn AMM to swap assets and query exchange rates.
The way it is implemented is confusing and error prone because in some cases it is used as a standalone contract with its own storage and sometimes as a library executing delegated calls from the protocol modules and using its storage.
Because AMM swaps and exchange rates queries are used by every protocol module - it is is a crucial part of our codebase which requires refactoring to improve robustness and clarity of our codebase, for both internal usage and external integrations implicitly improving security.

Solution

We refactored the SwapsImplSovrynSwap by converting it into a Sovryn protocol module SwapsImplSovrynSwapModule and extracting all the AMM integration functions into a library which increases the robustnessness and clarity of the AMM interface.

If approved, this proposal will update all the Sovryn protocol modules and add a new SwapsImplSovrynSwapModule.

Proposed change

Existing Sovryn protocol module contracts

Contract Address
Affiliates 0xb756218F36179e26102f7b485aa43031861f5D49
LoanClosingsLiquidation 0x2d7b3c5B4985A5dA5059AF1466c3FF2fbff4c0A8
LoanClosingsRollover 0xc424d620bCB1e62D6A3353D6dc6D626b720f1D52
LoanClosingsWith 0x88500b472a245a937D07c53B22a107Ce1901d30f
LoanOpenings 0x78145b66Ee07365CDCf9D79B74100950C641Ba42
LoanMaintenance 0xf5Cb98bEAe74506Fafe4f5824C144bC7907869b0
LoanSettings 0xab39152B4F3553c28b1b50031D654c83b10BAFc1
ProtocolSettings 0xC7F237bC38356D7a5bad5C16502537658b9610DB
SwapsExternal 0x4010bc8A340fB7f9C98053cA2031631c9E575195

New Sovryn protocol module contracts

Contract Address
Affiliates 0x83a167A96e73c35C0EdF7bC26a6041f3a62004D3
LoanClosingsLiquidation 0xdC74C456457d769399e8DA8b49500E31E5b223Df
LoanClosingsRollover 0x2add8EfebD9477222784468f63F27e4cf6B7A8Ea
LoanClosingsWith 0xa9a268388D5c317E5F3EBd7C8e8E6c48a0BaFC9A
LoanOpenings 0x7b520c4BDB4527A2c1cA8E24c245660df9636b22
LoanMaintenance 0x4BC462e2c8D106511D8e7985b05A52fD8b726464
LoanSettings 0xABA8f49e4EDbd95ccd593ED37b86a5716Fde2bED
ProtocolSettings 0x93B1F35d9c9F5abED48E44782D58A6804B967Ee3
SwapsExternal 0xBba834823b3351359A89f548504a11a601a6eD42
SwapsImplSovrynSwapModule 0x8104682DF8309c5Fae7C2cB2F457a2878290e2Ac

Proposed changes: PR#530

License

Copyright and related rights waived via CC0.