Skip to main content

API overview

Base URLhttps://testnet.blockfinax.com/api/v2
FormatJSON over HTTPS
AuthAuthorization: Bearer <sessionToken> or X-Session-Token, where marked. See Authentication.
SigningThe API never signs for users. .../prepare endpoints return unsigned transactions; the user's passkey signs; POST /transactions/relay submits.

Resource ids​

Pools and positions are addressed by a resource id, chain:contract:kind/number:

stellar-testnet:CAEKJTUSZIWY5OMK6EVOSNPMEULI3MDO3BLP6Y5OKPHRNKM6KTH5YURM:pool/1
stellar-testnet:CAEKJTUSZIWY5OMK6EVOSNPMEULI3MDO3BLP6Y5OKPHRNKM6KTH5YURM:position/12

URL-encode them in paths (: as %3A, / as %2F). In JSON responses they appear as { chain, contract, id }.

Values​

ValueFormatExample
USDC amountsDecimal string in USDC"274.28"
RatesDecimal string"1332.819531"
...E6 fieldsInteger per millionfairRateE6: 23851 is 2.3851%
...Bps fieldsInteger basis pointsmarkupBps: 11500 is 115%
TimesUnix seconds1793663852
directionup (Up cover: pays if the rate rises) or down (Down cover: pays if it falls)
structurecapped (shown to users as Limited) or open

Errors​

{ "error": { "code": "QUOTE_EXPIRED", "message": "..." } }
HTTPCodes
401UNAUTHORIZED
404POOL_NOT_FOUND
409INSUFFICIENT_LIQUIDITY, QUOTE_EXPIRED, QUOTE_USED, CHAIN_DRAINING
503CHAIN_NOT_ENABLED
500UNKNOWN
400Every other code

See Errors.

Endpoints​

GroupPage
Markets and pricingMarkets and pricing
ProtectionProtection
Pools and liquidityPools and liquidity
Accounts, wallet and transactionsAccounts and transactions