Documentation ¶
Index ¶
- func CollateralValue(av *big.Int) *big.Int
- func ComputeAgentData(ctx context.Context, sdk poolstypes.PoolsSDK, agentAvailableBalance *big.Int, ...) (*vc.AgentData, error)
- func CreditScore(ead *big.Int, ltv *big.Float, ltc *big.Float, edr *big.Int, dte *big.Float, ...) *big.Int
- func CreditScoreSimple(ead *big.Int, ltv *big.Float, ltc *big.Float, edr *big.Int, dte *big.Float, ...) *big.Int
- func DebtToEquityRatio(principal *big.Int, equity *big.Int) *big.Float
- func DebtToEquityScore(dte *big.Float) *big.Int
- func DebtToIncome(edp *big.Int, edr *big.Int) *big.Float
- func DebtToIncomeScore(dti *big.Float) *big.Int
- func EstimatedDailyPayment(ead *big.Int, rate *big.Float) *big.Int
- func ExpectedLoss(ead *big.Int, pd *big.Float, lgd *big.Float) *big.Int
- func ExposureAtDefault(current *big.Int, principal *big.Int) *big.Int
- func FaultScore(faultRatio *big.Float) *big.Int
- func InterestOwed(ctx context.Context, account abigen.Account, rate *big.Int, ...) *big.Int
- func InterestRate(gcred *big.Int) *big.Float
- func LoanToCollateralRatio(ead *big.Int, cv *big.Int) *big.Float
- func LoanToCollateralScore(ead *big.Int, ltv *big.Float, ltc *big.Float) *big.Int
- func LoanToValueRatio(ead *big.Int, mv *big.Int) *big.Float
- func LossGivenDefault(cv *big.Int, ead *big.Int) *big.Float
- func ProbabilityOfDefault() *big.Float
- func VestingScore(vestingToPledgeRatio *big.Float) *big.Int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollateralValue ¶
*
- @notice Collateral Value (CV)
- CV = Agent Value * Termination Penalty Ratio
- The collateral value of an agent is the agent's balance multiplied by the
- termination penalty ratio. The termination penalty ratio is the estimated percentage
- of the agent's balance that will be lost if the agent is terminated.
func ComputeAgentData ¶
func CreditScore ¶
func CreditScore(ead *big.Int, ltv *big.Float, ltc *big.Float, edr *big.Int, dte *big.Float, faultRatio *big.Float, vestingToPledgeRatio *big.Float) *big.Int
* Credit Score * Credit Score = (DTE * 30%) - (LTC * 30%) - (FaultRatio * 20%) - (VestingRatio * 20%) * Score = 90-100 is excellent * Score = 80-90 is good * Score = 60-80 is fair * Score = 40-60 is poor
func CreditScoreSimple ¶
func DebtToEquityRatio ¶
* Debt to Equity (DTE) * DTE = Pricipal / Equity * Debt to equity ratio is debt divided by equity
func DebtToEquityScore ¶
* Debt to Equity Credit Score * LTE < 80%: Score of 10 * LTE between 80% and 90%: Score of 8 * LTE between 90% and 100%: Score of 6 * LTE > 100%: Score of 4
func DebtToIncome ¶
* Debt to Income (DTI) * DTI = Estimated Daily Payments (EDP) / Estimated Daily Reward (EDR) * Debt to income ratio is debt payments divided by income
func DebtToIncomeScore ¶
* Debt to Income Credit Score * DTI < 20%: Score of 10 * DTI between 20% and 35%: Score of 8 * DTI between 35% and 50%: Score of 6 * DTI > 50%: Score of 4
func EstimatedDailyPayment ¶
ead * rate / 365
func ExpectedLoss ¶
EL = EAD * PD% * LGD%
func ExposureAtDefault ¶
EAD = current loans principal + new principal
func InterestOwed ¶
func InterestOwed(ctx context.Context, account abigen.Account, rate *big.Int, chainHeadHeight abi.ChainEpoch) *big.Int
@dev rates have 2 WADs worth of precision (1e36) to maintain per epoch rate precision
func InterestRate ¶
* Interest Rate * Interest Rate = 15 * e^(0.015 * (100 - CreditScore))
func LoanToCollateralRatio ¶
LTC = EAD / CV (Collateral Value)
func LoanToCollateralScore ¶
* Loan to Collateral Credit Score * LTC < 80%: Score of 10 * LTC between 80% and 100%: Score of 8 * LTV between 80% and 100%: Score of 6 * LTV > 100%: Score of 4
func LoanToValueRatio ¶
LTV = EAD / MV (Miner Value)
func LossGivenDefault ¶
CV = AV-TP AV Agent Value TP Termination Penalty LGD = 1 - (CV / EAD) LGD (in dollars) = Exposure at Risk (EAD) * (1 - Recovery Rate) LGD (as percentage) = 1 - (Agent Collateral Value / Outstanding Debt) LGD is loss given default and refers to the amount of money a bank loses when a borrower defaults on a loan. (Percentage)
func ProbabilityOfDefault ¶
PD = hard coded to 20% maybe a function of edr vs payments
func VestingScore ¶
* Vesting to Pledge Credit Score * Vesting to Pledge Ratio > 10%: Score of 10 * Vesting to Pledge Ratio between 5% and 10%: Score of 8 * Vesting to Pledge Ratio between 1% and 5%: Score of 6 * Vesting to Pledge Ratio < 1%: Score of 4
Types ¶
This section is empty.