Curve implements a set of LP oracle contracts for 2-coin Curve pools. The oracle computes a manipulation-resistant LP token price and portfolio value using the StableSwap invariant, so that external integrators such as lending markets can price Curve LP tokens as collateral.
The codebase is organized around a shared StableSwap solver (lp_oracle_2) that uses Newton iteration with a bisection fallback, with thin wrappers for Twocrypto-with-stableswap (LPOracle) and StableSwap-NG (StableSwapNGLPOracle) pools that translate pool parameters into the form expected by the solver and expose portfolio values and LP token prices to integrators. The contracts are stateless and carry no privileged roles.
Throughout the engagement, the communication and cooperation with the Curve team were excellent. We focused primarily on pricing correctness, manipulation resistance, and the assumptions the oracle contracts inherit from their underlying pools. The primary concerns are edge cases when using the oracle to price LP tokens as collateral in potentially large lending markets.
The Curve team improved the solver’s initial guess, removed redundant calculations, and expanded the supported amplification range to cover StableSwap-NG amplification ramps. Our review of these changes identified no additional correctness or security findings. Because the contracts are stateless and carry no privileged roles, the administrative attack surface is minimal.
Security regarding pricing correctness and manipulation resistance remains improvable. The Curve team accepted the risks around pricing LP tokens as collateral in low-liquidity pools, the propagation of the EMA price cap to the LP oracles, mispricing of the LP token after a token crash, and collateral value jumps. These limitations arise from the underlying pools and their oracle and rebalancing mechanisms, and integrating protocols must account for the resulting valuation risk by sizing their LTV, liquidation thresholds, and supply caps accordingly.
In summary, we find that the codebase provides a high level of security. It is important to note that security audits are time-boxed and cannot uncover all vulnerabilities. They complement but don’t replace other vital measures to secure a project.