Skip to content

Commit 173047c

Browse files
committed
Implement a vault that holds underlying (AMPL) and perp (SPOT) tokens and auto-rebalances to maintain the system's target deviation ratio via IRolloverVault swaps.
Key features: - Deposit underlying tokens and mint vault notes (LP tokens) - Redeem notes for proportional underlying + perp tokens - Auto-rebalance when system DR is outside equilibrium zone: DR < 1 (perpTVL too high): redeem perps to decrease perpTVL DR > 1 (perpTVL too low): mint perps to increase perpTVL - Rebalance formula: requiredChange = perpTVL × |dr - targetDR| (rolloverVaultTVL unchanged during flash mint/redeem) - Liquidity limits based on swap direction: underlying->perp: limited by underlying balance perp->underlying: limited by perp value held - Separate lag factors and percentage limits for each direction - Slippage protection with configurable max swap fee percentage - Keeper-controlled pause functionality.
1 parent b91b91d commit 173047c

File tree

13 files changed

+3631
-1340
lines changed

13 files changed

+3631
-1340
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ artifacts
2323
#Generated files
2424
RolloverBatch.json
2525
RedeemBatch.json
26+
27+
.claude
28+
CLAUDE.md

spot-contracts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"@ethersproject/providers": "^5.6.8",
2727
"@nomicfoundation/hardhat-chai-matchers": "latest",
2828
"@nomicfoundation/hardhat-ethers": "^3.0.0",
29-
"@nomicfoundation/hardhat-verify": "latest",
29+
"@nomicfoundation/hardhat-verify": "^2.0.0",
3030
"@nomiclabs/hardhat-waffle": "^2.0.6",
3131
"@openzeppelin/hardhat-upgrades": "^3.0.4",
3232
"@openzeppelin/upgrades-core": "latest",

0 commit comments

Comments
 (0)