Special Window Protocol

Autopilot uses a defined execution window at the end of each epoch to ensure voting, claiming, and swapping actions are processed securely and consistently. This mechanism protects against timing-based manipulation, ensures fair participation, and aligns reward distribution with on-chain state.


πŸ•’ Timing Structure

Each epoch includes a 2-hour Special Window, split into two parts:

  • Pre-Epoch Window: Begins 90 minutes before epoch end β†’ Deposits and withdrawals are blocked β†’ Bot operations (voting, claiming, swapping) begin

  • Post-Epoch Window: Lasts 30 minutes after the new epoch starts β†’ Bot logic completes reward processing β†’ User interactions remain paused to avoid state conflicts

This time-bound design ensures that user deposits or exits cannot interfere with reward logic mid-cycle.


πŸ” Special Window Behavior

β›” User Actions Blocked

  • Deposits and withdrawals are disabled during the Special Window

  • Prevents users from joining too late or exiting too early relative to reward timing

Enforced by:

solidityCopyEdit_isInSpecialWindowOrFail()

πŸ€– Bot Actions Allowed

During this window, protocol contracts are authorized to execute:

  • vote() β€” submit votes based on current strategy

  • claim() and claimBribes() β€” collect all available rewards

  • swap() β€” convert rewards to USDC using internal routing

These steps are executed automatically and in order.


πŸ› οΈ Snapshot & Sync

Autopilot maintains on-chain accuracy through:

  • Emergency Snapshots: Taken before user or bot actions to lock in voting power and reward eligibility

  • Epoch Synchronization: If a transaction is missed or delayed, the system can detect the gap and re-align automatically for the next epoch


🟒 Behavior Outside the Special Window

  • Users can deposit and withdraw freely

  • Bot operations are paused

  • All strategy logic and vote execution is idle until the next window begins

This separation ensures that on-chain actions remain consistent and trackable between epochs.


πŸ”„ Synchronization Logic

To maintain fair reward calculations, Autopilot implements:

  • Per-epoch weight tracking: Stored via total_tracked_weight[epoch_id] to capture each user’s voting power snapshot

  • Fallback handling: If an epoch operation fails or is skipped, the protocol automatically resumes in the next cycle without user input

  • Snapshot before each action: Ensures all operations reference the correct state:

    solidityCopyEditemergencySnapshot()

Last updated