I might structure it this way:
ARV: $45,000
Minus repairs: $10,000
Sell. price: $35,000
1st note amt: $31,500
Sell 1st note for: $22,700
Profit at closing: $12,750 (minus recording fees)
There are other ways to do it, but cash is there at the closing.