Skip to content

Commit 0d5feca

Browse files
authored
fix: deli hook init (#1143)
1 parent 4060fef commit 0d5feca

File tree

1 file changed

+7
-4
lines changed
  • pkg/liquidity-source/uniswap/v4/hooks/deli

1 file changed

+7
-4
lines changed

pkg/liquidity-source/uniswap/v4/hooks/deli/hook.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@ type Hook struct {
1616
}
1717

1818
var _ = 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

2629
func (h *Hook) BeforeSwap(params *uniswapv4.BeforeSwapParams) (*uniswapv4.BeforeSwapResult, error) {

0 commit comments

Comments
 (0)