Clicky

  • Welcome to P2P Lending / NFT Lending Forum.
 

ETH.LOAN

News:

This was the original Lend Academy peer-to-peer lending forum, since forensically restored by deBanked and now reintroduced to eth.loan.

To restore access to your user account, email [email protected]. We apologize for errors you may experience during the recovery.

Main Menu
NEW LOANS:   | 804.eth 2.500 Ξ | remoraid.eth 0.299 Ξ | remoraid.eth 0.299 Ξ | ALL

Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - gaoc

#1
Foliofn - LC / Best Tool for FOLIO Selling
December 06, 2016, 11:00:00 PM
Pricing is tricky. It involves lots of things, e.g. your goal, market price, note quality, risk, timing. The best tool usually is a custom strategy according to your personal preference.
#2
Foliofn - LC / stale incorrect data in notes-ext.csv file
December 06, 2016, 11:00:00 PM
Even the web page is not up to date. When a payment is just made, the payment history is updated but remaining payments is not updated. It takes a few days for remaining payments to catch up. Screen scraping is not a bad idea if you don't sell it too frequently.
#3
Foliofn - LC / calculate the right YTM with R
November 21, 2016, 11:00:00 PM
Some posts are complaining about the YTM provided by foliofn. I found that the YTM is usually wrong when a note is less than 1 year or has a discount rate. If your strategy is to find a decent YTM with bigger discount rate and less remaining payments, their YTM is meaningless and you have to calculate by yourself. I would like to share my algorithm. Any feedback and comments are welcome.

The basic idea is to resolve r, monthly interest rate, from this formula:

a=p*(r*(1+r)^n/((1+r)^n-1))

Where a is monthly payment, p is askPrice (assume that you buy it with askPrice) and n is the remaining payments. p and n are provided in the CSV file.
a is not provided so we have to calculate it. We still use the same formula, but for this time p is outstanding principal and r is the original monthly interest rate . Monthly interest rate is not directly provided, but you get it by dividing annual interest rate by 12. Some people would argue that r is a geometrical mean instead of a arithmetic mean. Well, I had the same point until I found that it is more common to use arithmetic mean. If we want to take into account the monthly 1% service fee, adjust a by multiplying it with 0.99.  Once we get a, we can start resolving the equation with a single unknown variable r. It is a nonlinear equation and there is no analytical solution for r. So we have to use numerical method to get an approximation of r.  There are many ways to do numerical calculation. The easiest way is probably Newton method.   

finally YTM=12*r*100%

Here is the R code to calculate Yield. You have to add the column of MonthlyPayment to the original dataframe before you pass it to this function.

getYield <- function(a,tol=1E-12,x0=1,N=20) {
  m<-as.numeric(a["MonthlyPayment"])
  n<-as.numeric(a["Remaining.Payments"])
  pr<-as.numeric(a["AskPrice"])
 
  h <- 0.001
  i <- 1; x1 <- x0
  p <- numeric(N)
  while (i<=N) {
    df.dx <- (f(x0+h,m,pr,n)-f(x0,m,pr,n))/h
    x1 <- (x0 - (f(x0,m,pr,n)/df.dx))
    p <- x1
    i <- i + 1
    if (abs(x1-x0) < tol) break
    x0 <- x1
  }

  return(p[i-1]*12*100)
}

f<-function(r,a,p, n)
{
  y<-a-p*(r*(1+r)^n/((1+r)^n-1))
  return(y)
}

A real example
https://www.lendingclub.com/foliofn/browseNotesLoanPerf.action?showfoliofn=true&loan_id=31317108&order_id=130405930&note_id=60503781" class="bbc_link" target="_blank">https://www.lendingclub.com/foliofn/browseNotesLoanPerf.action?showfoliofn=true&loan_id=31317108&order_id=130405930&note_id=60503781

Asking Price   $9.34
Interest rate 15.61%
Outstanding Principal   $9.66
Remaining Payments 12

r=0.1561/12= 0.01300833

a=p*(r*(1+r)^n/((1+r)^n-1))=9.66*(0.01300833*(1+0.01300833)^12/((1+0.01300833)^12-1))=0.8746782, which matches the monthly payment provided by Foliofn

finally, let's resolve the equation with Newton's Method

0.8746782 = 9.34*(r*(1+r)^12/((1+r)^12-1))

r= 0.018425

YTM=r*12*100%=22.1%