> ## Documentation Index
> Fetch the complete documentation index at: https://solana.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> This page is part of the Solana developer documentation at https://solana.com/developers/docs. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get the page as Markdown.
> Index of all pages: https://solana.com/llms.txt. Per-section indexes such as https://solana.com/developers/docs/payments/llms.txt are smaller; prefer them when working on one task.
> Coding agents: install the official Solana skill for current APIs and conventions with `npx skills add https://github.com/solana-foundation/solana-dev-skill` (also served at https://solana.com/SKILL.md).
> Code in the cookbook and task pages comes from tested example files. Prefer it over writing API calls from memory.

# Markets

> Build trading systems, integrate DEXs and oracles, and run financial applications on Solana.

Solana has one global state, 200ms slots, and sub-cent fees. One transaction
can call any program, such as DEXs, lending markets, oracles, and perps, and
it runs all or nothing.

<ol className="sol-flow not-prose" aria-label="Market data becomes a quote and signed transaction that onchain programs execute atomically"><li><b>Fetch</b><span>prices and liquidity</span></li><li><b>Quote</b><span>a route within slippage</span></li><li><b>Sign</b><span>the swap transaction</span></li><li><b>Execute</b><span>every instruction atomically</span></li><li><b>Settle</b><span>both balances at once</span></li></ol>

## Start building

New to settlement on Solana? Watch a trade priced from a live oracle settle
both legs at once, then settle one from your own machine with the DvP program.

<div className="sol-pcard not-prose" data-path="settle-trade">
<div className="sol-pcard-main">
<p className="sol-pcard-k">Settle a trade atomically · <span className="sol-nowrap">4 steps · \~40 min</span></p>
<p className="sol-pcard-title">[Settle a trade](/developers/docs/defi/settle-trade)</p>
<p className="sol-pcard-desc">Price a trade from a live oracle, then settle it so the asset and the USDC payment move in one transaction, or neither does.</p>
<ol className="sol-pcard-steps"><li>[Watch a trade settle](/developers/docs/defi/settle-trade/try-it)</li><li>[Read the code](/developers/docs/defi/settle-trade/browser)</li><li>[Run it from your machine](/developers/docs/defi/settle-trade/local)</li><li>[Go live](/developers/docs/defi/settle-trade/go-live)</li></ol>
</div>
<p className="sol-pcard-cta">[Start the tutorial →](/developers/docs/defi/settle-trade)</p>
</div>

<Columns cols={2}>
  <Card title="Add Solana to your exchange" href="/developers/docs/defi/exchange">
    Deposits, withdrawals, and account handling for exchanges and custodians
  </Card>
  <Card title="DvP program reference" href="/developers/docs/defi/dvp-program">
    Program ID, accounts, instructions, and errors for settling both legs
    through escrow
  </Card>
  <Card title="Delivery vs payment" href="/developers/docs/tokenization/dvp">
    Settle securities against USDC in one transaction with token delegation,
    no custom program
  </Card>
  <Card title="Confidential settlement" href="/developers/docs/defi/confidential-settlement">
    What each privacy option can hide when you settle a trade
  </Card>
  <Card title="Choosing the cash leg" href="/developers/docs/defi/cash-leg">
    A stablecoin, a tokenized deposit, or an offchain payment, and how the
    mint's controls affect each
  </Card>
  <Card title="Settlement and finality" href="/developers/docs/defi/finality">
    Which commitment level a system of record should treat as settled
  </Card>
</Columns>

## Ship reliably

<Columns cols={2}>
  <Card title="Protect against MEV" href="/developers/docs/defi/mev-protection">
    Keep transactions out of sandwich attacks
  </Card>
  <Card title="Stake-weighted QoS" href="/developers/docs/defi/stake-weighted-qos">
    Guaranteed transaction lanes for latency-sensitive flows
  </Card>
</Columns>

## Related use cases

<Columns cols={2}>
<Card title="Assets" icon="layers" href="/developers/docs/assets" arrow>
Issue the tokens that trade here: tokenized funds, securities, and stablecoins.
</Card>
<Card title="Payments" icon="credit-card" href="/developers/docs/payments" arrow>
Send, accept, and reconcile stablecoin payments.
</Card>
</Columns>
