Skip to main content
The Velora SDK is published as @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

pnpm add @velora-dex/sdk

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

Your first call

The smallest possible setup: quote 10,000 USDC → ETH on mainnet using native fetch.
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 for the four supported stacks (viem, ethers v5, ethers v6, web3).

Next steps

Delta

Full Delta order flow: build → sign → post → poll.

Configure providers

Wire up viem, ethers, or web3 for signing and transactions.
Last modified on June 14, 2026