based on IRS PUB 537 the part about the disposition of an installment sale obligation
https://www.irs.gov/pub/irs-pdf/p537.pdf
multiply the remaining (unpaid balance) by your gross profit percentage.
subtract this amount from the unpaid balance.
you now have the basis in the note.
the $180K less your basis is capital gain or ordinary loss because the sale involved section 1231 property.
.