A collection of Software Development Kits to ease interactions with the Morpho protocol and Morpho Vaults.
@morpho-org/blue-sdk-viem: Viem-based augmentation of@morpho-org/blue-sdkthat exports (and optionally injects) viem-based fetch methods@morpho-org/bundler-sdk-viem: Viem-based extension of@morpho-org/simulation-sdkthat exports utilities to transform simple interactions on Morpho (such asBlue_Borrow) and Morpho Vaults (such asMetaMorpho_Deposit) into the required bundles (with ERC20 approvals, transfers, etc) to submit to the bundler onchain@morpho-org/liquidity-sdk-viem: Viem-based package that helps seamlessly calculate the liquidity available through the PublicAllocator@morpho-org/liquidation-sdk-viem: Viem-based package that provides utilities to build viem-based liquidation bots on Morpho and examples using Flashbots and Morpho's GraphQL API
@morpho-org/blue-sdk-wagmi: Wagmi-based package that exports Wagmi (React) hooks to fetch Morpho-related entities@morpho-org/simulation-sdk-wagmi: Wagmi-based extension of@morpho-org/simulation-sdkthat exports Wagmi (React) hooks to fetch simulation states
-
@morpho-org/morpho-ts: TypeScript package to handle all things time & format-related -
@morpho-org/blue-sdk: Framework-agnostic package that defines Morpho-related entity classes (such asMarket,Token,Vault) -
@morpho-org/simulation-sdk: Framework-agnostic package that defines methods to simulate interactions on Morpho (such asSupply,Borrow) and Morpho Vaults (such asDeposit,Withdraw) -
@morpho-org/blue-api-sdk: GraphQL SDK that exports types from the API's GraphQL schema and a useful Apollo cache controller
-
@morpho-org/test: Viem-based package that exports utilities to build Vitest & Playwright fixtures that spawn anvil forks as child processes -
@morpho-org/test-wagmi: Wagmi-based extension of@morpho-org/testthat injects a test Wagmi config as a test fixture alongside viem's anvil client -
@morpho-org/morpho-test: Framework-agnostic extension of@morpho-org/blue-sdkthat exports test fixtures useful for E2E tests on forks
- Install
lcov:sudo apt install lcov - Generate coverage info:
pnpm test:coverage - Generate hierarchical coverage report:
pnpm coverage:report
Learn how to add a new chain configuration to the sdks.
Here's a tutorial on how to link a specific package to debug at runtime:
- From the repository in which you want to link the package:
pnpm link ../your/relative/path/to/sdks/packages/blue-sdk
- "@morpho-org/blue-sdk": "5.0.0",
+ "@morpho-org/blue-sdk": "link:../../../sdks/packages/blue-sdk",- Modify
blue-sdkpackage.json to use js main & js files:
- "main": "src/index.ts",
+ "main": "lib/index.js",
+ "types": "lib/index.d.ts"- In a separate process, start:
pnpm --dir packages/blue-sdk build --watch
- @rubilmax (rubilmax.eth, Twitter)
- @oumar-fall (oumix.eth)
- @julien-devatom (Twitter)
MIT License
