Skip to content

Instantly share code, notes, and snippets.

@phillro
Created December 2, 2016 23:29
Show Gist options
  • Save phillro/d93ecfc20003195e208eae6eef602e14 to your computer and use it in GitHub Desktop.
Save phillro/d93ecfc20003195e208eae6eef602e14 to your computer and use it in GitHub Desktop.
var payouts = {
'best-egg':.02,
'prosper' : .015,
'ascend': .02,
'lending-club': .0115,
'avant': .005,
'upstart' : 225,
'pave' : 200,
'freedom-plus' : 250,
'springleaf' : 170,
'pave' : 100,
'so-fi' : 250,
'avant' : .5
}
var takeRates = {
'pave-good':0.01,
'lending-club-fair':0.260869565,
'ascend-fair':0.25,
'lendingpoint-fair':0.245614035,
'best-egg-excellent':0.235294118,
'best-egg-good':0.2,
'lending-club-good':0.191780822,
'ascend-good':0.181818182,
'avant-good':0.140540541,
'prosper-good':0.137931034,
'lendingpoint-good':0.131147541,
'avant-fair':0.111702128,
'prosper-excellent':0.102564103,
'upstart-good':0.095477387,
'lending-club-excellent':0.06870229,
'springleaf-poor':0.066666667,
'avant-excellent':0.045454545,
'upstart-excellent':0.030769231,
'springleaf-fair':0.030358786,
'netcredit-fair':0.029739777,
'netcredit-good':0.029411765,
'springleaf-good':0.027472527,
'lendingpoint-excellent':0.026315789
}
var getExpectedPayout = function(lender, creditScore, amount){
var takeRate = takeRates[lender+'-'+creditScore];
var payout = payouts[lender] < 1 ? payouts[lender] * amount : payouts[lender];
var estimate = takeRate*payout;
//if null using existing logic
return estimate;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment