Notebook To Strategy
tradingstrategy-ai/trade-executor
Transfer code from a backtesting Jupyter notebook to a Trade Executor strategy module
Oracle attack vectors and safe integration patterns for DeFi protocols.
$ npx skills add ccashwell/evm-cortex --skill oracle-manipulation -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install ccashwell/evm-cortex oracle-manipulation --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/oracle-manipulation .claude/skills/oracle-manipulation && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "oracle-manipulation" agent skill from https://github.com/ccashwell/evm-cortex/tree/main/skills/oracle-manipulation into .claude/skills/oracle-manipulation/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "oracle-manipulation", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/ccashwell/evm-cortex/tree/main/skills/oracle-manipulationType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add ccashwell/evm-cortex --skill oracle-manipulation -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install ccashwell/evm-cortex oracle-manipulation --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/oracle-manipulation .agents/skills/oracle-manipulation && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "oracle-manipulation" agent skill from https://github.com/ccashwell/evm-cortex/tree/main/skills/oracle-manipulation into .agents/skills/oracle-manipulation/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "oracle-manipulation", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ccashwell/evm-cortex --skill oracle-manipulation -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install ccashwell/evm-cortex oracle-manipulation --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/oracle-manipulation .cursor/skills/oracle-manipulation && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "oracle-manipulation" agent skill from https://github.com/ccashwell/evm-cortex/tree/main/skills/oracle-manipulation into .cursor/skills/oracle-manipulation/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "oracle-manipulation", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/ccashwell/evm-cortex.git --path skills/oracle-manipulation--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add ccashwell/evm-cortex --skill oracle-manipulation -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install ccashwell/evm-cortex oracle-manipulation --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/oracle-manipulation .gemini/skills/oracle-manipulation && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "oracle-manipulation" agent skill from https://github.com/ccashwell/evm-cortex/tree/main/skills/oracle-manipulation into .gemini/skills/oracle-manipulation/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "oracle-manipulation", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install ccashwell/evm-cortex oracle-manipulationInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add ccashwell/evm-cortex --skill oracle-manipulation -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/oracle-manipulation .github/skills/oracle-manipulation && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "oracle-manipulation" agent skill from https://github.com/ccashwell/evm-cortex/tree/main/skills/oracle-manipulation into .github/skills/oracle-manipulation/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "oracle-manipulation", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ccashwell/evm-cortex --skill oracle-manipulation -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install ccashwell/evm-cortex oracle-manipulation --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/oracle-manipulation .opencode/skills/oracle-manipulation && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "oracle-manipulation" agent skill from https://github.com/ccashwell/evm-cortex/tree/main/skills/oracle-manipulation into .opencode/skills/oracle-manipulation/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "oracle-manipulation", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
oracle-manipulationOracle attack vectors and safe integration patterns for DeFi protocols.
Oracle Manipulation is an agent skill from ccashwell/evm-cortex. Oracle attack vectors and safe integration patterns for DeFi protocols. Use when integrating Chainlink, Uniswap TWAP, or any price oracle. Covers staleness checks, L2 sequencer downtime, sandwich oracle updates, and fallback strategies.
Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Business, Finance & HR, covering Third-party API integration and Crypto and DeFi analysis. It works with Uniswap. The repository describes itself as: Ethereum protocol engineering squad for AI coding assistants. The licence is MIT.
Read from SKILL.md and the folder at commit f8f3301. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are solidity).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Oracle Manipulation loads about 1.5k tokens when it runs. Until then it costs about 64 tokens; SKILL.md has 311 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from ccashwell/evm-cortex at commit f8f3301, republished under its MIT licence (© ccashwell). 311 words, ~1,518 tokens.
.claude/skills/oracle-manipulation/SKILL.md (or your agent's skills folder).Spot prices from DEXs (Uniswap V2 reserves, Curve pool balances) can be manipulated within a single transaction via flash loans.
// VULNERABLE: reads instantaneous reserves
function getPrice(address pair) external view returns (uint256) {
(uint112 reserve0, uint112 reserve1,) = IUniswapV2Pair(pair).getReserves();
return uint256(reserve1) * 1e18 / uint256(reserve0); // easily manipulated
}Never use spot prices for:
TWAPs average prices over a time window, making manipulation expensive (attacker must sustain the manipulated price across blocks).
import {OracleLibrary} from "@uniswap/v3-periphery/contracts/libraries/OracleLibrary.sol";
function getTWAP(
address pool,
address baseToken,
address quoteToken,
uint128 baseAmount,
uint32 twapWindow
) internal view returns (uint256 quoteAmount) {
if (twapWindow == 0) revert InvalidTwapWindow();
(int24 arithmeticMeanTick,) = OracleLibrary.consult(pool, twapWindow);
quoteAmount = OracleLibrary.getQuoteAtTick(
arithmeticMeanTick,
baseAmount,
baseToken,
quoteToken
);
}| Window | Security | Latency | Use Case |
|---|---|---|---|
| 1 min | Low | Low | Not recommended |
| 10 min | Medium | Medium | Fast-moving markets with monitoring |
| 30 min | High | High | Lending protocols, collateral valuation |
| 24 hr | Very high | Very high | Governance, long-term averaging |
Shorter windows are cheaper to manipulate. For lending protocols, use 30+ minutes.
Post-merge, a single validator can propose consecutive blocks. With 2+ consecutive slots, a validator can manipulate a short TWAP without competition.
Defense: Use longer TWAP windows (>30 min) or combine TWAP with Chainlink.
import {AggregatorV3Interface} from "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
error Oracle_StalePrice(address feed, uint256 updatedAt, uint256 maxAge);
error Oracle_InvalidRound(uint80 roundId, uint80 answeredInRound);
error Oracle_NegativePrice(int256 price);
error Oracle_SequencerDown();
error Oracle_GracePeriod();
uint256 public constant MAX_STALENESS = 3600; // 1 hour
function getChainlinkPrice(AggregatorV3Interface feed) internal view returns (uint256) {
(
uint80 roundId,
int256 answer,
,
uint256 updatedAt,
uint80 answeredInRound
) = feed.latestRoundData();
if (answer <= 0) revert Oracle_NegativePrice(answer);
if (updatedAt == 0) revert Oracle_StalePrice(address(feed), 0, MAX_STALENESS);
if (block.timestamp - updatedAt > MAX_STALENESS) {
revert Oracle_StalePrice(address(feed), updatedAt, MAX_STALENESS);
}
if (answeredInRound < roundId) {
revert Oracle_InvalidRound(roundId, answeredInRound);
}
return uint256(answer);
}Different feeds have different heartbeats. Match your staleness check to the feed's heartbeat.
| Feed | Heartbeat | Suggested MAX_STALENESS |
|---|---|---|
| ETH/USD (mainnet) | 1 hour | 3,600s |
| BTC/USD (mainnet) | 1 hour | 3,600s |
| USDC/USD | 24 hours | 86,400s |
| Low-cap tokens | Varies | Check feed docs |
On L2s (Arbitrum, Optimism), if the sequencer goes down and comes back up, stale prices may be used. Check the sequencer uptime feed.
AggregatorV3Interface public immutable SEQUENCER_UPTIME_FEED;
uint256 public constant GRACE_PERIOD = 3600; // 1 hour
function _checkSequencer() internal view {
(, int256 answer, , uint256 startedAt,) = SEQUENCER_UPTIME_FEED.latestRoundData();
// answer == 0: sequencer is up
// answer == 1: sequencer is down
if (answer != 0) revert Oracle_SequencerDown();
uint256 timeSinceUp = block.timestamp - startedAt;
if (timeSinceUp < GRACE_PERIOD) revert Oracle_GracePeriod();
}
function getPrice(AggregatorV3Interface feed) external view returns (uint256) {
_checkSequencer();
return getChainlinkPrice(feed);
}Attackers can watch the mempool for Chainlink oracle update transactions and sandwich them.
1. See Chainlink update TX that will change ETH price from $2000 to $2100
2. Front-run: open leveraged long position at $2000 price
3. Oracle update executes: price becomes $2100
4. Back-run: close position at $2100, profit from the price jumpDefense: Use time-delayed oracle consumption or spread oracle updates over multiple blocks.
function getPrice() external view returns (uint256 price) {
// Try Chainlink first
try this._getChainlinkPrice() returns (uint256 chainlinkPrice) {
return chainlinkPrice;
} catch {}
// Fallback to TWAP
try this._getTwapPrice() returns (uint256 twapPrice) {
return twapPrice;
} catch {}
revert Oracle_AllFeedsFailed();
}answeredInRound >= roundId check© ccashwell, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/oracle-manipulation of ccashwell/evm-cortex.
Open the folder on GitHubat commit f8f3301
Oracle Manipulation next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Oracle Manipulation this skillccashwell/evm-cortex | 131 | — | ~1.5k | Automated safety check: Pass | MIT | |
| Notebook To Strategytradingstrategy-ai/trade-executor | 160 | — | ~1.1k | Automated safety check: Pass | Custom licence | |
| Building Blocksaustintgriffith/ethskills | 294 | — | ~2.9k | Automated safety check: Pass | None | |
| Oracle Flashloan Analysisquillai-network/quillshield_skills | 129 | — | ~2.8k | Automated safety check: Pass | MIT | |
| Octav APIinternet-court/internet-court-skill | 6.4k | — | ~3.8k | Automated safety check: Pass | MIT | |
| Uniswap SwapNethereum/Nethereum | 2.3k | — | ~2.1k | Automated safety check: Pass | MIT |
tradingstrategy-ai/trade-executor
Transfer code from a backtesting Jupyter notebook to a Trade Executor strategy module
austintgriffith/ethskills
DeFi legos and protocol composability on Ethereum and L2s. An agent skill from austintgriffith/ethskills.
quillai-network/quillshield_skills
Detects price oracle manipulation and flash loan attack vectors in DeFi smart contracts.
internet-court/internet-court-skill
Integrate with Octav API for cryptocurrency portfolio tracking, transaction history, and DeFi analytics across 50+ blockchain networks.
Nethereum/Nethereum
Swap tokens on Uniswap V2/V3/V4 using Nethereum (.NET/C). An agent skill from Nethereum/Nethereum.
austintgriffith/ethskills
Verified contract addresses for major Ethereum protocols across mainnet and L2s.
ccashwell/evm-cortex
A skill your agent uses when preparing for a security audit, performing reconnaissance on a new codebase, or creating a protocol overview.
ccashwell/evm-cortex
A skill your agent uses when integrating with Aave V3 for lending, borrowing, flash loans, or building on top of Aave markets.
ccashwell/evm-cortex
Access control design patterns for Solidity protocols. An agent skill from ccashwell/evm-cortex.
ccashwell/evm-cortex
A skill your agent uses when running a local Ethereum node with Anvil.
ccashwell/evm-cortex
A skill your agent uses when performing systematic breadth-first review of all contracts during a security audit.
ccashwell/evm-cortex
A skill your agent uses when performing deep analysis of specific findings or high-risk areas during a security audit.
Works with
Categories
Oracle attack vectors and safe integration patterns for DeFi protocols. Oracle Manipulation is an agent skill from ccashwell/evm-cortex. Oracle attack vectors and safe integration patterns for DeFi protocols.
Oracle Manipulation fits situations like: integrating Chainlink; any price oracle.
Run `npx skills add ccashwell/evm-cortex --skill oracle-manipulation -a claude-code`. Or copy the skill folder (skills/oracle-manipulation in ccashwell/evm-cortex) into .claude/skills/oracle-manipulation in your project. Claude Code loads it when a task matches its description.
Run `npx skills add ccashwell/evm-cortex --skill oracle-manipulation -a codex`. Or copy the skill folder (skills/oracle-manipulation in ccashwell/evm-cortex) into .agents/skills/oracle-manipulation in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ccashwell/evm-cortex --skill oracle-manipulation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/oracle-manipulation, .gemini/skills/oracle-manipulation, .github/skills/oracle-manipulation and .opencode/skills/oracle-manipulation in your project.
SKILL.md names no scripts, command-line tools or credentials: Oracle Manipulation is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Oracle Manipulation is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.5k tokens (SKILL.md is roughly 6.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Oracle Manipulation: Notebook To Strategy (tradingstrategy-ai/trade-executor, 160 stars), Building Blocks (austintgriffith/ethskills, 294 stars), Oracle Flashloan Analysis (quillai-network/quillshield_skills, 129 stars) and Octav API (internet-court/internet-court-skill, 6.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
ccashwell (a GitHub user) maintains it in ccashwell/evm-cortex, which has 131 GitHub stars. The repository holds 89 skills in this directory. The repository was last updated on September 30, 2026.
Source: ccashwell/evm-cortex on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.