Currency Amount (Cryptocurrency)
finance.currency.amount_cryptoCryptocurrency amount with ticker symbol suffix. Supports high-precision decimals (up to 8+ decimal places). Common in exchange exports and portfolio tracking data.
Worked samples
DuckDB 1.5.5 · finetype 0.6.64
| Value | As VARCHAR | numeric_value | ticker |
|---|---|---|---|
| 0.00123456 BTC | 0.00123456 | 0.00123456 | BTC |
| 1.50000000 ETH | 1.50000000 | 1.50000000 | ETH |
| 100.00 USDT | 100.00000000 | 100.00000000 | USDT |
| 0.025 BTC | 0.02500000 | 0.02500000 | BTC |
Shape
^-?[0-9]+\.?[0-9]*\s?[A-Z]{2,5}$| Value | Length | Shape |
|---|---|---|
| 0.00123456 BTC | 14 | matches |
| 1.50000000 ETH | 14 | matches |
| 100.00 USDT | 11 | matches |
| 0.025 BTC | 9 | matches |
| 0.00123456 btc | 14 | rejected: lower-cased |
Background
Origin
FineType defines this type itself, as a cryptocurrency amount with a ticker symbol suffix.[1] FineType's definition gives 0.00123456 BTC, 1.50000000 ETH, 100.00 USDT and 0.025 BTC as samples of the type.[1]
One bitcoin is divisible to eight decimal places.[2] The Bitcoin Wiki gives one satoshi as a one hundred millionth of a single bitcoin (0.00000001 BTC).[3] According to the Bitcoin Wiki, the value of 100 million satoshis to the bitcoin was decided by Satoshi Nakamoto no later than November 2008.[3]
Use
Bitcoin's code is BTC, while XBT, a code that conforms to ISO 4217 though it is not officially part of it, is used by Bloomberg L.P.[2] Map tickers to assets with an explicit lookup table before you aggregate, so that BTC and XBT rows land in the same bucket and two different tokens sharing a symbol do not. (Meridian's view)
Bitcoin amounts can also be quoted in smaller units such as the millibitcoin (mBTC), equal to 1/1000 bitcoin.[2] Treat the unit suffix as part of the value's meaning, and check whether a column mixes whole coins with sub-units before you sum it. (Meridian's view)
Sources
- [1]finetype/labels/definitions_finance.yaml at main · meridian-online/finetype · GitHubFineType
- [2]Bitcoin - Wikipediasecondary source
- [3]Satoshi (unit) - Bitcoin Wikisecondary source
Detection notes
New in format coverage expansion. Crypto amounts can have up to 18 decimal places (ETH). Transform casts to DECIMAL(18,8) for reasonable precision.
Use it
$ finetype infer -i "0.00123456 BTC" --mode column
→ finance.currency.amount_crypto
SELECT ft_infer('0.00123456 BTC');
-- → 'finance.currency.amount_crypto'CAST(REGEXP_REPLACE({col}, '\s*[A-Z]{2,5}$', '') AS DECIMAL(18,8))Schema
https://meridian.online/schemas/finance.currency.amount_crypto · Frictionless type string
finetype taxonomy finance.currency.amount_crypto -o json-schema