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

# Quick Start: Your First Swap

> Go from zero to executing your first swap on Bolt's zero slippage execution layer in under five minutes. Install the SDK, connect to Sui, and trade programmatically.

This guide walks you through installing the Bolt Sui SDK, connecting to the network, and executing your first zero slippage swap. By the end, you will have a working integration that queries oracle prices, simulates output, and submits a trade on-chain.

<Info>
  This guide targets developers building DApps, aggregators, or any application that routes swaps through Bolt on Sui. Market maker integration requires a separate onboarding flow. [Contact the team](https://calendar.google.com/calendar/u/0/appointments/schedules/AcZssZ0h8Dz0XD9uiYnrWu6PUHvRfnuoNjXyCJYnzFX8t548I1YO-qnJxJSOrvuWeenqacByagNyyB0E) if that is your use case.
</Info>

***

## Install, connect, and swap

<Steps>
  <Step title="Prerequisites">
    Before you start, make sure you have:

    * **Node.js 18+** installed
    * A **Sui-compatible wallet** (Sui Wallet, Suiet, etc.) for signing transactions
    * Access to **Sui RPC endpoints** (the SDK uses `https://fullnode.mainnet.sui.io:443` for mainnet and `https://fullnode.testnet.sui.io:443` for testnet by default)
  </Step>

  <Step title="Install the SDK">
    <Tabs>
      <Tab title="NPM">
        ```bash theme={null}
        npm install @bolt-liquidity-hq/sui-client
        ```
      </Tab>

      <Tab title="YARN">
        ```bash theme={null}
        yarn add @bolt-liquidity-hq/sui-client
        ```
      </Tab>

      <Tab title="PNPM">
        ```bash theme={null}
        pnpm install @bolt-liquidity-hq/sui-client
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Initialize the client">
    The SDK connects to mainnet by default. Pass `environment: 'testnet'` to use testnet instead.

    ```typescript theme={null}
    type Environment = 'mainnet' | 'testnet';
    ```

    <Tabs>
      <Tab title="Mainnet">
        ```typescript theme={null}
        import { BoltSuiClient } from '@bolt-liquidity-hq/sui-client';

        const client = new BoltSuiClient();
        ```
      </Tab>

      <Tab title="Testnet">
        ```typescript theme={null}
        import { BoltSuiClient } from '@bolt-liquidity-hq/sui-client';

        const client = new BoltSuiClient({
          environment: 'testnet',
        });
        ```
      </Tab>
    </Tabs>

    <Tip>
      Need a custom RPC endpoint or advanced overrides? See the [full client initialization options](https://docs.boltliquidity.io/sui-typescript-sdk#client-initialization) in the SDK reference.
    </Tip>
  </Step>

  <Step title="Query supported assets">
    Fetch all assets available on Bolt and find the denominations you need for your swap.

    ```typescript theme={null}
    // Get all supported assets
    const assets = await client.getAssets();
    assets.forEach((asset) => {
      console.log(`${asset.symbol} (${asset.name}): ${asset.denom}`);
      console.log(`  Decimals: ${asset.decimals}`);
    });

    // Find a specific asset
    const suiAsset = assets.find((a) => a.symbol === 'SUI');
    console.log(`SUI type: ${suiAsset?.denom}`); // "0x2::sui::SUI"
    ```
  </Step>

  <Step title="Simulate the swap">
    Before committing on-chain, simulate the swap to preview the expected output, fees, and pool routing. This is a dry run with no gas cost.

    ```typescript theme={null}
    const simulation = await client.simulateSwap({
      assetIn: '0x2::sui::SUI',
      amountIn: '1000000000', // 1 SUI (9 decimals)
      assetOut: '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC',
    });

    console.log(`Expected output: ${simulation.amountOut} USDC`);
    console.log(`Protocol fee: ${simulation.protocolFee}`);
    console.log(`LP fee: ${simulation.lpFee}`);
    console.log(`Total fees: ${simulation.totalFees}`);
    ```

    <Info>
      `simulateSwap()` uses current oracle prices and pool state. The output reflects exactly what the on-chain swap will return, because Bolt uses deterministic oracle-referenced pricing, not a bonding curve.
    </Info>
  </Step>

  <Step title="Execute the swap">
    Submit the swap on-chain. Bolt's prop-AMM executes at the oracle-validated price with zero slippage.

    ```typescript theme={null}
    // Get signer from wallet (implementation depends on wallet)
    const signer: Signer = await getSuiWalletSigner();

    // Execute a swap: exactly 1 SUI for USDC
    const result = await client.swap({
      assetIn: '0x2::sui::SUI',
      amountIn: '1000000000', // 1 SUI (9 decimals)
      assetOut: '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC',
      minimumAmountOut: '1900000', // Minimum 1.9 USDC (6 decimals)
    }, signer);

    console.log(`Swapped 1 SUI for ${result.amountOut} USDC`);
    console.log(`Transaction digest: ${result.txHash}`);
    console.log(`Gas cost: ${result.txOutput.effects.gasUsed.computationCost}`);
    console.log(`Status: ${result.txOutput.effects.status.status}`);
    ```

    <Warning>
      Always set `minimumAmountOut` in production. This protects against edge cases where oracle prices update between simulation and execution. See [slippage protection best practices](https://docs.boltliquidity.io/sui-typescript-sdk#best-practices) for a helper function.
    </Warning>
  </Step>
</Steps>

***

## What just happened

When you called `client.swap()`, your transaction went through Bolt's execution layer:

1. The **Oracle** provided a deterministic reference price from aggregated market data
2. The **Outpost** (on-chain smart contract) validated the price, checked expiry and deviation limits, and matched your order against the liquidity pool
3. The **Market Maker** settled the order on-chain, providing immediate liquidity at the oracle-validated price
4. You received USDC at exactly the quoted rate, with zero slippage

This is the same flow that powers swaps on [Cetus](https://www.cetus.zone/), [FlowX](https://flowx.finance), and [Aftermath Finance](https://aftermath.finance) today.

***

## What's next

<CardGroup cols={2}>
  <Card title="Sui TypeScript SDK" icon="code" href="/sui-typescript-sdk">
    Full API reference: oracle queries, pool inspection, advanced client configuration, and best practices.
  </Card>

  <Card title="Sui Outpost Addresses" icon="map-pin" href="/sui-outpost-addresses">
    Contract addresses for mainnet and testnet deployments.
  </Card>

  <Card title="Off-Chain Quoting" icon="calculator" href="/off-chain-quoting">
    Simulate swaps off-chain using deterministic pricing for your own UI.
  </Card>

  <Card title="Contract Math" icon="square-root-variable" href="/contract-math">
    Understand the pricing formula behind simulateSwap().
  </Card>
</CardGroup>

<Info>
  Need integration support or want to discuss your use case? Join the [Developer Telegram](https://t.me/BoltOnboarding) or [book a call](https://calendar.google.com/calendar/u/0/appointments/schedules/AcZssZ0h8Dz0XD9uiYnrWu6PUHvRfnuoNjXyCJYnzFX8t548I1YO-qnJxJSOrvuWeenqacByagNyyB0E) with the team.
</Info>
