Giter VIP home page Giter VIP logo

funding-rate-arb's Introduction

Marginfi Mango x 01 Funding Rate Arb Bot

⚠ Warning

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Prerequisites

Fund your wallet with:

  • 0.2 SOL (for margin account + mango + 01 rent)
  • 10 USDC

Setup

cp .env.example.mainnet .env

Set the WALLET= the path of your solana wallet.

Setup node dependencies

yarn

You can follow either the Setup Script or the Cli Setup

Setup Script

Create your marginfi account, fund it, and activate the trading protocols

yarn setup

It is recommended you use a private RPC node, as public ones like to fail/serve stale data.

If at any step the setup script fails, you can continue manually with the CLI from the step that failed

Cli Setup

Download the CLI

yarn global add @mrgnlabs/marginfi-cli

Create your marginfi account

mfi account create -k <wallet_path>

Fund your marginfi account

mfi account deposit <account_address> 10 -k <wallet_path>

Activate and fund Mango

mfi account mango activate <account_address> -k <wallet_path>
mfi account mango deposit  <account_address> -k <wallet_path>

Activate and fund 01

mfi account zo activate <account_address> -k <wallet_path>
mfi account zo deposit <account_address> -k <wallet_path>

Set the MARGINFI_ACCOUNT=<address> to the just created address.

Start the bot

yarn start

Troubleshooting

If anything goes wrong you can set export DEBUG=* and repeat the failing step and send us the log via Telegram ❤️.

DISCLAIMER

Not financial advice.

This bot is written for educational purposes only.

funding-rate-arb's People

Contributors

jkbpvsc avatar losman0s 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.