Skip to main content
The FX Forward Protocol subgraph indexes all onchain events into a queryable GraphQL API. It powers historical position data, pool analytics, oracle price history, and protocol state tracking that would be expensive or impossible to retrieve via direct RPC calls.

GraphQL Endpoint

Run via docker compose with the local Graph Node stack.

Indexed Data Sources

The subgraph listens to events from six contracts:

Entity Overview

Thirteen entity types fall into three categories:

Mutable State Entities

Updated as new events arrive. Use these for current-state queries.

Immutable Event Records

Append-only, never updated after creation. Optimized for write performance.

Internal Helper

Design Principles

Event-driven only — the subgraph uses no block handlers or call handlers. All data comes from emitted events, keeping indexing fast and deterministic. No eth_calls — handler code never calls contract functions. Every data point is derived from event parameters, avoiding RPC round-trips during indexing. Immutable optimization — append-only entities use @entity(immutable: true), skipping block-range versioning and reducing write amplification by 2-3x.

Schema Reference

Complete entity and field definitions.

Query Examples

Common GraphQL query patterns.

Data Source Guide

When to use subgraph vs RPC.