Rule Craft
DocsConfig schemaMenu

Reference

Config schema

The Rules struct every Rule Craft pool is created with.

A pool's rules are one Solidity struct, validated by the contracts and frozen when the pool opens. Fees are in v4 pips (1,000,000 = 100%); shares are in basis points (10,000 = 100%). Fields of modules that are off must be zero, so one rule set has exactly one encoding and one hash.

struct Rules {
  uint8  modules;      // bit flags: 1 Snipe Guard, 2 Size-Scaled Fee, 4 Buy Burn, 8 LP Stream, 16 Liquidity Timelock
  uint24 baseFee;      // pips; 500, 3000 or 10000 when Size-Scaled Fee is off, else 0
  uint32 guardBlocks;  // 5–600
  uint16 maxBuyBps;    // share of supply all buyers may receive per block during the guard, 10–500
  uint16 guardTaxBps;  // 0–6000
  uint24 minFee;       // pips, 500–10000 (Size-Scaled Fee)
  uint24 maxFee;       // pips, minFee–50000
  uint16 depthBps;     // trade size vs in-range virtual reserve where maxFee applies, 50–1000
  uint16 burnBps;      // 10–500
  uint16 streamBps;    // 10–300
  uint32 lockDays;     // 1–3650
}

guardTaxBps + burnBps + streamBps may not exceed 5,000 (50%). A pool's key is ETH (currency0) / token (currency1), fee 0x800000 (dynamic) when Size-Scaled Fee is on, tick spacing 10 / 60 / 200 by fee tier (60 for dynamic), hooks = RuleCraftHook.

The composer's "Copy spec" JSON shows the same rule set in percent, plus the worst-case take it computes.