Reactive in Tsuneni
The Watcher is a reactive contract: it decides on every swap, on-chain, with no server watching anything.
Reactive Network runs contracts that react to events on other chains and call back contracts there. Tsuneni's whole decision layer is one such contract, the Watcher, on Reactive Lasna. Nothing off-chain decides when a rule fires.
| What Reactive does here | How Tsuneni uses it |
|---|---|
| Subscriptions to other chains' events | The Watcher subscribes to each Executor's rule, ack, budget and charge events on Base Sepolia and Unichain Sepolia, and to the Swap of every pool a rule depends on, filtered by pool id, subscribing and unsubscribing as rules come and go. |
react() on each event | Rule events update its mirror of every rule; swap events move each pool's tick and check the nearest triggers; acks clear in-flight requests. |
| Callbacks with a gas limit | When a trigger holds, it requests a callback to the right chain's Executor with a gas limit per action (1.3M for a re-range, 0.9M for an exit). |
| Cron | Only while something waits on it: ack timeouts, wait times and schedules. |
The callback proxy and pay() | Delivers the callback and charges the Executor, which charges the rule's owner (payment). |
Built with reactive-lib-omni (the system contract at 0x8888…8888, requestCallbackV_1_0, onlySystem) and tested with Reactive's reactive-test-lib (omni) under its metered fee mode: 48 of the 100 tests run the whole loop through Reactive's real fee path, covering every rule type except Compound and Rebalance.
One Watcher serves both chains. A rule on Base can watch a pool on Unichain (a price trigger), and a Move can send a position from one chain to the other: the Watcher sees both chains' swaps and calls back whichever Executor holds the position.
- 1
- 2
- 3