Smart Margin v3 (SMv3) will serve as Kwenta's on-chain margin engine for trading derivatives powered by Synthetix v3. SMv3 will handle all trades created on the platform and serve as a single entry point for any on-chain integrators.
Kwenta's SMv3 system will be a unified gateway for all platform trading, prioritizing minimalism and immutability. SMv3's "Engine" will operate as a singleton contract that can manage trader collateral, async order committing, and conditional order verification/execution.
SMv2 was designed to interact exclusively with Synthetix v2 based perp markets. Consequently, Kwenta's current margin engine solution cannot support the newly introduced Synthetix v3 perp markets. SMv3 represents the first step in Kwenta's transition to supporting Synthetix v3 perp markets from an on-chain perspective.
Furthermore, SMv3 initiates Kwenta's shift to a fully immutable and trustless margin engine design. While maintaining the flexibility found in SMv2, SMv3 strives to remove state complexity and emphasize trade execution and trader experience.
In SMv2, delegation was seldom used. However, SMv3 prioritizes it to support engine selectivity. This is managed through Synthetix v3's account module, which allows for permission-based delegation (3). This feature enables Kwenta to roll out new SM versions without requiring trader migration. Traders can choose their preferred trading engine and revoke permissions at will.
Ultimately, SMv3 will unify trader interactions through a single contract rather than using individual SM accounts for each trader. This modification offers several benefits, including lower gas expenses, simplified complexity, and decreased risk linked to upgradeability, as SMv3 will be immutable (1).
For more information, visit the: Kwenta State Log