Skip to main content

Welcome to Alpha SDK

Build powerful prediction market trading applications on Algorand with the Alpha SDK. Place orders, manage positions, read orderbooks, and create automated trading bots — all directly on-chain.

Get Started

Install the SDK and place your first order in minutes

Quickstart

Follow a step-by-step guide to start trading

API Reference

Explore the complete API documentation

Build Trading Bots

Learn how to create automated trading strategies

Key Features

Order Management

Create limit and market orders with automatic matching and slippage protection

Live Orderbook

Access real-time on-chain orderbook data for any market

Position Control

Split, merge, and claim tokens with simple SDK methods

Flexible Discovery

Fetch markets via API for rich data or directly on-chain without API keys

Trading Bots

Build automated strategies with full programmatic access

Liquidity Rewards

Access reward market data and track liquidity incentives

Quick Example

import { AlphaClient } from '@alpha-arcade/sdk';
import algosdk from 'algosdk';

// Setup clients
const algodClient = new algosdk.Algodv2('', 'https://mainnet-api.algonode.cloud', 443);
const indexerClient = new algosdk.Indexer('', 'https://mainnet-idx.algonode.cloud', 443);

const account = algosdk.mnemonicToSecretKey('your mnemonic...');
const signer = algosdk.makeBasicAccountTransactionSigner(account);

// Initialize Alpha client
const client = new AlphaClient({
  algodClient,
  indexerClient,
  signer,
  activeAddress: account.addr.toString(),
  matcherAppId: 3078581851,
  usdcAssetId: 31566704,
});

// Fetch live markets
const markets = await client.getLiveMarkets();

// Place a limit order
const result = await client.createLimitOrder({
  marketAppId: markets[0].marketAppId,
  position: 1,        // 1 = Yes
  price: 500_000,     // $0.50
  quantity: 1_000_000, // 1 share
  isBuying: true,
});

console.log(`Order created! Escrow app ID: ${result.escrowAppId}`);

Explore the Documentation

Core Concepts

Understand markets, orderbooks, positions, and fee structures

Guides

Step-by-step tutorials for common trading workflows

Trading Methods

Complete reference for order creation and management

Market Data

Learn how to fetch and filter market information

Build docs developers (and LLMs) love