# Simulating full accrue sequences: index desync and epochs versus block.timestamp

Mentorship Series #25 · 15 January 2026 · [@0xfirefist](https://x.com/0xFireFist) · Panoptic · Code4rena

Mentorship Series · [The Contest Academy](https://0xsimao.com/the-contest-academy) · 0xSimao

---

We continued the Panoptic [contest](https://code4rena.com/audits/2025-12-panoptic-next-core) on Code4rena.

**Lesson Summary:**

- Simulate full sequences (accrue → deposit/withdraw → accrue again) to catch borrow index desync or double-burning shares.
- Verify borrow index always updates proportionally on partial burns — stale index after exact-balance interest payment can wipe users out.
- Cross-check time handling: epoch (4s steps) vs raw block.timestamp mismatches → 0 delta in one contract while the other accrues → state drift.
- Test same-block loops on accrueInterest(): non-incrementing epoch + positive elapsed time can repeatedly inflate borrow rate toward max.Flag asymmetric rate math (faster increases than decreases, uncapped linear adaptation) — suspicious unless docs explicitly justify volatility or one-sided speed.

https://youtu.be/fLDqFL27h3k

Session video: https://youtu.be/fLDqFL27h3k

---

Newer: [Pool ID packing end-to-end: collision loops, initialization guards and permissionless expand](https://0xsimao.com/the-contest-academy/mentorship-series-26) · Older: [What happens when the borrow index stops updating, and how far linear adaptation can run](https://0xsimao.com/the-contest-academy/mentorship-series-24)
