Secured Finance Docs
HomeBlogGitHubCommunityStablecoin ↗Fixed Income ↗
  • Introduction
    • ⚜️About Secured Finance
    • 🎏Vision & Mission
    • 🌍Ecosystem Overview
    • 🏁Roadmap
      • Roadmap 2024
      • Roadmap 2023
    • 📚DeFi Starter Guide
      • 🔄DeFi vs CeFi
      • 👛Wallet Setup
      • ⛽Gas Fees
      • 🤝DApps
      • 🏦DEX
      • 📝Smart Contracts
      • 🪙Governance Tokens
      • 🏛️DAOs
  • USDFC Stablecoin
    • 📢Overview
    • 🧙Getting Started
      • 🧪Getting Test USDFC on Testnet
      • ⛽Creating Your First Trove
      • 👛Minting USDFC Step-by-Step
      • 🤝Managing Collateral Effectively
      • 🏦Monitoring Your Position
      • 🏊Using the Stability Pool
      • 💸Redeeming USDFC
    • 🔦Core Mechanics
      • 🏗️System Overview
      • ✏️The Trove System
      • 💰Mint & Borrow
      • 🚰Liquidation
      • 💸Redemption
      • 🧀Protocol Fees
    • 🎓Advanced Topics
      • 🚨Recovery Mode
    • 📔Contracts and Security
    • ❓FAQs
  • Fixed-Rate Lending
    • 📢Overview
      • 📖White Paper
      • 🎓Concept Paper
    • 🧙‍♂️Getting Started
      • 💵Lending Assets
      • 🏦Borrowing Assets
      • 📈Managing Positions
      • 🎮Platform Guide
        • 💰Trading
          • 💲Supported Currencies
        • 📈Markets
        • 🐋Portfolio
        • Bridge
        • 🚀Points
        • 📣Campaign
    • 🔦Core Mechanics
      • 🧩Order Book System
        • 🆎Order Type
        • 🪃Order Life Cycle
          • 💫Case Study: Order Status & Transition
      • 📐Standardization
        • 💠Zero-Coupon Bonds
        • ⏳Fixed Maturity
      • 🏋️Collateralization
      • 🪙Tokenization
      • 🚰Liquidation
        • ⚖️Mark to Market
        • 👮‍♂️Liquidators
          • ✏️How Liquidation Works
        • 📋Liquidation Case Study
      • 🧀Protocol Fees
    • 🎓Advanced Topics
      • 📈APR vs APY
      • ➗ZC Bond Price to APR
      • 📉Discount Factor
      • 🏋️‍♀️ZC Bond Collateral
        • 🏍️ZC Collateral Case Study
      • 🧬Market Dynamics
        • ♻️Auto-Rolling
          • 💰Price Discovery for Auto-Rolling
        • 🗓️New Market Listing and Delisting
          • 🤝Itayose - Fair Price Discovery
      • 🛡️Safety Measures
        • 🚦Circuit Breaker
          • 🛑Price Range Limits
        • 🪄Base Price Adjustment
        • 🌎Emergency Global Settlement
      • ⛓️Orderbook Deep Dive
        • 🎡Orderbook Rotation
        • 🎋Red Black Tree
        • ⏯️Lazy Evaluation
        • ⏮️Genesis Value
        • 🔄Compound Factor
    • 📔Contracts and Security
    • ❓FAQs
  • Developer Portal
    • 🧑‍💻Introduction
    • 🔌API Reference
      • 📈Fixed-Rate Lending Subgraph
        • 🔍Query Examples
    • 📦SDK Reference
      • ⛽Fixed-Rate Lending SDK
      • 👛USDFC SDK
    • 🐛Bug Bounty
  • Community
    • 🤝Overview
    • 🏛️Governance
    • 🪙Tokenomics
      • 🔵Secured Finance Coin (SFC)
      • 🔶Secured Finance Points (SFP) v2
        • 🔶Secured Finance Points (SFP) v1
    • 🎗️Support & Contacts
  • Resources
    • 🖼️Media Kit
      • 🖼️Secured Finance Logo
      • 💲USDFC Logo
    • ⚖️Legal
      • 📜Terms of Use
      • 🔒Privacy Policy
      • ⚠️Risk Disclaimer
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
Export as PDF
  1. Developer Portal

API Reference

API Reference for Secured Finance protocols

PreviousIntroductionNextFixed-Rate Lending Subgraph

Last updated 1 month ago

Was this helpful?

Secured Finance provides GraphQL APIs via The Graph protocol to query data from our smart contracts. This section documents how to use these APIs to access data from our protocols.

What You'll Learn

  • How to query data from the Fixed-Rate Lending protocol

  • Examples of common queries and their responses

  • How to use GraphQL to build custom queries

  • How to use our interactive API documentation with "Test It" functionality

Key Components

Subgraphs

