Borrow: Developer Resources
This page is your central hub for all the tools, links, and data sources you need to build on Morpho's Borrow product (Morpho Markets).
Onchain Data & Contracts
These resources are for interacting directly with the blockchain.
- Market Parameters: Every Morpho Market is defined by 5 immutable parameters. The easiest way to fetch these for all markets is via the Morpho API.
- Contract Specifications: For detailed function signatures, events, and errors, refer to the canonical contract specs:
- GitHub Repositories:
morpho-blue
: The core protocol contracts.public-allocator
: The contract for just-in-time liquidity.bundler3
: The latest multicall bundler for atomic transactions.
Offchain Data & Tools
These tools provide easier access to onchain data for frontends, backends, and analytics.
- Morpho API (Recommended): The simplest way to fetch comprehensive data about markets, their states, APYs, and user positions.
- API Playground: api.morpho.org/graphql
- Tutorial: Using the API for Markets
- Morpho Subgraphs: For developers who prefer querying via The Graph protocol.
- Tutorial: Using Subgraphs for Markets
- SDKs: A suite of TypeScript libraries to accelerate your development.
@morpho-org/blue-sdk
: Core, framework-agnostic classes for entities like Markets.@morpho-org/blue-sdk-viem
: Adds Viem-based fetchers to the core SDK classes for easy onchain data retrieval.@morpho-org/liquidity-sdk-viem
: A specialized SDK to calculate available liquidity, including from the Public Allocator.@morpho-org/bundler-sdk-viem
: The essential tool for creating one-click borrow, repay, or leverage actions.- Learn more: Introduction to Morpho SDKs
Code & Examples
- Example Application: The
bundler-basic-app
is a minimal but complete example of a React application for executing complex borrow-side actions. - Solidity Snippets: The
morpho-blue-snippets
repository contains simple, educational Solidity contracts for common market interactions. - Liquidation Bots: For advanced developers, the community has provided open-source liquidation bot examples.
- Learn more: Community Liquidations Resources