Coder Social home page Coder Social logo

raydium-il's Introduction

Autonomy Network

impermenant_loss_stop_loss on Solana blockchain with Raydium integration

How to run

Program

config to use devnet

anchor build
solana deploy <your-path-to-file.so>

copy your program id into PROGRAM_ID constant in tests/newVault.js

anchor test --skip-build --skip-deploy

Program detail

There are 4 instructions

  1. initialize_impermenant_loss_stop_loss
    • save min_change_factor, token a address, amount & token b address, amount
    • call raydium deposit with 0 to check if pair exists
  2. owner_add_liquidity
    • transfer user's token a, b to contract to manage
    • call raydium add liquidity
  3. owner_remove_liquidity
    • call raydium remove liquidity
    • transfer user's token a, b from contract back to user
  4. anyone_remove_liquidity
    • allows anyone (our bot) to check if token a, b in liquidity pool have deviated from min_change_factor variable
    • if true, remove liquidity and transfer back to user, else revert

Todo

  • Need to update anchor version and corresponding compile time issues (using version 0.7.0 here while it should be 0.17.0)

raydium-il's People

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.