Skip to content

Commit

Permalink
poc: modifyHedgePosition
Browse files Browse the repository at this point in the history
  • Loading branch information
roigecode committed Sep 17, 2024
1 parent 3b718bb commit 98675c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/Hedge/hedge-manager.sol
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
pragma solidity ^0.8.19;

contract HedgeManager {
function modifyHedgePosition(uint256 priceMovement) external onlyOwner{
function modifyHedgePosition(uint256 deltaDifference, uint256 gammaDifference) external onlyOwner{
// Detect from mapping if LP is delta-gamma hedge with a power-perp or future / borrowing
// Change accordingly to price movement and rebalance threshold if only delta-neutral


// 1. conditional statement to check if LP is delta-gamma hedge or only delta
// 2. if LP is delta hedged, check rebalance threshold, if exceeded, rebalance accordingly --> futures / borrowing
// 3. if LP is delta-gamma hedged, ensure both are within expected boundaries --> power perps
}
}
4 changes: 3 additions & 1 deletion src/Hook/univ4-risk-neutral-hook.sol
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ contract univ4riskneutralhook is BaseHook, Ownable {
bool isBorrowing;
}

mapping(address => (mapping LpHedge => LpGreeks)) public hedgeMap;

// Hedge Manager
HedgeManager hedgeManager;

Expand Down Expand Up @@ -329,7 +331,7 @@ contract univ4riskneutralhook is BaseHook, Ownable {
// updateLpGreeks();

// Re-hedge positions accordingly
// hedgeManager.modifyHedgePosition();
// hedgeManager.modifyHedgePosition(uint256 deltaDifference, uint256 gammaDifference);

// Update the gas price moving average with the gas price of this swap
updateMovingAverage();
Expand Down

0 comments on commit 98675c7

Please sign in to comment.