Ary0520/VerdexSwap-Core-Contracts — reverse-engineered prompt
Reverse engineered prompt
Build me the core Solidity contracts for VerdexSwap, a DEX where people can swap tokens, create pools, add or remove liquidity, and get some protection from impermanent loss through an on chain USDC insurance vault called IL Shield.
I want the system to include a factory for creating token pairs with risk tiers, a router for swaps and liquidity actions, pair contracts using the normal constant product model, and the insurance pieces that track LP positions, calculate coverage, and pay USDC claims when someone exits after enough time. Fees should be split between LP rewards, the insurance vault, and an optional treasury. Add TWAP based pricing so payouts are not based on easily manipulated spot prices.
Please include the staker side too, where users can deposit USDC into the vault, earn part of vault fees, and have a 14 day cooldown before withdrawing. Add sensible tests for swaps, liquidity, coverage limits, vault solvency rules, and basic attack protections. Look up current docs online if you need to.
Want more depth? Deep Reverse