File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
pkg/liquidity-source/uniswap/v4/hooks/deli Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -16,11 +16,14 @@ type Hook struct {
1616}
1717
1818var _ = uniswapv4 .RegisterHooksFactory (func (param * uniswapv4.HookParam ) uniswapv4.Hook {
19- return & Hook {
20- BaseHook : & uniswapv4.BaseHook {Exchange : valueobject .ExchangeUniswapV4Deli },
21- FeeTier : big .NewInt (int64 (param .Pool .SwapFee )),
22- isWBTLToken0 : param .Pool .Tokens [0 ].Address == wBLT ,
19+ hook := & Hook {
20+ BaseHook : & uniswapv4.BaseHook {Exchange : valueobject .ExchangeUniswapV4Deli },
2321 }
22+ if pool := param .Pool ; pool != nil {
23+ hook .FeeTier = big .NewInt (int64 (param .Pool .SwapFee ))
24+ hook .isWBTLToken0 = param .Pool .Tokens [0 ].Address == wBLT
25+ }
26+ return hook
2427}, HookAddresses ... )
2528
2629func (h * Hook ) BeforeSwap (params * uniswapv4.BeforeSwapParams ) (* uniswapv4.BeforeSwapResult , error ) {
You can’t perform that action at this time.
0 commit comments