Hadal
Start trading
  • OverviewStart
  • QuickstartStart
  • What is sealed and what is seenStart
  • Sealed balancesConcepts
  • Sealed ordersConcepts
  • The book and the pool's midConcepts
  • DealsConcepts
  • SoundingsConcepts
Start

Quickstart

From a wallet to a first swap: connect, unlock, open a balance, deposit, swap, read the receipt and withdraw, in the app or with the SDK.

This page takes one wallet through a first trade on Hadal. Each step is shown in the app and with the SDK, with the state it leaves you in. The detail of every step is in the guide it links to.

You need a Solana wallet that holds one of a market's two tokens, and SOL for transaction fees, account rent and computation fees. What each action costs is in Limits and measured figures.

The SDK steps share one client and a few inputs: rpcUrl, the wallet's keypair payer, the market's two mints, and clusterOffset, the Arcium cluster the venue computes on (2026 on mainnet).

ts
import { Connection } from '@solana/web3.js'
import { HadalClient, marketAddress } from '@hadal/sdk'

const connection = new Connection(rpcUrl, 'confirmed')
const hadal = new HadalClient({ connection, owner: payer.publicKey, clusterOffset })
const market = marketAddress(baseMint, quoteMint)

Amounts and prices in the SDK are integers in atoms: see Units.

  1. Connect

    Open Trade and press Connect wallet in the bar, then choose your wallet from the list. The order ticket shows the same wallets as buttons.

    State: connected and locked. Markets, prices and soundings are readable. Your sealed values show as sealed.

  2. Unlock

    Press Unlock in the bar or on the ticket and sign the message your wallet shows. It is a message, not a transaction.

    State: unlocked. You hold the reading key that seals your orders and reads your balances and receipts. Nothing moved. See The reading key.

  3. Open a balance

    Nothing to do before the deposit. Your first Deposit in a market opens your balance there, with a signature of its own: the deposit form shows First use of this market: Opens your balance.

    State: you have a balance account in this market, sealed to your reading key and empty. It is opened once per market.

  4. Deposit

    Open Portfolio. In the Deposit panel choose the market, the token and the amount, then press Deposit and sign. While the wallet is locked the panel shows Unlock in place of the button. The panel follows the deposit until the cluster has computed it.

    State: the tokens are in the market's vault and the amount is in your sealed balance. In the app the deposit shows Landed. With the SDK, balance.quote holds the amount. Every state a deposit can land in is in Deposit and withdraw.

  5. Swap

    Open Trade and pick the market. On the ticket keep Swap, choose Buy or Sell, enter a size and a limit, and press Swap. Sign once.

    State: the order is pending in the market's queue, with its side, size and limit sealed. When its turn comes it crosses the book at the pool's mid and sweeps the curve for the rest, inside the limit. Swap covers the limit, the estimate and every outcome.

  6. Read the receipt

    The ticket shows the result when the order has been processed: what filled and at what price, how much crossed and how much swept, and the fee. The same receipt is listed under Receipts on Trade and on Portfolio.

    State: the order is closed, your sealed balance holds what it bought, and the receipt is readable only with your reading key. Each field is explained in Read your receipts.

  7. Withdraw

    On Portfolio switch the panel to Withdraw, choose the market, the token and the amount, then press Withdraw and sign.

    State: when the sealed balance covers the amount, the tokens are in your wallet and the withdrawal shows Paid (paid is true). When it does not, the request is refused and nothing moves.

Where to go next