Denom
untyped stringDenom is the only asset this realm accepts.
Value
"ugnot"
MaxFeeBps
int64MaxFeeBps is the hard protocol-fee cap: 1000 bps = 10%.
Value
1000
LoanActive
untyped stringLoan status values. Repaid and Defaulted are terminal.
Value
"active"
LoanRepaid
untyped stringLoan status values. Repaid and Defaulted are terminal.
Value
"repaid"
LoanDefaulted
untyped stringLoan status values. Repaid and Defaulted are terminal.
Value
"defaulted"
MinPrincipal
int64Input bounds.
Value
1000
MaxPrincipal
int64// 1,000,000 GNOT
Value
1000000000000
MaxRateBps
int64Input bounds.
Value
10000
MinInstallments
int64Input bounds.
Value
1
MaxInstallments
int64Input bounds.
Value
60
MinPeriodBlocks
int64Input bounds.
Value
10
MaxPeriodBlocks
int64Input bounds.
Value
7500000
MaxLoansPerLender
untyped bigintInput bounds.
Value
(50 <untyped> bigint)
RenderLimit
untyped bigintInput bounds.
Value
(20 <untyped> bigint)
loan
typeValue
loans.loan
admin
.uverse.addressValue
<gnolang.StringValue>
pendingAdmin
.uverse.addressValue
<zero>
feeRecipient
.uverse.addressValue
<gnolang.StringValue>
feeBps
int64// snapshotted into NEW loans
Value
0
self
.uverse.addressValue
<gnolang.StringValue>
nextID
int64Value
2
loans
*v0.Tree// padID(id) -> \*loan
- OID
- 081106…55c4:10
loans details
lenderNum
*v0.Tree// lender.String() -> \*int64, stored loans
- OID
- 081106…55c4:13
lenderNum details
ledger
*feeledger.Ledger- OID
- 081106…55c4:16
ledger details
init.24
func()- OID
- 081106…55c4:20
init.24 details
Open
func(borrower .uverse.address, rateBps int64, installments int64, periodBlocks int64) int64Open funds a loan: the caller (the lender) attaches the principal, which is disbursed to borrower in this same transaction, and the loan is recorded with a flat finance charge of rateBps of the principal, repayable over \`installments\` installments of \`periodBlocks\` blocks each. The current protocol fee is snapshotted in. Returns the loan id.
- OID
- 081106…55c4:22
Open details
Claim
func(amount int64)Claim sends amount ugnot of the caller's claimable balance (repayments collected on their loans, net of the protocol fee) back to the caller.
- OID
- 081106…55c4:23
Claim details
ClaimAll
func()ClaimAll sends the caller's entire claimable balance back to the caller.
- OID
- 081106…55c4:24
ClaimAll details
Repay
func(loanID int64)Repay pays toward the caller's own loan. The caller must be the loan's borrower; the attached amount must be positive and must not exceed the outstanding balance. The payment credits the lender's claimable balance (the protocol fee splitting off at the ledger); when the cumulative repaid equals the total, the loan is Repaid. Repaying ahead of schedule is allowed.
- OID
- 081106…55c4:25
Repay details
Default
func(loanID int64)Default marks an active loan defaulted once it is past its grace window — the final installment's due height plus one more period — and not repaid in full. Permissionless by design: no loan's terminal state may depend on either party acting. No coins move; the shortfall is recorded.
- OID
- 081106…55c4:26
Default details
SetFeeBps
func(bps int64)- OID
- 081106…55c4:27
SetFeeBps details
SetFeeRecipient
func(recipient .uverse.address)- OID
- 081106…55c4:28
SetFeeRecipient details
WithdrawFees
func()- OID
- 081106…55c4:29
WithdrawFees details
SweepDenom
func(denom string)SweepDenom recovers out-of-band coins to the fee recipient. For the ledger denom the reserve is Liabilities() — lender balances and the fee pot are structurally unreachable.
- OID
- 081106…55c4:30
SweepDenom details
TransferAdmin
func(successor .uverse.address)- OID
- 081106…55c4:31
TransferAdmin details
AcceptAdmin
func()- OID
- 081106…55c4:32
AcceptAdmin details
LoanInfo
func(loanID int64) (lender .uverse.address, borrower .uverse.address, principal int64, total int64, repaid int64, installments int64, periodBlocks int64, startHeight int64, status string)- OID
- 081106…55c4:33
LoanInfo details
InstallmentAmount
func(loanID int64) int64InstallmentAmount is the per-installment amount: ceil(total/installments), with the rounding remainder carried on the FINAL installment so the installments sum to exactly the total.
- OID
- 081106…55c4:34
InstallmentAmount details
Outstanding
func(loanID int64) int64Outstanding is total − repaid.
- OID
- 081106…55c4:35
Outstanding details
ScheduledDue
func(loanID int64) int64ScheduledDue is the cumulative amount that should have been repaid by the current height: the sum of every installment whose due height has passed, capped at the total. Installment k (1-based) is due at start + k·period.
- OID
- 081106…55c4:36
ScheduledDue details
AmountDueNow
func(loanID int64) int64AmountDueNow is how far behind schedule the borrower is right now: ScheduledDue − repaid, floored at zero (a borrower who has prepaid is not behind).
- OID
- 081106…55c4:37
AmountDueNow details
DefaultableAt
func(loanID int64) int64DefaultableAt is the height at or after which an unpaid loan may be Defaulted: the final installment's due height plus one grace period.
- OID
- 081106…55c4:38
DefaultableAt details
IsDefaultable
func(loanID int64) boolIsDefaultable reports whether the loan may be Defaulted right now.
- OID
- 081106…55c4:39
IsDefaultable details
HasLoan
func(loanID int64) bool- OID
- 081106…55c4:40
HasLoan details
LoansOf
func(lender .uverse.address) int64- OID
- 081106…55c4:41
LoansOf details
Admin
func() .uverse.address- OID
- 081106…55c4:42
Admin details
PendingAdmin
func() .uverse.address- OID
- 081106…55c4:43
PendingAdmin details
FeeRecipient
func() .uverse.address- OID
- 081106…55c4:44
FeeRecipient details
FeeBps
func() int64- OID
- 081106…55c4:45
FeeBps details
NumLoans
func() int64- OID
- 081106…55c4:46
NumLoans details
ClaimableOf
func(a .uverse.address) int64- OID
- 081106…55c4:47
ClaimableOf details
FeesAccrued
func() int64- OID
- 081106…55c4:48
FeesAccrued details
Liabilities
func() int64- OID
- 081106…55c4:49
Liabilities details
Held
func() int64- OID
- 081106…55c4:50
Held details
Address
func() .uverse.address- OID
- 081106…55c4:51
Address details
Height
func() int64- OID
- 081106…55c4:52
Height details
scheduledDue
func(l *loans.loan, now int64) int64scheduledDue is the cumulative amount owed by \`now\`: k installments' worth where k is how many installment due-heights have passed, capped at total.
- OID
- 081106…55c4:53
scheduledDue details
defaultableAt
func(l *loans.loan) int64defaultableAt is the final installment's due height plus one grace period.
- OID
- 081106…55c4:54
defaultableAt details
mustLoan
func(id int64) *loans.loan- OID
- 081106…55c4:55
mustLoan details
assertNoSend
func()- OID
- 081106…55c4:56
assertNoSend details
counter
func(tree *v0.Tree, a .uverse.address) *int64- OID
- 081106…55c4:57
counter details
ceilDiv
func(a int64, b int64) int64ceilDiv returns ceil(a/b) for positive b; a,b assumed non-negative and b>0 (installments >= MinInstallments >= 1).
- OID
- 081106…55c4:58
ceilDiv details
addChecked
func(a int64, b int64) (int64, bool)- OID
- 081106…55c4:59
addChecked details
mulChecked
func(a int64, b int64) (int64, bool)- OID
- 081106…55c4:60
mulChecked details
mulDivChecked
func(a int64, b int64, d int64) (int64, bool)mulDivChecked returns floor(a\*b/d) without overflowing on the intermediate product, by dividing before multiplying where it can and checking the product otherwise. Here d is 10000 and a,b are bounded, so the simple checked product suffices; the helper names the intent and guards it.
- OID
- 081106…55c4:61
mulDivChecked details
padID
func(id int64) string- OID
- 081106…55c4:62
padID details
itoa
func(n int64) string- OID
- 081106…55c4:63
itoa details
Render
func(path string) string- OID
- 081106…55c4:64
Render details
renderHome
func() string- OID
- 081106…55c4:65
renderHome details
renderLoan
func(idStr string) string- OID
- 081106…55c4:66
renderLoan details
hasPrefix
func(s string, p string) bool- OID
- 081106…55c4:67