Support leverage trading with VVS and Tectonic.
Send USDC to accounts
hh run scripts/sendUSDC.tsAdd liquidity to WETH/USDC liquidity pool
hh run scripts/addLiquidity.ts Deploy the contract
hh run scripts/deploy.tsChange USD/ETH price to 1000.
PRICE=1000 hh run scripts/changePrice.tsOpen Long position
- Input: 1000 USDC
- Loan to Value Ratio: 60%
| round | 1st | 2nd | 3rd | total |
|---|---|---|---|---|
| USDC Borrowed | 600 | 360 | 960 | |
| WETH Collateral | 1 | 0.6 | 0.36 | 1.96 |
hh run scripts/openLongPosition.ts Change USD/ETH price to 2000.
PRICE=2000 hh run scripts/changePrice.tsClose long position
Estimate profit: 1000 * 1.96 = 1960.
hh run scripts/closeLongPosition.ts Change USD/ETH price to 1000.
PRICE=1000 hh run scripts/changePrice.tsOpen short position
- Input: 1000 USDC
- Loan to Value Ratio: 60%
| round | start | 1st | 2nd | 3rd | total |
|---|---|---|---|---|---|
| WETH Borrowed | 0.6 | 0.36 | 0.216 | 1.176 | |
| USDC Collateral | 1000 | 600 | 360 | 216 | 2176 |
hh run scripts/openShortPosition.ts Change USD/ETH price to 500.
PRICE=500 hh run scripts/changePrice.tsClose short position
Estimate profit: 500 * 1.176 = 588.
hh run scripts/closeShortPosition.ts