Paraape
Contracts

Architecture

One factory, one vault per token, a sampled oracle, and a risk engine with no custody.

Call path

Buyers and underwriters talk to InsuranceVault. The factory deploys a vault per token. Addresses for the current testnet deploy are on Deploy. The vault asks IPriceSource for the memecoin average and, when the quote is WETH, for the USDG rate. The insured-token average comes from PriceObserver, which reads the PoolManager. The risk engine only computes. It cannot move funds.

Anyone may record. Anyone may settle. A backing LP may challenge. The guardian can change protocol parameters. The guardian does not rule on a price and cannot withdraw LP funds.

Chainlink ETH/USD is consulted only when the pool is quoted in WETH. A USDG-quoted pool does not use it.

Solidity

ContractRole
MarketFactoryPermissionless createMarket, pool checks, insider addresses, config copied onto the vault
InsuranceVaultCells, policies, premiums, settle, challenge, release
PriceObserverSampled TWAP ring buffer
V4PoolTickSourceCurrent tick from the PoolManager
V4ChainlinkPriceSourceMeme average plus Chainlink ETH/USD
V4PriceSourceMeme average plus an optional WETH/USDG pool
ParaapeRiskEnginePremium, vol, APY, depth
BoundedRiskEngineCaps the engine's maximum rate. This is the address vaults call
ParaapeTestnetLockerTestnet lock attestation
V4LiquidityRouterAdd liquidity. Not a swap router
V4SwapRouterDemo swaps only

GridLib holds the six drops and five terms. ProtocolConfig holds the parameters in Parameters.

Stylus

apps/contracts-stylus is the Rust twin of the premium and depth math. It is not the live engine while Stylus activation is paused on Robinhood Chain (activationGas is 2^64 - 1). DeployParaape with an empty STYLUS_RISK_ENGINE deploys the Solidity engine and wraps it.

What does not upgrade

A vault keeps the bytecode, engine, and config from the factory that created it. Deploying a new factory leaves old policies on the old rules. That includes the challenge flow.

On this page