Skip to content

Conversation

@Debugger022
Copy link

@Debugger022 Debugger022 commented Jan 29, 2026

Adds a new DeviationSentinel Tenderly Web3 Action that monitors price deviations between the ResilientOracle and SentinelOracle on BSC Testnet. The action runs on a 5-minute schedule and automatically pauses borrows or supply when deviation thresholds are exceeded, and unpauses when deviations resolve.

Changes

  • New venus-labs-actions package with a Tenderly
    Web3 Action (src/actions/index.ts) that:
    • Initializes a wallet and RPC provider from Tenderly
      secrets
    • Verifies the keeper is whitelisted on the
      DeviationSentinel contract
    • Fetches all markets from the Comptroller and filters
      to those with monitoring enabled
    • Checks price deviation per market and calls
      handleDeviation() to pause/unpause accordingly
  • E2E test script (scripts/setDeviationPrices.ts)
    to simulate price deviations on the SentinelOracle,
    verify pause/unpause behavior, and validate collateral
    factor / liquidation threshold restoration
  • Tenderly deployment config (tenderly.yaml) with
    a 5-minute cron schedule
  • Docs & cleanup: README with architecture, setup,
    and configuration details; added out/ to .gitignore
    and removed committed build artifacts
  • Dependency bump: dotenv updated to 16.6.1

Contracts (BSC Testnet)

Contract Address
DeviationSentinel 0x9245d72712548707809D66848e63B8E2B169F3c1
Comptroller 0x94d1820b2D1c7c7452A163983Dc888CEC546b77D
SentinelOracle 0xa4f2B03919BAAdCA80C31406412C7Ee059A579D3

- Add Tenderly Web3 Action to monitor and handle price deviations on BSC Testnet
- Add e2e script to simulate deviation, verify pause/unpause, and validate CF/LT restoration
- Bump dotenv to 16.6.1
@Debugger022 Debugger022 self-assigned this Jan 29, 2026
Refactor the e2e test script to select network via CLI argument
(testnet|mainnet) and read RPC URLs from .env instead of hardcoding.
Add per-network config for addresses and markets, with mainnet
placeholders. Update README and .env.example accordingly.
- Add try/finally to always restore oracle prices on failure
- Add null receipt checks for dropped transactions
- Replace fixed-interval polling with exponential backoff (10s-60s)
- Log per-market pending status during polling
- Throw on poll timeout instead of silently logging
- Exit with non-zero code on test failure
- Extract getMarketState helper to reduce duplication
- Remove unused POLL_INTERVAL_MS constant
Add Step 0 to the e2e script that verifies the keeper is whitelisted
and logs each market's on-chain deviation threshold before running.
Extend the ABI with tokenConfigs and trustedKeepers, and document
admin-only setTokenConfig/setTrustedKeeper in network config comments.
- Cover both handleDeviation branches:
    - pass 1 tests sentinel < oracle (cfModifiedAndSupplyPaused),
    - pass 2 tests sentinel > oracle (borrowPaused).
- Adds setInflatedPrices helper and pauseType parameter to waitForMarketState.
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.

2 participants