The _smoothed_price
function limits price adjustments to a fixed rate (max_price_increment
), which cannot adapt to rapid market changes. During high volatility, the oracle price updates too slowly, creating a gap between the oracle and real market prices. Arbitrageurs exploit this gap, draining liquidity from the pool at the expense of LPs.
The linear smoothing formula restricts price changes to:
This creates predictable, incremental adjustments that cannot match sudden market movements.
Real Price Surge: scrvUSD’s market price jumps 2% due to high demand.
Oracle Lag: The oracle’s linear model only allows a 0.5% increase in the same timeframe.
Arbitrage Execution:
Arbitrageurs buy scrvUSD from the pool at the outdated lower price (0.5% increase).
Sell it on external markets at the higher real price (2% increase).
Result: The pool’s reserves are drained, and LPs lose funds.
Add this function to tests/scrvusd/oracle/unitary/test_v2.py:
Then run: pytest -s tests/scrvusd/oracle/unitary/test_v2.py
output:
LPs suffer losses proportional to the arbitrage gap.
Repeated exploitation could reduce liquidity, destabilizing the pool.
Implement Exponential Smoothing
Adjusts faster when the price gap is large.
Gradually stabilizes as the gap closes.
Or Dynamic max_price_increment
Adjustment
Allow DAO votes to increase max_price_increment
during volatility.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.