LogoLogo
  • Overview
    • Introduction
    • Table of Contents
  • Token Information
    • Symmio Foundation
  • Protocol Architecture
    • Protocol Introduction
    • Technical Documentation
      • Building an Application with SYMM
        • Introduction and Diamond Explainer
        • Querying Info from the SYMM Diamond
        • MultiAccount
        • Creating an Account and Depositing Funds
        • Sending a Quote
        • Closing a Quote
        • Instant Trading
          • Instant Login (EOA)
          • Instant Login (Account Abstraction)
          • Sending a Quote (Instant Open)
          • Sending a Quote (Instant Close)
        • Frequently Used Queries
      • Solver Docs
        • Solver Docs (github)
        • Solver Implementation Guide (High Level Overview)
        • Building a Solver on SYMMIO
          • 1. Intent Creation
          • 2. Seeing the Intent
          • 3. Hedging Off-Chain
          • 4. Opening/Closing a Position On-Chain
          • Creating the APIs
            • GET Contract Symbols
            • GET Open Interest
            • GET Notional Cap
            • GET Price Range
            • GET Error Codes
            • GET Get Locked Params
            • GET Get Funding Info
            • POST Position State
          • Solver Flow Summary Example
          • Recommended Architecture for Solvers
          • Glossary
        • Conditional Orders Handler
        • Rasa Solver TP/SL Implementation
        • Instant Trading
          • Instant Trading (Solvers)
          • Rasa Instant Trading Implementation
          • Instant Trading Condition Checks
        • Fetching Gas Prices Script
        • How to Add a Market as a Solver
        • Verifying Account Abstracted Instant Actions (ERC-4337)
      • Frontend Docs
        • Setting up a Frontend with SYMMIO
        • Frontend SDK Setup Guide
        • MultiAccount Deployment Guide
        • Instant Trading (Frontends)
          • Account Abstracted Instant Actions (Frontends)
        • Implement a Trading Bot on Symmio (OLD)
          • Setup
          • Creating a Sub-Account
          • Minting Collateral Tokens (Optional)
          • Depositing and Allocating Tokens
          • Obtaining Muon Signatures
          • Sending a Quote
          • Monitoring Price for Execution
      • Contract Docs
        • SYMMIO CORE v0.82
        • Contracts Documentation 0.8.2
          • Main Flow
          • The SYMM Diamond
          • Facets
            • Account Facet
            • Control Facet
            • Funding Rate Facet
            • PartyA Facet
            • PartyB Facet
            • Liquidation Facet
            • View Facet
          • MultiAccount
            • PartyA
            • PartyB
          • SYMM App (Muon)
            • LibMuon
            • MuonStorage
        • Contracts Documentation 0.8.3
          • Facets
            • Control Facet
            • Account Facet
            • PartyA Facet
            • PartyB Facet
            • View Facet
            • Bridge Facet
            • Liquidation Facet (Implementation)
          • Modified Events
          • New Events
          • MuonStorage
        • Contracts Documentation 0.8.4
          • Main Flow (0.8.4)
          • The SYMM Diamond (0.8.4)
          • Facets
            • Account Facet (0.8.4)
            • Bridge Facet (0.8.4)
            • Control Facet (0.8.4)
            • Force Actions Facet (0.8.4)
            • Funding Rate Facet (0.8.4)
            • Liquidations Facet (0.8.4)
            • PartyA Facet (0.8.4)
            • PartyB Group Actions Facet (0.8.4)
            • PartyB Quote Actions Facet (0.8.4)
            • PartyB Position Actions Facet (0.8.4)
            • Settlement Facet (0.8.4)
            • View Facet (0.8.4)
          • MultiAccount (0.8.4)
            • SymmioPartyA
            • SymmioPartyB
          • SYMM App (Muon)
            • LibMuon (0.8.4)
            • MuonStorage (0.8.4)
      • Contract Addresses / Solver Endpoints
        • Mantle
        • Mode
        • IOTA
        • Base
        • BSC
        • Arbitrum
        • Polygon
        • Berachain
        • Solver Endpoints and Addresses
          • Perps Hub
          • Rasa Capital
          • Rasa Capital (Zero Spread)
          • Zenith
      • How to Query our Contracts
      • Muon API Queries
      • Solver Error Codes
      • Interacting with SYMMIO Contracts
    • Protocol higher level architecture
      • 12-Hour Fraud Proof Window
      • PartyB
      • Solver Settings
      • Max Leverage
      • Maintenance Margin (CVA) Calculations
    • Symmio Whitepaper
  • Building on Symmio
    • Builders introduction
    • Solving for Symmio
      • Solver documentation
      • Solver - Example Flow
    • Trading Fees
      • Perps - Settlement Costs
      • Pair Trading - Settlement costs
    • Exchanges (Frontends)
      • Frontend Introduction
      • SDK - SYMM client
      • Trade on Symmio
  • Legal & Brand & Security
    • Security (Audits / Bugbounty)
      • Bug bounty / Coverage
        • How to contact ?
      • Audits
        • SYMM - V0.8 - 0.81
          • Sherlock Audit - Jun 15, 2023
          • Smart State - Jul 2, 2023
        • SYMM - 0.82
          • Sherlock Audit -Aug 30, 2023
        • SYMM - 0.83
          • Sherlock Audit - Jun 17, 2024
        • SYMM - 0.84
          • Sherlock Audit - Oct 3, 2024
        • Vaults
          • Sherlock Audit - Jan 2, 2024
    • Terms of Service & Licensing
      • TRADEMARK & COPYRIGHT NOTICE
      • CONTACT US
      • TERMS OF SERVICE
      • FRONTEND LICENSE
        • Frontend Modifications
        • Frontend Use Grants
      • CONTRACT LICENSE
        • Contract Use Grants
        • Contract Modifications
    • Brand - Assets Logos
