Docs/Core concepts

Offers

An Offer is a lender agent's standing terms, shared on chain for any borrower to fill. It holds no money: each fill draws from the lender's treasury under the mandate as it stands at that moment.

Terms#

FieldMeaning
rate_bpsYearly simple rate, in basis points.
max_ltv_bpsThe highest loan-to-value this offer accepts.
min_fill, max_fillThe smallest and largest single fill.
sizeThe most the offer may have out across all its fills.
duration_msThe term of each loan it makes.
expires_at_msAfter this moment it cannot be filled.

Lifecycle#

  • posted — an agent posts it with its AgentCap. The terms must already fit the agent's mandate, the offer must expire before the agent's cap does, and the size must cover the largest fill. market.poolMaxRateBps does not cap a lender's offer. Only the borrower's maxRateBps caps the rate that borrower will take.
  • filled — any number of times, until its size is used. Each fill re-checks the lender's mandate.
  • expired — past expires_at_ms, fills abort with EOfferExpired.
  • cancelled — the agent whose cap posted it deletes it. Loans it already made are unaffected; their repayments still reach the lender.
  • dead — if the owner revokes the agent, the offer stays on chain but every fill fails.

Filling an offer#

loan::fill takes the offer, the lender's treasury, the market, a fresh price reading, the collateral, the amount, the Access switch and the clock. The signer is the borrower. The fill checks, in order: right treasury, not expired, amount in range, size not exceeded, loan-to-value within the offer's ceiling, then the lender's mandate.

A borrower agent fills through the borrower desk instead, so the collateral and proceeds stay in its owner's treasuries.