Mikael BergandPaperclip 970f1f1395 docs: revise infra recommendation — self-hosted own hardware, not cloud VPS
Board clarified all silicon should run on own infrastructure, not cloud/VPS.
Updated node-vs-api.md and infra-cost.md to reflect:
- Production recommendation: BCHN + Fulcrum on own hardware (~$0-7/month marginal)
- Hardware requirements: 4 cores, 8 GB RAM, 500 GB SSD minimum
- BCH bandwidth is ~2-5 GB/month (much lighter than BTC)
- Cloud/VPS figures retained as reference-only fallback ceiling

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-17 16:23:31 +00:00

using-cash-spike

BCH engineering spike for using.cash — evaluates BCH node/API options, transaction ingestion, and price oracle.

Spike Goals

  1. Repo + node/API evaluation — PRO-61
  2. xpub transaction ingestion — PRO-62
  3. Historical price oracle — PRO-63

Price Oracle (src/price-oracle.ts)

BCH/USD historical price oracle. Accepts a block timestamp (Unix epoch or ISO date) and returns the BCH/USD spot price from multiple sources with variance comparison.

Sources Evaluated

Source Status Key Required Coverage
CoinGecko Works (with key) Yes — free Demo key BCH from 2017-08
CryptoCompare Works (no key) No BCH from 2017
Binance BCHUSDT Works (no key) No BCH from 2018-03
Messari Deprecated N/A data.messari.io → 404

Quick Start

# Single date lookup
node --experimental-strip-types src/price-oracle.ts 2023-01-15

# Multiple dates
node --experimental-strip-types src/price-oracle.ts 2021-05-10 2022-12-30 2024-03-15

# Full demo with variance table and recommendation
node --experimental-strip-types src/demo.ts

# With CoinGecko enabled (free Demo key from coingecko.com/en/api)
COINGECKO_API_KEY=your_key node --experimental-strip-types src/demo.ts

Demo Output (verified 2026-05-17)

BCH/USD Historical Price Comparison

Date          CoinGecko        CC   Binance   MaxVar%  Note
------------------------------------------------------------
2018-11-20          N/A   $218.34       N/A       N/A
2019-12-15          N/A   $207.20   $206.88    0.155%  ok
2021-05-10          N/A  $1321.91  $1321.31    0.045%  ok
2022-12-30          N/A    $96.62    $96.80    0.186%  ok
2024-03-15          N/A   $416.65   $416.70    0.012%  ok

Avg CryptoCompare vs Binance variance: 0.0995%
Max variance: 0.1861% — no dates exceeded the 1% threshold

Production Recommendation

Strategy: CoinGecko primary → CryptoCompare fallback → Binance fallback

  1. CoinGecko (primary): industry standard for FMV/accounting; requires free Demo API key (~30 req/min)
  2. CryptoCompare (fallback A): verified free, no key needed, full coverage from 2017, <0.2% divergence from Binance
  3. Binance BCHUSDT (fallback B): highest-volume exchange, free, no key, coverage from 2018-03

Cache by date (YYYY-MM-DD). Store prices as NUMERIC(20,8).

API

import { compareSourcesForTimestamps, printVarianceTable } from './src/price-oracle.ts';

const rows = await compareSourcesForTimestamps([
  '2023-01-15',
  1684368000,   // Unix epoch seconds also accepted
]);
printVarianceTable(rows);
// rows[0].cryptocompare → BCH/USD close price for that date
// rows[0].flagged       → true if any source pair differs >1%

Environment Variables

Variable Purpose
COINGECKO_API_KEY CoinGecko Demo or Pro API key (enables CoinGecko source)
CRYPTOCOMPARE_API_KEY CryptoCompare API key (raises rate limit)
S
Description
BCH xpub transaction ingestion spike — watch address, capture on confirmation
Readme
1.7 MiB
Languages
TypeScript 100%