GithubHelp home page GithubHelp logo

charlesma4 / mrgn-ts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mrgnlabs/mrgn-ts

0.0 0.0 0.0 70 MB

marginfi liquidator

Home Page: https://app.marginfi.com

License: Apache License 2.0

Shell 0.06% JavaScript 1.33% TypeScript 96.48% CSS 1.90% HTML 0.22% Dockerfile 0.02%

mrgn-ts's Introduction

A monorepo for marginfi-related TypeScript projects managed with Turbo.

About

mrgn-ts is an open source monorepo for TypeScript projects. It includes various app UI frontends, such as one for the product mrgnlend, as well as SDKs for marginfi v2, the marginfi v2 liquidator client, and the liquidity incentive program (LIP) client.

Features

  • Managed with Turbo
  • Includes various app UI frontends and SDKs
  • Open source under the Apache 2.0 license

Usage

  1. Fork and clone the repository.

  2. Install dependencies:

yarn
  1. marginfi frontend UIs can be found in apps/.

  2. marginfi SDKs can be found in packages/.

Contributing

We welcome contributions to mrgn-ts! Please review our contributing guidelines for more information.

License

mrgn-ts is open source software licensed under the Apache 2.0 license.

Updating the IDL

For historical reasons, the IDL file in this repository should be updated using the marginfi-v2 CLI tool to ensure the IDL stays in its canonical format. This is largely due to changes in the byte packing code used by Anchor, and the fact that Rust removed the #repr(packed) option in later releases. The process is to build the IDL file in the marginfi-v2 repository, patch it, then copy it into this repository and format it (via prettier).

To update the IDL:

  1. Checkout the marginfi-v2-cli repository and build it. Ensure you are on an x86-64 machine to get the build to succeed. Ensure the solana CLI tool is installed, alongside anchor and rust and yarn.

  2. Run marginfi-v2/scripts/build-workspace to generate the original IDL (anchor build)

  3. Use the marginfi-v2-cli and run the patch-idl command against the generated marginfi.json IDL in the marginfi-v2 repository.

Ensure you are on main branch in marginfi-v2.

For example, run this command from the root of the marginfi-v2 repository,

cargo run \
            --package marginfi-v2-cli \
            --features dev \
            -- patch-idl target

where target is the target directory for rust binaries. There should be an idl folder with the idl inside of target.

This produces a modified marginfi.json file alongside the original file. The _original file can be removed but is useful for checking diffs.

  1. Copy the marginfi.json file and the marginfi-types.ts into this repository.
  2. Lint the new IDL file using the prettier linter (.prettierrc) -- in VSCode you can simply use Format Document and it applies the lint automatically.

Review the IDL changes to make sure the new features/types in marginfiv2 are reflected in the new IDL. For example new instructions or types, should be reflected in the new IDL.

Commit the IDL changes and merge in the same mrgn-ts PR that adds features that rely on the new IDL. These should be committed together to ensure the new feature works.

mrgn-ts's People

Contributors

chambaz avatar losman0s avatar edgarpavlovsky avatar jkbpvsc avatar k0beleenders avatar exdx avatar dependabot[bot] avatar mohandesjiri avatar valentinmadrid avatar arihantbansal avatar 0xdeepmehta avatar ymittal avatar dtlehrer avatar littlejohntj 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.