Quick Start

Get started with PercolatePerps in just a few steps

Installation

Install the PercolatePerps SDK to interact with the protocol:

npm install @percolate/sdk @solana/web3.js

Initialize Client

import { Connection, PublicKey } from '@solana/web3.js';
import { PercolateClient } from '@percolate/sdk';

// Connect to Solana
const connection = new Connection('https://api.mainnet-beta.solana.com');

// Initialize Percolate client
const client = new PercolateClient({
  connection,
  routerProgramId: new PublicKey('Router11111111111111111111111111111111111'),
  slabProgramId: new PublicKey('Slab1111111111111111111111111111111111111'),
});
1

Connect Your Wallet

Connect your Solana wallet (Phantom, Solflare, or any SPL-compatible wallet) to get started with trading on PercolatePerps.

const wallet = await window.solana.connect();
const userEscrow = await client.getUserEscrow(wallet.publicKey);
2

Deposit Collateral

Deposit USDC, SOL, or other supported assets as collateral for trading. Your collateral is managed by the Router Program and can be used across all slabs.

// Deposit 1000 USDC as collateral
const tx = await client.depositCollateral({
  user: wallet.publicKey,
  mint: USDC_MINT,
  amount: 1000_000000, // 1000 USDC (6 decimals)
});
3

Start Trading

Place your first order and experience lightning-fast perpetual futures trading with MEV protection and portfolio margin.

// Place a limit order to buy SOL-PERP
const order = await client.placeOrder({
  slab: SOL_PERP_SLAB,
  side: 'buy',
  orderType: 'limit',
  price: 187.52,
  size: 10, // 10 SOL
  capability: await client.createCapability(wallet),
});

Next Steps

Learn more about the architecture and trading features