Coder Social home page Coder Social logo

examples's Introduction

Liquidation and supply-borrow-repay-redeem sample for Onyx protocol

This guide helps to understand how DeFi blockchain contracts works on examples, and offers a step-by-step guide on how to run them by yourself.

Installation and Usage

Requirements

  • Node.js v16+

Setup

npm install

Pre-launch tuning

Before running, copy .env.example file as .env.

cp .env.example .env

Change the existing fields to run examples with your own parameters:

  • MAINNET_RPC_URL Ethereum Mainnet RPC URL. You can use any public or private Ethereum node, for example, Infura, Quicknode or Alchemy.
  • XCN_ADDRESS Ethereum wallet from mainnet holding XCN tokens in quantity enough to repay a borrower’s debt. We call this account a signer or a liquidator.
  • XCN_BORROWER_ADDRESS XCN borrower wallet from mainnet with XCN borrowed assets and negative account liquidity. It’s a borrower.
  • USDC_ADDRESS USDC holder address from mainnet with USDC tokens to demonstrate Supply-Borrow-Repay-Redeem scenario

Running Liquidation sample

npm run liquidation

Running Supply Borrow Repay Redeem sample

npm run supplyBorrowRepayRedeem

Check Wiki page to see examples detailed step by step.

examples's People

Contributors

dissimilllate avatar al-onyxprotocol avatar merdynumber1 avatar confleux 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.