Core Components
There are a few core components within our protocol:
1. Clearing House Public Interface
The public interface is a defined set of methods that traders, liquidators, and developers interact with. It provides standardized access to the central features of the exchange, which include, but are not limited to:
(a) Placing or canceling limit orders
(b) Placing stop-loss or take-profit orders
(c) Closing existing positions
(d) Depositing or withdrawing collateral
(e) Liquidating positions
Having a well-defined API is important for exchange participants to develop automated strategies that lead to a more efficient market.
2. Market Access Control
Market access control refers to the set of checks that regulate access to the markets within the trading ecosystem. This includes, but is not limited to:
(a) role authentication
(b) risk exposure controls
(c) compliance checks
These checks ensure that participants are protected and respect internal risk limits.
3. Order Entry
This process captures the details of an order, including:
(a) direction (i.e. long or short)
(b) quantity
(c) price
(d) expiration timestamp
These fields are stored on-chain.
4. Vault
The vault is the smart contract that stores traders’ collateral. When a trader wants to open a new position, he must first deposit collateral into the vault to meet initial margin requirements.
5. Accounting
A set of accounting smart contracts manages traders’ positions, PNL, and free collateral across all markets. Free collateral is the amount of collateral that a trader can safely withdraw from the market without violating margin requirements. This is calculated with the trader’s vault balance, realized pnl, funding payments, and negative unrealized PNL. The clearing house uses the information in the accounting contracts to settle trades and monitor the health of the exchange.
6. Insurance Fund
The insurance fund is a financial reserve designed to cover losses due to unforeseen market events and position defaults. The primary purpose of the insurance fund is to protect both the exchange and its participants from losses that cannot be covered by the liquidation of collateral or margin requirements. For example, if a user’s position accrues bad debt, the insurance fund will cover the loss.
Last updated