Skip to content

This project provides an indexer to get Tezfin user liquidity

Notifications You must be signed in to change notification settings

StableTechnologies/tezfin-indexer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TezFin Indexer and Liquidation Bot

This project provides a liquidation bot and indexer for the Tezfin markets, it exposes api to get liquidity for all users that is updated at specific intervals and also optionally can run a liquidation bot for a particular market.

Configure Bot

The bot can liquidate undercollateralized users by repaying a particular asset(if the user has any borrow in that asset), the configuration for the liquidating asset(asset the bot will repay) is present in the config/ dir inside the testnet.jsonand mainnet.json files respectively for testnet and mainnet config. The valid liquidating assets that are supported include the markets that TezFin supports for eg. ETH, BTC, USD, XTZ etc. If the liquidatingAsset field in the config is left empty "" then the bot will not run any liquidations and only run the indexer.

You must make sure that the account(private key) used in the bot has sufficient XTZ for gas fees and sufficient amount of the liquidating asset available to perform the liquidations.

Run Bot

  1. Install dependencies (needs node v18+)
npm i
  1. Start the bot using the following command:
PRIVATE_KEY=<PRIVATE KEY> NETWORK=<TEZOS NETOWRK> npm run start

The env variables needed to run the indexer are :

  • PRIVATE KEY : your private key used to update interest params before calculating liquidity
  • NETWORK : Tezos network to run the bot on, support values are mainnet and testnet

API

The indexer runs a server on port 8888 by default but you can configure the api server to run on different port using env vcar PORT. To access the indexer data hit the / root path and it will return the liquidity data for all the users and the block number at which the liquidity was calculated.

About

This project provides an indexer to get Tezfin user liquidity

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published