Powered by GitBook
LogoLogo

All rights to the people (c) 2023 Symmetry Labs A.G.

On this page
  • View Facet (0.8.4)
  • Account Balances & Stats
  • balanceOf()
  • partyAStats()
  • balanceInfoOfPartyA()
  • balanceInfoOfPartyB()
  • allocatedBalanceOfPartyA() & allocatedBalanceOfPartyB()
  • balanceOfReserveVault()
  • allocatedBalanceOfPartyBs()
  • withdrawCooldownOf()
  • nonceOfPartyA() & nonceOfPartyB()
  • Quotes & Positions
  • getQuote()
  • quotesLength()
  • partyAPositionsCount()
  • getPartyAPendingQuotes() & getPartyBPendingQuotes()
  • getPartyAOpenPositions() & getPartyBOpenPositions()
  • getPositionsFilteredByPartyB() & getOpenPositionsFilteredByPartyB()
  • partyBPositionsCount()
  • Symbols & Bridge Transactions
  • getSymbol() & getSymbols()
  • symbolsByQuoteId(), symbolNameByQuoteId() & symbolNameById()
  • getBridgeTransaction() & getNextBridgeTransactionId()
  • Configuration & System State
  • isSuspended()
  • getLiquidatedStateOfPartyA()
  • getDeallocateDebounceTime()
  • getInvalidBridgedAmountsPool()
  • getSettlementStates()
  • pendingQuotesValidLength()
  • forceCloseGapRatio(), forceClosePricePenalty(), forceCloseMinSigPeriod()
  • liquidatorShare(), liquidationTimeout(), partyBLiquidationTimestamp()
  • coolDownsOfMA(), forceCloseCooldowns(), deallocateCooldown(), settlementCooldown(), lastUpnlSettlementTimestamp()
  • getMuonConfig() & getMuonIds()
  • pauseState()
  • getPartyBEmergencyStatus() & getBalanceLimitPerUser()
  • verifyMuonTSSAndGateway()
  • getNextQuoteId<()
  • getQuoteCloseId()
  1. Protocol Architecture
  2. Technical Documentation
  3. Contract Docs
  4. Contracts Documentation 0.8.4
  5. Facets

