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

# Install @velora-dex/sdk

> Install @velora-dex/sdk and fetch your first quote in under five minutes.

The Velora SDK is published as [`@velora-dex/sdk`](https://www.npmjs.com/package/@velora-dex/sdk). It has no required runtime dependencies; `viem`, `ethers`, `web3`, and `axios` are all optional peers that the SDK detects at construction time.

## Install the package

<CodeGroup>
  ```bash pnpm theme={null}
  pnpm add @velora-dex/sdk
  ```

  ```bash npm theme={null}
  npm install @velora-dex/sdk
  ```

  ```bash yarn theme={null}
  yarn add @velora-dex/sdk
  ```
</CodeGroup>

### Peer dependencies

Pick whichever wallet library and HTTP client you already use. All of these are optional peers, so install only the ones you need.

| Package  | Version              | When you need it                                                                        |
| -------- | -------------------- | --------------------------------------------------------------------------------------- |
| `viem`   | `^2.21.0`            | If you sign and submit transactions with viem.                                          |
| `ethers` | `^5.5.0` or `^6.0.0` | If you sign and submit transactions with ethers.                                        |
| `web3`   | `^4.14.0`            | If you sign and submit transactions with web3.js.                                       |
| `axios`  | `>=0.25.0 <2.0.0`    | If you wire the SDK fetcher to axios. (Use the built-in `fetch` instead to avoid this.) |

<Note>
  You can use the SDK in **read-only mode** without any of these. Pass `{ chainId, fetch }` (or `{ chainId, axios }`) and the SDK can call every API method (quotes, prices, order status), but it cannot sign or submit transactions.
</Note>

## Your first call

The smallest possible setup: quote 10,000 USDC → ETH on mainnet using native `fetch`.

```ts theme={null}
import { constructSimpleSDK } from "@velora-dex/sdk";

const simpleSDK = constructSimpleSDK({ chainId: 1, fetch });

const priceRoute = await simpleSDK.swap.getRate({
  srcToken: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
  destToken: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", // ETH
  amount: "10000000000", // 10,000 USDC (6 decimals)
  userAddress: "0x0000000000000000000000000000000000000000",
  side: "SELL",
  options: { partner: "my-app-name" },
});

console.log(priceRoute.srcAmount, "→", priceRoute.destAmount);
```

## Verify it works

The returned `priceRoute` contains at minimum:

* `srcAmount`: the input amount you passed (echoed for confirmation).
* `destAmount` is the expected output amount in destination-token wei.
* `bestRoute`, the resolved swap path across DEXes.
* `gasCost` and `gasCostUSD`: estimated execution gas.

If the call throws with `Network Error` or a 4xx response, double-check `chainId`, `partner`, and that your firewall allows outbound HTTPS to the Velora API.

## Add a wallet to send transactions

Pass a `providerOptions` argument to enable `approveToken`, `submitDeltaOrder`, and `buildTx`-then-send flows. The shape varies by library; see [Configure providers](/sdk/configure-providers) for the four supported stacks (viem, ethers v5, ethers v6, web3).

## Next steps

<CardGroup cols={2}>
  <Card title="Delta" icon="bolt" href="/sdk/products/delta">
    Full Delta order flow: build → sign → post → poll.
  </Card>

  <Card title="Configure providers" icon="sliders" href="/sdk/configure-providers">
    Wire up viem, ethers, or web3 for signing and transactions.
  </Card>
</CardGroup>
