Reconcile the protocol cut of an Aave v3 liquidation bonus

In the reference liquidation path the protocol fee is taken from the bonus part of collateral. Applying the configured percentage to all seized collateral exaggerates the treasury share.

Separate base collateral and the bonus

At the liquidation’s prestate, obtain the debt amount, applicable prices, reserve decimals and effective liquidation bonus. Reproduce the reference percentage arithmetic and collateral limit before computing the bonus component.

base collateral equivalent = 1000
collateral including 5% bonus = 1050
protocol fee at 10% of bonus = 5
liquidator collateral = 1045

In the fixture the bonus is fifty units. A protocol share of ten percent therefore takes five, leaving 1,045 units for the liquidator. Computing ten percent of 1,050 instead would report a transfer unrelated to the contract calculation.

Inspect the actual settlement form

The transfer path depends on whether the liquidator requested aTokens or underlying assets and on the borrower’s available collateral. Rounding and collateral exhaustion can change the realized debt amount. Check deployment-specific logic and event amounts before reconciling treasury receipts. github.com LiquidationLogic.sol