#Deterministic
Functions marked with Deterministic, grouped from the generated Determica catalog for fast scanning across related workflows.
- bytes_concat_agg(BYTES) Concatenates BYTES chunks in aggregate input order, preserving an aggregate ORDER BY clause when supplied.Scalar · EVM utilities
- clmm_amount0_delta_x96(UINT256, UINT256, UINT256, BOOLEAN) Computes the Uniswap v4 SqrtPriceMath currency0 delta between two Q64.96 boundaries. Determica requires non-zero uint128 liquidity; arithmetic is deterministic and NULL propagates.Scalar · Fixed-point and AMM math
- clmm_amount1_delta_x96(UINT256, UINT256, UINT256, BOOLEAN) Computes the Uniswap v4 SqrtPriceMath currency1 delta between two Q64.96 boundaries. Determica requires non-zero uint128 liquidity; arithmetic is deterministic and NULL propagates.Scalar · Fixed-point and AMM math
- clmm_amounts_for_liquidity_x96(UINT256, UINT256, UINT256, UINT256) Position token amounts at a price from liquidity and range, as Uniswap v3-periphery LiquidityAmounts.getAmountsForLiquidity. Integer math only; NULL propagates.Scalar · Fixed-point and AMM math
- clmm_bitmap_next_initialized_tick(INTEGER, INTEGER, UINT256, BOOLEAN) Scans exactly one Uniswap v4-style compressed tick bitmap word. Compression rounds negative non-multiples toward negative infinity. It is deterministic, propagates NULL, and does not fetch adjacent words.Scalar · Fixed-point and AMM math
- clmm_liquidity_for_amounts_x96(UINT256, UINT256, UINT256, UINT256, UINT256) Liquidity two token amounts buy in a price range, as Uniswap v3-periphery LiquidityAmounts.getLiquidityForAmounts. Integer math only; NULL propagates.Scalar · Fixed-point and AMM math
- clmm_next_sqrt_price_from_input_x96(UINT256, UINT256, UINT256, BOOLEAN) Computes the Uniswap v4 SqrtPriceMath next Q64.96 price for exact input. It is deterministic and propagates NULL.Scalar · Fixed-point and AMM math
- clmm_next_sqrt_price_from_output_x96(UINT256, UINT256, UINT256, BOOLEAN) Computes the Uniswap v4 SqrtPriceMath next Q64.96 price for exact output. It is deterministic and propagates NULL.Scalar · Fixed-point and AMM math
- clmm_sqrt_price_x96_to_tick(UINT256) Inverts a Q64.96 sqrt(currency1/currency0) using Uniswap v4 TickMath floor semantics. It is deterministic and propagates NULL.Scalar · Fixed-point and AMM math
- clmm_swap_step_x96(UINT256, UINT256, UINT256, INT256, UBIGINT) Computes one Uniswap v4 SwapMath-compatible price-range step. Negative amount_remaining means exact input; non-negative means exact output. Direction is inferred from current versus target. Hooks, dynamic fee resolution, tick-crossing liquidity changes, multi-word iteration, slippage, routing, and calldata are outside this deterministic helper. The five-argument overload uses Uniswap v4's 1,000,000 fee denominator.Scalar · Fixed-point and AMM math
- clmm_swap_x96(UINT256, INTEGER, INTEGER, UINT256, STRUCT(tick INTEGER, liquidity_net HUGEINT)[], INT256, UBIGINT, BOOLEAN) Exact swap across initialized ticks, as the Uniswap v3 and v4 swap loop: each step ends at the next listed tick or the tick-bitmap word edge (256 x tick_spacing), whichever is first, with clmm_swap_step_x96 math; crossing adds liquidity_net moving up, subtracts it moving down. Stops at the amount, price limit or list end; never assumes liquidity past listed ticks. Offline: caller reads state and ticks. No hooks, dynamic fees or protocol fee split. List sorted once per call.Scalar · Fixed-point and AMM math
- clmm_tick_to_sqrt_price_x96(INTEGER) Converts a Uniswap-compatible tick to Q64.96 sqrt(currency1/currency0) with TickMath's bit-decomposed constants and final upward rounding. It is deterministic and propagates NULL.Scalar · Fixed-point and AMM math
- evm_abi_word(ADDRESS) Encodes an ADDRESS, BYTES32, BOOLEAN, or integer as one 32-byte Solidity ABI word. ADDRESS and unsigned integer values are left-padded with zeros. Signed integers are sign-extended in two's-complement form; BOOLEAN uses 0 or 1. BYTES32 values are copied unchanged.Scalar · Contracts and ABI
- evm_pack_uint_be(UINT256, INTEGER) Packs a UINT256 value into an exact-width big-endian BYTES value for ABI-adjacent byte construction.Scalar · EVM utilities
- fixed_div(UINT256, UINT256, UINT256) Computes fixed-point division as x * scale / y with a full 512-bit intermediate product. The caller owns the units and scale: this function does not require decimal, WAD, or Q-format inputs. It is pure and deterministic. NULL input propagates to NULL. A zero y or a rounded quotient above UINT256 raises an error.Scalar · Fixed-point and AMM math
- fixed_exp(INT256) Computes e^(x / 1e18) * 1e18 for an 18-decimal fixed-point (WAD) exponent, with integer arithmetic only. NULL propagates; an exponent outside [-41e18, 130e18] errors. Results equal, digit for digit, those of the LogExpMath library that Balancer V2 and Pendle V2 contracts use, so a query recomputes an on-chain rate exactly. Accuracy: within 1e-17 relative for results of 1e17 or more; a few wei near 1e18 (exp(1e18) is 2718281828459045235); a tiny result keeps few digits (exp(-41e18) is 1, true 1.56).Scalar · Fixed-point and AMM math
- fixed_ln(UINT256) Computes ln(x / 1e18) * 1e18 for a positive 18-decimal fixed-point (WAD) value, with integer arithmetic only; arguments in (0.9e18, 1.1e18) use a 36-decimal series. NULL propagates. Results equal, digit for digit, those of the LogExpMath library that Balancer V2 and Pendle V2 contracts use, so a query recomputes an on-chain rate exactly. Accuracy: within 2 wei of the true value, on either side.Scalar · Fixed-point and AMM math
- fixed_mul(UINT256, UINT256, UINT256) Computes fixed-point multiplication as x * y / scale with a full 512-bit intermediate product. The caller owns the units and scale: this function does not require decimal, WAD, or Q-format inputs. It is pure and deterministic. NULL input propagates to NULL. A zero scale or a rounded quotient above UINT256 raises an error.Scalar · Fixed-point and AMM math
- fixed_pow(UINT256, UINT256) Raises an 18-decimal fixed-point (WAD) base to a WAD exponent as exp(y * ln(x)), with integer arithmetic only, for example to annualise a growth factor. NULL propagates. Results equal, digit for digit, those of the LogExpMath library that Balancer V2 and Pendle V2 contracts use, so a query recomputes an on-chain rate exactly. Accuracy: within 1e-16 relative for results of 1e17 or more (fixed_pow(2e18, 1e18) is 1999999999999999998).Scalar · Fixed-point and AMM math
- hex(ADDRESS) Formats a BLOB-backed EVM byte value as uppercase hexadecimal text without a 0x prefix. hex and to_hex are compatibility aliases with identical behavior.Scalar · EVM utilities
- length(BYTES) Returns the number of bytes in a BLOB or BLOB-backed EVM value such as ADDRESS, BYTES32, UINT256, or INT256.Scalar · EVM utilities
- to_hex(ADDRESS) Formats a BLOB-backed EVM byte value as uppercase hexadecimal text without a 0x prefix. hex and to_hex are compatibility aliases with identical behavior.Scalar · EVM utilities