Module price

Module price 

Source
Expand description

Represents a price in a market with a specified precision.

Structs§

Price
Represents a price in a market with a specified precision.

Constants§

ERROR_PRICE
The sentinel Price representing errors (this will be removed when Cython is gone).
PRICE_ERROR
The sentinel value for an error or invalid price.
PRICE_MAX
The maximum valid price value that can be represented.
PRICE_MIN
The minimum valid price value that can be represented.
PRICE_UNDEF
The sentinel value for an unset or null price.

Statics§

PRICE_RAW_MAX
The maximum raw price integer value.
PRICE_RAW_MIN
The minimum raw price integer value.

Functions§

check_positive_price
Checks the price value is positive.
decode_raw_price_i64
The raw i64 price has already been scaled by 10^9. Further scale it by the difference to FIXED_PRECISION to make it high/defi-precision raw price.

Type Aliases§

PriceRaw