Skip to main content

Inspect terms

Read a loan’s full state with lendingArrangements(lendingId) on openLend, or getLending(lendingId) on the data provider. The struct layout is below:
OracleParams and InterestRateParams are as defined under Oracle parameters and Interest rate curve. Review Supported tokens before funding a loan: openLend’s and openOracle’s accounting is only compatible with the token classes listed there.

Origination

An open origination request has active = false and curveOpen = true. You fund the stored principal against supplyAmount of collateral, for term seconds starting at acceptance.

Refinancing

An open refinance auction has active = true and curveOpen = true, and the deal is defined by the staged refiParams on top of the live loan. You fund the current close-out debt (principal plus the greater of accrued and commitment interest, minus interest already paid) plus refiParams.extraDemanded. The post-accept collateral is supplyAmount minus refiParams.supplyPulled, and the new term is refiParams.newTerm. The oracle configuration becomes refiParams.oracleParams when its settlementTime is nonzero; when it is zero, no new oracle configuration was staged and the loan keeps its current oracleParams unchanged. The close-out debt keeps accruing until acceptance, so fund with headroom and bound the result with minLendAmount and maxLendAmount. A refinance staged during a live liquidation cannot be funded until the liquidation resolves in the borrower’s favor. Its rate curve is parked while the oracle game runs and anchors at the game’s settleable-at time (more than settlementTime has passed since the last oracle price report): from that moment the curve starts ticking, and funding becomes possible, with the acceptance itself resolving the liquidation. A curve anchored in the past means the offered rate may already be partway up when the auction first becomes fundable.

Interest rate

The rate you would lock is the curve’s current offer: evaluate the interest rate curve against the time elapsed since requestStart. While the loan is in liquidation (inLiquidation is True), requestStart reads 0: the curve is parked, and the effective anchor becomes the oracle game’s settleable-at time once the liquidation resolves in the borrower’s favor.

What the borrower’s choices mean for a lender

Parameter definitions live on the Borrow page. From the lender’s seat:
  • liquidationThreshold: the debt level, relative to collateral value, at which the position becomes liquidatable.
  • term: how long your capital can be locked, and when the default claim on collateral opens if the borrower does nothing.
  • commitmentFraction: your guaranteed minimum interest even on an immediate repayment or refinance. It also counts into liquidation debt immediately, which moves liquidation eligibility in your favor.
  • stake: what a liquidation caller must wager on a successful outcome. If a liquidation fails near maturity, half of it is paid to you.
  • gasCompensation: ETH paid to you at acceptance.
  • settlementTime: the undisputed window each oracle round must survive before the price settles.
  • initialLiquidity: the capital required to start a liquidation. The higher it is relative to the position, the more expensive liquidating is, and the more rate you should demand.
  • oracleGameFee: a quarter of collected fees flow to you, but high fees blunt oracle accuracy.
  • maxBaseFee: when nonzero, liquidations cannot finalize against the borrower while gas is spiked above this level. That shifts risk from borrower to lender and should be priced into your rate.
  • finalizerReward: a non-refundable expense the liquidator escrows. Set too high relative to the equity cushion, liquidation becomes unprofitable and your liquidation backstop weakens.
  • multiplier and escalationFactor: how quickly and how far the oracle game escalates. They govern how expensive it is to manipulate and delay the liquidation price.

Thinking about oracle parameterization

Before accepting, decide whether participating in the loan’s oracle game is profitable relative to the equity earned from a successful liquidation. Running a liquidation means funding initialLiquidity * supplyAmount / 100 of the collateral token plus the matching borrow token side, wagering the stake, and escrowing the finalizer reward; the return is the equity buffer share set by liquidatorFraction. If you keep liquidatorFraction at 0, you are the liquidation backstop and that whole cost-benefit is yours. If the costs are outside your operational budget, either price the loan accordingly or share the equity buffer with outside liquidators. initialLiquidity sets the capital required to start a liquidation, and the size the liquidation price report starts at. Too high relative to the position and running a liquidation is expensive, so demand more rate. Too low and correcting a false report is not worth the gas, which weakens the price you settle at. Prefer settlementTime short enough and liquidationThreshold low enough that a liquidation resolves while the collateral is still likely enough to cover the debt at the liquidation threshold. A quarter of collected oracleGameFee flows to you, but a higher fee widens the price error a false report can hold before disputing it becomes profitable. A report that overstates the collateral’s value blocks or underpays your liquidation, so fee-driven accuracy loss cuts against you directly. multiplier governs how quickly the game punishes delay and manipulation. Too low and a manipulator can cheaply stall your liquidation with disputes; too high and the price error required for a profitable dispute grows, weakening the settled price. escalationFactor caps how large the game can grow. As high as is tolerable is preferable, since higher escalation punishes delay and manipulation geometrically, but a lower escalationFactor may make it easier for you to always be able to participate. Treat a nonzero maxBaseFee as a discount on your liquidation rights: while the base fee is above it, no liquidation can finalize against the borrower. Over a long term it also exposes you to gas fee regime shifts: if base fees move persistently above the cap, liquidation stays blocked for the duration, leaving you exposed to the full downside tail of the collateral price without a working stop.

Accept a borrow request

