# Querying Info from the SYMMIO Diamond

Because the Diamond delegates function calls to its facets, directly interacting with the Diamond via a blockchain explorer can be challenging. Instead, use specialized tools and subgraphs for querying:

### Using Louper

[**Louper**](https://louper.dev/) is a user‑friendly interface that displays all facets and their functions for a Diamond contract. It allows you to:

* **Inspect Facets:**\
  The `facets()` function (from the DiamondLoupeFacet) returns an array of facet structs with their addresses and function selectors.
* **Query View Functions:**\
  By selecting the “Read” tab and choosing the View Facet, you can query data directly. For example, you can call `getSymbol(symbolId)` to find all the information related to a symbol.

<figure><img src="https://1257875949-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYQhBmTCs9MwhhuPQrV5v%2Fuploads%2FRN8IUD5EjmMMNWm4TXUl%2Fimage.png?alt=media&#x26;token=a6593262-16b7-43f7-9ad7-555ee8c9e949" alt=""><figcaption><p>Using Louper</p></figcaption></figure>

How to use Louper:

1. **Paste the Diamond Address:**\
   Open [Louper](https://louper.dev/) and enter the Diamond contract address. You can find a list of all the Diamond addresses [here](https://docs.symm.io/exchange-builder-documentation/frontend-builder-technical-guidance/broken-reference).
2. **Select the Chain:**\
   Choose the correct network (e.g., BNB).
3. **Query Data:**\
   Go to the “Read” tab, select the View Facet, and call functions such as `getSymbol(symbolId)` to fetch  trading symbols.

### Using Goldsky Subgraphs

We now use Goldsky for our subgraphs. SYMMIO provides subgraph endpoints to query the Diamond’s data.

**Example Subgraph Endpoint (BNB):**

```
https://api.goldsky.com/api/public/project_cm1hfr4527p0f01u85mz499u8/subgraphs/arbitrum_analytics/latest/gn
```

**Example Query (GraphQL):**

```graphql
query {
  symbols(first: 3) {
    id
    name
    blockNumber
    timestamp
    tradingFee
    updateTimestamp
  }
}
```

### Useful Query Functions

The following functions allow you to retrieve information from the SYMMIO diamond. These functions are designed to help applications display real‑time account data and market status. All functions are to be called on the Diamond contract, which will delegate the queries to the appropriate facets.

* **`allocatedBalanceOfPartyA(address partyA)`:**\
  Returns the allocated balance for a given sub‑account. This balance represents the collateral that is “free”—i.e., not locked in open positions. Full documentation [here](https://docs.symm.io/contract-documentation/symmio-perps-v0.8.4/facets/view-facet-0.8.4#allocatedbalanceofpartya-and-allocatedbalanceofpartyb).
* **`balanceInfoOfPartyA(address subaccount)`:**\
  Provides detailed balance information for Party A. This includes allocated balances, locked balances, pending locked funds, and other relevant metrics. Full documentation [here](https://docs.symm.io/contract-documentation/symmio-perps-v0.8.4/facets/view-facet-0.8.4#balanceinfoofpartya).
* **`deallocateCooldown(address subaccount)`:**\
  Retrieves the cooldown period required before funds can be withdrawn following a deallocation. This period is typically set to 12 hours.&#x20;
* **`getpartyAOpenPositions(address subaccount)`:**\
  Returns an array of all open positions held by Party A. Full documentation [here](https://docs.symm.io/contract-documentation/symmio-perps-v0.8.4/facets/view-facet-0.8.4#getpartyaopenpositions-and-getpartybopenpositions).
* **`getQuote(uint quoteId)`:**\
  Fetches detailed information about a specific quote. Use this function to review all parameters of a quote submitted by a user. Full documentation [here](https://docs.symm.io/contract-documentation/symmio-perps-v0.8.4/facets/view-facet-0.8.4#getquote).
* **`getSymbol(uint symbolId)`:**\
  Returns details about a trading symbol, including its name, trading fee, and other configuration parameters. Full documentation [here](https://docs.symm.io/contract-documentation/symmio-perps-v0.8.4/facets/view-facet-0.8.4#getsymbol-9-and-getsymbols).
* **`partyAPositionsCount(address subaccount)`:**\
  Provides the total number of open positions held by Party A. This is useful for quickly assessing account exposure. Full documentation [here](https://docs.symm.io/contract-documentation/symmio-perps-v0.8.4/facets/view-facet-0.8.4#partyapositionscount).
* **`withdrawCooldownOf(address subaccount)`:**\
  Retrieves the withdrawal cooldown timestamp for a sub‑account, indicating when funds will next be available for withdrawal. Full documentation [here](https://docs.symm.io/contract-documentation/symmio-perps-v0.8.4/facets/view-facet-0.8.4#withdrawcooldownof).
