> For the complete documentation index, see [llms.txt](https://docs.symm.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.symm.io/options-protocol-architecture/technical-architecture/collateral-and-margin-system.md).

# Collateral & Margin System

### Collateral management

Symmio runs two margin systems to manage risk and keep counterparties solvent.

#### 1. Isolated margin

* Used only for PartyA option purchases.
* PartyA's funds go into an individual isolated balance, managed per user.
* PartyB keeps enough collateral in its own isolated balance to cover the total unrealized PnL of all open positions across all PartyAs.
* The required collateral is set by the *loss coverage ratio*, which defines what percentage of unrealized losses must be backed by actual funds.
* Solvency checks for PartyB run only against its isolated balance, aggregated across all counterparties (not per PartyA).
* If PartyB's available balance falls below the required threshold, liquidation is triggered.
* The Scheduled Release Balance System governs how and when deposited funds become available, adding timed delays for security.

#### 2. Cross margin

* Available for both buying and selling by PartyA.
* Each PartyA and PartyB keeps a dedicated cross balance per counterparty pair.
* This model covers PartyA's maintenance margin (when selling options) and PartyB's loss coverage (when PartyA is the buyer).
* Funds can be allocated from the isolated balance into a cross balance specific to a trading counterparty.
* Solvency and liquidation are pair-specific: they apply only to the trades and margin balances between a particular PartyA and PartyB.
  * PartyA must keep enough maintenance margin in its cross balance with PartyB to support short positions.
  * PartyB must allocate enough funds in the cross balance with PartyA to cover the required unrealized PnL.
* PartyB also gets a dedicated *reserve balance*: a fail-safe collateral source that can top up a cross balance and prevent liquidation when the account is at risk.

### Scheduled Release Balance System

The Scheduled Release System is a contract-based balance manager that handles funds with time-delayed releases and multi-counterparty support. It works with both the isolated and cross-margin models and their locking mechanisms, and it:

* Controls fund release and transfers between parties.
* Adds security delays so funds aren't immediately available.
* Reduces the risk of rapid fund movements.
* Provides different behavior for isolated vs. cross margin.

**Balance types**

1. **Isolated balance:** the user's main balance pool, used in isolated solvency checks.
2. **Cross balance:** per-counterparty balance for cross-margin operations and solvency checks.
3. **Scheduled balance:** time-locked funds awaiting first release.
4. **Transitioning balance:** funds in the second phase of the release process.

**Margin types**

* **Isolated margin:** uses the scheduled-release mechanism with time delays.
* **Cross margin:** direct balance operations without delays.

<figure><img src="/files/byxZ5888M1kSeWmSNxHO" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/12wkyGHeNTzFg21oc6f8" alt=""><figcaption></figcaption></figure>

#### Isolated balance functions

* `instantIsolatedAdd()`: immediately adds funds to a party's isolated balance.
* `isolatedSub()`: subtracts funds from the isolated balance.
* `isolatedLock()` / `isolatedUnlock()`: lock or unlock portions of the isolated balance.

<figure><img src="/files/7vgqmvKHS3dyWIGMWUnF" alt=""><figcaption></figcaption></figure>

#### Cross balance functions

* `allocateBalance()`: transfer funds from isolated to cross balance for a specific counterparty.
* `deallocateBalance()`: transfer funds from cross balance back to isolated balance.
* `crossLock()` / `crossUnlock()`: lock or unlock portions of the cross balance.

#### Scheduled release functions

* `scheduledAdd()`: add funds with a time-delayed release (the delay is a security measure).

<figure><img src="/files/dNgQwrWVepDIM8cArDes" alt=""><figcaption></figcaption></figure>

* `subForCounterParty()`: subtract funds from balances for a counterparty, not just the isolated balance.

<figure><img src="/files/9op4FC9jF0XHmDmTKJJJ" alt=""><figcaption></figcaption></figure>

#### Release mechanism

The system uses two release intervals:

1. **Release Interval 1:** Scheduled Balance to Transitioning Balance.
2. **Release Interval 2:** Transitioning Balance to Isolated Balance.

The `sync()` function must be called to move funds through the intervals. It checks elapsed time for each balance bucket, moves funds from Scheduled to Transitioning when interval 1 expires, and from Transitioning to Isolated when interval 2 expires.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.symm.io/options-protocol-architecture/technical-architecture/collateral-and-margin-system.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
