Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 1.13 KB

README.md

File metadata and controls

42 lines (28 loc) · 1.13 KB

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