Skip to content

Ethereum dApp for a HODLing pool with bonuses and penalties.

License

Notifications You must be signed in to change notification settings

artdgn/hodl-bonus-pool-dapp

Repository files navigation

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.