Dharma Protocol

The Dharma Protocol is a decentralized protocol built on blockchain technology, designed to enable peer-to-peer lending of cryptocurrencies. It operates as a smart contract platform on Ethereum, allowing users to borrow and lend digital assets without the need for intermediaries such as banks or lending institutions. The protocol utilizes collateralized debt positions (CDPs) to facilitate lending transactions securely.

Here's how the Dharma Protocol typically works:

1. **Borrowing**: A user creates a CDP by depositing collateral in the form of cryptocurrencies into a smart contract. The user specifies the amount of cryptocurrency they wish to borrow and the terms of the loan, such as the interest rate and duration.

2. **Lending**: Other users can lend their cryptocurrency assets to borrowers by funding CDPs. Lenders earn interest on their deposits, which is paid by borrowers as part of the loan agreement.

3. **Repayment**: Borrowers are required to repay the borrowed amount plus interest within the agreed-upon timeframe. If a borrower fails to repay the loan, the collateral held in the CDP may be liquidated to cover the outstanding debt.

4. **Liquidation**: In the event of a borrower default, the smart contract automatically liquidates the collateral held in the CDP to compensate lenders for their losses. This ensures that lenders are protected from potential defaults.

Example:
Alice wants to borrow 10 ETH and is willing to deposit 20 ETH as collateral. She creates a CDP on the Dharma Protocol platform, specifying the terms of the loan, including an interest rate of 5% and a repayment period of 30 days.

Bob has some excess ETH and decides to lend 5 ETH to Alice by funding her CDP. He earns interest on his deposit, which is paid by Alice according to the loan agreement.

Alice successfully repays the loan along with the interest within the specified timeframe. Bob receives his principal amount plus interest, and Alice retrieves her collateral.

Case:
If Alice fails to repay the loan within the agreed-upon timeframe, the smart contract automatically liquidates her collateral to cover the outstanding debt. For instance, if Alice defaults on the loan, the Dharma Protocol may sell her 20 ETH collateral to repay Bob's 5 ETH loan plus interest, ensuring that lenders are compensated for their losses.