View Facet (0.8.4)

View Facet (0.8.4)

The View Facet is a read-only interface that allows clients and external systems to query the state of the SYMM protocol. It aggregates data from multiple storages—including account balances, quote information, symbol details, settlement states, and configuration parameters—to provide a comprehensive view of the system’s state.


Account Balances & Stats

balanceOf()

Description: Returns the free balance (in 18 decimals) of the specified user.

function balanceOf(address user) external view returns (uint256);

partyAStats()

Returns a detailed set of statistics for Party A, including liquidation status, various balance metrics, positions count, pending quotes count, nonces, and the total number of quotes.

function partyAStats(address partyA)
    external
    view
    returns (
        bool liquidationStatus,
        uint256 allocatedBalances,
        uint256 lockedCVA,
        uint256 lockedLF,
        uint256 lockedPartyAmm,
        uint256 lockedPartyBmm,
        uint256 pendingLockedCVA,
        uint256 pendingLockedLF,
        uint256 pendingLockedPartyAmm,
        uint256 pendingLockedPartyBmm,
        uint256 partyAPositionsCount,
        uint256 partyAPendingQuotesCount,
        uint256 partyANonces,
        uint256 quoteIdsCount
    );

balanceInfoOfPartyA()

Returns detailed balance information of Party A, including allocated, locked, and pending locked balances for various components (CVA, LF, partyAmm, partyBmm).

function balanceInfoOfPartyA(address partyA) external view returns (
    uint256 allocatedBalances,
    uint256 lockedCVA,
    uint256 lockedLF,
    uint256 lockedPartyAmm,
    uint256 lockedPartyBmm,
    uint256 pendingLockedCVA,
    uint256 pendingLockedLF,
    uint256 pendingLockedPartyAmm,
    uint256 pendingLockedPartyBmm
);

balanceInfoOfPartyB()

Returns detailed balance information for Party B corresponding to a given Party A.

function balanceInfoOfPartyB(address partyB, address partyA) external view returns (
    uint256 allocatedBalances,
    uint256 lockedCVA,
    uint256 lockedLF,
    uint256 lockedPartyAmm,
    uint256 lockedPartyBmm,
    uint256 pendingLockedCVA,
    uint256 pendingLockedLF,
    uint256 pendingLockedPartyAmm,
    uint256 pendingLockedPartyBmm
);

allocatedBalanceOfPartyA() & allocatedBalanceOfPartyB()

Description:

  • allocatedBalanceOfPartyA: Returns Party A’s allocated balance.

  • allocatedBalanceOfPartyB: Returns the allocated balance of Party B for a specific Party A.

function allocatedBalanceOfPartyA(address partyA) external view returns (uint256);
function allocatedBalanceOfPartyB(address partyB, address partyA) external view returns (uint256);

balanceOfReserveVault()

Returns the balance held in the emergency reserve vault for Party B.

function balanceOfReserveVault(address partyB) external view returns (uint256);

allocatedBalanceOfPartyBs()

Returns an array of allocated balances for a set of Party Bs for a given Party A.

function allocatedBalanceOfPartyBs(address partyA, address[] memory partyBs) external view returns (uint256[] memory);

withdrawCooldownOf()

Returns the timestamp indicating when the user last executed a deallocation (i.e. their withdrawal cooldown).

function withdrawCooldownOf(address user) external view returns (uint256);

nonceOfPartyA() & nonceOfPartyB()

Returns the current nonce for Party A or Party B (with respect to a specific Party A).

function nonceOfPartyA(address partyA) external view returns (uint256);
function nonceOfPartyB(address partyB, address partyA) external view returns (uint256);

Quotes & Positions

getQuote()

Returns the complete details of a quote identified by its ID.

