Skip to content

Latest commit

 

History

History

liquidation-sdk-viem

@morpho-org/liquidation-sdk-viem

Version MIT License Downloads per month

Viem-based package that provides utilities to build viem-based liquidation bots on Morpho and examples using Flashbots and Morpho's GraphQL API.

Installation

npm install @morpho-org/liquidation-sdk-viem
yarn add @morpho-org/liquidation-sdk-viem

Getting Started

An example liquidation bot currently used in production is available under examples/.

This bot, provided a list of whitelisted markets to monitor, automatically:

  1. Fetches liquidatable positions from the API
  2. Finds the largest available liquidity for a swap of the collateral for the debt via 1inch
  3. Redeems collateral MetaMorpho shares for the underlying assets when applicable
  4. Only submit profitable liquidations (wrt to the gas cost & the swap's slippage)