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.
- Node.js v16+
npm install
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
npm run liquidation
npm run supplyBorrowRepayRedeem
Check Wiki page to see examples detailed step by step.