Skip to content

v0.0.4

Yahoo crypto history and crypto portfolios: a daily backfill pairs coins with Yahoo and fills missing bars, CoinGecko and Yahoo bars line up by session, and Users can record trades and read positions and portfolio value as Datasets.

New

  • History backfill (cointoss.backfill): cointoss backfill [--days N] and a backfill node fill every date with no stored bar, from CoinGecko's market_chart (up to 365 days) and from Yahoo (full history) for coins paired with Yahoo. Existing bars are never overwritten. A coin is paired by its YAHOO_PAIRS entry, then {SYMBOL}-USD, then Yahoo search for suffixed tickers such as UNI7083-USD; a ticker is accepted only when its closes are within 3% median of CoinGecko's over the last 30 shared sessions. Unpaired coins are retried on the next run. Runs on its own trigger, daily_backfill, suggested at 0 1 * * *, taking the sweep lock only for each write.
  • Portfolios (cointoss.portfolio, ADR-0001 amendment): a Portfolio is owned by one User and holds single-leg Trades in UTC with a signed quantity and optional USD cost. Trades are voided, never edited or deleted. Positions are derived on read, with average cost reset when a position closes and none while short.
  • Portfolio writes: JSON-RPC create_portfolio, add_trade, void_trade, and CLI cointoss portfolio create, cointoss trade add, cointoss trade void, which work against a remote instance through --url/$COINTOSS_URL and --token/$COINTOSS_TOKEN. They need the new portfolio Role (call cointoss.portfolio). A traded coin joins the portfolio-held universe, so the sweep prices it even outside the top 100.
  • Portfolio Datasets (cointoss.datasets, ADR-0010 amendment): trades, positions and portfolio_value, each showing only the caller's own portfolios. A position with no close on a date is valued null.
  • Automatic copy before migrating (cointoss.store): opening a database at an older schema version first copies it to cointoss.db.v<old>-<UTC time>.bak beside itself.

Changed

  • Session Offset (cointoss.store, ADR-0009 amendment): resolved bars are dated by the session they close. CoinGecko's bar stamped D+1 is now read as the close of D, so the bars and returns Datasets and every resolved read shift CoinGecko-sourced dates back one day. Stored bars are unchanged.
  • Schema version 2: adds the Portfolio and Trade tables. The first open by v0.0.4 migrates the file, after the automatic copy above.
  • Existing woodglue.yaml: add the daily_backfill trigger and the portfolio Role by hand; cointoss init prints the snippets when they are missing.
  • portfolio-held is a reserved universe name; declaring it in cointoss.yaml is refused.
  • The sweep fetches universe Inclusions missing from CoinGecko's markets listing by id.

Fixes

  • A negative CoinGecko volume or market cap is read as absent instead of failing the bar.
  • An unknown Yahoo ticker is reported as no such ticker instead of a pandas error.

Documentation

  • README: a new Upgrade section on schema versions, migration and the automatic copy.
  • Glossary: Session Offset, Void, Portfolio-held. Road map: steps 6 and 7 done; stocks deferred to step 8.

Decisions and tickets

Amended ADRs:

Closed:

  • 26 History backfill: CoinGecko market_chart and Yahoo crypto history, filling dates with no stored bar

  • 31 Session Offset: align CoinGecko and Yahoo crypto bars on read

  • 32 Portfolio storage: Portfolio and Trade tables, positions on read

  • 33 Portfolio writes: JSON-RPC methods and CLI, portfolio-held universe

  • 34 Portfolio datasets: trades, positions, portfolio_value

  • 35 Yahoo: report an unknown ticker as 'no such ticker'

  • 36 Yahoo pairing: find suffixed tickers (UNI7083-USD) and look at SHIB