Asset Precision Differences
Overview
BitGo supports the full divisibility of each asset (documented in Coins and Tokens table). If your platform supports only smaller divisibilities, BitGo must calculate the precision of the maximum and minimum amounts on a per transaction basis. This page provides examples of three assets (ETH, GUSD, and USDT) that you can reference to better understand how BitGo calculates and validates precision.
BitGo uses the following terms when calculating precision:
- Base Unit - Smallest measurable unit of an asset.
- Example: A wei.
- Big Unit - Largest measurable unit of an asset.
- Example: An ether.
- Divisibility - Amount of base units per big unit.
- Example: Ether is divisible by 10-18. Therefore, 1 ether = 1,000,000,000,000,000,000 wei.
- Precision - Total maximum number of digits that can be used to represent a value.
- Example: BitGo supports a maximum of 32 digits for any value. Therefore the maximum amount of ether that BitGo can display is 99,999,999,999,999.999999999999999999 ETH.
- Scale - Number of digits to the right of a decimal in a representation.
- Example: 1 wei = 0.000000000000000001 ether. Therefore, the scale is 18.
Asset Precision & Trading Units
The following table shows the precision and scale that BitGo uses versus an example partner.
Asset | Asset Divisibility | BitGo Precision | BitGo Scale1 | Partner Precision | Partner Scale | BitGo Base Units (Minimum Trading Unit) | BitGo Base Units (Maximum Trading Amount) |
---|---|---|---|---|---|---|---|
ETH | 10¹⁸ | 32 | 18 | 28 | 8 | 10¹⁰ | 10³¹ - 1 |
GUSD | 10² | 32 | 2 | 28 | 5 | 10⁰ | 10²⁴ - 1 |
USDT | 10⁶ | 32 | 6 | 28 | 5 | 10¹ | 10²⁸ - 1 |
Minimum Trading Unit
BitGo uses the following formulas to calculate minimum trading units:
- BitGo Minimum Trading Big Unit =
- Partner Minimum Trading Big Unit =
- Minimum Trading Base Unit =
- Minimum Trading Big Unit =
USDT
- BitGo minimum trading big unit:
USDT - Partner minimum trading big unit:
USDT - Minimum trading base unit:
Base Units - Minimum trading big unit:
USDT
GUSD
- BitGo Minimum Trading Big Unit:
GUSD - Partner Minimum Trading Big Unit:
GUSD - Minimum Trading Base Unit:
Base Unit - Minimum Trading Big Unit:
GUSD
ETH
- BitGo Minimum Trading Big Unit:
ETH - Partner Minimum Trading Big Unit:
ETH - Minimum Trading Base Unit:
Base Units - Minimum Trading Big Unit:
ETH
Maximum Trading Amount
BitGo uses the following formulas to calculate Maximum Trading Units:
- Overflow Buffer =
Base Units - Maximum Trading Base Units =
- Maximum Trading Big Units =
ETH
- Calculation:
Base Units - Maximum Trading Big Units:
ETH
GUSD
- Calculation:
Base Units - Maximum Trading Big Units:
GUSD
USDT
- Calculation:
Base Units - Maximum Trading Big Units:
USDT
Acceptance Scenarios
Allocate and Deallocate
In this example a client allocates or deallocates 0.00005 to or from the partner:
- Client converts:
- BitGo registers: 50
Base Units Base Units → Valid
Trade
In this example, a partner fills a client's trade order of 0.0005 GUSD. However, BitGo only partially fills the trade due to the client accumulating dust that they can't withdraw or deallocate. Specifically:
- Theres an amount in the partner's trading account that's so small that BitGo doesn't track it in off-chain custody.
- The client can't withdraw the small amount from the partner because withdrawals can only happen at BitGo after deallocation from the partner.
- In order for a settlement or deallocation to occur, the amount must be traded away into an amount or currency that's trackable by BitGo.
- BitGo doesn't account for dust at the partner platform during client and partner reconciliations.
Settlement
In this example a settlement of 0.00005 USDT occurs between the partner and the client:
- Partner converts:
- BitGo registers: 50
Base Units Base Units → Valid
In this example, a settlement of 0.0005 GUSD occurs between a partner and client:
- Partner converts:
- BitGo registers: 0
- Below minimum unit (
) - Action proceeds as no-op (no change)
Rejection Scenarios
Allocate and Deallocate
In this example, a client attempts to allocate or deallocate 10^26 USDT to or from a partner:
- Client converts:
- BitGo registers:
base units but base units → Rejected
In this example, a client attempts to allocate or deallocate 0.000005 USDT to or from a partner:
- Client converts:
- BitGo registers: 5
base units → Rejected
Settle
In this example, a partner attempts to settle 0.000005 USDT with a client:
- Partner converts:
- BitGo registers: 5
base units → Rejected
In this example, a partner attempts to settle 10^20 ETH with a client:
- Partner converts:
- Possible overflow (partner max digits = 20)
- BitGo registers:
base units but base units → Rejected
Footnotes
-
Always equals
. ↩