Morpho API
The Morpho API provides a powerful, GraphQL-based interface for accessing a comprehensive range of onchain and offchain data from the Morpho ecosystem. It is designed for developers building applications, dashboards, bots, or any service that requires reliable data on Morpho Markets, Morpho Vaults, user positions, and more.
Endpoints
The ecosystem uses two primary API endpoints:
- Main GraphQL API: For all data related to markets, vaults, and positions. You can explore the schema and run live queries in the GraphQL Playground.
- Rewards API: A dedicated REST API for fetching data on reward programs, user eligibility, and distributions. See the Rewards API Documentation for details.
Key Data & Features
- Real-time & Historical Data: Access both current state and historical timeseries data for markets and vaults.
- Market & Vault Analytics: Retrieve metrics like APYs, TVL, utilization, fees, and market allocations.
- User Positions: Fetch detailed information on supply, borrow, and collateral positions for any user.
- Public Allocator Liquidity: Query data on reallocatable liquidity available through the Public Allocator.
Supported Networks
The API provides data for fully supported deployments on networks including:
- Ethereum (Chain ID: 1)
- Base (Chain ID: 8453)
- Polygon (Chain ID: 137)
- Unichain (Chain ID: 130)
- Katana (Chain ID: 747474)
Best Practices & Rate Limiting
To ensure reliable service for all users, the API is subject to rate limiting: 5k/5min. We strongly recommend implementing the following best practices in your integration:
- Cache Responses: Cache API query results on your backend to reduce redundant requests and improve your application's performance.
- Request Only What You Need: Structure your GraphQL queries to fetch only the data fields required for your use case.
- Avoid Excessive Polling: Design your application to fetch data efficiently, respecting API limits to prevent interruptions.
Where to Find Query Examples
This page serves as a high-level overview. For detailed documentation and hands-on query examples, please refer to the dedicated sections below.
Comprehensive API Documentation
For a full list of available queries, schemas, and example use cases for each part of the protocol, explore these sections:
Practical Integration Tutorials
To see how the API is used in practical integration scenarios, check out our step-by-step tutorials:
- Integrating Earn Data: See the Get Data for Earn tutorial.
- Integrating Borrow Data: Follow the Get Data for Borrow guide.
- Fetching Public Allocator Data: Visit the Trigger the Public Allocator tutorial.