Skip to content

Add oracle-round budget enforcement and liquidation distance safety for staged operations#339

Open
KillariDev wants to merge 1 commit into
mainfrom
t3code/0d553bdd
Open

Add oracle-round budget enforcement and liquidation distance safety for staged operations#339
KillariDev wants to merge 1 commit into
mainfrom
t3code/0d553bdd

Conversation

@KillariDev

Copy link
Copy Markdown
Collaborator

Summary

  • Added oracle safety parameters to SecurityPoolOracleCoordinator and factory deployments to cap oracle usage per price round, cap settlement base fee sensitivity, and define minimum liquidation distance from threshold.
  • Introduced per-round budget accounting in coordinator:
    • Tracks priceRoundMaxNotional and priceRoundConsumedNotional.
    • Added isPriceFresh, getPriceRoundRemainingNotional, isPriceUsable helpers and notional-based operation execution checks.
    • Enforces budget checks before staged operations execute; failures emit ExecutedStagedOperation with explicit reasons.
    • Rejects liquidation execution when price move is too close to liquidation threshold.
  • Added stale/expired staged operation handling in settlement callback so expired auto-execute slots are consumed and no longer block later valid reports.
  • Tightened operational constraints with max operation timeout and new constructor validations (e.g., nonzero escalation multiplier, base fee multiplier floor).
  • Switched batch auction factory to deterministic create2 deployment path with explicit failure check.
  • Updated simulator/deployment helper wiring and UI contract typings/hooks to surface new coordinator fields/rules.
  • Extended Solidity + UI test coverage for oracle budget behavior, pending slot expiry handling, and partial liquidation expectations.

Testing

  • Not run (not requested in this task).
  • Relevant checks included in diff:
    • solidity/ts/tests/priceOracleSecurity.test.ts
      • pending operation cleanup after expiry
      • shared oracle-round budget consumption/exhaustion semantics
      • liquidation distance guard behavior
    • solidity/ts/tests/peripherals.test.ts
      • partial liquidation expectations and blocking scenarios
    • UI test updates in ui/ts/tests/* for liquidation/security flow consistency and contract integration adjustments
  • Recommended follow-up to validate locally:
    • bun run tsc
    • bun run test
    • bun run format
    • bun run check
    • bun run knip

- Added oracle-round budget accounting, settlement/base-fee multipliers, and operation timeout/cap guards in `SecurityPoolOracleCoordinator`
- Prevents expired auto-execute staging slots from blocking later valid oracle settlements and rejects operations when price is stale, overpriced, or budget-exceeded
- Added liquidation threshold-distance checks and non-zero budget gating for staged liquidations and allowance/withdrawal ops
- Propagated new oracle coordinator parameters through factory deployment and updated Create2 auction factory deployment path
- Expanded Solidity and UI tests to cover new budget behavior, deferred execution semantics, and liquidation safety scenarios
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant