MeridianMERIDIAN

Currency Amount (Cryptocurrency)

finance.currency.amount_crypto

Cryptocurrency amount with ticker symbol suffix. Supports high-precision decimals (up to 8+ decimal places). Common in exchange exports and portfolio tracking data.

Operations on this type: Parse nested values

Try a value

Currency Amount (Cryptocurrency)'s rule accepts it.

Reads it as 0.00123456

Use it

Shell
finetype infer -i '0.00123456 BTC' --mode column
# → finance.currency.amount_crypto
DuckDB
SELECT ft_infer('0.00123456 BTC');
-- → 'finance.currency.amount_crypto'
Cast template: {col} is your column
CAST(REGEXP_REPLACE({col}, '\s*[A-Z]{2,5}$', '') AS DECIMAL(18,8))

How finetype reads the samples

DuckDB 1.5.5 · finetype 0.6.66

ValueAs VARCHARnumeric_valueticker
0.00123456 BTC0.001234560.00123456BTC
1.50000000 ETH1.500000001.50000000ETH
100.00 USDT100.00000000100.00000000USDT
0.025 BTC0.025000000.02500000BTC

Pattern

Regular expression
^-?[0-9]+\.?[0-9]*\s?[A-Z]{2,5}$
ValueLengthShape
0.00123456 BTC14matches
1.50000000 ETH14matches
100.00 USDT11matches
0.025 BTC9matches
0.00123456 btc14rejected: 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)

How it's detected

Crypto amounts can have up to 18 decimal places (ETH). Transform casts to DECIMAL(18,8) for reasonable precision.

Schema

https://meridian.online/schemas/finance.currency.amount_crypto · Frictionless type string

finetype taxonomy finance.currency.amount_crypto -o json-schema

Aliases

crypto_amount

Type Registry