@@ -6,12 +6,10 @@ import { zapAbi } from "@delvtech/hyperdrive-js";
6
6
import { useAddRecentTransaction } from "@rainbow-me/rainbowkit" ;
7
7
import { MutationStatus } from "@tanstack/query-core" ;
8
8
import { useMutation } from "@tanstack/react-query" ;
9
- import { Token } from "@uniswap/sdk-core" ;
10
9
import toast from "react-hot-toast" ;
11
10
import { useAppConfigForConnectedChain } from "src/ui/appconfig/useAppConfigForConnectedChain" ;
12
11
import { SUCCESS_TOAST_DURATION } from "src/ui/base/toasts" ;
13
12
import { usePreviewCloseLong } from "src/ui/hyperdrive/longs/hooks/usePreviewCloseLong" ;
14
- import { fetchUniswapPath } from "src/ui/hyperdrive/zaps/fetchUniswapPath" ;
15
13
import { useTokenFiatPrice } from "src/ui/token/hooks/useTokenFiatPrice" ;
16
14
import TransactionToast from "src/ui/transactions/TransactionToast" ;
17
15
import { Address , encodePacked , WalletClient } from "viem" ;
@@ -106,25 +104,6 @@ export function useCloseLongZap({
106
104
} ) ,
107
105
) ;
108
106
109
- const swapPath = await fetchUniswapPath ( {
110
- tokenIn : new Token (
111
- 1 , // TODO: Use the chainId from the current chain
112
- baseToken . address ,
113
- baseToken . decimals ,
114
- baseToken . symbol ,
115
- baseToken . name ,
116
- ) ,
117
- tokenOut : new Token (
118
- 1 , // TODO: Use the chainId from the current chain
119
- tokenOut . address ,
120
- tokenOut . decimals ,
121
- tokenOut . symbol ,
122
- tokenOut . name ,
123
- ) ,
124
- recipient : destination ?? account ,
125
- amountIn : previewBaseTokenAmountOut ,
126
- } ) ;
127
-
128
107
try {
129
108
const hash = await drift . write ( {
130
109
abi : zapAbi ,
@@ -151,13 +130,11 @@ export function useCloseLongZap({
151
130
amountOutMinimum : minAmountOut ?? 1n ,
152
131
deadline : block . timestamp + 60n ,
153
132
// Use the fetched Uniswap path if available, otherwise fall back to direct path
154
- path : swapPath
155
- ? swapPath
156
- : encodePacked (
157
- // Direct path between tokens with 1% fee
158
- [ "address" , "uint24" , "address" ] ,
159
- [ baseToken . address , 100 , tokenOut . address ] ,
160
- ) ,
133
+ path : encodePacked (
134
+ // Direct path between tokens with 1% fee
135
+ [ "address" , "uint24" , "address" ] ,
136
+ [ baseToken . address , 100 , tokenOut . address ] ,
137
+ ) ,
161
138
recipient : destination ?? account ,
162
139
} ,
163
140
} ,
0 commit comments