Endpoints
Use the RPC, public API and maker API URLs supplied by your operator. Set them explicitly: SDK defaults select the mainnet hosts and do not discover the network from your trader ID. For an isolated network, use Local maker testing and its generated manifest.
The tables below identify SDK endpoint constants and program addresses. They do not establish availability or version compatibility. The operator must verify the program, gateway and SDK combination before onboarding a maker.
Environments
Devnet reference values
| What | Value |
|---|---|
Public API (flint.margin.user.v1, plus maker AuthService / MakerService / NodeService) | https://devnet.api.flint.trade |
Authenticated API (every flint.margin.maker.v1 service) | https://devnet.makerapi.flint.trade |
| Flint margin program | 4MxEr7W5f9xtajcTTpTTd5wfdBmwrF72j2NMg6YzXgMo |
| Flint oracle program | fnt2ARonSBGhBY1RTxVSvZ3p8JSYi9iAE9Hkq5jXcmf |
| Trading app | devnet.app.flint.trade/perps |
| Dashboard (Kellnr token) | devnet.dash.flint.trade |
| Solana RPC | Bring your own devnet RPC (e.g. https://api.devnet.solana.com). |
Mainnet SDK defaults
| What | Value |
|---|---|
| Public API | https://mainnet.api.flint.trade (SDK default) |
| Authenticated API | https://mainnet.makerapi.flint.trade (SDK default) |
| Flint margin program | Obtain the tested address and SDK combination from the operator. |
Collateral assets, mints, and perp contracts are discovered at runtime
— MarketService.ListMarkets returns each collateral market's mint
and decimals, and PerpMarketService.ListPerpMarkets returns every
perp contract. Read them before selecting a collateral mint or perp ID.
Public and authenticated hosts
Margin uses the spot API's two listeners. Each host can have a different ingress policy:
| Host | Margin services | Auth |
|---|---|---|
api (public) | All eight flint.margin.user.v1 services; maker AuthService, MakerService, and NodeService | None for user services and NodeService; bearer session for MakerService. |
makerapi (authenticated) | Maker AuthService, MakerService, NodeService, TxService, SessionService, SpreadProtectService, EscalationService | Bearer session for all except AuthService and NodeService. |
TxService, SessionService, SpreadProtectService, and
EscalationService exist only on the authenticated host. Makers should point
their whole maker client — AuthService included — at the authenticated
host, so the session and the services that use it share one
connection.
Node discovery
Each hostname can resolve to several Flint nodes. The Rust maker client picks one for you:
- It resolves the host to every address and probes each with
NodeService.GetNodeInfo— connect time plus the median of three calls — skipping nodes that report themselves degraded or halted. - It pins the channel to the fastest healthy node, keeping the hostname for TLS, and re-probes every 10 s. It moves at once when the current node fails its probe, and for latency only when another node is both 10% and 5 ms faster on two probes in a row.
- The maker and public channels are discovered independently.
discovered_endpoint()anddiscovered_public_endpoint()report the pick;reprobe_endpoints()probes now. .endpoint_discovery(false)onClient::builder()turns it off. IP literals and channels you supply connect directly.
NodeService.ListNodes returns the published endpoints for a
cluster; a listed endpoint is not a promise that it is healthy. The
Rust user client connects to the endpoint you give it. The TypeScript
transport can race a list of hosts you pass it — see
TypeScript.
Choosing the endpoint in an SDK
Every SDK exports MAINNET_*, DEVNET_*, and DEFAULT_* endpoint
constants (DEFAULT_* is mainnet):
| Package | Constants |
|---|---|
flint-margin-user-client / @superis-labs/flint-margin-user-client | MAINNET_PUBLIC_ENDPOINT, DEVNET_PUBLIC_ENDPOINT, DEFAULT_PUBLIC_ENDPOINT |
flint-margin-maker-client / @superis-labs/flint-margin-maker-client | MAINNET_MAKER_ENDPOINT, DEVNET_MAKER_ENDPOINT, DEFAULT_MAKER_ENDPOINT |
use std::sync::Arc;
use flint_margin_maker_client::DEVNET_MAKER_ENDPOINT;
use flint_margin_user_client::DEVNET_PUBLIC_ENDPOINT;
// Public user API.
let user = flint_margin_user_client::Client::connect(DEVNET_PUBLIC_ENDPOINT).await?;
// Maker API — authenticated host, so TxService is available.
let maker = flint_margin_maker_client::Client::connect(
DEVNET_MAKER_ENDPOINT,
Arc::new(keypair),
)
.await?;import {
DEVNET_PUBLIC_ENDPOINT,
createPerpMarketClient,
} from "@superis-labs/flint-margin-user-client";
import {
AuthFlow,
DEVNET_MAKER_ENDPOINT,
createMakerClient,
} from "@superis-labs/flint-margin-maker-client";
const perps = createPerpMarketClient({ baseUrl: DEVNET_PUBLIC_ENDPOINT });
const auth = new AuthFlow({ baseUrl: DEVNET_MAKER_ENDPOINT, signer });
const maker = createMakerClient({ auth });The program address is baked into the on-chain clients as
FLINT_ID (Rust) and FLINT_PROGRAM_ADDRESS (TypeScript). See
On-chain clients.