# Loan pricing

This page describes how Marginly prices loans.

A collateralized loan model for the pool we consider has the following specifications:

The loan has an infinite lifetime (no maturity)

At time 0, the user borrows amount Q (Q > 0) USD from the pool using 1 unit of an asset (e.g., ETH) as collateral.

The continuously compounding loan interest rate is r. The client may regain the asset by repaying the Q*exp(rt) amount to the pool at any time t ≥ 0.

User may default (not obliged to return the loan)

The task may be regarded as a user buying an American option at the price of (asset price - Q) with the following payoff function:

This time-dependent strike price option is evaluated, for example, in Xia and Zhou. Since in our setup, we know the exact position user wants to take (the leverage), and thus the effective option value, we can rearrange final equations to solve for the interest rate r: *Marginly* calculates interest rate as proportional to the asset volatility and the leverage of the pool’s position:

*Marginly* keeps track of the total long leverage and the total short leverage in the pool and scales interest rates proportionally for each side. This way, every time any user performs any action in the system, it recalculates how much interest has accrued since the last time and updates collateral and debt coefficients accordingly.

Last updated