Inspiration

Decentralized Finance (DeFi) vs. Traditional Finance

The DeFi movement aims to decentralize financial services by harnessing blockchain protocols and cryptocurrencies. Traditional finance, with its monolithic institutions, malfunctioning ATMs, and reliance on third-party intermediaries like banks, insurance companies, and brokers, is being challenged. DeFi seeks to offer solutions for hedging, speculating, earning interest, or collateralizing loans without the need for centralized control. In developing nations, censorship can lead to capital controls, poor governance, and corruption, costing the global economy trillions of dollars annually and creating high barriers to entry, especially for small businesses and women who face gender inequality in accessing banking services.

Cash Cow: A Decentralized Paradigm

Cash Cow operates without central authority, governed by a decentralized network of $COW governance token holders. Unlike traditional banks, which are owned by single entities and require permission (AML/KYC) to mitigate counterparty risk, Cash Cow offers transparency, traceability, and public verifiability. Smart contracts execute only when parties meet requirements, eliminating the risk of counterparty failure.

Internet Computer: A Global Opportunity

The Internet Computer provides a globally accessible, affordable, and scalable blockchain. It empowers developers and users worldwide to create projects that impact both local communities and the broader ecosystem.

Logo Concept: The Spherical Cow in Space

What it does

Decentralized and Autonomous Borrowing and Lending

Cash Cow is a peer-to-peer tokenized money market liquidity pool protocol on the Internet Computer, fueled by smart contract canisters. It operates as follows:

  • Lenders provide liquidity, earning passive income
  • Borrowers obtain overcollateralized loans
  • Liquidity mining rewards users depositing or lending $COW tokens

Compound Protocol: Lending and Borrowing Tokens

The Compound protocol facilitates lending and borrowing of tokens, allowing users to:

  • Earn interest
  • Borrow tokens, betting on price decreases by the time they repay the loan
  • Connect lenders and borrowers with full control over assets
  • Swap ICP and COW tokens without intermediary involvement
  • Benefit from lower overhead costs, enabling higher interest rates

Two User Types

  1. Borrowers: Post cryptocurrency collateral to borrow other supported cryptocurrencies, subject to collateral value fluctuations.
  2. Lenders: Deposit cryptocurrency into lending pools, earning interest on their deposits.

Reward System

Cash Cow rewards users with $COW tokens based on two factors:

  • Amount of $COW held in their wallet
  • Interest rate influenced by asset supply

Users can transfer and trade $COW tokens, redeemable only for the locked cryptocurrency, enabling flexibility and control. Earn Interest with Cash Cow Lending.

Accessible Lending and Borrowing

Cash Cow facilitates the lending and borrowing of ICP coin $COW. Users can send, lock, deposit, and lend any desired amount to the protocol, making crypto lending and borrowing accessible to anyone globally.

Borrowing Against Collateral

Cash Cow eliminates the need for credit checks. Borrowing amounts depend on collateral quality, allowing users to borrow against their assets securely.

Interest Rates

Interest rates are dynamically determined by Cash Cow's protocol, varying based on supply and demand. They accrue with each mined ICP block and reflect current market conditions.

Liquidation Mechanism

To maintain overcollateralization, Cash Cow's smart contracts automatically close positions if collateral values approach borrowed amounts, a process known as liquidation.

Cash Cow Tokens: The $COW ICP Tokenization

Cash Cow tokens ($COW) represent users' crypto balances and are created from Internet Computer's tokens. Users control $COW tokens with public and private keys, offering the same level of control as other digital assets on the ICP blockchain.

Collateralization and Borrowing

Users can borrow up to 50-75% of their $COW's value based on underlying asset quality. They can add or remove funds at any time, with liquidation serving as an incentive to maintain collateralization.

Token Distribution and Governance

Cash Cow reserves 10% of interest paid and distributes it to lenders and borrowers. The governance token ($COW) empowers the community, allowing token-holders to propose, vote on changes, and oversee protocol reserves and treasury.

Decentralized Governance

Cash Cow's governance proposals are executable code subject to community voting. Changes take effect after two days, providing a grace period for position adjustments.

Unlocking DeFi Potential

Cash Cow's native $COW governance token holds the potential to create a fully decentralized, self-governed ecosystem, bringing blockchain benefits to lending and borrowing in the expanding DeFi landscape.

Software as a Service (SAAS): A Fee Model

