/hodl-bonus-pool-dapp

Ethereum dApp for a HODLing pool with bonuses and penalties.

Primary LanguageJavaScriptMIT LicenseMIT

CI

HODL-bonus-pool πŸ§‘β€πŸ€β€πŸ§‘πŸ€½ dApp

A project for learning smart-contract-full-stack-whizz-bang-dApp-buidling using the incredible austintgriffith/scaffold-eth.

πŸ’‘ The idea: "Strong πŸ’ŽβœŠ hands" get a bonus from "weak 🧁 hands"'s penalties for early withdrawals.

Why would anyone use it, why is it a good idea ❔

  1. Price effect: like "staking", but without the inflation
    • Raises the price by reducing amount in circulation πŸ“₯.
    • Builds trust in the asset by proving an amount commited to be held πŸ’.
    • Makes HODLing more attractive by providing a positive economic incentive πŸ€‘.
  2. Social proof / network effects: like "time lock", but with an incentive to participate
    • Makes HODLing provable and shareable 🐦 .
    • Increases trust in the community's / project team's long term commitment, provides a social incentive to demonstrate "skin in the game" πŸ™‹β€β™€οΈ .
  3. Yield generating: like AMMs LP or lending, but without AMM's impermanent loss and doesn't depend on borrowing demand
    • Vs. liquidity providing in AMMs: no dependence on trading volume, no exposure to additional assets, no bleeding value to arbitrageurs (not-so""impermanent"" loss) 🩸.
    • Vs. lending: earns yield on tokens that don't have a borrowing market with high interest rates πŸ”„ (or any borrowing market).
  4. Volatility bonus: market volatility causes higher bonuses
    • Asset price "moons" πŸ₯³ - more "weak hands" will withdraw early to take profits, increasing the bonus πŸ’Έ.
    • Asset price "tanks" 😒 - more "weak hands" will withdraw early to panic-sell, increasing the bonus πŸ’Έ.
  5. So what tokens this should / shouldn't be used for?
    • βœ”οΈ Most tokens which don't have profitable AMM / staking / lending usage.
    • βœ”οΈβœ”οΈ Community driven tokens like meme-tokens.
    • βœ”οΈβœ”οΈβœ”οΈ Smaller (new) project tokens instead of time-lock mechanism .
    • πŸ‘Ž Stablecoins: they can be profitably and safely lended, or provided as liquidity in AMMs.
    • πŸ‘Ž Tokens which have very high trading volume but don't change in price much: they can be LPed in AMMs.
    • πŸ‘Ž Tokens which have profitable staking mechanisms: they can be staked for guaranteed yield.

🧭 Vague versions plan (roadmap?)

  1. v0 βœ”οΈ (PoC)
    • goal: πŸš€ end-to-end bare skeleton first version deployed (to testnet).
    • scope: fixed commitment params & bonus depends on ratio of current pool, only eth
    • deliver βœ”οΈ repo βœ”οΈ, tests + CI βœ”οΈ, basic UI βœ”οΈ, kovan testnet deployed & verified contract βœ”οΈ and frontend (eth) βœ”οΈ
    • stretch βœ”οΈ: erc20 support βœ”οΈ (supporting a single token)
  2. v1 βœ”οΈ (alpha)
  3. v2 βœ”οΈ (alpha+)
  4. v3 βœ”οΈ :

    • Goal & added scope: deposit is ✨ERC721 NFT✨ (transferable, view on supporting platforms) βœ”οΈ, multiple deposits for same account βœ”οΈ, depositFor on behalf someone else βœ”οΈ, all-deposits view βœ”οΈ.
    • UI:
    • Contract:
      • Kovan βœ”οΈ
      • Mainnet(s): ⏳

Basic V2 demo (Try it out):


Local development

System dependencies: Node & Yarn

Running local chain + contract + local frontend

  1. Install dependecies: yarn install
  2. Start a local chain: yarn chain
  3. In second terminal: deploy the contract to the chain - yarn deploy or yarn watch
  4. In third terminal: start the frontend react server yarn start

Testing:

  • All tests: yarn test
  • Run some tests matching a pattern (in their description strings):
    1. Go to contracts package: cd packages/hardhat
    2. Start a local chain: yarn chain
    3. In second terminal: run e.g. "deployment" related tests - yarn mocha -g deployment

Other utils:

In in packages/hardhat:

  • Gas report: yarn gas-report. It's saved to packages/hardhat/gasReportResults.txt.
  • slither report:
    • To install: yarn install-slither (this creates a python .venv virtual environment with slither)
    • To run: yarn slither. Report is saved to packages/hardhat/slitherReport.txt.