You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sync note: This file must stay in sync with
stellar-lend/contracts/lending/src/lib.rs. After any pub fn change in
that file, update the tables below and run
bash docs/scripts/check_interface_sync.sh to verify.
1. Unit Scales & Precisions
Parameter
Scale
Description
Amounts
raw i128
No automatic decimal shifting. Callers supply and receive raw integer amounts.
Health Factor
10^4 base
1.0 = 10000. Values < 10000 are eligible for liquidation. 100_000_000 is the sentinel for a debt-free position.
Basis Points (BPS)
10^4
1% = 100 BPS. Used for interest rates, fees, and risk thresholds.
Timestamps
Seconds
Unix epoch seconds from env.ledger().timestamp().
2. Implemented Function Reference
Initialization
Function
Signature
Auth Required
Returns
initialize
(admin: Address)
—
()
get_admin
()
—
Address
propose_admin
(new_admin: Address)
current admin
()
accept_admin
()
proposed admin
()
set_guardian
(guardian: Address)
admin
()
get_guardian
()
—
Option<Address>
User Operations
Function
Signature
Auth Required
Returns
deposit
(user: Address, amount: i128)
user
Result<i128, LendingError> — new collateral balance
withdraw
(user: Address, amount: i128)
user
Result<i128, LendingError> — new collateral balance
borrow
(user: Address, amount: i128)
user
Result<i128, LendingError> — debt principal
repay
(user: Address, amount: i128)
user
Result<i128, LendingError> — remaining debt principal