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#
| Field | Meaning |
|---|---|
| rate_bps | Yearly simple rate, in basis points. |
| max_ltv_bps | The highest loan-to-value this offer accepts. |
| min_fill, max_fill | The smallest and largest single fill. |
| size | The most the offer may have out across all its fills. |
| duration_ms | The term of each loan it makes. |
| expires_at_ms | After 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.poolMaxRateBpsdoes not cap a lender's offer. Only the borrower'smaxRateBpscaps 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 withEOfferExpired. - 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.