MultiAccount
Last updated
Last updated
The MultiAccount contract is a critical component of the SYMM architecture that enables users to create dedicated sub‑accounts.
MultiAccounts are contracts typically deployed by frontends that are whitelisted by hedgers. They enable users to create sub-accounts to trade with.
These sub‑accounts are smart contracts deployed via the MultiAccount contract. By default, all positions within an account are considered for liquidation, each account is in CROSS. By using sub‑accounts, users can isolate risk by using separate sub‑accounts.
Frontends must deploy a MultiAccount and get whitelisted by SYMM. If you're a frontend looking to deploy a MultiAccount, please refer to this .
Account Creation:
Your wallet calls the MultiAccount contract and specifies which sub‑account to use for executing functions. When you create a sub‑account using addAccount()
, a new contract is deployed using the current account implementation and linked to your wallet as the owner.
Forwarding Calls:
When you call the _call()
function on MultiAccount, the call is forwarded to your sub‑account, which in turn sends the call to the SYMM Diamond. Since the Diamond’s logic operates based on the msg.sender
, actions must originate from the sub‑account to correctly update storage and state.
Parameter Encoding:
All function calls are encoded using the SYMM Diamond’s ABI. This means you must encode the parameters for the desired function using the ABI, and pass that data to the _call()
method. For example:
The MultiAccount contract address is also known as the affiliate address. The affiliate allows for automatic tracking and claiming of platform fees generated by a frontend.