enabledao / enable

Stablecoin loans for borderless peer-to-peer credit
https://www.enable.credit
MIT License
26 stars 8 forks source link

Lenders should be able to view loan request and amortization schedule and buy fractional shares of loan request #11

Closed onggunhao closed 5 years ago

onggunhao commented 5 years ago

Step 3: Lenders can view Loan Request and amortization schedule Once Loan Contract (at the stage of 'new request') has been deployed, lenders should be able to view the loan request on a frontend app. The frontend app should show the loan parameters that the borrower requested. The frontend app should also show the amortization schedule (i.e. repayment table). The frontend app might also show some graphs to show the declining outstanding balance.

Step 4: Lenders can fund the loan request [Needs more thought] Lender should be able to either:

For simplicity, Lender should use a stablecoin (e.g. Dai). However, given that Dai is currently trading at 0.95, we might explore fiat-collateralized stablecoins (e.g. Paxos, USDC) as an interim measure.

To dos:

tspoff commented 5 years ago
adibas03 commented 5 years ago

To use fractional shares, somthing in the lines of this should suffice @tspoff


Loan {
...
uint blockSize
}

constructor(
        ...
        uint _blockSize,
        ...
    ) ...{
    ...
    loan.blockSize = _blockSize;
    ...
}

function getEffectiveValue(amount) internal returns (uint){
    if (loan.blockSize === 0) {
        return amount;
    } else {
        return (amount/loan.blockSize) * loan.blockSize;
    }
}

function buyTokens(address beneficiary, uint amount) public nonReentrant {
   amount = getEffectiveValue(amount);
   ...
}
onggunhao commented 5 years ago

Superseded by debt token