function getQuote(uint256 quoteId) external view returns (Quote memory);

Example Response:

{
  "id": "22000", //ID of the QUOTE
  "partyBsWhiteList": [
    "0x00c069d68bc7420740460DBC3cc3fFF9b3742421"
  ], //Array of partyBs (hedgers) to accept the quote
  "symbolId": "116", //The symbol ID
  "positionType": 1, //Position Type (0 = LONG, 1 = SHORT)
  "orderType": 1, //Order Type (0 = LIMIT, 1 = MARKET)
  "openedPrice": "3665277843182656445", //The Price PartyB Opened the position at (this shifts when funding rates are charged and the uPnL is settled)
  "initialOpenedPrice": "3661652747252747252", //The initial opened price
  "requestedOpenPrice": "3610334000000000000", //Requested openPrice from the user
  "marketPrice": "3664453530000000000", //Market price from the Muon Signature
  "quantity": "1364400000000000000000", //Quantity (in e18 form)
  "closedAmount": "1364400000000000000000", //The quantity closed)
  "initialLockedValues": {
    "cva": "69948343876320000000", //Credit Value Adjustment
    "lf": "3940751767680000000", //Liquidator Fee
    "partyAmm": "911298846276000000000", //Party A Maintenance Margin
    "partyBmm": "0"
  },
  "lockedValues": {
    "cva": "0",
    "lf": "0",
    "partyAmm": "0",
    "partyBmm": "0"
  },
  "maxFundingRate": "200000000000000000000", //The Maximum Funding Rate (as requested by partyA)
  "partyA": "0x20A144bDb43B499aD20b01769f1E776b8bEc9Ea8", //The partyA address
  "partyB": "0x00c069d68bc7420740460DBC3cc3fFF9b3742421", //The PartyB address
  "quoteStatus": 7, //The Quote Status
  "avgClosedPrice": "3268950650650650650",//Average Close Price
  "requestedClosePrice": "0", //Requested Close Price
  "quantityToClose": "0", //Quantity to Close
  "parentId": "0", //Parent ID of the Quote (if applicable)
  "createTimestamp": "1738156558", //The time the quote was created
  "statusModifyTimestamp": "1738523304", //The time the quote was last modified
  "lastFundingPaymentTimestamp": "1738512000", //The last funding payment charge
  "deadline": "1738525099", //Deadline of the quote
  "tradingFee": "3800000000000000", //The trading fee
  "affiliate": "0x6273242a7E88b3De90822b31648C212215caaFE4" //Affiliate (this is the MultiAccount Address)
}

quoteIdsOf()

Description: Returns an array of quote IDs associated with a Party A address, starting at a specified index.

function quoteIdsOf(address partyA, uint256 start, uint256 size) external view returns (uint256[] memory);

getQuotes() & getQuotesByParent()

Description:

  • getQuotes: Retrieves an array of quotes associated with Party A.

  • getQuotesByParent: Retrieves quotes linked to a parent quote (e.g., residual quotes).

function getQuotes(address partyA, uint256 start, uint256 size) external view returns (Quote[] memory);
function getQuotesByParent(uint256 quoteId, uint256 size) external view returns (Quote[] memory);

quotesLength()

Returns the total number of quotes associated with a user.

function quotesLength(address user) external view returns (uint256);

partyAPositionsCount()

Description: Returns the number of open positions held by Party A.

function partyAPositionsCount(address partyA) external view returns (uint256);

getPartyAPendingQuotes() & getPartyBPendingQuotes()

Description:

  • getPartyAPendingQuotes: Returns an array of pending quote IDs for Party A.

  • getPartyBPendingQuotes: Returns an array of pending quote IDs for Party B associated with a given Party A.

function getPartyAPendingQuotes(address partyA) external view returns (uint256[] memory);
function getPartyBPendingQuotes(address partyB, address partyA) external view returns (uint256[] memory);

getPartyAOpenPositions() & getPartyBOpenPositions()

