diff --git a/src/hooks/use-barter-validation.ts b/src/hooks/use-barter-validation.ts index aec74abf..fac231b6 100644 --- a/src/hooks/use-barter-validation.ts +++ b/src/hooks/use-barter-validation.ts @@ -6,7 +6,7 @@ import { fetchBarterRoute } from "@/lib/barter-api" import { ZERO_ADDRESS, WETH_ADDRESS } from "@/lib/swap-constants" import type { Token } from "@/types/swap" -const DEBOUNCE_MS = 1500 +const DEBOUNCE_MS = 300 const MAX_SLIPPAGE_PCT = 2.0 interface UseBarterValidationParams { diff --git a/src/hooks/use-swap-form.ts b/src/hooks/use-swap-form.ts index 9cac9598..03fbab0a 100644 --- a/src/hooks/use-swap-form.ts +++ b/src/hooks/use-swap-form.ts @@ -278,7 +278,7 @@ export function useSwapForm(allTokens: Token[]) { // --- Minimum "Calculating..." display time --- // The combined validating signal (quote loading OR barter validating) must stay true // for at least 1.5s to prevent the swap button text from flickering. - const MIN_VALIDATING_DISPLAY_MS = 1500 + const MIN_VALIDATING_DISPLAY_MS = 500 const rawValidating = isBarterValidating || (isQuoteLoading && !isWrapUnwrap) const [debouncedValidating, setDebouncedValidating] = useState(false) const validatingSinceRef = useRef(0) diff --git a/src/hooks/use-swap-quote.ts b/src/hooks/use-swap-quote.ts index 5b324449..80da5261 100644 --- a/src/hooks/use-swap-quote.ts +++ b/src/hooks/use-swap-quote.ts @@ -399,7 +399,7 @@ export function useQuote({ amountIn, slippage, enabled = true, - debounceMs = 500, + debounceMs = 300, tradeType = "exactIn", tokenList = [], }: UseQuoteProps): UseQuoteReturn {