This project is a test of the Lyra protocol.
buyHedgedCall(strikeId, amount)
- Buys a long call option with strikeId and amount using Lyra.
- Transfers margin and then buys a short of delta * (amount of call options) using Synthetix.
- Transfers Lyra option token and remaining Lyra quote asset (USDC for the script example) to the original sender.
rehedge()
- Looks at current open position.
- Compares current short with the the new call option delta.
- Withdraws or deposits the difference from short position to become delta neutral again.
yarn
npx hardhat node --fork https://optimism-mainnet.infura.io/v3/api_key --fork-block-number 108310000
// new terminal
yarn run deploy:hedge- Give owner of Hedge better control over open positions on Synthetix / Lyra
- Add tests