# Incorrect MOMP calculation in neutral price calculation

Ajna's Loans.update divides borrower debt instead of total pool debt when computing MOMP, lowering neutral price and causing kickers to lose bonds more often.

- Payout: Contest reward
- Severity: medium
- Program: Ajna
- Credited: Jeiwan
- Disclosed: 2022-12-21
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2023-01-ajna-judging/issues/148
- Library page: https://bugbountylibrary.com/r/sherlock%3A2023-01-ajna%3AM-4
- Tags: domain:web3 impact:funds-loss kind:contest platform:sherlock sev:medium tech:solidity technique:source-review vuln:accounting-error

**Target:** Solidity lending pool contracts (Loans.update / neutral price)
**Root cause:** MOMP is meant to be the price where deposits above equal the pool's average loan size, requiring total pool debt divided by loan count; the code divides only the single borrower's accrued debt by loansInPool, yielding a too-small MOMP and thus a too-low neutral price.
**Steps:**
1. Read whitepaper definition of MOMP: price where deposit above equals average loan size of pool.
2. Compare correct implementation in Auctions.sol kick path (line ~799) using total pool debt.
3. Inspect Loans.update: `uint256 curMomp = _priceAt(Deposits.findIndexOfSum(deposits_, Maths.wdiv(borrowerAccruedDebt_, loansInPool * 1e18)));`
4. Observe borrowerAccruedDebt_ is used instead of total pool debt, so MOMP is computed on a smaller debt.
5. Conclude neutral price (interest-adjusted MOMP) is lower than intended, increasing kicker bond forfeitures.
**How found:** Cross-referenced whitepaper MOMP definition against two implementations in the codebase; noticed the kick-path version used total pool debt while Loans.update used only borrower debt, flagging the inconsistency.
**Insight:** When a spec defines a metric over pool-wide aggregates, diff every implementation of that metric against the spec and against each other; a single-variable substitution (borrower debt vs total debt) in one code path is a classic accounting bug that skews downstream incentive math.
