# Triggering liquidations ahead of expected time leads to loss and lock of funds

Astaria allowed liquidation before the epoch-end auction window, skipping lien-count decrement and liquidation accountant setup, causing auction proceeds to bypass accountants and halting the epoch.

- Payout: Contest reward
- Severity: high
- Program: Astaria
- Credited: 0xRajeev
- Disclosed: 2022-11-07
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2022-10-astaria-judging/issues/167
- Library page: https://bugbountylibrary.com/r/sherlock%3A2022-10-astaria%3AH-25
- Tags: domain:web3 impact:dos impact:funds-loss kind:contest platform:sherlock sev:high technique:source-review vuln:accounting-error vuln:business-logic vuln:liquidation

**Target:** AstariaRouter liquidation logic
**Root cause:** Liquidation can be triggered when a lien exceeds loan duration, but the branch that decrements epoch lien count and initializes the liquidation accountant only runs when time-to-epoch-end is within the auction window; the auction proceeds regardless.
**Steps:**
1. Observe a collateral with a lien past its loan duration but epoch end more than auction window (default 2 days) away.
2. Trigger liquidation via AstariaRouter (L388-L415).
3. Liquidation proceeds to auction without decrementing epoch lien count or setting up the liquidation accountant.
4. Auction settles, sending proceeds directly to lien owners instead of via liquidation accountants.
**How found:** Manual review of AstariaRouter liquidation trigger logic comparing the time-to-epoch-end condition against the auction window, spotting that the accountant setup and lien-count decrement are gated but the auction is not.
**Exploitation:** Attacker triggers liquidation early in the epoch; auction runs without liquidation accountant setup, so proceeds route to lien owners directly and the epoch lien count is never decremented, preventing epoch progression.
**Insight:** When a state-changing path has a time-window guard, check whether sibling side effects (accounting counters, role/accountant initialization) share that guard or are skipped on the alternate branch; mismatched gating between auction start and accounting setup is a recurring fund-loss pattern.
