/Nahmi-Hackfest

A Protocol Owned Liquidity DApp Deployed on the Nahmii 3 Testnet (Early)

Primary LanguageJavaScript

NIIT Protocol

Nahmi Hackfest submission (An interpretation of the Olympus Pro contract)

A Protocol Owned Liqidity DAapp Deployed on the Nahmii 3 Testnet (Early) The NIIt protocol was built on the Olympus pro protocol model. The protocol encourages users to hold the protocol tokens (NIIT) as opposed to selling, because there’s a lot more profit to be gained from holding the tokens. These profits can be gained in two distinct ways: bonding of assets, or staking. The goal of the protocol is to ensure a rise in the market value of the protocol tokens, by ever increasing the demand for it.

Constraints

Since we do not have access to any decentralised oracle that supports the Nahmi blockchain, we had to assume market value prices for the assets used in the project.

  • 100 Nii = 1NIIT
  • 25 AssetToken = 1NIIT
  • 4 NII = 1 AssetToken
  • Price with bonds => 24 AssetToken = 1 NIIT (4% discount)

Features

  • Mint test AssetToken for free to deposit for bonds.
  • Mint Niitokens with the Nii at a market price ratio of 100Nii to 1 Niitoken.
  • Alternatively bond AssetToken minted above for 7 days to get the market value equivalence worth protocol tokens given at a 4% discount rate.
  • The tokens gotten from the bond can then be staked for a longer period of time, with 7 days being the minimum waiting period before the staked tokens can begin to rack up rewards from the stake. The reward is calclated per second of stake, at at reward rate of 50% ROI per year.
  • Alternatively, if you own the protocol tokens, and you want to make passive income with it, you can directly stake your tokens, using the same reward system explained above.
  • All funds made by the dapp is sent directly to a vault contract, which should be controlled by a DOA in the long run, but currently is cunrrently manged by a single owner.

Stack

  • Solidity - Object-oriented, high-level language for implementing smart contracts.
  • Tailwind - CSS framework for faster and easier web development.
  • React.js - JavaScript library for building user interfaces.
  • Ethers.js - Allows users to interact with a local or remote ethereum node using HTTP, IPC or WebSocket.
  • Hardhat - Development environment, testing framework and asset pipeline for blockchains using the Ethereum Virtual Machine (EVM).

Interact with the deployed DApp

Run the DApp Locally

Open new terminal window and clone this repository

git clone https://github.com/jutivia/Nahmi-Hackfest

Install dependencies

npm install

Compile smart contract

npx hardhat compile

Deploy smart contract

npx hardhat run scripts/deploy.ts --network nahmii

Test smart contract

npx hardhat test test/bondAndStake.ts.

Navigate to the frontend

cd frontend

Install dependencies

yarn

Start DApp

yarn start
  • Open metamask browser wallet and connect network.
#### Hardhat help commands
npx hardhat help