Create the sub-account
Why. You trade as a sub-account that your EOA owns, not as the EOA itself. The sub-account is what holds collateral, what gets bound to a PartyB, and what shows up as signerAccount.addr in the EIP-712 messages you sign to open positions. Your EOA is the authority; the sub-account is the trader.
Signed by. Owner EOA, on-chain, against the AccountLayer diamond.
Function. createSubAccounts(affiliate, accountsData[]), where each entry has name, metadata (bytes), symmioCore (the diamond address), isolationType (uint8), and singleVAMode (bool).
Isolation type decides how virtual accounts get spawned when you trade. 2 = MARKET_DIRECTION is the right answer for almost everyone: it gives one VA per (symbol, direction), for example: all your SYMM longs share a VA, all your SYMM shorts share another, and BTC trades are kept separate from SYMM. The other modes are for specialized use cases (per-trade isolation, per-symbol pooled, fully manual).
singleVAMode = true is mandatory if you want TP/SL to work. With single mode off, every sendQuote call creates a fresh VA, even on the same (symbol, direction) key. The conditional-orders service that handles TP/SL validates that your already-open position's VA equals predictNextVirtualAccountAddress(sub, isolationType, symbolId). With single mode off, the predicted "next VA" is by definition a different VA from the one your position lives on, so the check fails forever. Turn single mode on at creation; it can only be flipped while no VAs are active, so changing your mind later means making a new sub-account.
After this transaction lands, read the new sub-account address from either the tx receipt or getUserSubAccountsAddresses(owner, 0, limit). Save it; you'll need it for everything else.
Last updated

