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

# Quickstart

> Create, quote, deposit, withdraw, and discover Overpass yield tokens.

This quickstart shows the core Overpass flows using the TypeScript SDK.

## Install

```sh theme={null}
npm install @symmetry-hq/overpass @solana/web3.js @solana/spl-token
```

## Connect to Solana

```ts theme={null}
import { Connection, PublicKey } from "@solana/web3.js";
import {
  PROGRAM_ID,
  createWrapper,
  buildOverpassSwap,
  loadAllWrappers,
} from "@symmetry-hq/overpass";

const connection = new Connection("https://api.mainnet-beta.solana.com");
```

The mainnet program ID is:

```text theme={null}
WRAPdXmxrH37RKUbH1QMnYrKdNe8w4Kz44t1cXmYeum
```

## Discover wrappers

Use wrapper discovery when you need to list existing yield tokens.

```ts theme={null}
const wrappers = await loadAllWrappers(connection, {
  programId: PROGRAM_ID,
  refresh: true,
});

for (const wrapper of wrappers) {
  console.log({
    wrapperMint: wrapper.wrapperMint.toBase58(),
    underlyingMint: wrapper.underlyingMint.toBase58(),
    protocol: wrapper.protocol,
    sourcePool: wrapper.wrapperVault.sourcePool.toBase58(),
  });
}
```

## Create a yield token

Creating a wrapper mints a new SPL token tied to a source pool.

```ts theme={null}
const result = await createWrapper(connection, {
  creator: walletPublicKey,
  source: new PublicKey("SOURCE_POOL_ADDRESS"),
  underlyingMint: new PublicKey("UNDERLYING_MINT"),
  name: "Wrapped USDC",
  symbol: "wUSDC",
  uri: "ipfs://...",
  creatorDepositFeeBps: 0,
  initialDeposit: {
    amount: 1_000_000n,
    minOut: 0n,
  },
});

const signed = await wallet.signTransaction(result.tx);
const sig = await connection.sendTransaction(signed);
console.log(result.wrapperMint.toBase58(), sig);
```

`initialDeposit` is optional. If supplied, the wrapper launches with backing in the same transaction as creation.

## Deposit into a yield token

A deposit moves the underlying asset into the source pool and returns the yield token.

```ts theme={null}
const built = await buildOverpassSwap(connection, {
  user: walletPublicKey,
  wrapperMint: new PublicKey("WRAPPER_MINT"),
  amount: 1_000_000n,
  direction: "deposit",
  minOut: 0n,
});

// Send the returned instructions with your wallet transaction flow.
console.log(built.ixs, built.lookupTables, built.suggestedComputeUnits);
```

## Withdraw from a yield token

A withdrawal burns the yield token and redeems the underlying asset.

```ts theme={null}
const built = await buildOverpassSwap(connection, {
  user: walletPublicKey,
  wrapperMint: new PublicKey("WRAPPER_MINT"),
  amount: 1_000_000n,
  direction: "withdraw",
  minOut: 0n,
});
```

Withdrawal quality depends on the source pool. A highly utilized, paused, stale-oracle, or impaired pool can make withdrawals fail or reduce practical redeemability.

## Quote before building

Use quotes when you need preview amounts, warnings, or route simulation.

```ts theme={null}
import { Overpass, OverpassLoader, SwapMode } from "@symmetry-hq/overpass";

const overpass = Overpass.fromAccount(wrapperVaultPda, accountData);
const loader = new OverpassLoader();
await loader.refreshMany(connection, [overpass]);

const ctx = overpass.getQuoteContext(
  BigInt(currentSlot),
  BigInt(Math.floor(Date.now() / 1000)),
);

const quote = overpass.quote(
  {
    amount: 1_000_000n,
    inputMint: overpass.underlyingMint,
    outputMint: overpass.wrapperMint,
    swapMode: SwapMode.ExactIn,
  },
  ctx,
);

console.log(quote.outAmount, quote.feeAmount, quote.warnings);
```

## Next steps

* Learn the asset model in [yield tokens](/concepts/yield-tokens).
* Review [minting and redemption](/concepts/minting-and-redemption).
* Build with the [SDK](/integrations/sdk).
* Check [risk model](/reference/risk-model) before exposing routes to users.
