API overview
| Base URL | https://testnet.blockfinax.com/api/v2 |
| Format | JSON over HTTPS |
| Auth | Authorization: Bearer <sessionToken> or X-Session-Token, where marked. See Authentication. |
| Signing | The 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
| Value | Format | Example |
|---|---|---|
| USDC amounts | Decimal string in USDC | "274.28" |
| Rates | Decimal string | "1332.819531" |
...E6 fields | Integer per million | fairRateE6: 23851 is 2.3851% |
...Bps fields | Integer basis points | markupBps: 11500 is 115% |
| Times | Unix seconds | 1793663852 |
direction | up (Up cover: pays if the rate rises) or down (Down cover: pays if it falls) | |
structure | capped (shown to users as Limited) or open |
Errors
{ "error": { "code": "QUOTE_EXPIRED", "message": "..." } }
| HTTP | Codes |
|---|---|
| 401 | UNAUTHORIZED |
| 404 | POOL_NOT_FOUND |
| 409 | INSUFFICIENT_LIQUIDITY, QUOTE_EXPIRED, QUOTE_USED, CHAIN_DRAINING |
| 503 | CHAIN_NOT_ENABLED |
| 500 | UNKNOWN |
| 400 | Every other code |
See Errors.
Endpoints
| Group | Page |
|---|---|
| Markets and pricing | Markets and pricing |
| Protection | Protection |
| Pools and liquidity | Pools and liquidity |
| Accounts, wallet and transactions | Accounts and transactions |