Documentation Index
Fetch the complete documentation index at: https://docs.argyros.xyz/llms.txt
Use this file to discover all available pages before exploring further.
SDK Configuration
SDKConfig
Pass a config object to the ArgyrosSDK constructor:
import { ArgyrosSDK } from "@argyros/sdk";
const sdk = new ArgyrosSDK({
apiKey: "argy_your_api_key",
chain: "solana",
baseUrl: "https://api.argyros.xyz",
timeout: 30000,
retries: 2,
});
Options
| Option | Type | Default | Required | Description |
|---|
apiKey | string | — | yes | Your Argyros API key. Sent as Authorization: Bearer <apiKey>. |
chain | "solana" | "fogo" | "solana" | no | Target chain. Appended as ?chain=<value> to every request. |
baseUrl | string | "https://api.argyros.xyz" | no | API base URL. Trailing slashes are stripped automatically. |
timeout | number | 30000 | no | Per-request timeout in milliseconds. Uses AbortController. |
retries | number | 2 | no | Number of retry attempts for retryable errors (429, 5xx, network failures). Total attempts = retries + 1. |
Chains
| Chain | Description | Token Standard |
|---|
"solana" | Solana mainnet | SPL Token / Token-2022 |
"fogo" | Fogo chain | SPL Token |
The chain parameter is sent as a query parameter on every API call. It determines which set of DEX markets the aggregator searches.
Retry Behavior
The SDK retries automatically on transient failures:
| Condition | Retried | Backoff |
|---|
| HTTP 429 (rate limit) | yes | Exponential: 1s, 2s, 4s, … (max 8s) |
| HTTP 5xx (server error) | yes | Exponential: 1s, 2s, 4s, … (max 8s) |
| Network error / timeout | yes | Exponential: 1s, 2s, 4s, … (max 8s) |
| HTTP 400 (bad request) | no | — |
| HTTP 401/403 (auth) | no | — |
| HTTP 404 (no route) | no | — |
With the default retries: 2, the SDK makes up to 3 attempts before throwing.
Self-Hosted API
If you run your own route-engine instance, point the SDK at it:
const sdk = new ArgyrosSDK({
apiKey: "any-value",
baseUrl: "http://localhost:8080",
});