Skip to main content
The Cesto SDK (@cesto/sdk) is a typed TypeScript client for the Cesto API. Use it to list and inspect baskets (products), look up a user’s positions by their Solana wallet, and open, close, or rebalance positions — either on managed wallets (Cesto provisions and signs, you never touch a key) or with client-signed transactions — all behind a single API key.

Products

List baskets and fetch full basket detail, optionally with backtested performance and charts.

Positions

Read a user’s positions by wallet, and live per-basket holdings for SDK positions.

Managed wallets

Cesto provisions a Privy-backed Solana wallet per user and signs server-side — open, close, and rebalance by user reference, no key handling.

Open, Close & Rebalance

The self-custody alternative: open, close, and rebalance positions where the user’s wallet signs its own transactions — Cesto never holds the key.

Bridging (CCTP)

Bridge native USDC between Base and Solana — the user signs once on the source chain, Cesto handles the rest.

No gas, no SOL

Cesto sponsors network gas and ATA rent on Solana, and pays destination mint gas when bridging — user wallets need only USDC.

Typed & resilient

Every method and response is typed (ESM + CJS), with automatic retries, timeouts, and a typed error hierarchy.

Requirements

  • Node.js 18+ (uses the global fetch).
  • Server-side only: the SDK uses a secret API key and refuses to run in a browser.
Never use the SDK in browser / client-side code; your secret key would be exposed to end users. It is meant for backends, scripts, and serverless / edge functions.

Install

Quickstart

You need an API key to use the SDK. See Authentication to request one.
Integrating for partner users? The managed wallets flow is the recommended path — Cesto provisions and signs, you never touch a key: Managed Wallets. Integration Models compares it with the self-custody setups — your own Privy, browser EOAs (Phantom / Solflare), and cross-chain EVM funding.

Next steps

Integration Models

Choose a wallet model: managed wallets, your own Privy, EOAs, or cross-chain.

Managed Wallets

Cesto-managed Privy wallets, signed server-side — the recommended flow.

Authentication

Get a key and start making requests.

Configuration

Client options, timeouts, and retries.

Products

List and fetch baskets.

Positions

Positions by wallet.

Open a Position

Open positions with client-signed transactions.

Close a Position

Close a wallet’s full basket holding.

Rebalance a Position

Migrate a position to the basket’s latest version.

Bridging (CCTP)

Bridge USDC between EVM chains and Solana, then invest the arrived amount.

Examples

Runnable Node.js examples for every feature.