Protocol

Borrowing USDG

Borrowing is a single transaction once you have collateral deposited. The pool checks your remaining capacity, mints debt indexed against the global borrow rate, and transfers USDG to your wallet.

typescript
// 1. Make sure you have collateral
await vault.deposit(TSLA, 10n * 10n ** 18n);

// 2. Borrow up to your capacity
await pool.borrow(3_000n * 10n ** 6n);

// 3. USDG arrives in your wallet
const bal = await usdg.balanceOf(me);

Interest accrual

Interest accrues per-second on a borrow index. The index updates lazily on every mutating call — there is no off-chain process required for interest to apply correctly to outstanding debt.

Rate model

Two-slope kinked rate: a base rate that climbs slowly until utilization passes the kink (default 80%), after which the rate steepens sharply to incentivise repayment or new supply.

For the buildathon demo, the kink is 80% and the steep slope is 60% APR — strong enough to demonstrate rate response without spending hours waiting for the curve to bite.