{"owner":"genesiscode2026","slug":"icp-multi-exchange-price-oracle","channel":"genesiscode2026/icp-multi-exchange-price-oracle","version":"1.0.0","artifact_sha256":"8ff0ea5b8687820bce04f272e3141d59f2f70e292053c2b35d63ed6c4a0a20e7","published_at":"2026-09-16T21:19:24.610Z","price_micro":"249000000","update_price_micro":"59000000","resource_endpoint":"https://x402git.com/api/r/genesiscode2026/icp-multi-exchange-price-oracle","version_url":"https://x402git.com/api/v/genesiscode2026/icp-multi-exchange-price-oracle","computed":{"artifact_class":"Pack","component_inventory":[{"kind":"source","count":1},{"kind":"tests","count":1},{"kind":"docs","count":12},{"kind":"config","count":5},{"kind":"assets","count":1},{"kind":"other","count":1}],"file_count":21,"dir_depth":1,"bytes_text":69976,"bytes_binary":1359,"languages":{"Rust":26798},"tree":[{"path":".gitignore","size":25,"binary":false},{"path":"AGENT_EVAL.md","size":1231,"binary":false},{"path":"ARCHITECTURE.md","size":2704,"binary":false},{"path":"CHANGELOG.md","size":503,"binary":false},{"path":"Cargo.lock","size":20781,"binary":false},{"path":"Cargo.toml","size":369,"binary":false},{"path":"DEPENDENCIES.md","size":399,"binary":false},{"path":"LICENSE.md","size":1660,"binary":false},{"path":"LIMITATIONS.md","size":794,"binary":false},{"path":"PREVIEW.md","size":2253,"binary":false},{"path":"QUICKSTART.md","size":1343,"binary":false},{"path":"README.md","size":3639,"binary":false},{"path":"SECURITY.md","size":1567,"binary":false},{"path":"SUPPORT.md","size":624,"binary":false},{"path":"TEST_REPORT.md","size":1476,"binary":false},{"path":"VERIFICATION.md","size":376,"binary":false},{"path":"candid/market_oracle.did","size":1359,"binary":true},{"path":"commercial-manifest.json","size":1215,"binary":false},{"path":"dfx.json","size":254,"binary":false},{"path":"release-manifest.json","size":1965,"binary":false},{"path":"src/lib.rs","size":26798,"binary":false}],"readme_html":"<h2>ICP Multi-Exchange Price Oracle Canister</h2>\n<blockquote><p><strong>Multi-Venue Spot Market Data &amp; Candlestick Oracle for the Internet Computer</strong></p></blockquote>\n<p><img src=\"https://img.shields.io/badge/tests-10%20passed-brightgreen.svg\" alt=\"Tests\" loading=\"lazy\" decoding=\"async\" /> <img src=\"https://img.shields.io/badge/target-wasm32--unknown--unknown-blue.svg\" alt=\"Target\" loading=\"lazy\" decoding=\"async\" /> <img src=\"https://img.shields.io/badge/license-Commercial%20Source-blue.svg\" alt=\"License\" loading=\"lazy\" decoding=\"async\" /></p>\n<hr />\n<h3>1. WHAT IS THIS?</h3>\n<p>The <strong>ICP Multi-Exchange Price Oracle Canister</strong> is a production-ready Rust smart contract for the Internet Computer (ICP). It fetches, validates, normalizes, and caches real-time and historical candlestick (OHLCV) market data from three Tier-1 exchanges (Binance, Coinbase, OKX) via deterministic HTTPS outcalls, serving queries to frontend clients with zero cycle fees.</p>\n<h3>2. WHO IS IT FOR?</h3>\n<ul><li><strong>Web3 DeFi &amp; DEX Developers:</strong> Needing validated multi-timeframe OHLCV bars and multi-exchange spread data for interactive charting and on-chain trade logic.</li><li><strong>DAO Treasuries:</strong> Requiring automated asset valuation without recurring third-party oracle subscription fees.</li><li><strong>Canister Architects:</strong> Requiring a secure reference implementation for rate-limited, single-flight HTTPS outcalls with cycle reserve protection.</li></ul>\n<h3>3. WHAT PROBLEM DOES IT SOLVE?</h3>\n<p>The official DFINITY Exchange Rate Canister (XRC) provides single spot price cross-rates but has structural limitations for interactive applications:</p>\n<ol><li><strong>Cycles Attached on Query:</strong> XRC requires the caller to attach cycles to every query call, making direct, unauthenticated frontend web client queries impossible.</li><li><strong>No Candlestick (OHLCV) Series:</strong> XRC returns a single spot price; it does not aggregate, normalize, or cache multi-timeframe OHLCV series required for charting.</li><li><strong>Black-Box Aggregation:</strong> XRC hides individual exchange order-book/candle provenance.</li><li><strong>Bankruptcy Risk:</strong> Naive outcall loops can rapidly exhaust a canister cycle balance during upstream network disruptions.</li></ol>\n<h3>4. WHY PAY FOR IT INSTEAD OF BUILDING IT?</h3>\n<ul><li><strong>Free Client Queries:</strong> An in-canister RAM cache serves authenticated query calls (<code>cached_market_data</code>) to browser frontends at zero cycle cost to the user.</li><li><strong>Full OHLCV Candlestick Parsing:</strong> Parses and normalizes native candlestick streams across M1, M5, M15, H1, H4, D1, W1 timeframes.</li><li><strong>Multi-Exchange Transparency:</strong> Queries Binance, Coinbase, and OKX concurrently, returning validated series and provenance alongside explicit failure tracking for each venue.</li><li><strong>100 Billion Cycle Reserve Protection:</strong> Automatically aborts outcalls if canister reserves drop below 100B cycles (~0.1 TC), preventing canister freeze.</li><li><strong>Single-Flight Coalescing:</strong> Concurrent requests for the same asset/timeframe share an in-flight promise to eliminate duplicate outcall expenses.</li></ul>\n<h3>5. WHAT IS VERIFIED?</h3>\n<ul><li><strong>10 / 10 Automated Rust Unit Tests Passed:</strong> OHLCV validation, duplicate timestamp rejection, negative/zero price rejection, case-insensitive asset normalization, boundary calculation, and exchange parser error handling.</li><li><strong>WASM Compilation:</strong> Compiles to optimized <code>wasm32-unknown-unknown</code> canister binary.</li><li><strong>Candid Interface:</strong> Fully verified Candid contract (<code>candid/market_oracle.did</code>).</li></ul>\n<h3>6. HOW DO I RUN IT?</h3>\n<pre><code class=\"language-bash\"># 1. Run unit tests\ncargo test --manifest-path Cargo.toml\n\n# 2. Build optimized canister WASM\ncargo build --manifest-path Cargo.toml --target wasm32-unknown-unknown --release\n\n# 3. Deploy locally with dfx\ndfx start --background\ndfx deploy market_oracle\ndfx canister call market_oracle refresh_market_data &#39;(record { asset = &quot;BTC&quot;; timeframe = variant { H1 }; limit = 20 })&#39;\n</code></pre>","dependencies":[],"licence":{"verdict":"manual"},"scan":{"verdict":"pass","scanner_version":"2026.09.1","at":"2026-09-16T21:19:27.571Z","checks":[{"id":"secrets","tool":"x402git/secrets","tool_version":"2026.09.1","status":"pass","at":"2026-09-16T21:19:27.571Z","findings":0},{"id":"limits","tool":"x402git/limits","tool_version":"2026.09.1","status":"pass","at":"2026-09-16T21:19:27.571Z","findings":0},{"id":"known_vulns","tool":"osv.dev","tool_version":"2026-09-16","status":"pass","at":"2026-09-16T21:19:27.571Z","findings":0,"packages":5},{"id":"known_malware","tool":"osv.dev/MAL","tool_version":"2026-09-16","status":"pass","at":"2026-09-16T21:19:27.571Z","findings":0,"packages":5},{"id":"dep_behaviour","tool":"socket.dev","tool_version":"2026-09-16","status":"findings","at":"2026-09-16T21:19:27.571Z","findings":108,"packages":89},{"id":"capabilities","tool":"x402git/caps","tool_version":"2026.09.1","status":"findings","at":"2026-09-16T21:19:27.571Z","findings":4},{"id":"injection","tool":"x402git/inject","tool_version":"2026.09.1","status":"pass","at":"2026-09-16T21:19:27.571Z","findings":0}],"findings":[{"kind":"capability","check":"capabilities","tier":"disclosed","rule_id":"host","severity":"LOW","description":"Talks to api.coinbase.com","path":"src/lib.rs"},{"kind":"capability","check":"capabilities","tier":"disclosed","rule_id":"host","severity":"LOW","description":"Talks to data-api.binance.vision","path":"src/lib.rs"},{"kind":"capability","check":"capabilities","tier":"disclosed","rule_id":"host","severity":"LOW","description":"Talks to github.com","path":"Cargo.lock"},{"kind":"capability","check":"capabilities","tier":"disclosed","rule_id":"host","severity":"LOW","description":"Talks to www.okx.com","path":"src/lib.rs"},{"kind":"behaviour","check":"dep_behaviour","tier":"disclosed","rule_id":"envVars","severity":"LOW","description":"futures 0.3.34 (direct) — reads environment variables","package":{"ecosystem":"cargo","name":"futures","version":"0.3.34","direct":true,"dev":false},"source":"socket.dev"},{"kind":"behaviour","check":"dep_behaviour","tier":"disclosed","rule_id":"envVars","severity":"LOW","description":"serde 1.0.229 (direct) — reads environment variables","package":{"ecosystem":"cargo","name":"serde","version":"1.0.229","direct":true,"dev":false},"source":"socket.dev"},{"kind":"behaviour","check":"dep_behaviour","tier":"disclosed","rule_id":"filesystemAccess","severity":"LOW","description":"serde 1.0.229 (direct) — reads or writes files","package":{"ecosystem":"cargo","name":"serde","version":"1.0.229","direct":true,"dev":false},"source":"socket.dev"},{"kind":"behaviour","check":"dep_behaviour","tier":"disclosed","rule_id":"hasNativeCode","severity":"MODERATE","description":"serde 1.0.229 (direct) — ships compiled native code","package":{"ecosystem":"cargo","name":"serde","version":"1.0.229","direct":true,"dev":false},"source":"socket.dev"},{"kind":"behaviour","check":"dep_behaviour","tier":"disclosed","rule_id":"installScripts","severity":"MODERATE","description":"serde 1.0.229 (direct) — install scripts run when installed","package":{"ecosystem":"cargo","name":"serde","version":"1.0.229","direct":true,"dev":false},"source":"socket.dev"},{"kind":"behaviour","check":"dep_behaviour","tier":"disclosed","rule_id":"envVars","severity":"LOW","description":"serde_json 1.0.151 (direct) — reads environment variables","package":{"ecosystem":"cargo","name":"serde_json","version":"1.0.151","direct":true,"dev":false},"source":"socket.dev"},{"kind":"behaviour","check":"dep_behaviour","tier":"disclosed","rule_id":"hasNativeCode","severity":"MODERATE","description":"serde_json 1.0.151 (direct) — ships compiled native code","package":{"ecosystem":"cargo","name":"serde_json","version":"1.0.151","direct":true,"dev":false},"source":"socket.dev"},{"kind":"behaviour","check":"dep_behaviour","tier":"disclosed","rule_id":"installScripts","severity":"MODERATE","description":"serde_json 1.0.151 (direct) — install scripts run when installed","package":{"ecosystem":"cargo","name":"serde_json","version":"1.0.151","direct":true,"dev":false},"source":"socket.dev"},{"kind":"behaviour","check":"dep_behaviour","tier":"review","rule_id":"gptSecurity","severity":"MODERATE","description":"block-buffer 0.10.4 (transitive) — flagged for review by Socket's classifier as a security risk","package":{"ecosystem":"cargo","name":"block-buffer","version":"0.10.4","direct":false,"dev":false},"source":"socket.dev"},{"kind":"behaviour","check":"dep_behaviour","tier":"disclosed","rule_id":"mediumCVE","severity":"MODERATE","description":"block-buffer 0.10.4 (transitive) — has a known vulnerability GHSA-qwgh-2vcv-g2f7","package":{"ecosystem":"cargo","name":"block-buffer","version":"0.10.4","direct":false,"dev":false},"advisory_ids":["GHSA-qwgh-2vcv-g2f7"],"source":"socket.dev"},{"kind":"behaviour","check":"dep_behaviour","tier":"review","rule_id":"gptAnomaly","severity":"LOW","description":"flagged for review by Socket's classifier in 2 transitive packages","source":"socket.dev","aggregate":{"packages":2,"examples":["anyhow@1.0.104","num-bigint@0.4.8"]}},{"kind":"behaviour","check":"dep_behaviour","tier":"disclosed","rule_id":"hasNativeCode","severity":"MODERATE","description":"hasNativeCode in 22 transitive packages","source":"socket.dev","aggregate":{"packages":22,"examples":["anyhow@1.0.104","ar_archive_writer@0.5.3","binrw@0.15.2"]}},{"kind":"behaviour","check":"dep_behaviour","tier":"disclosed","rule_id":"installScripts","severity":"MODERATE","description":"installScripts in 22 transitive packages","source":"socket.dev","aggregate":{"packages":22,"examples":["anyhow@1.0.104","autocfg@1.5.1","binrw@0.15.2"]}},{"kind":"behaviour","check":"dep_behaviour","tier":"disclosed","rule_id":"shellAccess","severity":"MODERATE","description":"shellAccess in 7 transitive packages","source":"socket.dev","aggregate":{"packages":7,"examples":["autocfg@1.5.1","darling_core@0.20.11","libc@0.2.189"]}},{"kind":"behaviour","check":"dep_behaviour","tier":"disclosed","rule_id":"networkAccess","severity":"MODERATE","description":"networkAccess in 3 transitive packages","source":"socket.dev","aggregate":{"packages":3,"examples":["arrayvec@0.5.2","object@0.39.1","quote@1.0.47"]}},{"kind":"behaviour","check":"dep_behaviour","tier":"disclosed","rule_id":"envVars","severity":"LOW","description":"envVars in 27 transitive packages","source":"socket.dev","aggregate":{"packages":27,"examples":["anyhow@1.0.104","ar_archive_writer@0.5.3","autocfg@1.5.1"]}},{"kind":"behaviour","check":"dep_behaviour","tier":"disclosed","rule_id":"filesystemAccess","severity":"LOW","description":"filesystemAccess in 13 transitive packages","source":"socket.dev","aggregate":{"packages":13,"examples":["ar_archive_writer@0.5.3","autocfg@1.5.1","either@1.18.0"]}},{"kind":"behaviour","check":"dep_behaviour","tier":"disclosed","rule_id":"urlStrings","severity":"LOW","description":"urlStrings in 2 transitive packages","source":"socket.dev","aggregate":{"packages":2,"examples":["libc@0.2.189","unicode-width@0.2.2"]}}],"capabilities":{"tools":[],"runs":[],"hosts":[{"host":"api.coinbase.com","local":false,"from":"code","paths":["src/lib.rs"]},{"host":"data-api.binance.vision","local":false,"from":"code","paths":["src/lib.rs"]},{"host":"github.com","local":false,"from":"code","paths":["Cargo.lock"]},{"host":"www.okx.com","local":false,"from":"code","paths":["src/lib.rs"]},{"host":"ic0.app","local":false,"from":"docs","paths":["QUICKSTART.md"]},{"host":"img.shields.io","local":false,"from":"docs","paths":["README.md"]},{"host":"internetcomputer.org","local":false,"from":"docs","paths":["QUICKSTART.md"]}],"env":[],"install_runs":false,"summary":"talks to 4 hosts · links to 3 hosts in its docs · nothing runs at install"},"counts":{"blocking":0,"disclosed":109,"review":3}},"originality":{"blob_overlap_ratio":0.05,"blobs_seen_elsewhere":1,"blobs_total":20,"nearest_listing":"genesiscode2026/agent-workspace-guard-sdk","derivative_of":null},"engineering":{"unique_5gram_ratio":0.544,"type_token_ratio":0.358,"effective_code_lines":445,"effective_doc_words":1802,"code_files":1,"test_files":1,"padding_suspected":true,"class_note":"Capped at Pack: unique 5-gram ratio 0.544 is below the 0.6 guard."},"cadence":{"releases":0,"median_days_between_releases":null,"on_time_fraction":null,"days_since_last":null,"score":null,"finished":false},"inventory_sentence":"1 source file · 1 test file · 12 docs · 5 config files","extensions":{"md":13,"rs":1,"did":1,"json":3,"lock":1,"toml":1,"(none)":1},"lines_of_code":817,"warnings":["sbom_unavailable"],"repo_meta":{"repo_id":1372978805,"name":"icp-multi-exchange-price-oracle","full_name":"genesiscode2026/icp-multi-exchange-price-oracle","description":"Rust/ICP multi-exchange price oracle with Binance, Coinbase and OKX HTTPS outcalls, provenance and validation safeguards.","homepage":null,"topics":["defi","icp","internet-computer","market-data","oracle","rust"],"language":"Rust","default_branch":"main","size_kb":24,"created_at":"2026-09-16T12:09:16Z","pushed_at":"2026-09-16T12:09:21Z","licence_spdx":null,"open_issues":null,"stars":null,"forks":null,"watchers":null,"archived":false,"private":true,"html_url":null},"owner":{"login":"genesiscode2026","name":null,"avatar_url":"https://avatars.githubusercontent.com/u/329895054?v=4","bio":null,"blog":null,"company":null,"location":null,"twitter_username":null,"followers":null,"public_repos":1,"created_at":"2026-09-16T08:01:39Z","html_url":"https://github.com/genesiscode2026"},"computed_at":"2026-09-16T21:19:36.687Z","analyzer_version":"0.1.0"},"self_reported":{"description":"Rust/ICP multi-exchange price oracle with Binance, Coinbase and OKX HTTPS outcalls, provenance and validation safeguards.","trigger_hint":"When requiring verified ICP / Market Data functionality in autonomous workflows"}}