System Overview

Smart Margin v3 Overview

Smart Margin v3 (SMv3) continues the legacy of its predecessors, aiming to elevate the trading experience on Kwenta by offering advanced tools for trading Synthetix derivatives.

Architectural Evolution

SMv3 marks a departure from the previous versions’ account proxy approach. It introduces a monolithic "Engine" contract. This Engine is the hub for managing various components, including collateral, async orders, and conditional orders. It's designed to seamlessly integrate future features, consolidating them into a single, efficient contract.

Streamlined Authentication Process

The shift to an account-based architecture in Synthetix v3 represents a significant leap forward regarding user authentication. This development simplifies how trader calls are transmitted from SM to Synthetix v3, enhancing security and efficiency.

For users to interact with SMv3, setting up a Synthetix v3 account via the Synthetix proxy is mandatory. Those who already have Synthetix accounts can integrate with Kwenta's Engine by granting it administrative permissions. This permission is flexible and can be revoked by the user at their discretion, providing an additional layer of control and security.

Upgradability in Smart Margin v3

Smart Margin v3 (SMv3) retains the upgradability feature characteristic of its predecessors. The system's upgradability is enabled through the integration of OpenZeppelin's UUPSUpgradeable utility. Although the initial intention was to avoid upgradability, it remains a necessary feature. This is primarily due to the dynamic nature of the Synthetix v3 protocol, which SMv3 interfaces with. Aligning with Synthetix v3’s upgradability ensures that Kwenta and its traders can adapt to evolving needs and changes in the ecosystem.

The process of upgrading SMv3 is structured and secure. Upgrades are implemented using specific scripts, available here. To ensure safety and prevent any storage conflicts during upgrades, comprehensive internal tests have been developed using Foundry.

It’s important to highlight that upgrade decisions and executions are under strict governance. These actions are exclusively authorized and carried out only if initiated by Kwenta's ProtocolDAO (pDAO), a multisig owner entity. This governance layer reinforces the security and integrity of the SMv3 system, ensuring that upgrades align with the community's best interests and the platform's strategic vision.

Last updated