project screenshot 1
project screenshot 2
project screenshot 3

Morpho Loan Bot

Calculated the health factor of your loans on Morpho and pings you when they are in danger of being liquidated

Morpho Loan Bot

Created At

ETHGlobal London

Project Description

SMART CONTRACT QUERIES AND CALCS It uses Ethers.js to read values from the Morpho Blue smart contract. Based on the specified wallet address and Morpho market ID, it queries the position of the wallet in the given market. It also queries the total borrowed shares and assets in the market, to calculate the actual outstanding loan of the given wallet:

Loan = (borrowShares * total borrow assets) / total borrow shares

Then it calculates the health factor using the Loan and LLTV for the given market:

health factor = (collateral * LTV) / debt.

UX - TELEGRAM BOT The Telegram bot implementation would remember your addresses/loans and periodically check their health. It would message you if the health factor dropped under a pre-set threshold. No more manual checking, installing new apps or anything like that... just a message like you're used to.

Axiom is used to interact with the Telegram APIs. Express runs the server which would eventually be deployed on Netlify or similar. It works on localhost, but I haven't managed to deploy unfortunately...

How it's Made

I'm a product designer, without any experience of web3 development. This project was a way for me to learn how to interact with smart contracts and an attempt to build something simple, yet useful...

Both Ethers.js and Telegram bots are completely new to me. I have managed to crack most of them individually (with help from mentors and tutorials) but didn't quite put them together. To be continued...

background image mobile

Join the mailing list

Get the latest news and updates