depth
Build an app

Quickstart

Register your app and connect a trader in a few steps.

On this page

Install the SDK

Terminal
npm install @depthhq/sdk

Use a Solana wallet adapter that exposes publicKey, signTransaction, and signAllTransactions. Examples use your connected wallet; the SDK does not create or hold its private key.

Register your app

Register once with the app owner’s wallet. Choose an app fee from 0 to 2 basis points and save the confirmed appId.

Register an app
import { create_depth } from "@depthhq/sdk";

const admin = await create_depth({
  environment: "devnet",
  wallet: appOwnerWallet,
});

const registration = await admin.app.register({ feeBps: 1 });
const { appId } = await registration.confirm();

Connect a trader

Create the trader client
const depth = await create_depth({
  environment: "devnet",
  wallet: traderWallet,
  appId,
  privateViews: "device",
  viewAuthorization: "session",
});

The SDK verifies the network and signed deployment before returning a client. Read sessions require the configured API sponsor; use viewAuthorization: "wallet" for individually signed reads.

Fund and trade

Documentation
8 results