redstone

Integrate RedStone oracle price feeds into EVM smart contracts using Pull, Push, and RedStone X models.

6|20|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/andresdefi/cryptoskills --skill redstone-andresdefi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: redstone
Source: https://github.com/andresdefi/cryptoskills/tree/main/skills/redstone
Command: npx skills add https://github.com/andresdefi/cryptoskills --skill redstone-andresdefi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @redstone-finance/evm-connector, @redstone-finance/protocol, @redstone-finance/sdk, ethers, viem, and includes references (resource) components.

What problem does it solve? AI agents frequently produce incorrect RedStone integrations: they treat the Pull model like Chainlink push feeds, forget to wrap transactions with the EVM Connector SDK, mishandle bytes32 feed IDs, or misconfigure signer thresholds, causing reverts like CalldataMustHaveValidPayload and InsufficientNumberOfUniqueSigners. ## Core Features & Use Cases - Pull Model Integration: Build contracts inheriting RedstoneConsumerNumericBase that extract signed price data from transaction calldata, with frontend wrapping via WrapperBuilder from @redstone-finance/evm-connector. - Push Model & Chainlink Compatibility: Read RedStone push feeds through the standard AggregatorV3Interface with staleness, round, and decimal validation, including dual-oracle fallback patterns. - RedStone X Frontrunning Protection: Implement two-phase commit execution where users submit intents and keepers execute with post-intent price data, plus custom data feeds with whitelisted signers and custom timestamp validation. - Use Case: Build a lending vault that prices collateral on-demand via RedStone Pull, a limit order book protected from oracle frontrunning via RedStone X, or a custom data service for proprietary off-chain metrics. ## Quick Start Use the redstone skill to write a Solidity contract that reads ETH and BTC prices via the RedStone Pull model along with the frontend wrapping code.

Frequently Asked Questions about redstone

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate RedStone Pull oracle into a Solidity contract?

Inherit RedstoneConsumerNumericBase from @redstone-finance/evm-connector and call getOracleNumericValueFromTxMsg with a bytes32 feed ID like bytes32("ETH"). On the frontend, wrap every price-reading transaction with WrapperBuilder.wrap(contract).usingDataService() to attach signed price data to the calldata.

What is the difference between RedStone Pull and Push models?

Pull delivers signed price data in transaction calldata on-demand with no on-chain storage cost, while Push stores prices on-chain via Chainlink-compatible AggregatorV3Interface feeds updated on a heartbeat. Use Pull for cheaper gas and freshness, Push for composability with existing Chainlink consumers.

Why does my RedStone transaction revert with CalldataMustHaveValidPayload?

The transaction was sent without RedStone price data attached to the calldata. Wrap the ethers.js contract instance with WrapperBuilder from @redstone-finance/evm-connector before sending, and ensure dataPackagesIds includes every feed the contract reads.

How does RedStone X prevent oracle frontrunning?

RedStone X splits execution into two phases: users submit an intent in phase 1, then a keeper executes in a later block with price data timestamped after the submission. Since the user cannot know the execution price when submitting, frontrunning the oracle update is impossible.

What decimals do RedStone price feeds use?

RedStone USD-denominated feeds return uint256 values with 8 decimals, matching Chainlink conventions, so ETH at $3,000 returns 300000000000. Cross-pair feeds like stETH/ETH use 18 decimals. Always verify with the feed's decimals() function for push feeds.

How do I test RedStone Pull contracts in Foundry?

Create a test harness contract that inherits your consumer and overrides getOracleNumericValueFromTxMsg to return a mock price. Unit tests have no frontend to attach calldata, so the harness bypasses signature validation while preserving your contract's business logic.