Skip to content

Consolidate Goldsky endpoint and schema reference and self-document #118

@timfong888

Description

@timfong888

Problem

There is no single file that defines both the Goldsky subgraph endpoints AND the schema entities used by the explorer. An AI agent or new developer must piece together information from multiple files:

  • lib/config/network.ts — endpoint construction (project ID, subgraph names, versions)
  • lib/graphql/client.ts — GraphQL client configuration
  • METRIC-DEFINITIONS.md — metric formulas and sample queries (has a "Data Sources" section but it's incomplete)
  • subgraph/README.md — generic deployment guide with no endpoints or schema

METRIC-DEFINITIONS.md already has the right structure but has gaps — notably line 508: {fill this in based on code}.

Proposed Changes

Update METRIC-DEFINITIONS.md to be the single canonical reference:

  1. Add an Endpoints table at the top of the Data Sources section covering all networks:
Network Subgraph Version Endpoint URL Contract Address
Mainnet filecoin-pay-mainnet x.y.z full URL 0x...
Mainnet fwss-mainnet x.y.z full URL 0x...
Calibration filecoin-pay-calibration x.y.z full URL 0x...
Calibration fwss-calibration x.y.z full URL 0x...
  1. Fill in the incomplete FWSS section (currently {fill this in based on code})
  2. Add PDP Explorer endpoint — already used in code but not formally documented
  3. Cross-reference lib/config/network.ts as the runtime source of truth, so the doc and code stay in sync
  4. Clarify official vs dev-fork endpoints — currently the code uses -tim suffixed subgraph names which are dev forks

Why This Matters

  • AI agents (Claude Code, Cursor, etc.) need a single file to understand the data layer
  • New contributors shouldn't have to read 4+ files to find an endpoint
  • Metric definitions without endpoint context are incomplete

Acceptance Criteria

  • All Goldsky endpoints (mainnet + calibration) listed in one table
  • FWSS data source section filled in
  • PDP Explorer endpoint documented
  • {fill this in based on code} placeholder removed
  • Doc references lib/config/network.ts as code source of truth

Metadata

Metadata

Assignees

No one assigned

    Labels

    opsOperational improvements

    Type

    No type

    Projects

    Status

    🐱 Todo

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions