# Understanding the Contract Architecture

At the center of the protocol is a diamond contract (EIP-2535). This serves as a single "hub" address that exposes many different modules, called facets. Each facet handles one area of the system: opening and closing positions, funding, liquidations, force actions, viewing state, and so on. When you call the diamond, it forwards your call to the right facet behind the scenes while sharing the same storage. As a solver, you mostly interact with one main contract address, but still get access to all the protocol's features.

On the trader side, user accounts are managed by the [**AccountLayer Diamond**](/contract-documentation/symmio-perps-v0.8.5/account-layer-diamond.md)**,** which is a shared contract that all frontends build on top of. Users create SubAccounts under this contract, and each SubAccount can spin up isolated VirtualAccounts (VAs) for individual trades, markets, or directions, so a liquidation in one position can't cascade into another. As a solver, you will see intents and positions tied to these sub-account addresses (Party A), not the user's main wallet.

Your address acts as [Party B](/getting-started/glossary-of-terms.md) inside this architecture. Before you can trade, your solver must be whitelisted as a Party B on the diamond. You have two collateral modes to choose from: **isolated mode**, where you hold separate collateral per counterparty, and **cross mode**, where you pool everything into a single cross-margin bucket and solvency is evaluated against your total pool. Cross mode significantly improves capital efficiency but has implications for settlement, force close, and liquidation that are worth understanding before enabling it. See Cross Mode for details.

For [instant trading](/trader-documentation/how-trading-works-in-symmio/instant-trading.md) and [conditional orders](/liquidity-provider-documentation/building-a-solver-on-symmio/conditional-orders.md), the protocol uses the [**Instant Layer**](/options-protocol-architecture/technical-architecture/helper-contracts/instantlayer-contract.md). Rather than granting open-ended permissions, users sign specific EIP-712 operations with exact parameters. You bundle those with your own operations and submit everything in one transaction via `executeBatch`. Frontends can also generate a temporary session key in the browser at the start of each session, delegating a scoped set of permissions to it so trading feels seamless without repeated wallet popups. See Instant Trading for integration details.

Symbol configuration, minimum position value, funding parameters, open interest caps etc.  is exposed through [view functions](/contract-documentation/symmio-perps-v0.8.5/diamond-core-facets/view-facet.md) on the diamond. Solvers listen for events from the diamond, reads state from it, and reacts with its own logic.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.symm.io/liquidity-provider-documentation/core-concepts/understanding-the-contract-architecture.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
