$ node foxwire.mjs new · rules signed once, run by bonded keepers

Triggers

A trigger is read on-chain by the vault itself, with the same code in arm, execute and attempt. Every rule also has a nextRun time: no trigger is true before it.

KindReadsFields
TIME (0)The block timestart, and an interval for repeating rules. The schedule stays aligned: a late run does not shift the next ones.
FEED (1)Chainlink latestRoundData()feed, below or above, threshold (8 decimals), maxAge. Stock feeds move on weekdays, so the default maxAge is 80 hours; tighten it for faster markets.
POOL (2)Uniswap V4 sqrtPriceX96 through PoolManager.extsload, or a V3 pool's slot0pool id (V4) or pool (V3), below or above, threshold. Must be true when armed and when executed, at least 2 L1 blocks apart.
BALANCE (3)balanceOf(account), or ETH when the token is zerotoken, account, below or above, value
CALL (4)Any view: staticcall(target, data)target, calldata, the index of the returned word, comparison, value

Pool prices and the two-block guard

A pool price can be pushed for one block. A POOL rule therefore runs only if its condition was true when it was armed and is still true when it runs, at least two L1 blocks later (block.number on this chain is the Ethereum block, about 12 seconds). The house keeper arms POOL rules itself and waits. The PoolManager is 0x8366a39CC670B4001A1121B8F6A443A643e40951.

Any view

CALL is what makes any trigger possible: a Pons V2 launch's phase in the factory (the graduation recipe reads word 10 of getLaunchedToken and waits for phase 2, when the Uniswap pool is live), a curve's graduated(), a stock token's multiplier before a split, a vault's share price. The call gets 300,000 gas and must not revert.

Feeds and pools in the app

TokenChainlink feedUniswap V4 pool (USDG)
NVDA0x379EC4f7…fee 0.3%
TSLA0x4A1166a6…fee 0.3%
AAPL0x6B22A786…fee 1%
GOOGL0xF6f373a0…fee 0.3%
AMD0x943A29E7…fee 1%
METApool onlyfee 0.3%
MSFTpool onlyfee 0.3%
AMZNpool onlyfee 0.3%
SPYpool onlyfee 0.3%
QQQpool onlyfee 0.3%
COINpool onlyfee 1%
PLTRpool onlyfee 1%