Risk management for Dual Finance protocol DIP and SO positions
The risk manager triggers trades from the following events:
- Receive DIP token balance change
- Receive order fill from gamma levels
- Scalper window timer Expires
- DIP expires
- DIP exercised
Trading events per event:
- Cancel all orders
- Calc net position delta and gamma
- Buy or sell delta to 0 via TWAP if necessary
- Place bid and ask at gamma levels
- Start scalper window timer
source .env ; yarn run main