Description:

  • getPartyAOpenPositions: Retrieves an array of open positions (quotes) for Party A.

  • getPartyBOpenPositions: Retrieves an array of open positions for Party B for a specific Party A.

function getPartyAOpenPositions(address partyA, uint256 start, uint256 size) external view returns (Quote[] memory);
function getPartyBOpenPositions(address partyB, address partyA, uint256 start, uint256 size) external view returns (Quote[] memory);

getPositionsFilteredByPartyB() & getOpenPositionsFilteredByPartyB()

Description:

  • getPositionsFilteredByPartyB: Returns positions filtered by Party B.

  • getOpenPositionsFilteredByPartyB: Returns only those positions that are currently open for Party B.

function getPositionsFilteredByPartyB(address partyB, uint256 start, uint256 size) external view returns (Quote[] memory);
function getOpenPositionsFilteredByPartyB(address partyB, uint256 start, uint256 size) external view returns (Quote[] memory);

partyBPositionsCount()

Description: Returns the number of positions held by Party B for a specific Party A.

function partyBPositionsCount(address partyB, address partyA) external view returns (uint256);

Symbols & Bridge Transactions

getSymbol() & getSymbols()

Description:

  • getSymbol: Retrieves the details of a symbol by its ID.

  • getSymbols: Retrieves an array of symbols starting from a specified index.

function getSymbol(uint256 symbolId) external view returns (Symbol memory);
function getSymbols(uint256 start, uint256 size) external view returns (Symbol[] memory);

Example Response:

{
  "symbolId": "1",
  "name": "BTCUSDT",
  "isValid": true,
  "minAcceptableQuoteValue": "120000000000000000000",
  "minAcceptablePortionLF": "3000000000000000",
  "tradingFee": "3800000000000000",
  "maxLeverage": "100000000000000000000",
  "fundingRateEpochDuration": "14400",
  "fundingRateWindowTime": "420"
}

symbolsByQuoteId(), symbolNameByQuoteId() & symbolNameById()

Description:

  • symbolsByQuoteId: Returns an array of symbols associated with an array of quote IDs.

  • symbolNameByQuoteId: Returns an array of symbol names for the given quote IDs.

  • symbolNameById: Returns an array of symbol names for the provided symbol IDs.

function symbolsByQuoteId(uint256[] memory quoteIds) external view returns (Symbol[] memory);
function symbolNameByQuoteId(uint256[] memory quoteIds) external view returns (string[] memory);
function symbolNameById(uint256[] memory symbolIds) external view returns (string[] memory);

getBridgeTransaction() & getNextBridgeTransactionId()

Description:

  • getBridgeTransaction: Retrieves the details of a specific bridge transaction.

  • getNextBridgeTransactionId: Returns the next available bridge transaction ID.

function getBridgeTransaction(uint256 transactionId) external view returns (BridgeTransaction memory);
function getNextBridgeTransactionId() external view returns (uint256);

Configuration & System State

isSuspended()

Checks whether a user is suspended.

function isSuspended(address user) external view returns (bool);

getLiquidatedStateOfPartyA()

Returns the liquidation details for Party A.

function getLiquidatedStateOfPartyA(address partyA) external view returns (LiquidationDetail memory);

getDeallocateDebounceTime()

Returns the current deallocate debounce time (in seconds).

function getDeallocateDebounceTime() external view returns (uint256);

getInvalidBridgedAmountsPool()

Returns the address of the pool for invalid bridged amounts.

function getInvalidBridgedAmountsPool() external view returns (address);

getSettlementStates()

Returns an array of settlement states for Party Bs corresponding to a given Party A.

function getSettlementStates(address partyA, address[] memory partyBs) external view returns (SettlementState[] memory);

pendingQuotesValidLength()

Returns the maximum allowed number of pending quotes.

function pendingQuotesValidLength() external view returns (uint256);

forceCloseGapRatio(), forceClosePricePenalty(), forceCloseMinSigPeriod()

