Skip to content

What is Smart Margin

JaredBorders edited this page Sep 6, 2023 · 13 revisions

System Overview

Smart Margin v3

Like previous versions of Smart Margin, SMv3 aims to enhance the trading experience for Kwenta users by offering improved tools for trading Synthetix derivatives.

Architecture

SMv3 replaces the previous SM account proxy solution with a unified "Engine" contract, which centrally manages collateral, async orders, and conditional orders. Future features will also be integrated into this same contract.

Authentication

With the introduction of an account-based architecture in Synthetix v3, we've significantly reduced the logic required for secure user authentication. This simplifies how trader calls are routed from SMv3 to Synthetix v3.

Users can set up Synthetix v3 accounts either directly through the Synthetix proxy or via Kwenta's Engine. Those with existing accounts can also "register" with Kwenta's Engine by granting it admin permissions, which can be revoked later if necessary.

Delegation

In SMv1/v2, delegation was managed at the SM account level. In SMv3, it's handled through Synthetix account permissions. Users can delegate authority to another address by granting it admin permission directly via the Synthetix proxy.

In essence, SMv3 is all about delegation. By making Kwenta's Engine a delegate of their Synthetix v3 account, users enable the Engine to execute trades on their behalf. This also allows the Engine to provide custom trading features, like conditional orders, that aren't natively available in the Synthetix protocol.

Disregarding on-chain stats tracking, the Engine is a stateless and trustless contract that verifies any incoming call's permission with Synthetix v3 before forwarding it. As a result, granting admin permission to the Engine is secure; neither Kwenta nor any other entity can influence its functionality in any way.

Clone this wiki locally