malkhut: three-layer identifier architecture for cross-system asset identification
Layer 1 (canonical identity): symbol, base_asset, name, unified_symbol (CCXT format), quote_currency Layer 2 (cross-system): coingecko_id, cmc_id, blockchain, contract_address Layer 3 (exchange mapping): exchanges tuple All 13 pre-defined assets migrated with accurate CoinGecko IDs, CMC IDs, blockchains, and contract addresses (ERC-20 tokens). 7 new query functions: get_asset_by_coingecko_id, get_asset_by_cmc_id, get_assets_by_base_asset, get_assets_by_blockchain, get_assets_by_unified_symbol. 33 new tests covering: Layer 1 identity, Layer 2 cross-system identifiers, identifier query functions, identifier consistency (uniqueness, derivation), exchange registry. Total: 1189 tests, 47 files, all green. Based on research: CCXT BASE/QUOTE is de facto standard, CoinGecko ID most widely used in crypto-native, ISO 24165 DTI emerging, FIGI for institutional.
This commit is contained in:
@@ -398,7 +398,7 @@ simple doctrinal tick-exits (C11) ship first via T19 step 3; MALKHUT supersedes
|
||||
|
||||
## DEVELOPMENT STATUS (2026-07-11)
|
||||
|
||||
**1156 test functions. 47 test files. All green. 0 failures. 0 regressions.**
|
||||
**1189 test functions. 47 test files. All green. 0 failures. 0 regressions.**
|
||||
|
||||
### Completed subsystems
|
||||
|
||||
@@ -620,15 +620,23 @@ Regimes: `trending_up`, `trending_down`, `high_volatility`, `low_volatility`,
|
||||
|
||||
Multi-label asset classification using **only invariant characteristics** — properties
|
||||
intrinsic to the token that predict price behaviour and order-book performance.
|
||||
**Three-layer identifier architecture** for cross-system interoperability.
|
||||
|
||||
**Design principle:** Classify by WHAT an asset IS (fundamental), not how it's trading
|
||||
right now. Volatility/liquidity appear as long-run statistical profiles, not as
|
||||
classification axes that change minute-to-minute.
|
||||
|
||||
**Industry alignment:** CoinGecko/CMC use multi-tag taxonomy (ETH = "Smart Contracts" +
|
||||
"SEC/CFTC Token Taxonomy"). BNB = "CEX Token" + "Smart Contracts" + "Layer 1". Our
|
||||
system matches this: Sector and TokenRole are tuples (multi-label), first element =
|
||||
primary label for backward compatibility.
|
||||
#### Three-Layer Identifier Architecture
|
||||
|
||||
| Layer | Fields | Purpose | Example |
|
||||
|-------|--------|---------|---------|
|
||||
| **1. Canonical** | `symbol`, `base_asset`, `name`, `unified_symbol`, `quote_currency` | Venue-independent identity | BTCUSDT / BTC / "Bitcoin" / BTC/USDT / USDT |
|
||||
| **2. Cross-system** | `coingecko_id`, `cmc_id`, `blockchain`, `contract_address` | Data provider + on-chain mapping | "bitcoin" / 1 / "ethereum" / "" |
|
||||
| **3. Exchange mapping** | `exchanges: tuple[str, ...]` | Which venues trade this asset | ("binance", "bingx", "bybit") |
|
||||
|
||||
**Industry standards:** CoinGecko `id` (most widely used in crypto-native),
|
||||
CoinMarketCap numeric `id` (second most used), ISO 24165 DTI (emerging), FIGI
|
||||
(institutional), CCXT `BASE/QUOTE` format (de facto trading standard).
|
||||
|
||||
#### Fundamental Dimensions (intrinsic, never change)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user