[VPD-551] Deviation Sentinel WEB3 action for monitoring#84
Draft
Debugger022 wants to merge 7 commits intodevelopfrom
Draft
[VPD-551] Deviation Sentinel WEB3 action for monitoring#84Debugger022 wants to merge 7 commits intodevelopfrom
Debugger022 wants to merge 7 commits intodevelopfrom
Conversation
- 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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
venus-labs-actionspackage with a TenderlyWeb3 Action (
src/actions/index.ts) that:secrets
DeviationSentinel contract
to those with monitoring enabled
handleDeviation()to pause/unpause accordinglyscripts/setDeviationPrices.ts)to simulate price deviations on the SentinelOracle,
verify pause/unpause behavior, and validate collateral
factor / liquidation threshold restoration
tenderly.yaml) witha 5-minute cron schedule
and configuration details; added
out/to.gitignoreand removed committed build artifacts
dotenvupdated to 16.6.1Contracts (BSC Testnet)
0x9245d72712548707809D66848e63B8E2B169F3c10x94d1820b2D1c7c7452A163983Dc888CEC546b77D0xa4f2B03919BAAdCA80C31406412C7Ee059A579D3