Skip to content
Logo

Getting started

From a fresh wallet to a closed trade on Flint perps.

Flint is a cross-margin exchange: one trading account holds your collateral, your perp positions, and any lending or borrowing, and its health is measured across all of them. Market orders must fill in full immediately. Limit orders can fill immediately or leave size resting on the book, according to their time in force. Read How Flint perps work for the background; this page is the hands-on path.

What you need

You needWhy
A Solana wallet that supports Wallet Standard (Phantom, Solflare, Backpack, …)It owns your trading account and signs deposits, withdrawals, and account changes.
Collateral in that walletAny asset with a listed margin market counts; USDC is the default. See Collateral & margin.
A little SOLWallet-signed transactions pay their own network fees and the rent for your account.

The path

#StepWhere
1Connect a walletApp header
2Create a trading accountAccount panel (optional; a first deposit does it)
3Deposit collateralDeposit dialog
4Open a positionOrder ticket
5Close itPositions tab → Close
6Settle PnL and withdrawSettlements tab, Withdraw dialog

The Flint web app currently runs on devnet at devnet.app.flint.trade/perps.

1. Connect a wallet

Click Connect in the header and pick your wallet from Select wallet. Every installed Wallet Standard wallet appears in the list. If none is installed, the app links to Phantom, Solflare, and Backpack.

Make sure the wallet is on the same network as the app. A wallet with no SOL on that network can't pay fees, and the app says so before sending.

2. Create a trading account

A trading account is an on-chain account owned by your wallet. It's identified by a numeric trader id that every API call uses.

With a wallet connected and no account, the app shows No trading account with two buttons:

  • Create account creates an empty account.
  • Deposit creates the account and funds it in the same transaction.

Either is fine. You can hold several accounts per wallet. Use New trading account in the account menu, and switch between them in Trading accounts. Each account is margined on its own.

3. Deposit collateral

Open Deposit from the account bar or the account drawer.

  1. Deposit from: your connected wallet, or another of your trading accounts.
  2. Asset: any listed margin asset. Native SOL is wrapped for you, and the app keeps 0.005 SOL back for fees.
  3. Amount: click the Depositable figure to use the maximum.
  4. Check the After this transfer preview (equity, free collateral, health ratio), then press Deposit {asset} and Confirm.

There's no minimum deposit. Deposits sit as idle collateral. They count toward margin at the asset's collateral weight but earn no interest unless you lend them. See Collateral & margin.

4. Open a position

The order ticket is on the right of the trading screen.

  1. Pick Long or Short.
  2. Pick Market or Limit. Market orders use fill-or-kill (FOK): the full size must fill or nothing changes. Limit orders offer GTC, GTD, IOC, or FOK. GTC and GTD can leave unfilled size resting on the book. See Orders for expiry, post-only, and reduce-only controls.
  3. Enter a Size in the base asset, or toggle to USD. The 25% / 50% / 75% / Max chips size against your free collateral.
  4. Set Leverage with the slider. Leverage only sizes the order; your account is cross-margined, so there's no per-position leverage on-chain.
  5. Review Estimates: average fill price, margin required, liquidation price, slippage, taker fee, and health before and after.
  6. Press the main button, e.g. Open long · SOL.

Your wallet signs the order, unless you've set up 1-click trading or a passkey, in which case Flint pays the fee. Turn on Order confirmations under Configuration → Trading if you want every ticket to need a second press.

5. Close it

In the account drawer's Positions tab, press Close on the row. The Close position dialog closes 25%, 50%, 75%, or all of the position with a reduce-only FOK order at your max slippage. The full selected size must fill or nothing changes. See Positions & PnL.

6. Settle PnL and withdraw

Closing a position realises its PnL, but realised PnL isn't cash in your account until it's settled into a balance. Open the Settlements tab and press Settle (or Settle all). Losses are paid from your idle balance and borrowed if that runs short. Gains are paid from the contract's PnL pool. See Positions & PnL.

Then open Withdraw, pick the asset and amount (the Available figure is the most you can take), and confirm. A withdrawal is allowed only if the account still meets initial margin afterwards, so you can't withdraw collateral that's backing open positions.

Programmatic access

Bots and dashboards use two layers:

LayerWhat it doesPackage
Margin user API (flint.margin.user.v1)Public reads: markets, books, account health, positions, fills, PnL history, leaderboard. Order previews and fee sponsorship.@superis-labs/flint-margin-user-client, flint-margin-user-client
Margin programEvery state change (create account, deposit, trade, settle, withdraw) is a Solana transaction you build and sign.On-chain clients, re-exported by both SDKs

The API never holds keys and has no "submit order" endpoint. You build the instruction, sign it, and send it to Solana (or, for passkey and delegate trades, to the sponsorship service).

Read an account

Every margin user service is public, so there's no auth step. Endpoints are listed on Endpoints.

use flint_margin_user_client::{Client, DEVNET_PUBLIC_ENDPOINT};
use flint_margin_user_client::proto::{GetAccountRequest, TraderId};
 
let client = Client::connect(DEVNET_PUBLIC_ENDPOINT).await?;
let snapshot = client
    .account()
    .get_account(GetAccountRequest { trader_id: Some(TraderId { id: 42 }) })
    .await?
    .into_inner()
    .account;

AccountService.ListAccounts({ authority }) finds the trader ids a wallet owns or is a delegate of.

Create a trading account

The program derives a trading account's address from the trader id alone (["trader_account", u64_le(trader_id)]), so ids are global. Pick one nobody holds yet; the app checks ids upward from 0 until it finds a free one.

import type { Address } from "@solana/kit";
import {
  findTraderAccountPda,
  getCreateTraderAccountInstruction,
} from "@superis-labs/flint-margin-user-client";
 
const traderId = 42n;
const [traderAccount] = await findTraderAccountPda({ traderId }, { programAddress });
const ix = getCreateTraderAccountInstruction(
  {
    rentPayer: wallet,
    owner: wallet,
    traderAccount,
    systemProgram: "11111111111111111111111111111111" as Address,
    traderId,
  },
  { programAddress },
);

wallet is a @solana/kit TransactionSigner; createTransactionSigner adapts a browser wallet's signTransaction to one. Pass the programAddress for your cluster. Deposits (deposit), withdrawals (withdraw), and PnL settlement (settleRealisedPnl) are built the same way; see On-chain clients. To place orders, see Orders → Placing orders from code.