GithubHelp home page GithubHelp logo

mangosolana's Introduction

Mango Events Parser

This is a Node TypeScript repository for parsing Mango events from transactions on Solana mainnet using the Mango program account ID: 4MangoMjqJ2firMokCjjGgoK8d4MXcrgL7XJaL3w6fVg.

Installation

git clone https://github.com/ritvick/mangosolana.git

Usage

docker compose -f docker-compose.development.yml up

This will bring the docker up and program will do the following:

  • The application will establish a connection to Solana mainnet via an RPC endpoint.
  • The application will query transactions from Mango's program account and try to decode and parse for any available Mango events in each transaction's logs.
  • If an event is found, the parsed data along with the transaction signature and block time will be logged to the console.

Output

Sample snippet of parsed event

Transacton Signature 2YHHuVRzLot3aSBpamYMVFUXqqmM8uQ6AEEhaYf74SpWnHFPN8C7RZmwc9j1N482gEY2Rf6J1qQ4Gmz5ywPacF2E
event {
  data: {
    mangoGroup: PublicKey [PublicKey(78b8f4cGCwmZ9ysPFMWLaLTkkaYnUjwMJYStWe5RTSSX)] {
      _bn: <BN: 5b17c7c86a6e739faf1751818363e94f908bf37004ce6d3fbcf197bdd2f51f1c>
    },
    tokenIndex: 455,
    depositIndex: <BN: f4240000000000000>,
    borrowIndex: <BN: f4241f26d7c543a6c>,
    avgUtilization: <BN: 0>,
    price: <BN: 69facd4ee21>,
    stablePrice: <BN: 69facd4ee21>,
    collectedFees: <BN: 0>,
    loanFeeRate: <BN: 147ae147ae1>,
    totalBorrows: <BN: 0>,
    totalDeposits: <BN: bbd62a980000000000000>,
    borrowRate: <BN: 0>,
    depositRate: <BN: 0>
  },
  name: 'UpdateIndexLog'
}

mangosolana's People

Contributors

ritvick avatar

Watchers

 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.