Skip to content

Morpho SDKs

The Morpho Software Development Kits (SDKs) are a comprehensive suite of TypeScript packages designed to streamline development on the Morpho protocol. Whether you're building a full-featured DeFi application, a liquidation bot, or a simple data dashboard, these SDKs provide the tools you need to interact with Morpho's onchain and offchain ecosystems efficiently.

The SDKs are built with a modular, framework-agnostic core and offer powerful integrations for modern tools like Viem and Wagmi.

The SDK Stack

The SDKs are organized into logical layers, allowing you to pick and choose the packages that best fit your needs.

Core Packages

These framework-agnostic packages form the foundation of the Morpho SDK ecosystem.

  • @morpho-org/blue-sdk: The heart of the stack. Defines core entity classes like Market, Vault, and Position, and handles essential offchain computations.
  • @morpho-org/simulation-sdk: A powerful engine for simulating user interactions like supplying, borrowing, or depositing into vaults before executing them onchain.
  • @morpho-org/blue-api-sdk: A GraphQL client for fetching data directly from the Morpho API, complete with types and an Apollo cache controller.

Viem Integration Packages

These packages augment the core SDKs with Viem-based fetchers for seamless onchain interaction.

  • @morpho-org/blue-sdk-viem: Extends @morpho-org/blue-sdk with methods to fetch live market and position data from the blockchain using Viem.
  • @morpho-org/liquidity-sdk-viem: Simplifies calculations for available liquidity, including funds accessible via the Public Allocator.
  • @morpho-org/liquidation-sdk-viem: Provides utilities to build robust, Viem-based liquidation bots.

Wagmi (React) Integration Packages

Designed for frontend developers, these packages provide React hooks for fetching Morpho data in your application.

  • @morpho-org/blue-sdk-wagmi: A set of Wagmi hooks for fetching Morpho-related entities.
  • @morpho-org/simulation-sdk-wagmi: Wagmi hooks for fetching and managing simulation states in a React environment.

Get Started

Ready to build?