Fee receiver
When a loan is liquidated with a nonzerooracleGameFee, each disputed round of the oracle game charges a fee on takers. Those fees accrue to a per-liquidation fee receiver: a minimal contract at a deterministic address derived from the liquidation-time snapshot (lending id, tokens, borrower, lender, and liquidator), salted by the oracle game’s report id. The address is emitted as feeRecipient in the LoanLiquidationUnderway event.
Collected fees are split half to the borrower and a quarter each to the lender and liquidator.
The receiver contract is deployed lazily: fees accrue to the address before any code exists there, and the first distribution deploys it. Distribution works at any time, during a live oracle game or long after the liquidation resolved, and can be repeated as more fees accrue.
Deploy and distribute
LoanLiquidationUnderway event, or from the data provider while the liquidation is live.
uint256
The oracle game’s report id, emitted in
LoanLiquidationUnderway.uint256
Unique identifier of the lending arrangement the liquidation belongs to.
address
The loan’s collateral token at liquidation time.
address
The loan’s borrow token at liquidation time.
address
The loan’s borrower at liquidation time.
address
The loan’s lender at liquidation time.
address
The liquidator recorded when the liquidation started.
distribute() on the receiver itself is also permissionless and equivalent.
Withdrawing your share
Distribution credits each party’s share to their internal balance inside the openOracle contract, not to their wallet. Withdraw with the oracle’swithdraw(token, amount) or withdrawTo(token, amount, to). Internal balances are readable via tokenHolder(owner, token) on the oracle.
Integrations
Any oracle game can point its fee recipient at a receiver address built from arbitrary values, so match a receiver’s address against thefeeRecipient emitted in the loan’s LoanLiquidationUnderway event rather than trusting its reported lending id alone.