feat: historical asset pricing tool#214
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Resolves assets via AssetService search -> CAIP-19 -> CoinGecko ID, fetches market_chart/range per coin in parallel, downsamples, and returns start/end prices with percent change. Uses partial success pattern where individual asset failures don't fail the batch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…data Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Mock.module for @shapeshiftoss/utils was leaking into evmParser tests, removing AssetService.getIcon. Now mocking only the local helper module. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Disabled knowledge base sources:
📝 WalkthroughWalkthroughThe PR adds a new getHistoricalPrices tool (schema, execution, CoinGecko range API integration, downsampling, results/errors), exports the new tool, introduces asset-resolution helpers and CoinGecko types, adds tests, removes numerous debug logs across many tools, tweaks two UI components, and adds three bug-report tickets. Changes
Sequence DiagramsequenceDiagram
actor User
participant Tool as getHistoricalPrices Tool
participant AssetSvc as Asset Service
participant CoinGecko as CoinGecko API
participant Processor as Downsample/Processor
User->>Tool: request(assets, startDate, endDate, dataPoints)
Tool->>Tool: validate input (Zod)
loop per asset
alt input.assetId
Tool->>AssetSvc: getAssetMeta(assetId)
else input.searchTerm
Tool->>AssetSvc: searchAsset(searchTerm)
end
AssetSvc-->>Tool: assetId, symbol, name, coinGeckoId?
end
par parallel fetches
loop per resolved asset
Tool->>CoinGecko: getMarketChartRange(coinGeckoId, from, to)
CoinGecko-->>Tool: market chart response
end
end
loop per response
Tool->>Processor: downsample(prices, dataPoints)
Processor-->>Tool: sampled points
Tool->>Tool: compute startPrice, endPrice, percentChange
end
Tool-->>User: results[] (successes and per-asset errors)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add px-4 pb-4 padding to ErrorFooter in Execution.tsx so error text aligns with the stepper content above it. Create tickets for parallel swap execution failures (sa-qczu) and transaction history misclassification (sa-besp). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
getHistoricalPricestool that fetches historical price data from CoinGecko'smarket_chart/rangeendpoint for one or more assets over a date range{assetId?, searchTerm?, network?}input pattern asgetAssetPrices, plusstartDate,endDate, anddataPoints(1-30, default 2)startPrice,endPrice, andpercentChange— enables questions like "what was ETH worth 2 months ago?" or "how much has BTC grown since January?"Test plan
downsampleutility (edge cases: empty, single element, boundary values)getHistoricalPricestool (schema validation, happy path, partial failure, API errors, empty data, parallel fetching, single data point)getHistoricalPrices🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
UI Improvements
Documentation
Tests