Skip to content

Core concepts

The envelope

Vector wraps every response in:

{ "code": 0, "data": , "message": "success" }

code: 0 means success. Errors reuse the HTTP status as the numeric code with data: null — for example a missing key:

{ "code": 401, "message": "missing api-key header", "data": null }

This envelope is different from Photon's and Meadow's — don't share response-parsing code between them.

Routes and legs

A quote returns route candidates. Each Route is a complete plan:

Field Meaning
quoteId Pins this exact route for building later.
amount, amountOut Input and expected output (base-10 integer strings).
minAmountOut Worst acceptable output after your slippage.
fees routeFee / integratorFee with USD figures.
gasFee Estimated execution gas (gasFee, gasFeeUsd, gasLimit).
path The legs to execute — each with provider, type, per-leg amounts.
providers The venues/bridges involved.
expiry When the quoteId stops being buildable.
routeKind sameChainSwap, or a bridge-involving kind for cross-chain routes.

Route modes

routeMode chooses the ranking:

  • max_value — highest output. The default; unknown values fall back to it.
  • fastest — lowest estimated completion time (estimatedTimeMs).
  • suggested — the platform's balance of value and speed.

Acquisition modes

How Vector takes custody of the input token when it executes for you:

Mode Name The user provides
2 Permit2 A PermitTransferFrom signature — token pulled by signature, no approval transaction (beyond the one-time Permit2 approval per token).
3 Permit2Witness The same, plus a witness binding the signature to {callDataHash, target} — the signature authorizes exactly one calldata on one contract.

Mode 3 is the strict-security variant: even the platform cannot execute anything other than the calldata the user signed. Both modes appear on gasless quotes as an eip712 payload ready for signTypedData.

Amounts, slippage, fees

  • Amounts are base-10 integer strings in the token's smallest unit — "25000000" is 25 USDC. Never send floats.
  • Slippage is a percentage: 1 means 1%.
  • Fees are basis points where a rate is expressed; concrete fee amounts on quotes are token-unit strings with USD equivalents. See Fees.

Field-casing quirks to respect

Two deliberate irregularities in the wire format:

Copy the reference examples exactly and you won't be surprised.

Status vocabularies

Two tracking surfaces, two vocabularies:

Gasless submissions also return a photonTxId — the same execution viewed from the relayer's side, queryable via Photon's transaction status.