Cash Cow utilizes a SAAS model, earning a small fee from transactions. This approach ensures sustainability while offering competitive advantages.

How we built it

Built end-to-end on the Internet Computer. Made possible due to the Internet Computer blockchain's scalability, low costs, and innovations in smart contract technology. Earn interest for token balance expressed as Motoko actor (fully encapsulates its state through asynchronous messages) internet computer native canister smart contracts.

https://internetcomputer.org/docs/current/motoko/main/base/

Cash Cow Backend

  1. checkBalance: () → (float64) query

  2. compound: () → () oneway

  3. topUp: (float64) → () oneway

  4. withdrawal: (float64) → () oneway

Cash Cow Frontend

Website hosted on the Internet Computer showing how traditional DeFi solutions can now be hosted completely on-chain by using the Internet Computer blockchain, completely decentralizing a service. As a Web3 solution, now by having the front-end of their swap solution hosted on the Internet Computer blockchain, the full-stack is truly decentralized. This minimizes risks of centralization which include wrongful takedowns, outages, censorship, and more.

  • Current Balance: $
  • Amount to Top Up
  • Amount to Withdraw
  • Finalize transaction

Using the dfx SDK to write functions for bank withdrawal() and topup().

Challenges we ran into

  • The version of DFX used (0.10.0) is different than the version being run (0.10.1). DFX_VERSION=0.10.0 sh -ci "$(curl -fsSL https://smartcontracts.org/install.sh)"
  • Error when trying to forward to project dfx:
    • Failed to get path to binary 'dfx' for version '0.10.0'.
    • Caused by: 0: Failed to install binary cache for version '0.10.0'. 1: Unknown version '0.10.0'.
    • Installed executable: 0.10.1
  • Currently, the compound interest calculation is set to the mathematical formula for calculating compound interest, A=P(1+r/n)^nt.

    • Compound 1% for 1 second is not realistic and solely used for the supernova hackathon.
    • Money = Float, not Nat type
  • Two terminals, one running ICP internet computer, other webpack

  • dfx canister id __Candid_UI

    • qoctq-giaaa-aaaaa-aaaea-cai
  • dfx canister id cash_cow

    • renrk-eyaaa-aaaaa-aaada-cai

Accomplishments that we're proud of

  • Orthogonal persistence canister states + async decentralized (speed).
  • Using Candid UI instead of running dfx deploy in the terminal every time.

What we learned

  • Using canister_inspect_message to avoid DOS/cycles draining.
  • Intended compatibility with ERC20/DIP20 and Ledger Canister.
  • Research about collateralized NFT loans, Loan collateralization, Fractional ownership, Insurance, and Debt management.
  • Query calls vs. update calls: one updates to the blockchain, takes much longer.
  • On the Internet Computer, smart contract calls run in parallel, because smart contracts (called "canisters") are "software actors". This removes a key security vulnerability and provides for the unbounded, efficient scaling of blockchain computation with asynchronous calls.

What's next for Cash Cow

  • Plug wallet, users can search for and purchase any coveted Internet Identity numbers which may be up for auction.
  • Pseudonymize their wallet addresses on ICP, as well as domain names, and canister smart contract IDs.
  • Bridge and communication protocol that contracts across interchains like Ethereum, Solana.
  • Build a version using Rust (instead of the current version with Motoko).
  • Motoko style guidelines to increase readability and uniformity of Motoko source code.
  • dfx deploy --network=ic deploy canister to the internet computer with appropriate Subnet memory allocation to HTML page on the internet computer so that anyone can access it Link
  • Implement other IC infrastructure like IC agents, IDEs, debuggers, oracles, asset bridges, and general integrations and APIs or the novel "chain key cryptography" that powers the Internet Computer has recently been made available to hosted blockchain code via APIs. This means you can now write blockchain code that directly invokes code and controls token balances on OTHER blockchains, and create DeFi systems and meta glue that binds different blockchains together, without the need for dangerous bridges.
  • Leverage advanced tokenization strategies to fundraise and drive viral growth.
  • Support other currencies like ETH, BAT, DAI, SAI, ETH, REP, USDC, WBTC, and ZRX.
  • Get audited and formally verified.
  • Apply for DFINITY grant funding ($220,000,000).
  • Monitor crypto price factors like exchange inflows and outflows, sentiment, technical and fundamental developments, the news cycle, and the general economic environment.

Built With

  • motoko
Share this project:

Updates

Submission history