Skip to main content

Net Pressure & the PID Controller

When YieldBasis markets drift out of balance, the protocol needs to attract crvUSD liquidity faster than a governance vote can react. The PID controller measures that pressure on-chain and streams crvUSD incentives to a designated Curve pool until the pressure clears.

What net pressure is

Every YieldBasis market holds Curve LP tokens (for example cbBTC/crvUSD) as collateral against crvUSD debt. Net pressure is the market's debt minus the crvUSD sitting inside those LP tokens.

Say a cbBTC market owes 100M crvUSD while its LP tokens contain 92M crvUSD worth of the stable side. Unwinding the whole position frees 92M; someone has to buy the remaining 8M on the open market. The net-pressure oracle reports that 8M of buy pressure.

A balanced market reads near zero. In simulations over 2021–2025 BTC data, the signal sits near zero most of the time and spikes during sharp crashes, which is when crvUSD liquidity depth matters most.

Why a feedback controller instead of a gauge vote

Curve-style gauge votes are built for long-term emission steering and take days to move. Net pressure spikes in minutes. The response is a PID controller (proportional–integral–derivative), the same feedback loop used in cruise control: measure, compare to target, adjust, repeat.

Each cycle, the controller:

  1. Measures pressure across a DAO-selected set of YieldBasis markets, normalised by their size.
  2. Measures the sink: how much liquidity is already staked in the target pool, using a flash-loan-resistant moving average.
  3. Computes the gap between the two and turns it into a crvUSD-per-second reward rate: it reacts to the current gap (proportional), remembers accumulated past gap (integral), and adds weight when pressure is rising fast (derivative).

Anyone can call the update; the loop needs no keeper. Every parameter is DAO-tunable within hard-coded safety bounds.

Where the incentives point

All incentives stream to one place: the crvUSD/pyUSD stableswap pool on Curve. Liquidity parked there deepens the crvUSD side of the market, so demand for crvUSD during imbalance windows clears without destabilising the peg.

How you earn from it

  1. Provide liquidity to the crvUSD/pyUSD pool on Curve.
  2. Stake the LP tokens in the FastGauge (an ERC-4626 vault over the LP token, with one-call helpers to add or remove liquidity), or follow the Merkl campaigns that surface the same incentive rate in a familiar claim interface.
  3. Rewards stream in crvUSD.

The rate is spiky by design: it rises during imbalance windows and decays toward zero in calm periods. Quiet weeks can pay little or nothing, because the mechanism pays only while pressure exists.

The FastGauge is not a Curve LiquidityGauge: it receives no CRV emissions, and no veYB or veCRV boost applies. Its only reward is the PID-driven crvUSD stream.

Where the incentives come from

The FeeSplitter diverts a DAO-set share of YieldBasis admin fees (15% at activation; read split_fraction() for the live value) to the controller's reserve and forwards the rest to the veYB FeeDistributor. The reserve was seeded at activation with fees recovered from the deprecated BTC markets. Fees arrive as yb-LP tokens; the controller converts them to crvUSD through bounded, oracle-protected swaps.

The reserve is the spending limit. When it runs low, the stream slows and stops: nothing reverts, and the protocol borrows nothing to keep paying.

veYB holders give up that share of the weekly fee stream and get deeper crvUSD liquidity under the markets that generate the fees.