Secured Finance maintains subgraphs for its protocols:

  • - For querying data from the Fixed-Rate Lending protocol

Note: The USDFC Subgraph is currently under development and not yet deployed. USDFC data is only available through the .

Available Networks

Our subgraphs are deployed on the following networks:

Protocol
Ethereum
Arbitrum
Filecoin

Fixed-Rate Lending

✅

✅

✅

Subgraph Endpoints

These are Subgraph endpoint URLs for our production Mainnet and Testnet environments. You can click the URL and try some queries on the GraphQL playground.

Fixed-Rate Lending Subgraph

Ethereum

Arbitrum

Filecoin

Note: The Filecoin Calibration testnet endpoints are not provided yet.

Getting Started

If you're new to GraphQL or The Graph, check out our introduction to subgraphs in the next sections. If you're already familiar with these technologies, you can jump directly to the specific subgraph documentation.

The Graph is a decentralized protocol for indexing and querying blockchain data, making it easier to query the difficult-to-read data stored on the blockchain. The Graph's decentralized approach ensures resilience, eliminating the need for centralized and resource-intensive alternatives.

Interactive API Documentation

We provide interactive API documentation for our Fixed-Rate Lending Subgraph using GitBook's OpenAPI integration. This allows you to explore and test the API directly from the documentation page in real-time.

The interactive documentation above allows you to:

  1. Explore available endpoints and operations

  2. View request and response schemas

  3. Try out API calls directly from the documentation using the "Test It" feature

  4. See example queries and responses

Using the Interactive Documentation

  1. Browse through the available operations

  2. Click on an operation to expand it

  3. View the request parameters and example values

  4. Click "Test It" to execute a request against the selected server

  5. View the response directly in the documentation

For more complex queries, you can also use The Graph's Playground interface by visiting the subgraph endpoints directly.

Related Resources

Note: The USDFC Subgraph is currently under development and not yet deployed. USDFC data is only available through the on the Filecoin network.

Mainnet:

Sepolia:

Mainnet:

Sepolia:

Mainnet:

To view the source of our subgraphs, visit our .

🔌
Fixed-Rate Lending Subgraph
USDFC SDK
USDFC SDK
https://api.studio.thegraph.com/query/64582/sf-prd-mainnet/version/latest
https://api.studio.thegraph.com/query/64582/sf-prd-sepolia/version/latest
https://api.studio.thegraph.com/query/64582/sf-prd-arbitrum-one/version/latest
https://api.studio.thegraph.com/query/64582/sf-prd-arbitrum-sepolia/version/latest
https://api.goldsky.com/api/public/project_cm8i6ca9k24d601wy45zzbsrq/subgraphs/sf-filecoin-mainnet/latest/gn
GitHub Repository
The Graph Documentation
GraphQL Documentation
Secured Finance GitHub Repositories
  • What You'll Learn
  • Key Components
  • Subgraphs
  • Available Networks
  • Subgraph Endpoints
  • Getting Started
  • Interactive API Documentation
  • POSTQuery the Fixed-Rate Lending Subgraph
  • Using the Interactive Documentation
  • Related Resources

Query the Fixed-Rate Lending Subgraph

post

Execute a GraphQL query against the Fixed-Rate Lending Subgraph

Body
querystringRequired

GraphQL query to execute

Example: { lendingMarkets( where: { isActive: true }, orderBy: maturity, orderDirection: asc, first: 10 ) { id currency maturity isActive openingUnitPrice lastLendUnitPrice lastBorrowUnitPrice volume } }
variablesobjectOptional

Variables for the GraphQL query (optional)

Responses
200
Successful response
application/json
post
POST /query/64582/sf-prd-arbitrum-sepolia/version/latest/ HTTP/1.1
Host: api.studio.thegraph.com
Content-Type: application/json
Accept: */*
Content-Length: 278

{
  "query": "{\n  lendingMarkets(\n    where: { isActive: true },\n    orderBy: maturity,\n    orderDirection: asc,\n    first: 10\n  ) {\n    id\n    currency\n    maturity\n    isActive\n    openingUnitPrice\n    lastLendUnitPrice\n    lastBorrowUnitPrice\n    volume\n  }\n}\n"
}
200

Successful response

{
  "data": {
    "lendingMarkets": [
      {
        "id": "0x123...",
        "currency": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        "maturity": "1735689600",
        "isActive": true,
        "openingUnitPrice": "9900",
        "lastLendUnitPrice": "9830",
        "lastBorrowUnitPrice": "9870",
        "volume": "1000000000000"
      },
      {
        "id": "0x456...",
        "currency": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
        "maturity": "1735689600",
        "isActive": true,
        "openingUnitPrice": "9850",
        "lastLendUnitPrice": "9780",
        "lastBorrowUnitPrice": "9820",
        "volume": "500000000000"
      }
    ]
  }
}