Skip to content

Commit 7a0c9c2

Browse files
committed
better description of obligation fields
1 parent 33db65a commit 7a0c9c2

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

token-lending/sdk/src/state/obligation.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,15 @@ pub struct Obligation {
4343
/// Risk-adjusted upper bound market value of borrows.
4444
/// ie sum(b.borrowed_amount * max(b.current_spot_price, b.smoothed_price) * b.borrow_weight for b in borrows)
4545
pub borrowed_value_upper_bound: Decimal,
46-
/// The maximum borrow value at the weighted average loan to value ratio using the minimum of
47-
/// the spot price and the smoothed price
46+
/// The maximum open borrow value.
47+
/// ie sum(d.deposited_amount * d.ltv * min(d.current_spot_price, d.smoothed_price) for d in deposits)
48+
/// if borrowed_value_upper_bound >= allowed_borrow_value, then the obligation is unhealthy and
49+
/// borrows and withdraws are disabled.
4850
pub allowed_borrow_value: Decimal,
49-
/// The dangerous borrow value at the weighted average liquidation threshold
51+
/// The dangerous borrow value at the weighted average liquidation threshold.
52+
/// ie sum(d.deposited_amount * d.liquidation_threshold * min(d.current_spot_price, d.smoothed_price)
53+
/// for d in deposits)
54+
/// if borrowed_value >= unhealthy_borrow_value, the obligation can be liquidated
5055
pub unhealthy_borrow_value: Decimal,
5156
}
5257

0 commit comments

Comments
 (0)