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.
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.
balanceInfoOfPartyA()
Returns detailed balance information of Party A, including allocated, locked, and pending locked balances for various components (CVA, LF, partyAmm, partyBmm).
balanceInfoOfPartyB()
Returns detailed balance information for Party B corresponding to a given Party A.
allocatedBalanceOfPartyA() & allocatedBalanceOfPartyB()
Description:
allocatedBalanceOfPartyA
: Returns Party A’s allocated balance.allocatedBalanceOfPartyB
: Returns the allocated balance of Party B for a specific Party A.
balanceOfReserveVault()
Returns the balance held in the emergency reserve vault for Party B.
allocatedBalanceOfPartyBs()
Returns an array of allocated balances for a set of Party Bs for a given Party A.
withdrawCooldownOf()
Returns the timestamp indicating when the user last executed a deallocation (i.e. their withdrawal cooldown).
nonceOfPartyA() & nonceOfPartyB()
Returns the current nonce for Party A or Party B (with respect to a specific Party A).
Quotes & Positions
getQuote()
Returns the complete details of a quote identified by its ID.
Example Response:
quoteIdsOf()
Description: Returns an array of quote IDs associated with a Party A address, starting at a specified index.
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).
quotesLength()
Returns the total number of quotes associated with a user.
partyAPositionsCount()
Description: Returns the number of open positions held by Party A.
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.
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.
getPositionsFilteredByPartyB() & getOpenPositionsFilteredByPartyB()
Description:
getPositionsFilteredByPartyB
: Returns positions filtered by Party B.getOpenPositionsFilteredByPartyB
: Returns only those positions that are currently open for Party B.
partyBPositionsCount()
Description: Returns the number of positions held by Party B for a specific Party A.
Symbols & Bridge Transactions
getSymbol()9 & getSymbols()
Description:
getSymbol
: Retrieves the details of a symbol by its ID.getSymbols
: Retrieves an array of symbols starting from a specified index.
Example Response:
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.
getBridgeTransaction() & getNextBridgeTransactionId()
Description:
getBridgeTransaction
: Retrieves the details of a specific bridge transaction.getNextBridgeTransactionId
: Returns the next available bridge transaction ID.
Configuration & System State
isSuspended()
Checks whether a user is suspended.
getLiquidatedStateOfPartyA()
Returns the liquidation details for Party A.
getDeallocateDebounceTime()
Returns the current deallocate debounce time (in seconds).
getInvalidBridgedAmountsPool()
Returns the address of the pool for invalid bridged amounts.
getSettlementStates()
Returns an array of settlement states for Party Bs corresponding to a given Party A.
pendingQuotesValidLength()
Returns the maximum allowed number of pending quotes.
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.
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).
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.
cooldownsOfMA() Example Response:
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.
pauseState()
Returns the current pause state of various system operations.
getPartyBEmergencyStatus() & getBalanceLimitPerUser()
Description:
getPartyBEmergencyStatus
: Checks if Party B is in emergency status.getBalanceLimitPerUser
: Returns the maximum balance allowed per user.
verifyMuonTSSAndGateway()
Verifies a given hash against a Schnorr signature and a gateway signature using Muon’s TSS.
getNextQuoteId<()
Returns the next available quote ID.
getQuoteCloseId()
Description: Returns the close ID associated with a given quote.
Last updated