{
"Oracle": "0xdE82e5Ee59C150f29ac930Ce14AA48014eD4C609",
"ShortPowerPerp": "0xc388B97694F0dEdbc07Ba41509d2615d997182Fb",
"WPowerPerp": "0x8dC84d89C96db58D5F7e738DA204F88aaFAEdc9d",
"SQU/ETH Pool": "0xEB38933823829320cb8d55949cB346fbe1f05429",
"ETH/USD Pool": "0x6e543B707693492a2D14D729Ac10A9D03B4C9383",
"ABDKMath64x64": "0xD22Af7Aa8A9F4eD72e1fA75AeB220c98CC18bEd0",
"TickMathExternal": "0x63C228d52dCBFf09d0A7a4eFd7Fea71A8E18657A",
"SqrtPriceMathPartial": "0x148B2B8898d989bdaC19a56803379cdB57bCC6D7",
"Controller": "0x2Eab3378Fe281b3CE16e0f6F4dEb7d47c644A978",
"ShortHelper": "0x7Fd8d2dE200FfD381a7878b7687e5889bbb999E0",
"CrabStrategyDeployment": "0x73d413a947834eD2A32AdA1EEFa2e4ca3717C393",
"ControllerHelperUtil": "0xfB9e8846AB7E094E9db29482E93Da05A737eF598",
"ControllerHelper": "0xEea0347eD7F20597745Ae828DBC29b62EfebF6c3",
"CrabStrategyV2": "0x4116c1e672E94742463d26B2E82e6E3b2Eb329A3",
"CrabHelper": "0xBf8b9Ee781d05A8360280F049179995Af4071B24",
"ZenBullVault": {
"ZenBullStrategy": "0xbD429107EEba27caA8A0a135Fb3037B5a0b1f007",
"ZenEmergencyShutdown": "0x3cb4639063894b5e07823c5e0cd873732087c175",
"ZenAuction": "0xdab7b3942d392043d0b1c4a6f87a25a70c7ecfa9",
"FlashZen": "0x135b7d561f1D56935bD55e9c93EABDdCB7b95a08",
"EmergencyWithdraw": "0xd42fe09e5a5bb0aa2312c9ddd198548f72bde5c5"
},
"ZenBullNetting": {
"NettingLib": "0x4c99979656504f498d71c27ffef95757fe1be682",
"ZenBullNetting": "0x6a7fe96eb4bb2e33b95d20c0940824ee75e36902"
}
}
-
Configure the
.env
file:RPC_URL
-https://api.s0.t.hmny.io
PRIVATE_KEY
CONTROLLER_ADDRESS
-0x2Eab3378Fe281b3CE16e0f6F4dEb7d47c644A978
UNI_SWAP_ROUTER_ADDRESS
-0x88250361E27a3Bf78C0588782B8792d0Bd3A5Ad5
UNI_NONFUNGIBLE_POSITION_MANAGER_ADDRESS
-0xE4E259BE9c84260FDC7C9a3629A0410b1Fb3C114
-
Install Dependencies:
- Run
forge install
- Run
This script can be used to create a new vault and deposit collateral into it or to deposit collateral into an existing vault.
VAULT_ID
: The ID of the vault. Pass0
to create a new vault. | numberCOLLATERAL_AMOUNT
: Collateral amount. Not required. | numberMINT_AMOUNT
: Power perp mint amount. | numberUNI_TOKEN_ID
: Uniswap v3 position token ID (additional collateral). Pass0
to skip. | numberIS_W_AMOUNT
: Set to"true"
forwPowerPerp
(non-rebasing) and"false"
forpowerPerp
(rebasing). | boolean
To execute a trade that potentially profits from volatility in the underlying asset, use this command:
make mint-and-deposit VAULT_ID=0 COLLATERAL_AMOUNT=10000000000000000000 MINT_AMOUNT=5000000000000000000 UNI_TOKEN_ID=0 IS_W_AMOUNT=false
This command creates a new vault and deposits an initial amount of collateral. The trade can be profitable if the value of the PowerPerp appreciates relative to the collateral cost.
Burn a specified power perp amount and remove collateral from the vault.
VAULT_ID
: The ID of the vault. | numberBURN_AMOUNT
: Burn amount. | numberWITHDRAW_AMOUNT
: Collateral amount. | numberIS_W_AMOUNT
: Set to"true"
forwPowerPerp
(non-rebasing) and"false"
forpowerPerp
(rebasing). | boolean
To close a position and realize a profit after an increase in the PowerPerp's value:
make burn-amount VAULT_ID=4 WITHDRAW_AMOUNT=9000000000000000000 BURN_AMOUNT=4000000000000000000 IS_W_AMOUNT=false
This command burns a specific amount of PowerPerp, and withdraws a set amount of collateral from the vault. It's profitable if the price increase of the PowerPerp offsets the costs of maintaining the position.
Deposit additional collateral into a vault.
VAULT_ID
: The ID of the vault. | numberCOLLATERAL_AMOUNT
: Collateral amount. | numberUNI_TOKEN_ID
: Uniswap v3 position token ID. | number
To strengthen your position during a market dip, ensuring you stay above the minimum collateral requirement:
make deposit-collateral VAULT_ID=3 COLLATERAL_AMOUNT=1000000000000000000 UNI_TOKEN_ID=0
This command deposits more collateral into a vault, allowing for increased exposure or safeguarding against liquidation.
Withdraw collateral from a vault.
VAULT_ID
: The ID of the vault. | numberCOLLATERAL_AMOUNT
: Collateral amount. | numberIS_UNI_TOKEN
: Set to"true"
for a Uniswap v3 position token and"false"
for collateral. | boolean
To realize a profit by reducing exposure when the market conditions are favorable:
make withdraw-collateral VAULT_ID=3 COLLATERAL_AMOUNT=1000000000000000000 IS_UNI_TOKEN=false
This command withdraws collateral, which could be beneficial if the collateral's value has appreciated or if you are taking profits.
Liquidate a vault. If a vault is under the 150% collateral ratio, anyone can liquidate it by burning wPowerPerp
.
VAULT_ID
: The ID of the vault. | numberMAX_DEBT_AMOUNT
: Maximum amount ofwPowerPerp
to repay. | number
To capitalize on a potential gain from a vault's undercollateralization:
make liquidate VAULT_ID=3 MAX_DEBT_AMOUNT=10000000
This command allows you to liquidate an undercollateralized vault, potentially profiting by acquiring assets at below-market prices due to the forced liquidation.
Mint PowerPerp and deposit it into the wSqueeth/WETH pool.
VAULT_ID
: The ID of the vault. Pass0
to create a new vault. | numberCOLLATERAL_AMOUNT
: Collateral amount. Not required. | numberMINT_AMOUNT
: Amount of wPowerPerp to mint and provide as liquidity. | numberUNI_TOKEN_ID
: Uniswap v3 position token ID (additional collateral). Pass0
to skip. | numberWETH_AMOUNT
: Amount of WETH to provide as liquidity. | number
make mint-and-lp VAULT_ID=0 COLLATERAL_AMOUNT=10000000000000000000 MINT_AMOUNT=5000000000000000000 UNI_TOKEN_ID=0 WETH_AMOUNT=10000000000000000000
Withdraw wSqueeth/WETH pool liquidity and burn wPowerPerp.
TOKEN_ID
: Uniswap v3 position token ID. | numberVAULT_ID
: The ID of the vault. | numberWITHDRAW_AMOUNT
: Amount of collateral to withdraw from vault. | number
make withdraw-lp TOKEN_ID=23 VAULT_ID=1 WITHDRAW_AMOUNT=10000000000000000000
Open a long position by swapping WETH for wPowerPerp.
WETH_AMOUNT
- Amount of WETH to swap for wPowerPerp. | numberSLIPPAGE
- Maximum slippage percentage. | number
make open-long WETH_AMOUNT=10000000000000000000 SLIPPAGE=20
Open a short position by swapping wPowerPerp for WETH.
VAULT_ID
- The ID of the vault. Pass0
to create a new vault. | numberCOLLATERAL_AMOUNT
- Collateral amount. Not required. | numberMINT_AMOUNT
- Amount of wPowerPerp to mint and swap for WETH. | numberUNI_TOKEN_ID
- Uniswap v3 position token ID (additional collateral). Pass0
to skip. | numberSLIPPAGE
- Maximum slippage percentage. | number
make mint-and-short VAULT_ID=0 COLLATERAL_AMOUNT=10000000000000000000 MINT_AMOUNT=5000000000000000000 UNI_TOKEN_ID=0 SLIPPAGE=10
Close a mint position by swapping WETH for wPowerPerp and burning the wPowerPerp.
VAULT_ID
- The ID of the vault. | numberSHORT_AMOUNT
- Amount of wPowerPerp to burn. | numberCOLLATERAL_WITHDRAW_AMOUNT
- Amount of WETH to withdraw from vault. Not required. | numberSLIPPAGE
- Maximum slippage percentage. | number
make close-short VAULT_ID=1 SHORT_AMOUNT=5000000000000000000 COLLATERAL_WITHDRAW_AMOUNT=0 SLIPPAGE=20
Close a long position by swapping wPowerPerp for WETH.
WPOWER_PERP_AMOUNT
- Amount of wPowerPerp to swap for WETH. | numberSLIPPAGE
- Maximum slippage percentage. | number
make close-long WPOWER_PERP_AMOUNT=5000000000000000000 SLIPPAGE=20
Deposit ETH into the Crab Strategy to mint wSqueeth and strategy token.
ETH_AMOUNT
- Amount of ETH to deposit. | number
make crab-deposit ETH_AMOUNT=10000000000000000000
Withdraw ETH from the Crab Strategy by burning wSqueeth and strategy token.
CRAB_AMOUNT
- Amount of strategy token to burn. | number
make crab-withdraw CRAB_AMOUNT=10000000000000000000
Execute 3 trades, 2 long and 1 short. The first long to close a position, being profitable and the short to as well.
WETH_AMOUNT
: Amount of WETH to provide as liquidity. | numberBOB_WETH_AMOUNT
- Bob's Amount of WETH to swap for wPowerPerp. | numberCHARLIE_MINT_AMOUNT
- Charlie's Amount of wPowerPerp to mint and swap for WETH. | numberDAN_WETH_AMOUNT
- Dan's Amount of WETH to swap for wPowerPerp. | number
make trade WETH_AMOUNT=10000000000000000000 BOB_WETH_AMOUNT=2000000000000000000 CHARLIE_MINT_AM
OUNT=20000000000000000000 DAN_WETH_AMOUNT=20000000000000000000