API Reference
API Reference for Secured Finance protocols
Last updated
Was this helpful?
API Reference for Secured Finance protocols
Last updated
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.
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
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 .
Our subgraphs are deployed on the following networks:
Fixed-Rate Lending
✅
✅
✅
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.
Ethereum
Arbitrum
Filecoin
Note: The Filecoin Calibration testnet endpoints are not provided yet.
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.
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:
Explore available endpoints and operations
View request and response schemas
Try out API calls directly from the documentation using the "Test It" feature
See example queries and responses
Browse through the available operations
Click on an operation to expand it
View the request parameters and example values
Click "Test It" to execute a request against the selected server
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.
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 .
Execute a GraphQL query against the Fixed-Rate Lending Subgraph
GraphQL query to execute
{ lendingMarkets( where: { isActive: true }, orderBy: maturity, orderDirection: asc, first: 10 ) { id currency maturity isActive openingUnitPrice lastLendUnitPrice lastBorrowUnitPrice volume } }
Variables for the GraphQL query (optional)
Successful response