Works with the AI Agents you already use
Solana Oracle Risk Review
by BanditXBT
Review Pyth/Switchboard/AMM/LST price reads on Solana for staleness, confidence, manipulation cost.
$3.15
About this skill
Quantify cost to move the price vs. profit from the move. Validate everything the caller passes; the oracle account is attacker-supplied unless pinned.
- Price updates are posted on-chain by whoever submits them (verified Wormhole-signed data). Read via the receiver SDK's
PriceUpdateV2account. - SDK facts to rely on:
Account<PriceUpdateV2>in Anchor enforces the receiver-program owner (with rawAccountInfoyou must check it yourself);get_price_no_older_than(&clock, max_age, &feed_id)checks feed ID, verification level, and age againstClock::unix_timestamp(publish time in seconds, not slots);get_price_uncheckedskips age checks, so never use it without your own staleness logic. Prefer the receiver's ephemeral/atomic post-then-consume pattern within one transaction for execution paths. - Validate: account owner = the Pyth receiver program (Anchor
Account<PriceUpdateV2>handles this), feed ID equals the one stored in your market config (never accept any feed), verification level is full, age viaget_price_no_older_than(&Clock::get()?, max_age_seconds, &feed_id). - Handle
exponent(usually negative) explicitly; convert to your fixed-point with checked math. Compareconftoprice: reject or widen margins whenconf/priceexceeds a threshold. Use the lower/upper bound (price ± k·conf) conservatively: lower for collateral value, upper for debt value. - Latency arbitrage: any valid update within the window is acceptable, so a user can pick a favorable one. Mitigate with short windows, publish-time ≥ order-creation time, monotonic publish-time storage, and execution by a keeper with a fresh update.
Check the feed account address/authority matches config, staleness by slot or timestamp as the feed defines, minimum number of oracle responses/samples, and variance/standard-deviation bounds if exposed. Read the on-demand vs. legacy semantic differences before assuming values and units.
- Never use pool spot price or reserves for value-bearing decisions. Flash-loan/bundle-financed swaps move it within one transaction at low cost on shallow pools.
- On-chain TWAP is limited or absent in many pools; if you build one, window length must make manipulation unprofitable, accounting for multi-slot control by leaders/bundles.
- LP-token valuation: use fair-value formulas based on external prices for each asset, not pool reserves (inflation attacks).
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 13 days ago
Requires
Nothing to install.
Permissions
No special permissions declared or detected
What's inside
Frequently Asked Questions
New in Security
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.