Synthetix Docs
V2 User Docs
  • User Docs
  • Synthetix Exchange
  • Leveraged Tokens
  • For Developers
V2 User Docs
  • Synthetix Protocol
    • Welcome to Synthetix
    • The Synthetix Protocol
      • Synthetix Token (SNX)
      • The Role of Stakers
      • Oracles
      • Synthetix Litepaper
    • Synthetic Assets
      • Perpetual Futures
      • Spot Synths
  • Staking
    • Depositing to the 420 Pool
    • Current Protocol Parameters
    • Staking Guide (Nearing Deprecation)
      • Steps for Staking SNX (via Minting)
      • Steps for Unstaking SNX (via Burning)
      • Steps for Claiming Rewards
      • Automating Staking, Claiming, Burning, and Minting
        • Legacy Automated Minting & Claiming
      • Understanding the Collateralization Ratio
      • Understanding Debt, Minting, and Burning
      • Simplified Debt Hedging
      • Escrow and Vesting
      • Liquidations
    • Staking FAQ
    • Bridging sUSD
  • DAO
    • Governance Framework
      • Synthetix Improvement Proposals (SIPs)
      • Synthetix Configuration Change Proposal (SCCPs)
      • Spartan Council
      • Core Contributors
      • Staker
    • Elections and Voting
      • Voting with a Gnosis Safe
    • How to write SIP/SCCPs
  • V3
    • Synthetix v3
    • Build on v3
  • Synthetix Ecosystem
    • Built on Synthetix
      • Kwenta - Spot and Perps
      • Decentrex - Perps
      • Lyra - Options
      • Polynomial - Perps and Option Vaults
      • 1inch/Curve - Atomic Swaps
    • Community Infrastructure
    • Ecosystem Operations
  • integrations
    • Perps Integration Guide
      • Introduction
      • Optimistic Sepolia Testnet Tokens
      • Technical Integration
      • Perps Subgraph
      • General FAQ
      • Tracking Codes
      • Perps Keeper
      • Liquidations
      • Useful Links
      • Migration Guides
        • PerpsV2 Mintaka -> Almach
        • FuturesV1 -> PerpsV2 (Mintaka)
    • Contract Addresses
    • Releases
  • Terms of Use
  • Brand Assets
    • Design Resources
Powered by GitBook
On this page
  1. integrations
  2. Perps Integration Guide

Perps Subgraph

PreviousTechnical IntegrationNextGeneral FAQ

There are subgraphs that provides all the necessary information for a perp trading front end. Available networks are Optimism:

Entities

In the list below you find all entities that the subgraph has to offer.

  • Frontends: gives you information about integrators, which market they traded on and their names.

  • FuturesPositionLiquidated: gets created every time there is a liquidation. You get information about size and fee, but also about the trader and the position.

  • PositionFlagged: gets created when a position is close to liquidation.

  • Trader: is an accumulative entity that keeps track of a trader's stats, pnl, liquidations etc.

  • FuturesTrade: this entity gets created every time there is an interaction with the position. When it gets opened, modified, closed or liquidated. This entity is helpful when you would like to know how much volume a market did in one day, or if you are interested in the history of a position.

  • Synthetix: this entity is like the trader entity, although only one ever will exists. It keeps track of total volume that has flown through the system, how much fees got generated etc.

  • FuturesPosition: as the name suggests, this entity gives you all the information about a position.

  • FuturesOrder: this entity is almost like the futures trade entity but serve the purpose of keeping track of position that are submitted through a different way. There are: DelayedOrder, DelayedOffchainOrder and NextPriceOrder. Once a futures order gets executed, it creates a futures trade entity and a futures position.

  • FundingRateUpdate: every time there is a funding rate update on a market, a new entity of this type will get created and helps to compute the pnl for the futures position and trade entity. Also, it allows the consumer to see the historic movement of the funding rate.

  • FuturesMarginTransfer: when a trader deposits or withdraw margin from a market, this entity will get created.

  • FuturesMarket: lists all available market that got emitted from the FuturesMarketManager contract.

Perps SubgraphPerps Subgraph
Optimism Mainnet subgraph for production
Logo