package
2.0.1+incompatible
Repository: https://github.com/dydxprotocol/v4-chain.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
AddUint32 returns the sum of a and b.
No description provided by the author
No description provided by the author
AvgInt32 returns average of the input int32 array.
BaseToQuoteQuantums converts an amount denoted in base quantums, to an equivalent amount denoted in quote quantums.
BigFloat0 returns a `big.Float` that is set to 0.
BigFloatMaxUint64 returns a `big.Float` that is set to MaxUint64.
BigInt0 returns a `big.Int` that is set to 0.
BigInt32Clamp takes a `big.Int` as input, and `int32` upper and lower bounds.
See `bigGenericClamp` for specification.
BigIntMulPpm takes a `big.Int` and returns the result of `input * ppm / 1_000_000`.
BigIntMulSignedPpm takes a `big.Int` and returns the result of `input * ppm / 1_000_000`.
BigIntOneMillion returns a `big.Int` that is set to 1_000_000.
BigIntOneTrillion returns a `big.Int` that is set to 1_000_000_000_000.
BigIntRoundToMultiple takes an input, a multiple, and a direction to round (true for up, false for down).
BigMax takes two `big.Int` as parameters and returns the larger one.
BigMaxInt32 returns a `big.Int` that represents `MaxInt32`.
BigMin takes two `big.Int` as parameters and returns the smaller one.
BigMulPow10 returns the result of `val * 10^exponent`, in *big.Rat.
BigNegMaxUint64 returns a `big.Int` that is set to -math.MaxUint64.
BigPow10 returns the result of `10^exponent`.
BigRat0 returns a `big.Rat` that is set to 0.
BigRat1 returns a `big.Rat` that is set to 1.
See `bigGenericClamp` for specification.
BigRatMulPpm takes a `big.Rat` and returns the result of `input * ppm / 1_000_000`.
BigRatOneMillion returns a `big.Rat` that is set to 1_000_000.
BigRatRound takes an input and a direction to round (true for up, false for down).
BigUint64Clamp takes a `big.Int` as input, and `uint64` upper and lower bounds.
ChangeRateUint64 returns the rate of change between the original and the new values.
ContainsDuplicates returns true if the slice contains duplicates, false if not.
ConvertBigFloatSliceToUint64Slice attempts to convert all values in a slice from big Float to uint64 and return an error if any conversions fail.
ConvertBigFloatToUint64 attempts to convert a big Float into a uint64 and returns an error if the conversion would fail.
ConvertStringSliceToBigFloatSlice attempts to convert all values in a slice from string to big Float and return an error if any conversions fail.
FilterSlice takes a function that returns a boolean on whether to include the element in the final result, and returns a slice of elements where the function returned true when called with each element.
FundingRateToIndex converts funding rate (in ppm) to FundingIndex given the oracle price.
GetSortedKeys returns the keys of the map in sorted order.
No description provided by the author
Int64MulPpm multiplies an int64 by a scaling factor represented in parts per million.
IntToString converts any int type to a base-10 string.
No description provided by the author
MapSlice takes a function and executes that function on each element of a slice, returning the result.
No description provided by the author
Median is a generic median calculator.
MergeAllMapsMustHaveDistinctKeys merges all the maps into a single map.
No description provided by the author
`MustConvertBigIntToInt32` converts a `big.Int` to an `int32` and panics if the input value overflows or underflows `int32`.
No description provided by the author
MustDivideUint32RoundUp returns the result of x/y, rounded up.
MustGetMedian is a wrapper around `Median` that panics if input length is zero.
MustParseCoinsNormalized parses a string of coins and panics on error.
QuoteToBaseQuantums converts an amount denoted in quote quantums, to an equivalent amount denoted in base quantums.
RandomBytesBetween returns a random byte slice that is in the range [start, end] when compared lexicographically.
RatPow10 returns the result of `10^exponent`.
TxMode returns a textual representation of the tx mode, one of `CheckTx`, `ReCheckTx`, or `DeliverTx`.
Uint32ToKey converts a uint32 to a 4-byte slice in big-endian format.
Uint64LinearInterpolate interpolates value v0 towards v1 by a small constant value c, typically expected to be between 0 and 1.
Uint64MulPpm multiplies a uint64 value by a scaling factor represented in parts per million.
UintToString converts any uint type to a base-10 string.
UniqueSliceToSet converts a slice of unique values to a set.
# Constants
No description provided by the author
10^BaseDenomExponent denotes how much full coin is represented by 1 base denom.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
10^6 quantums == 1 USD.
No description provided by the author
No description provided by the author
# Variables
PowerReduction defines the default power reduction value for staking.
# Interfaces
No description provided by the author