Launch App

Error Codes & Troubleshooting

A guide to understanding smart contract reverts, API failure states, and common developer issues when building on Longbow.

Solidity Revert Errors

The LongbowExecutor contract enforces security assertions before conducting any on-chain swap. Here are the error strings and custom error reverts you might encounter:

Revert ErrorMeaningSolution
StalePrice()The Chainlink price feed has not been updated within maxPriceAge (default 1h).Wait for the stock exchange to open or for the oracle provider to update the feed.
OraclePaused()The stock token's issuer has paused pricing (e.g. during a split, halt, or corporate merger).Execution is suspended until corporate actions complete and oracle resumes.
SequencerDown()The Robinhood Chain L2 sequencer oracle reports that the L2 sequencer is currently offline.Wait for the chain sequencer to recover.
SequencerGraceActive()The L2 sequencer just restarted. A 1-hour safety grace period is active to prevent frontrunning.Wait for the 1-hour grace period to elapse.
SlippageExceeded()The swap output was lower than the user's minAmountOut slippage threshold.Recalculate minAmountOut with a wider slippage tolerance or check pool reserves.
Expired()The order's expiry timestamp has already passed.The order is dead. Create a new order with a longer expiry time.
OutOfRuns()DCA order remainingRuns is already 0.The order is completed. Cancel it or create a new DCA schedule.
InvalidPath()The swap path does not start with tokenIn and end with tokenOut.Ensure path is [tokenIn, USDG] or [USDG, tokenOut] depending on the trade direction.

Client-Side & Wallet Issues

  • "Insufficient Allowance" Revert — The user approved the token, but the approved amount is lower than the order's amountIn. Note that for DCA orders, the user must approve the total value: amountIn × runs, or approve dynamic allowance.
  • USDG 18-Decimal Bug — The USDG stablecoin uses **6 decimals**, unlike stock tokens which use **18 decimals**. Make sure you call parseUnits("100", 6) for USDG, not parseEther("100").
  • Mock Mode Stuck — If your app shows simulated data but you want real testnet/mainnet data, check if NEXT_PUBLIC_USE_MOCKS=true is set in your env. Set it to false and restart the Next.js server to fetch from the RPC.

HTTP API Error States

API routes under `/api/*` use standard HTTP status codes:

  • 400 Bad Request — Missing query parameters (e.g. `GET /api/quote` without `?symbol=TSLA`).
  • 429 Too Many Requests — You have hit Finnhub's free API rate limit (60 requests/minute). Configure a paid or standard key in your `.env` under FINNHUB_API_KEY to increase caps.
  • 500 Internal Server Error — Database connection loss or RPC timeout. Check logs.