apply_factor

Documentation for eth_defi.gmx.keys.apply_factor function.

apply_factor(value, factor)

Apply a 30-decimal factor to a value.

GMX uses 30-decimal fixed-point arithmetic for many values. This function applies a factor stored as an integer with 30 decimals.

Parameters
  • value (numeric) – Value to apply factor to

  • factor (int) – Factor in 30-decimal format (e.g., 10^30 = 1.0)

Returns

Result of (value * factor) / 10^30

Return type

numeric