Git Product home page Git Product logo

mangoliquidator's Introduction

Mango Liquidator

Setup Partial Liquidator

Prerequisites

To run the liquidator you will need:

  • A Solana account with some SOL deposited to cover transaction fees
  • Token accounts for each currency in the Mango Group (e.g. BTC, ETH, SOL, SRM, USDT)
  • Roughly equal deposits for each token. You will need base currencies to liquidate shorts, and quote currency to liquidate longs.
  • Serum Dex OpenOrders accounts associated with your account. This is required for balance wallets functionality.
    • The easiest way to set these up is by placing an order on Serum Dex for each currency pair then immediately cancelling it.

Setup

Make sure to edit the .env file to look something like this:

CLUSTER="mainnet-beta"
CLUSTER_URL="https://solana-api.projectserum.com"
KEYPAIR=${HOME}/.config/solana/id.json
NODE_ENV=production
TARGETS="0.1 2.0 100.0 500.0"
GROUP_NAME="BTC_ETH_SOL_SRM_USDC"
CHECK_INTERVAL="1000.0"
FILTER_ACCOUNTS=true

Replace ${HOME} with your actual path to home. For example,

KEYPAIR=/Users/john/.config/solana/id.json

TARGETS represents the amounts of each token the partial liquidator should try to maintain in the liquidator's wallet. Any excess of that amount in the wallet will be market sold on Serum DEX.

CHECK_INTERVAL is the amount of milliseconds to wait between querying all margin accounts

FILTER_ACCOUNTS uses a more efficient method of querying marginAccounts by only returning accounts with open borrows. This is only supported on Mango Groups released after 'BTC_ETH_SOL_SRM_USDT'. Disabled by default.

Run

yarn install
source .env
yarn partialLiquidate

Run

yarn install
source .env
yarn liquidate

mangoliquidator's People

Contributors

mschneider avatar tlrjs avatar dafyddd avatar drewkiino avatar riordanp avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.