Skip to content
LitVMSwapDocs
Open app
Developers / Troubleshooting
Developers · Help

Troubleshooting

Things break. Here are the usual suspects, roughly in the order people run into them.

API says "Token not found"

The Swap API only routes listed tokens. Check the address against /partner/tokens, and make sure you used the 0xEeee… placeholder for native zkLTC (not the zero address, not wzkLTC).

API says "No route found"

No pool path has enough liquidity for that pair and size. Try a smaller amount. If the pair has no pool at all, nothing can route it until someone adds liquidity.

Quote looks a bit low

partnerFeeBps defaults to 10. If you don't charge an integrator fee, pass partnerFeeBps=0 and the numbers will match what the app shows.

The swap transaction reverts

Most reverts come down to one of these:

What you seeWhat it meansFix
InsufficientAmountAfterFees (0x6145e8b9)Output came in under minAmountOut. The price movedFetch a fresh /partner/swap and resend. Raise slippage a little for volatile tokens
transferFrom failed / SafeERC20FailedOperation (0x5274afe7)The swap contract couldn't pull your tokenApprove spender for at least amount, and check the balance
InsufficientNativeValue (0x35898e6e)Sent less zkLTC than the swap needsSend exactly transaction.value
UnexpectedNativeValue (0xe0aeda7d) / NativeNotAccepted (0x1a9fe9f6)Sent zkLTC with a token sellvalue must be 0 when you sell an ERC-20
ReferrerFeeAboveMaximum (0x25a0d875)Integrator fee over 500 bpsKeep partnerFeeBps (or widget fee) at 500 or lower
BuyAndSellTokensAreSame (0xdef6e22c)fromToken equals toTokenPick two different tokens
Out of gasGas limit set by hand too lowLet the wallet estimate, or add headroom for multi-hop routes

Got a raw revert like 0x6145e8b9? The first 4 bytes are the error selector. Match it against the table, or paste the transaction hash into the explorer.

Wallet is on the wrong network

Everything here is on chain id 4441. Prompt the user to switch, or add the chain with wallet_addEthereumChain (see Network setup).

Amounts are off by a factor of 10^something

Two classics:

  • API vs chain units. The API wants "1.5". Contracts want 1500000000000000000 (for 18 decimals).
  • Wrong decimals. Read decimals() from the token. ZKUSDC on LitVM has 18, not 6.

eth_getLogs errors or times out

Your block range is too big. Use chunks of about 5,000 blocks. See scanning logs in chunks.

Block numbers don't line up

Inside a contract, block.number is the parent chain's block number. Use ArbSys(0x64).arbBlockNumber() for LitVM's own number. Details on Network setup.

V3 calldata doesn't match

The SwapRouter here is the original one, with deadline inside the params struct. SwapRouter02 style calldata (no deadline) won't decode. See V3 pools.

Still stuck?

Come say hi in the builders Telegram. Bring the request you sent (minus any private keys, obviously) or the transaction hash. We'll take a look.

Never share a private key or seed phrase

Nobody from LitVMSwap will ever ask for one. Not in Telegram, not in DMs, not "to debug your integration".