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

# SDK

> TypeScript SDK for trading integrations: quotes, swaps, and the bonding curve

<Warning>
  The SDK is under active development. The surface described here is the design; details may change until the packages are published.
</Warning>

## What it is

A TypeScript SDK for **trading bots and aggregators**: quoting, swapping, and buying and selling on the launchpad's bonding curve. That is the whole scope — liquidity positions, farming, pool creation, launching and graduating are deliberately out.

Two packages:

| Package            | For                                                            |
| ------------------ | -------------------------------------------------------------- |
| `@lunya/sdk`       | Framework-agnostic core, [viem](https://viem.sh) for transport |
| `@lunya/sdk-react` | wagmi + TanStack Query hooks on top                            |

## The three things to know

**Writes return unsigned calls; they do not send.** Every builder gives back `{ to, data, value, approvals? }` — your signer is your own: a wagmi hook, an ethers wallet, a KMS, a Safe proposal. An SDK that owned `sendTransaction` would serve exactly one of those.

**The DEX is Uniswap-V3-shaped but not V3-compatible.** The events are identical by design, so your indexing works unchanged. The periphery is not: callbacks are `lunya*`, a route path carries a **one-byte pool type** where V3 has a three-byte fee, and pools are keyed on a curve rather than a fee tier. Route through this SDK — never a V3 router. Details in [Uniswap V3 Compatibility](/developers/integrations).

**A launch stops being a launch.** Once a token graduates, its liquidity lives in an ordinary CP pool and the curve answers zero rather than erroring. Price a graduated token with the DEX module, not the launchpad module.

## A taste of the surface

```ts theme={null}
import { createLunyaClient, dex, launchpad } from "@lunya/sdk";

const client = createLunyaClient({ deployment: "lunya@arc" });

// Price a swap and get an unsigned call back.
const { quote, transaction } = await dex.buildSwap(client, {
  tokenIn, tokenOut, amountIn: 1_000000n, slippageBps: 50, recipient,
});

// Price a bonding curve without touching the network.
const launch = await launchpad.getLaunch(client, token);
const { tokensOut, fee } = launchpad.curve.quoteBuy(launch, 10n ** 17n);
const buy = launchpad.buildBuy(client, {
  token, ethIn: 10n ** 17n, expectedTokensOut: tokensOut, slippageBps: 100,
});
```

The curve math runs locally — quoting a launch costs no RPC call — and ABIs and addresses ship generated from the contracts and the deployment records, so the SDK always knows which chain it is talking to.

<Info>
  Install instructions, the full API reference, and runnable examples (a quote reader, a curve trading bot, a swap widget) will be published here when the packages ship.
</Info>
