Skip to content

MarginalProtocol/v1-liquidity-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

v1-liquidity-monitor

Bot to monitor pool liquidity for Marginal v1. Alerts when the invariant

liquidityReturned >= position.liquidityLocked  # (owed)

is broken for position settlement or liquidation. Should only occur in extreme funding payment cases, as LPs should not experience bad debt.

Installation

The repo uses ApeWorX for development and uv for project management.

Install requirements and Ape plugins

uv sync
uv run ape plugins install .

Usage

Include environment variables for the address of the MarginalV1Pool contract verified on the network

export CONTRACT_ADDRESS_MARGV1_POOL=<address of marginal v1 pool contract on network>

and (optionally) the bot to send alert messages with

export TELEGRAM_BOT_TOKEN=<telegram bot token>
export TELEGRAM_CHAT_ID=<telegram chat ID to send messages to>

Then run silverback

uv run silverback run "main:app" --network :mainnet:alchemy

About

Bot to monitor pool liquidity for Marginal v1

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages