> 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/contract-documentation/symmio-perps-v0.8.5/diamond-core-facets/view-facet-symbol.md).

# View Facet Symbol

The ViewFacet Symbol provides read-only functions for querying symbol configuration, symbol type information, PartyA-PartyB connections, allowed symbol lists, and funding fee structures. All functions are `view` and do not modify state.

***

### Overview

The ViewFacet Symbol is organized into the following categories:

* **Symbol Lookups:** Retrieve individual symbols or paginated lists, with or without type information.
* **Allowed Symbols for PartyA:** Filtered symbol lists based on the PartyA's connected PartyBs and their whitelisted symbols.
* **Symbol Lookups by Quote:** Resolve symbols from quote IDs.
* **PartyA-PartyB Connections:** Query which PartyBs are connected to a PartyA, with optional active symbol counts.
* **PartyB Symbol Whitelisting:** Check whether a symbol type is whitelisted for a PartyB.
* **Funding & Force Close:** Funding fee structures per (symbol, PartyB) and force close gap ratios.

***

### Symbol Lookups

| Function                                          | Parameters | Returns                                                  |
| ------------------------------------------------- | ---------- | -------------------------------------------------------- |
| `getSymbol(uint256 symbolId)`                     | Symbol ID  | Full `Symbol` struct                                     |
| `getSymbolWithType(uint256 symbolId)`             | Symbol ID  | `SymbolWithType` struct (symbol details + category type) |
| `getSymbols(uint256 start, uint256 size)`         | Pagination | Paginated array of `Symbol` structs                      |
| `getSymbolsWithType(uint256 start, uint256 size)` | Pagination | Paginated array of `SymbolWithType` structs              |

***

### Allowed Symbols for PartyA

These functions return symbols that a PartyA is permitted to trade, based on the PartyBs they are connected to and those PartyBs' whitelisted symbols. Only valid (`isValid = true`) symbols are included.

| Function                                                                          | Parameters         | Returns                                                    |
| --------------------------------------------------------------------------------- | ------------------ | ---------------------------------------------------------- |
| `getAllowedSymbolsForPartyA(address partyA, uint256 start, uint256 size)`         | PartyA, pagination | Paginated `Symbol[]` of allowed symbols                    |
| `getAllowedSymbolsWithTypeForPartyA(address partyA, uint256 start, uint256 size)` | PartyA, pagination | Paginated `SymbolWithType[]` of allowed symbols with types |

**Note:** These scan over the full symbol ID range, so entries where the symbol is not allowed for the PartyA will be empty (zero-initialized structs) in the returned array.

***

### Symbol Lookups by Quote

| Function                                  | Parameters          | Returns                                   |
| ----------------------------------------- | ------------------- | ----------------------------------------- |
| `symbolsByQuoteId(uint256[] quoteIds)`    | Array of quote IDs  | Array of `Symbol` structs (one per quote) |
| `symbolNameByQuoteId(uint256[] quoteIds)` | Array of quote IDs  | Array of symbol name strings              |
| `symbolNameById(uint256[] symbolIds)`     | Array of symbol IDs | Array of symbol name strings              |

***

### PartyA-PartyB Connections

| Function                                              | Parameters     | Returns                                                                                                        |
| ----------------------------------------------------- | -------------- | -------------------------------------------------------------------------------------------------------------- |
| `getConnectedPartyBs(address partyA)`                 | PartyA address | Array of connected PartyB addresses                                                                            |
| `isConnectedPartyB(address partyA, address partyB)`   | PartyA, PartyB | Whether this PartyB is connected to the PartyA                                                                 |
| `getConnectedPartyBsWithSymbolCounts(address partyA)` | PartyA address | Array of `PartyBSymbolCount` structs — each PartyB with the count of unique symbols that have active positions |

The `PartyBSymbolCount` struct:

```solidity
struct PartyBSymbolCount {
    address partyB;
    uint256 symbolCount;  // Number of unique active symbols for this PartyA-PartyB pair
}
```

This is useful for frontends that need to know the scope of each PartyB relationship (e.g., to paginate aggregate position queries).

***

### PartyB Symbol Whitelisting

| Function                                                      | Parameters          | Returns                                                    |
| ------------------------------------------------------------- | ------------------- | ---------------------------------------------------------- |
| `isWhitelistedSymbolType(address partyB, uint256 symbolType)` | PartyB, symbol type | Whether the symbol category is whitelisted for this PartyB |

***

### Funding & Force Close

| Function                                                   | Parameters        | Returns                                                                     |
| ---------------------------------------------------------- | ----------------- | --------------------------------------------------------------------------- |
| `getFundingFeesOfPartyB(uint256 symbolId, address partyB)` | Symbol ID, PartyB | `FundingFee` struct containing current rates, accumulated rates, epoch info |
| `forceCloseGapRatio(uint256 symbolId)`                     | Symbol ID         | The force close gap ratio for this symbol                                   |

The `FundingFee` struct contains:

```solidity
struct FundingFee {
    int256 currentLongRate;
    int256 currentShortRate;
    int256 accumulatedLongRate;
    int256 accumulatedShortRate;
    uint256 lastUpdatedEpoch;
    uint256 startEpoch;
    uint256 epochDuration;
}
```


---

# 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/contract-documentation/symmio-perps-v0.8.5/diamond-core-facets/view-facet-symbol.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.
