ProtocolBorrowing
Querying a position
Observable states and the full set of returned fields.
A position's status can be queried at any time. There are four observable states:
Opened- active, with outstanding interest and/or principal. Liquidation can occur. CallRepayto reduce or settle.Paid- fully repaid, principal and interest, but the remaining margin hasn't been withdrawn yet. CallCloseto finalize.Closed- fully repaid and all assets withdrawn. Contract is inactive.Liquidated- fully liquidated. Contract is inactive.
Returned fields
| Field | Explanation |
|---|---|
| Position Amount | Current asset balance held in the position contract. Sum of collateral and borrowed assets post-swap, minus any liquidations or partial closings. |
| Loan Interest Rate | Interest rate paid to lenders, expressed in permille (‰). |
| Protocol Interest Rate | Protocol's interest rate (used for buybacks), expressed in permille (‰). |
| Principal Due (in LPN) | Remaining principal that must be repaid, excluding accumulated interest. |
| Protocol Interest Overdue | Unpaid protocol interest past the due period. Deducted via partial liquidation if left unpaid. |
| Loan Interest Overdue | Unpaid loan interest past the due period. Same treatment. |
| Protocol Interest Due | Total protocol interest accrued to the current point in time. |
| Loan Interest Due | Total loan interest accrued to the current point in time. |
| Take Profit Threshold | LTV at which the position automatically closes to realize profit. Empty by default. |
| Stop Loss Threshold | LTV at which the position automatically closes to preserve capital. Empty by default. |