Description:

  • forceCloseGapRatio: Returns the force close gap ratio for a given symbol.

  • forceClosePricePenalty: Returns the current force close price penalty.

  • forceCloseMinSigPeriod: Returns the minimum signature period required for force closing.

function forceCloseGapRatio(uint256 symbolId) external view returns (uint256);
function forceClosePricePenalty() external view returns (uint256);
function forceCloseMinSigPeriod() external view returns (uint256);

liquidatorShare(), liquidationTimeout(), partyBLiquidationTimestamp()

Description:

  • liquidatorShare: Returns the percentage share for liquidators.

  • liquidationTimeout: Returns the timeout duration for liquidation for partyB (in seconds).

  • partyBLiquidationTimestamp: Returns the liquidation timestamp for PartyB (with respect to a given Party A).

function liquidatorShare() external view returns (uint256);
function liquidationTimeout() external view returns (uint256);
function partyBLiquidationTimestamp(address partyB, address partyA) external view returns (uint256);

coolDownsOfMA(), forceCloseCooldowns(), deallocateCooldown(), settlementCooldown(), lastUpnlSettlementTimestamp()

Description:

  • coolDownsOfMA: Returns several MA (Master Agreement) cooldown values.

  • forceCloseCooldowns: Returns the force close first and second cooldowns.

  • deallocateCooldown: Returns the current deallocate cooldown.

  • settlementCooldown: Returns the settlement cooldown period.

  • lastUpnlSettlementTimestamp: Returns the last UPnL settlement timestamp for a given combination of sender Party B, target Party B, and Party A.

function coolDownsOfMA() external view returns (uint256, uint256, uint256, uint256);
function forceCloseCooldowns() external view returns (uint256, uint256);
function deallocateCooldown() external view returns (uint256);
function settlementCooldown() external view returns (uint256);
function lastUpnlSettlementTimestamp(address senderPartyB, address targetPartyB, address partyA) external view returns (uint256)

cooldownsOfMA() Example Response:

[
  "43200", //deallocateCooldown
  "150", //forceCancelCooldown
  "150", //forceCancelCloseCooldown
  "90" //forceCloseFirstCooldown
]

getMuonConfig() & getMuonIds()

Description:

  • getMuonConfig: Retrieves the current Muon UPnL and price validity periods.

  • getMuonIds: Retrieves the Muon application ID, public key, and valid gateway address.

function getMuonConfig() external view returns (uint256 upnlValidTime, uint256 priceValidTime);
function getMuonIds() external view returns (uint256 muonAppId, PublicKey memory muonPublicKey, address validGateway);

pauseState()

Returns the current pause state of various system operations.

function pauseState() external view returns (
    bool globalPaused,
    bool liquidationPaused,
    bool accountingPaused,
    bool partyBActionsPaused,
    bool partyAActionsPaused,
    bool internalTransferPaused,
    bool emergencyMode
);

getPartyBEmergencyStatus() & getBalanceLimitPerUser()

Description:

  • getPartyBEmergencyStatus: Checks if Party B is in emergency status.

  • getBalanceLimitPerUser: Returns the maximum balance allowed per user.

function getPartyBEmergencyStatus(address partyB) external view returns (bool);
function getBalanceLimitPerUser() external view returns (uint256);

verifyMuonTSSAndGateway()

Verifies a given hash against a Schnorr signature and a gateway signature using Muon’s TSS.

function verifyMuonTSSAndGateway(bytes32 hash, SchnorrSign memory sign, bytes memory gatewaySignature) external view;

getNextQuoteId<()

Returns the next available quote ID.

function getNextQuoteId() external view returns (uint256);

getQuoteCloseId()

Description: Returns the close ID associated with a given quote.

function getQuoteCloseId(uint256 quoteId) external view returns (uint256);
PreviousSettlement Facet (0.8.4)NextMultiAccount (0.8.4)

Last updated 2 months ago