In Compound III, absorb clears a liquidatable account's debt and moves its collateral into protocol reserves. buyCollateral is a separate purchase: a buyer pays the market's base asset and receives available collateral when the reserve gate permits it. Absorption records liquidator points; it does not automatically pay the absorber a collateral bonus.
This walkthrough follows Compound III's Comet implementation, specifically CometWithExtendedAssetList at revision f766f51, inspected on 28 October 2026. Individual deployments can use different code or settings. Identify the chain, Comet proxy and active implementation before applying the calculation.
Follow the borrower, absorber and buyer separately
The official liquidation documentation describes two operations. Any address can initiate absorption of a liquidatable account. A separate buyer can purchase collateral using the deployment's base token. The two participants can be the same address, but participation in the first operation does not reserve the second opportunity.
| Participant or balance | absorb | buyCollateral |
|---|---|---|
| Borrower | Debt removed; collateral claim cleared | Already absorbed position stays cleared |
| Protocol | Takes collateral ownership; base reserves decrease | Receives base tokens; releases purchased collateral |
| Absorber | Receives points accounting | Has no exclusive purchase right |
| Buyer | Need not fund the absorption | Pays base tokens for the quoted collateral |
Treat “liquidation” as a sequence when reading transactions. Finding an absorption proves a change to the borrower's position. It does not prove that seized collateral was sold, identify its eventual buyer, or establish anyone's realized profit.
Comet stores a signed base principal and separate collateral balances, as shown in its storage definitions. A negative base position represents borrowing; a positive one represents supply. The Aave liquidity-index and borrow-index walkthrough illustrates the broader reconciliation habit: give internal positions and wallet tokens separate columns. Each protocol still needs its own conversion rules.
Establish why the account can be absorbed
An account must pass the liquidatability test before absorption succeeds. Keep liquidateCollateralFactor, which governs eligibility, separate from liquidationFactor, which affects the value credited during absorption. Their similar names hide different jobs. The borrow-factor versus liquidation-factor comparison develops those boundaries.
Consider an entirely hypothetical market with base token B and collateral token C. B has six decimals, C has 18, and both price feeds use eight decimals. Assume ordinary exact token transfers, fixed prices and no interest accrual or other transactions during the sequence. Set both base indices to their unit value so principal and present-value base amounts coincide. Every balance and parameter below is invented for the demonstration.
The borrower has 10 C, currently priced by the oracle at 200 valuation units each. B's oracle price is 1 valuation unit. The borrower owes 1,750 B. C's liquidation collateral factor is 85%, while its liquidation factor is 90%.
Eligibility support is 10 × 200 × 85% = 1,700 valuation units. Debt value is 1,750 × 1 = 1,750. Debt exceeds support by 50, so the position is liquidatable under these assumptions. The 90% liquidation factor has not entered this eligibility calculation.
These percentages are different inputs in the official asset configuration. Copying a dashboard's generic “liquidation factor” label into both worksheet cells would erase the distinction.
Absorb changes claims before collateral leaves the contract
Now absorber A initiates a successful absorption. The pinned absorption implementation clears the account's recorded collateral, reduces aggregate user collateral claims, and computes its new base position.
For this fixture, the credited collateral value is 10 × 200 × 90% = 1,800 valuation units, equivalent to 1,800 B at the assumed base price. Apply that to the signed base balance: −1,750 + 1,800 = +50 B.
The borrower therefore has zero debt, zero C recorded as collateral, and a 50 B internal supply position. That 50 B is a claim within Comet. Absorption has not sent 50 B to the borrower's wallet.
The same distinction matters for C. Those tokens were already held by the Comet contract. Removing the borrower's claim makes them protocol collateral reserves without requiring a token transfer to absorber A. Ownership accounting changes first; a later sale moves tokens out.
To reconcile the protocol, give it the following opening balances, including this borrower:
| Quantity | Before absorption | After absorption | After later purchase |
|---|---|---|---|
| Base-token cash, B | 10,000 | 10,000 | 10,950 |
| Aggregate supplied-base claims, B | 20,000 | 20,050 | 20,050 |
| Aggregate borrowed-base claims, B | 12,000 | 10,250 | 10,250 |
| Base reserves, B | 2,000 | 200 | 1,150 |
| Protocol collateral reserves, C | 0 | 10 | 5 |
| Borrower's signed base position, B | −1,750 | +50 | +50 |
Base reserves equal base-token cash minus supplied-base claims plus borrowed-base claims. Initially, 10,000 − 20,000 + 12,000 = 2,000 B. After absorption, 10,000 − 20,050 + 10,250 = 200 B.
The reserve decrease is 1,800 B: 1,750 of removed debt plus the borrower's 50 B credit. Subtracting only the old debt would overstate remaining reserves by 50 B. Checking cash alone would miss the entire reserve change.
That is why the Aave withdrawal-liquidity walkthrough also keeps claims and transferable cash apart. Here the distinction explains a liquidation ledger rather than a withdrawal limit. Base reserves also exclude the value of the newly owned 10 C; adding collateral value would create a different measure.
Price the later purchase using its own inputs
Assume this market's target reserves are 1,000 B and its storefront price factor is 50%. After absorption, base reserves of 200 B are below target. Collateral purchasing can proceed if the other execution checks pass. The target-reserves versus liquidity guide explains the separate meaning of that reserve threshold.
The official pricing reference derives the discount from the storefront factor and the asset's liquidation factor. In human-readable decimals, the discount here is 50% × (1 − 90%) = 5%.
The discounted collateral price is therefore 200 × 95% = 190 valuation units per C. Buyer R pays 950 B, worth 950 valuation units under the example's base price. The quote is 950 ÷ 190 = 5 C.
This quote uses the base oracle price as well as the collateral oracle price. A base token trading away from its assumed unit value requires a fresh calculation. The function also returns a collateral quantity for a specified base payment; interpreting its result as a price reverses the units.
After that purchase, cash rises to 10,950 B. Aggregate base supply and borrowing claims are unchanged because this is payment for collateral. Reserves become 10,950 − 20,050 + 10,250 = 1,150 B. The recipient receives 5 C, leaving another 5 C owned by the protocol.
The purchase implementation checks the target before the purchase. Our 950 B purchase starts with reserves below 1,000 B and finishes above it. It is not trimmed automatically to the 800 B gap. A subsequent purchase would fail the reserve gate if these balances stayed unchanged, despite the remaining collateral.
The implemented quote also has no elapsed-time discount input. Waiting alone does not increase its discount under fixed prices and configuration. A numerical quote establishes neither available inventory nor permission to execute.
Read points and events without inventing a payout
The official absorption tests check an unchanged absorber token portfolio alongside incremented liquidator points.
Points track successful calls, absorbed accounts and approximate gas spend. The implementation's spend estimate uses its measured gas interval multiplied by block base fee. It is not a receipt for the caller's entire transaction cost, and it creates no automatic reimbursement transfer.
In our one-account call, A's call count and absorbed-account count each increase by one. A receives neither the 5 C later purchased by R nor the borrower's 50 B internal balance. Assigning points to A does not make A the recipient in R's purchase.
Events need the same care. The event interface defines separate AbsorbDebt, AbsorbCollateral and BuyCollateral records. In this example, AbsorbDebt.basePaidOut is 1,800 B: the change from −1,750 to +50. Reading that field as a transfer of 1,800 B to A would contradict the balances. Reconcile events against state changes and token transfers before labeling wallet income.
Validate each step against one recorded state
For a real investigation, preserve the market identity, implementation, block number and timestamp with each snapshot. Read the borrower's accrued base balance, collateral balances, relevant factors and oracle prices at that same block. Mixed-block inputs can produce an account that never existed.
For absorption, simulate the exact account list and inspect its outcome. The governance reference exposes separate absorption and purchase pause controls. A purchase being enabled does not establish that absorption is enabled, or vice versa.
For a purchase, record base reserves, target reserves, collateral reserves, payment, quote, minimum collateral amount and recipient. Check token decimals before converting human amounts into arguments. In our fixture, 950 B is 950,000,000 base units and 5 C is 5,000,000,000,000,000,000 collateral units. Integer arithmetic reproduces the displayed quote exactly.
A minimum of 5.01 C would reject this 5 C quote. An inventory shortage also rejects the call; it does not promise a smaller fill. Re-simulate after state changes, and compare the confirmed recipient's collateral increase with the confirmed base payment.
Finally, value any intended resale with an executable external quote and its costs. The illustrative buyer receives collateral worth 1,000 valuation units at the assumed oracle price for 950 B, but that 50-unit gap is not realized profit. A useful liquidation record ends with three independently reconciled facts: the borrower's cleared position, the protocol's remaining reserves, and the buyer's actual tokens received.
