Compute
Compute

Math · Reads onchain state

Applies a unary math operation to a value and returns the result. Operations are absolute value, square root, exponential, and natural logarithm, all at 18 decimals on a signed input. exp and ln are the WAD-scaled functions protocols use for continuous compounding. Reach for it to convert between per-second rates and annual growth, to take the geometric mean of two prices, or to normalize a signed delta to its magnitude before a comparison.