Skip to content

Commit

Permalink
improve ganache test loanproducts for tests (nicer numbers for collat…
Browse files Browse the repository at this point in the history
…eral ratios, increase interest rates for short term prods)
  • Loading branch information
treerz committed Jul 25, 2019
1 parent 0c5c97a commit 3d710cb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions contracts/SB_scripts/localTest/localTest_initialSetup.sol
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,17 @@ contract localTest_initialSetup {

// add test loan Products
// term (in sec), discountRate, initialCollateralRatio (ppm), minDisbursedAmount (token), defaultingFeePt (ppm), isActive, minCollateralRatio (ppm)
_loanManager.addLoanProduct(365 days, 854701, 1818182, 1000, 50000, true, 1500000); // 17% p.a., (collateral ratio: initial = ~181%, minimum = 150%)
_loanManager.addLoanProduct(180 days, 924753, 1818182, 1000, 50000, true, 1500000); // 16.5% p.a., (collateral ratio: initial = ~181%, minimum = 150%)
_loanManager.addLoanProduct(365 days, 854701, 1850000, 1000, 50000, true, 1500000); // 17% p.a., (collateral ratio: initial = 185%, minimum = 150%)
_loanManager.addLoanProduct(180 days, 924753, 1850000, 1000, 50000, true, 1500000); // 16.5% p.a., (collateral ratio: initial = 185%, minimum = 150%)

_loanManager.addLoanProduct(90 days, 962046, 1666667, 1000, 50000, true, 1200000); // 16%. p.a., (collateral ratio: initial = ~166%, minimum = 120%)
_loanManager.addLoanProduct(60 days, 975154, 1666667, 1000, 50000, true, 1200000); // 15.5% p.a., (collateral ratio: initial = ~166%, minimum = 120%)
_loanManager.addLoanProduct(30 days, 987822, 1666667, 1000, 50000, true, 1200000); // 15% p.a., (collateral ratio: initial = ~166%, minimum = 120%)
_loanManager.addLoanProduct(14 days, 994280, 1666667, 1000, 50000, true, 1200000); // 15% p.a., (collateral ratio: initial = ~166%, minimum = 120%)
_loanManager.addLoanProduct(7 days, 997132, 1666667, 1000, 50000, true, 1200000); // 15% p.a., (collateral ratio: initial = ~166%, minimum = 120%)
_loanManager.addLoanProduct(90 days, 962046, 1600000, 1000, 50000, true, 1200000); // 16%. p.a., (collateral ratio: initial = 160%, minimum = 120%)
_loanManager.addLoanProduct(60 days, 975154, 1600000, 1000, 50000, true, 1200000); // 15.5% p.a., (collateral ratio: initial = 160%, minimum = 120%)
_loanManager.addLoanProduct(30 days, 987822, 1600000, 1000, 50000, true, 1200000); // 15% p.a., (collateral ratio: initial = 160%, minimum = 120%)
_loanManager.addLoanProduct(14 days, 994280, 1600000, 1000, 50000, true, 1200000); // 15% p.a., (collateral ratio: initial = 160%, minimum = 120%)
_loanManager.addLoanProduct(7 days, 997132, 1600000, 1000, 50000, true, 1200000); // 15% p.a., (collateral ratio: initial = 160%, minimum = 120%)

_loanManager.addLoanProduct(1 hours, 999998, 1020408, 2000, 50000, true, 1010000); // due in 1hr for testing repayments ~1.75% p.a., (collateral ratio: initial = ~102%, minimum = 101%)
_loanManager.addLoanProduct(1 seconds, 999999, 1010101, 3000, 50000, true, 1010000); // defaults in 1 secs for testing ~3153.6% p.a., (collateral ratio: initial = ~101.01%, minimum = 101%)
_loanManager.addLoanProduct(1 hours, 999000, 1230000, 2000, 50000, true, 1050000); // due in 1hr for testing repayments ~877% p.a., (collateral ratio: initial = 123%, minimum = 105%)
_loanManager.addLoanProduct(1 seconds, 999000, 1110000, 3000, 50000, true, 1020000); // defaults in 1 secs for testing ~3156757% p.a., (collateral ratio: initial = 111%, minimum = 102%)

// add test lock products
// (perTermInterest, durationInSecs, minimumLockAmount, isActive)
Expand Down
2 changes: 1 addition & 1 deletion migrations/1001_topup_interestEarnedAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = function(deployer) {
const tokenAEur = TokenAEur.at(TokenAEur.address);
const loanManager = LoanManager.at(LoanManager.address);

await loanManager.newEthBackedLoan(0, 0, { value: web3.toWei(0.1066) }); // = 50 A-EUR
await loanManager.newEthBackedLoan(0, 0, { value: web3.toWei(0.10845) }); // = 50 A-EUR

await tokenAEur.transferWithNarrative(
InterestEarnedAccount.address,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@augmint/contracts",
"version": "1.1.0-pre6",
"version": "1.1.0-pre7",
"description": "Augmint Stable Tokens - Solidity contract's abi and deployment descriptors",
"author": "“Augmint”",
"homepage": "https://github.com/Augmint/augmint-contracts#readme",
Expand Down

0 comments on commit 3d710cb

Please sign in to comment.