Skip to main content

Module units

Module units 

Source
Expand description

Amounts an action carries as whole integers: USDC in millionths (vaultTransfer, subAccountTransfer), HYPE in 1e8 (cDeposit, tokenDelegate). The integer is what is signed, so it is made here, once.

Enums§

BadUnits
Why an amount has no integer form to sign.

Constants§

HYPE_DECIMALS
HYPE on HyperCore counts in 1e8: what wei means in staking and delegation.
USDC_DECIMALS
USDC’s decimals on the perp side and on Arbitrum: millionths.

Functions§

cut_units
value cut toward zero to a count of 10^-places: for a computed figure (a whole balance, say), so it never asks for more than there is.
exact_units
value as a count of 10^-places, refused rather than rounded when it is finer than that: what was typed is what is signed.