LayerHopDocsLaunch app (opens in a new tab)

AMOUNT_TOO_SMALL

Amount too small: The input amount is zero or below the route's minimum. When LayerHop can tell the minimum, error.details.minAmount (base units), minAmountUsd and minAmountApprox say how much the route needs.

HTTP status Retry
400 no

Where it comes from: GET /v1/quote / POST /v1/quote (amount 0, or every provider failed below its minimum); also mapped from provider errors (for example Relay AMOUNT_TOO_LOW).

Causes#

  • amount is "0".
  • The amount does not cover the route's fixed costs (bridge fees, destination gas).
  • The amount was sent in human units instead of base units ("1" USDC means 0.000001 USDC).

How to fix#

  • Send base units: 1 USDC is "1000000" (6 decimals), 1 SOL is "1000000000" (9 decimals).
  • Increase the amount to at least error.details.minAmount when it is present (minAmountApprox: true means LayerHop found it by quoting $10 / $25 / $50; the true minimum is at most that).
  • Increase the amount; cross-chain routes need more than same-chain swaps.

Example response#

JSON
{
  "error": {
    "code": "AMOUNT_TOO_SMALL",
    "message": "amount must be > 0",
    "requestId": "0d5e1f6a-3b2c-4d1e-8f9a-7b6c5d4e3f21",
    "docsUrl": "https://docs.layerhop.com/errors/AMOUNT_TOO_SMALL"
  }
}

See Error handling & retries for a retry strategy, and the error catalog for every code.

Last updated