/** * Loan-cap rule for UCD mints. * * The on-chain guard (`UCDController._enforceLoanPathPerMintCap`, audit V12 * #62230) compares the position's TOTAL debt after the mint — existing debt + * principal + origination fee — against `LoanOperationsManager.maximumLoanValueUcd`. * A principal-only check lets a request at the cap pass every off-chain gate, * pay for the Lit round-trip, and revert on-chain with `MintGuardFailed(1)` * (mainnet, 2026-09-15: 98 UCD + 2.94 fee against a 100 UCD cap). * * Pure arithmetic, no runtime dependencies — imported ONLY by * `ucd-mint-validator.ts` so it rotates that action's CID and no other. */ export interface LoanCapCheck { /** Position debt before this mint (wei). */ currentDebt: bigint; /** Principal requested (wei). */ mintAmount: bigint; /** Origination fee charged on the principal, tail fee included (wei). */ mintFee: bigint; /** `maximumLoanValueUcd` scaled to wei. */ maxLoan: bigint; } /** Total position debt once the mint lands — the quantity the contract caps. */ export declare function debtAfterMint(check: LoanCapCheck): bigint; /** * The LARGEST principal that still fits under the cap once its base fee is added: * `floor(((maxLoan - currentDebt + 1) * 10000 - 1) / (10000 + feeBps))`. Zero when the * position is already at or above the cap. Exact (the previous `floor(room * 10000 / * (10000 + feeBps))` could be 1 wei short); base fee only, the tail fee is not included. */ export declare function maxPrincipalWithinLoanCap(maxLoan: bigint, currentDebt: bigint, originationFeeBps: number): bigint; /** * Throws when the mint would take the position's total debt above the cap. * Mirrors the contract exactly: `debtAfterMint > maxLoan` is a rejection, * `debtAfterMint == maxLoan` is allowed. */ export declare function assertDebtWithinLoanCap(check: LoanCapCheck): void; //# sourceMappingURL=loan-cap.module.d.ts.map