Anyone can call lend() to accept the current rate on a borrow request’s curve. The same function accepts refinance auctions: when the loan is already active with an open refi curve, the caller funds the roll instead of a fresh origination. On an origination, the caller funds the borrower with the requested amount, the loan goes active, and the recorded lender receives the escrowed gas compensation. On a refinance acceptance, the caller funds the previous lender’s close-out debt plus any extra borrow the borrower staged, the borrower receives the extra borrow and any pulled collateral, and the loan restarts with the staged term at the rate the refi curve shows at acceptance. If the recorded lender is unchanged and the call is made by that lender or its lender delegate, the prior debt is netted: only the staged extra borrow must be funded, since the rolled principal cancels against what the previous lender is owed. For the incumbent lender this is the path to retaining a refinanced loan: accept your borrower’s refi yourself and only the extra borrow needs funding. A refinance can only be accepted before the loan’s maturity plus any grace period. The call resolves a settleable pending liquidation first; if that resolution restores the loan, the acceptance proceeds against the post-settle state.
uint256
Unique identifier of the lending arrangement to accept.
bytes32
Required hash pinning the loan’s configuration, including any staged refinance terms such as supplyPulled and extraDemanded. If the loan’s terms change between transaction broadcast and inclusion, the hash no longer matches and the acceptance reverts instead of funding a deal you didn’t review. See Calculating the param hash for how to calculate it.
uint128
Refinance-only floor on the new principal. Reverts if the close-out debt plus staged extra borrow lands below this value, for example because the borrower repaid down the debt after you built the transaction. Pass 0 on an origination.
uint128
Refinance-only ceiling on the new principal. Reverts if the close-out debt plus staged extra borrow lands above this value, bounding interest accrued between transaction broadcast and inclusion. Pass type(uint128).max on an origination.
uint128
Reverts if the loan’s live collateral before the acceptance is below this value. On a refinance the post-accept collateral can be lower when the borrower staged a collateral pull; that pull is pinned by paramHashExpected, not by this check.
uint32
Floor on the accepted rate, 1e8 = 10% APR. Required in practice: the param hash deliberately does not pin the curve’s requestStart anchor, so this floor is the only guard on the rate you accept. The curve only rises between broadcast and inclusion in the normal case, but a failed liquidation can re-anchor it, so always pass the rate you were shown.
uint24
Your share split for liquidations, 1e7 fixed-point. On a successful liquidation, any equity buffer beyond the debt is split: this fraction goes to the liquidator and the rest to you. Pass 0 to keep the full buffer and handle liquidations yourself, or a higher fraction to make outsourced liquidation attractive. Anyone can call liquidate() regardless; this only sets the split. Bounded [0, 1e7].
address
Address recorded as lender. Funds are still pulled from msg.sender. The loan is owned by the lender: repayments, claimed collateral, and liquidation payouts all go to this address. Make sure you control the address passed here.
address
Optional contract authorized to perform netted refinances on the lender’s behalf. This delegate is fully trusted. Pass address(0) for none. Changeable or revocable later by the lender via setLenderDelegate().
Token flows On an origination, the call must be funded with:
On a refinance acceptance, the call must be funded with:
If borrowToken is native ETH, funding rides in msg.value; on a refinance, any excess msg.value is refunded to the recorded lender, not to msg.sender, so send exact value when funding on behalf of a different lender. The recorded lender also receives the borrower’s escrowed gasCompensation in ETH.

Receiving repayments

Repayments are push payments. A partial repayment is transferred to the recorded lender the moment the borrower pays, satisfying your interest claim first and then reducing principal. A full repayment pays the close-out debt, including the commitment interest floor, and ends the loan. A refinance accepted by another lender also pays you the full close-out debt automatically: you are taken out of the position without acting. If a push payment to you fails, the amount is credited to escrow. See Recover held tokens.

Claim collateral

If a loan is not fully repaid or refinanced before its term plus any grace period ends, the collateral is forfeited to the lender. claimCollateral() is permissionless; the collateral always goes to the recorded lender.
uint256
Unique identifier of the lending arrangement.

Delegation

setLenderDelegate() registers or revokes the contract allowed to net your lending into a borrower refinance on your behalf. The delegate is fully trusted. Lender-only.
uint256
Unique identifier of the lending arrangement.
address
Contract to authorize. Pass address(0) to revoke.

Liquidation payouts

If you kept liquidatorFraction at 0, you are the liquidation backstop: no third party has an incentive to liquidate for you, so monitor the position and call liquidate() yourself. See Liquidate. Liquidations resolve through finalize(); see Finalize and autoSettle for the resolution mechanics. From the lender’s seat: If the liquidation succeeds and the settled price implies the debt exceeds the collateral, you receive the entire collateral. If there is an equity buffer, you receive the debt valued in collateral terms plus your share of the buffer per liquidatorFraction. Debt is measured at finalize time, so it includes interest accrued up to resolution. If the liquidation fails, the liquidator’s forfeited stake is added to the loan’s collateral, which you receive on a later default. If the failure lands within the last 30 minutes of the term or after maturity, half the stake is paid to you directly as compensation for the grace period granted to the borrower. You also receive a quarter of any oracle game fees collected during the liquidation. See Fee receiver.

Recover held tokens

If a payout to you fails, for example because the token blacklists the recipient, the amount is credited to a per-recipient escrow. See Recover held tokens.

Receiving WETH

Native ETH payouts that cannot be delivered directly, for example to a contract that rejects plain ETH transfers, arrive wrapped as WETH instead. For a lender this applies to repayments, gas compensation, and liquidation payouts on native ETH sides. See Receiving WETH.