Rebalancing Rules

Behind every rebalance is a set of safety and efficiency checks designed to protect your capital and maximize returns.
1. Pool Safety
Before entering a new opportunity, the Agent compares the pool's total size to your wallet balance. It prefers pools significantly larger than your position so you don't end up owning a disproportionate share of the liquidity. This minimizes the impact of a sudden reduction in the pool's TVL. If a pool shrinks unexpectedly (e.g., after a large exit), the Agent will exit your position rather than leave funds stranded in a shallow market.
2. Meaningful Yield Difference
Not every uptick in yield is worth chasing. The Agent calculates the difference between your current yield and the potential yield in the target pool. Only when the improvement crosses a meaningful threshold will it consider rebalancing. Minor differences are ignored to avoid unnecessary costs.
3. Yield Stability
A high APY is not useful if it disappears overnight. The Agent calculates the mean and standard deviation of the target yield to assess its stability. If the yield has been relatively steady (not dramatically spiking or crashing), the pool passes this test. This allows the Agent to capture upside without jumping into unstable opportunities. This check is combined with a TVL drawdown analysis.
4. Profit vs. Transaction Costs
On mainnet, every move incurs gas fees. The Agent estimates how much additional yield the new pool would generate daily and compares it to the one-off cost of moving your funds. It then calculates how long it would take for the extra yield to cover those costs. If the payback period is short enough, the Agent proceeds. Otherwise, it waits for a better opportunity. The Agent never rebalances unless the expected earnings exceed the gas cost. This rule may be overridden in emergency scenarios.
5. Money Market Liquidity
The Agent monitors liquidity, utilization, and the Interest Rate Model (IRM) of each money market. When a market becomes highly utilized and remaining liquidity shrinks to a level that could affect withdrawals, the Agent proactively exits your position. This avoids situations where your funds become illiquid or yield deteriorates because the market is overcrowded.
6. Collateral Health
Every collateral and counterparty that Zyfai users are exposed to is monitored continuously for health. A deviation of 50 bps from its peg triggers a Warning; 100 bps is flagged as Risky, and the Agent automatically rebalances away.
7. TVL Stability
All pool TVLs are monitored. If TVL falls below 40% of its 14-day high, the Agent flags the pool as Risky and automatically rebalances away.
By combining these checks, Zyfai Agents capture higher returns without taking on unnecessary risk or incurring excessive costs.
Once a rebalance passes these checks, it is executed through the Execution & Verifiability Layer, where every action is validated by the Security Proxy Gateway and can be cryptographically proven via ZK proofs anchored in the ERC-8004 registry.