Core Lending Functionality
Drawdowns, extending further credit and repayments
Reminder: a 'Line of Credit' (LoC) is a single credit facility for a single Borrower. Within it, the Borrower can draw on any number of individual Credit Lines (aka Credit Positions) made available by any number of Lenders, in any token, at individually agreed rates and deadlines. Each Credit Position is an ERC-721 token.
Proposing and creating a Credit Position (mutual consent + nonce)
Either party can propose a Credit Position at any time while the Line is ACTIVE (or REPAID — adding a new position to a repaid Line reactivates it).
The position is created when Borrower and Lender have both signed a transaction with exactly identical terms:
The drawn rate and facility rate (in bps)
The Credit Token (any ERC-20; native ETH is not supported as a credit token) and the deposit amount
The position's deadline — its individual repayment term
The early withdrawal fee the Lender will owe the Borrower for withdrawing committed capital early
Whether the position's ERC-721 token is transfer-restricted
Every proposal also commits to the facility's current nonce. The nonce increments whenever facility-level state changes (Borrower change, Admin change, collateral parameter changes, Spigot changes, etc.), which automatically invalidates open proposals — a Lender can never be bound to terms that changed underneath them. Either party can also explicitly revoke consent on an open proposal.
On creation, the Lender's deposit transfers into the Line, an ERC-721 Credit Position Token is minted to the Lender, and the position joins the repayment queue. If an origination fee is configured, it is charged to the Borrower pro-rata to the position's term and sent to the protocol treasury.
Borrowing
The Borrower can draw at any time from any Credit Position with available liquidity, while the Line is ACTIVE. Draws can be sent to the Borrower or to a designated recipient address. A draw that would put the facility into breach (e.g. past a deadline or below the minimum collateral ratio) reverts.
Increasing an existing position / Refinancing
A Borrower and Lender can refinance an open position by mutual consent (against the current nonce) in a single action:
Set new drawn/facility rates (rates of zero are allowed — interest-free positions are supported)
Extend the position's deadline
Optionally increase the Lender's deposit
Origination fees, where configured, are charged on the deadline extension and on any new deposit amount.
New Lenders
New Lenders join the same way — mutual consent on a new Credit Position. They can lend a different token, at different rates, with a different deadline and different early-withdrawal terms from existing positions in the same facility.
Interest Rates
Each position carries two rates, in basis points:
The Drawn Rate — charged on funds actually drawn by the Borrower
The Facility Rate — charged on committed-but-undrawn funds (the headroom), compensating the Lender for capital availability
Rates are updated by refinancing (mutual consent), including when a facility risks impairment and the parties renegotiate.
Accrued Interest Calculation
Interest accrues from the moment a Lender deposits: the facility rate applies to undrawn deposit, and the drawn rate applies to outstanding principal. Accrual is recalculated any time a position's balance or rates change (draw, repayment, deposit increase, refinance, withdrawal), and can be triggered for the whole facility at any time by anyone.
Facility-wide outstanding debt (principal + accrued interest) is also valued in USD via oracle for collateral-ratio purposes.
Repaying Credit Positions
Anyone — the Borrower or any third party — can deposit Credit Tokens at any time to repay the facility. Repayments follow the FIFO repayment queue and apply to accrued interest first, then principal. A servicing fee, where configured, is added to repayment amounts and routed to the protocol treasury. Overpayment is not possible: repayment amounts are automatically capped at the total owed.
Repaid funds become available for the position's Lender to withdraw.
If the Line is secured by a Spigot, escrowed revenue provides further repayment paths.
Withdrawals by Lenders
A Lender (the holder of the position's ERC-721 token) can withdraw at any time:
Repaid interest — withdrawable free of any fee
Undrawn deposit — withdrawable on demand; if the Line is ACTIVE and the position's deadline has not passed, withdrawing more than repaid interest incurs the position's Early Withdrawal Fee, which accrues to the Borrower
The Early Withdrawal Fee compensates the Borrower for the loss of committed liquidity. The Borrower claims accrued early-withdrawal fees directly from the Line.
Closing Credit Positions and the facility
A position can be closed by the Borrower or Servicer once its principal is fully repaid; closing settles any remaining accrued interest (plus servicing fee). The Borrower can also repay-and-close in one step.
When the last open position closes, the facility's status becomes REPAID. New positions can still be proposed on a REPAID facility — creating one reactivates the Line, making the facility reusable without redeployment.
Repayment queue
Open positions with outstanding principal sit in a FIFO queue: the earliest-drawn position is repaid first. Queue order is maintained automatically as positions are drawn and closed.
Line Health Status
A healthcheck can be run at any time by anyone to evaluate and update facility status against its covenants (position deadlines; minimum collateral ratio where an Escrow is attached).
There are six statuses: UNINITIALIZED, ACTIVE, LIQUIDATABLE, REPAID, INSOLVENT, ABORTED. REPAID, INSOLVENT and ABORTED are terminal for the facility's health-checking (a REPAID facility can be reactivated by a new position). See Credit Events for LIQUIDATABLE, INSOLVENT and ABORTED.
Fees
Three facility-level fees can be configured, each set — and only amendable — by mutual consent of Admin and Borrower:
Origination Fee — charged to the Borrower when a position is created or increased, pro-rated to the position's term; sent to the protocol treasury
Servicing Fee — added to repayment amounts; sent to the protocol treasury
Swap Fee — charged when escrowed or Spigot tokens are swapped into the repayment asset
Separately, each position's Early Withdrawal Fee is agreed per-position and is paid by the Lender to the Borrower. See the Fees page for the complete fee reference.
Last updated
Was this helpful?