FUNCTOR API

API reference · testnet

Errors

What each status code and error message means, and what to do about it.

HTTP status codes

CodeMeaning
200Answered. For /exchange, check status: the action itself may have failed in its block
400Bad request, or refused before it reached a block (reason in the body)
403Refused by Cloudflare (for example a request that sets CF-Connecting-IP)
404Unknown endpoint
405Wrong method (/info, /exchange and /faucet are POST)
426/ws without a WebSocket upgrade
429Rate limited: wait Retry-After seconds (Rules)

Refused before a block

400, {"status": "err", "response": "<message>"}. Nothing happened and the nonce was not used.

MessageNotes
bad request: …The body isn't a valid request (missing field, wrong type, unknown action type)
signature is not hex
signatureChainId is required for wallet-signed actionsSee Signing
bad signature: Malformed | BadRecoveryId | NonCanonical | UnrecoverableNot 65 bytes; v not 0, 1, 27 or 28; high-s (EIP-2); or no key recovers
signer is neither the account nor its approved agentWrong key, wrong chain id, or a field differs from what was signed
protocol accounts cannot be used
this node has no spot market
cannot send to a protocol accountspotSend
invalid agentapproveAgent: the agent is the signer itself or a protocol account
address rate limit: … next request allowed in … msSee Rules: address limits
nonce outside (now − 2 days, now + 1 day)See Rules: nonces
nonce already usedSafe to treat as a duplicate of an accepted request
nonce below the signer's windowSee Rules: nonces
tif must be Gtc, Ioc or Alo
unknown vaultvaultTransfer
user must be a 0x address/faucet
invalid address/faucet: a protocol account or the zero address
faucet already used; try again in … min/faucet: once per address per 24 hours

Failed in a block

200, status: "err", result.ok: false, and result.error holds the chain's error, nested as Outer(Inner), for example Ch(InsufficientMargin), Spot(CancelFrozen), Vault(Locked { until_ms: 1791754154108 }) or TooManyOpenOrders { open: 1000, limit: 1000 }. The nonce was used.

TxError

VariantMeaning
NotValidatorValidator-only action
StaleOracleThe market's oracle price is stale: only reduce-only orders until it is fresh
NoSpotMarketThis node has no spot market
WithdrawalsPausedSome account has negative equity: withdrawals and perpetuals → spot transfers wait until it is settled
TooManyOpenOrdersTooManyOpenOrders { open, limit }: the account is at its open-order limit (see Rules)
ChPerpetuals error, below
OracleOracle error (validators only)
SpotSpot error, below
VaultVault error, below

ChError

VariantMeaning
UnknownMarketNo such market
NoMarkPriceThe market has no mark price yet
InsufficientMarginNot enough margin for the order or the leverage change
InsufficientBalanceNot enough withdrawable USDC
ReduceOnlyWouldIncreaseA reduce-only order would increase the position
ZeroAmountAmount is zero
ProtocolAccountProtocol accounts can't do this
NotLiquidatableThe account is not liquidatable
OrderTooLargeOrder notional above the market maximum
PriceTooFarFromOracleLimit price more than 20% from the oracle
TooAggressiveAtOiCapAt the open-interest cap, orders priced through the oracle are refused
OpenInterestCapThe order would take open interest above the cap
OpenInterestIncreaseTooFastOpen interest is growing too fast this block
NoOraclePriceNo oracle price yet
FundingNotDueInternal: funding is settled once an hour
TimeWentBackwardsInternal: an older price update
OrderTooSmallOrder notional below $10 (reduce-only orders are exempt)
InvalidLeverageLeverage 0 or above the market maximum
ExceedsMarginTierThe position would exceed its margin tier at this leverage
BookOrder book error, below
MathArithmetic overflow (report it)

LaunchError

VariantMeaning
TooSmallBelow the minimum order (1 FCTR)
ZeroPricePrice is zero
TifNotAllowedInPhaseAuctions take GTC orders only
CancelFrozenCancels are frozen in the opening auction's closing window
PriceOutsideBandContinuous trading: limit too far from the last price
InsufficientUsdcNot enough spot USDC to fund the bid
UnknownOrderNo such order
NotOwnerThe order belongs to another account
ReservedAccountProtocol accounts and the clearing pool can't trade or receive
TokenFCTR ledger error (for example sending locked FCTR)
BookOrder book error, below
MathArithmetic overflow (report it)

VaultError

VariantMeaning
UnknownVaultNo such vault
ZeroAmountAmount is zero
TooSmallDeposit worth less than one share
InsolventVault equity ≤ 0: no deposits or withdrawals
LockedLocked { until_ms }: inside the 4-day lock-up
NoSharesThe account holds no shares
IlliquidThe vault can't free enough margin for this withdrawal; nothing happened
NotAllowedVaults and protocol accounts can't deposit into a vault
ChPerpetuals error, above
MathArithmetic overflow (report it)

BookError

VariantMeaning
ZeroSizeSize is zero
ZeroPricePrice is zero
AloWouldCrossA post-only (ALO) order would have traded on arrival
DuplicateIdInternal: duplicate order id
UnknownOrderNo such order
NotOwnerThe order belongs to another account
MathArithmetic overflow (report it)

Generated from the node's source code by tools/api-docs.mjs; examples are real responses from https://api.functorfund.com. Questions: Telegram. Changes: News.

On this page

HTTP status codesRefused before a blockFailed in a block