Client Configuration Types
AlphaClientConfig
AlphaClientConfig
Configuration object for initializing the Used by: Client initializationKey fields:
AlphaClient.algodClientandindexerClient: Algorand SDK clients for interacting with the blockchainsigner: Wallet or account that signs transactionsactiveAddress: The address that will execute trades and operationsmatcherAppId: The Alpha matcher smart contract app IDusdcAssetId: The USDC asset ID on AlgorandapiKey: Optional API key for enhanced market data (probabilities, volume)
Market Types
Market
Market
Represents a prediction market, either fetched from the Alpha API or discovered on-chain.Used by: getMarkets(), getMarket()Key fields:
marketAppId: The smart contract app ID for this market (required for all trading operations)yesAssetId/noAssetId: Algorand ASA IDs for YES and NO outcome tokensyesProb/noProb: Current market probabilities (only available when using API)source: Indicates whether data came from the Alpha API or on-chain discovery
MarketOption
MarketOption
Represents an option within a multi-choice prediction market.Used by: Multi-choice markets in the
Market type’s options arrayEach option in a multi-choice market has its own market app ID and asset IDs for trading.MarketGlobalState
MarketGlobalState
Raw global state of a market smart contract as read from the Algorand blockchain.Used by: Internal SDK methods that read on-chain market stateThis type reflects the raw smart contract global state. Most developers will work with the higher-level
Market type instead.Order Types
Position
Position
Enum-like type representing which side of the market to trade.Values:
0: NO position1: YES position
OrderSide
OrderSide
The side of an order.Values:
'BUY': Buying outcome tokens'SELL': Selling outcome tokens
CreateLimitOrderParams
CreateLimitOrderParams
Parameters for creating a limit order.Used by: createLimitOrder()Key fields:
price: Limit price in microunits (1,000,000 = $1.00)quantity: Number of shares in microunitsisBuying:truefor buy orders,falsefor sell ordersfeeBase: Optional fee override (auto-fetched from market if not provided)
CreateMarketOrderParams
CreateMarketOrderParams
Parameters for creating a market order that executes immediately against the orderbook.Used by: createMarketOrder()Key fields:
slippage: Maximum acceptable price movement (in microunits)matchingOrders: Optional pre-computed matches for advanced use cases- All price and quantity values are in microunits (1,000,000 = 1.00)
CancelOrderParams
CancelOrderParams
Parameters for cancelling an existing order.Used by: cancelOrder()Key fields:
escrowAppId: The unique escrow contract ID for the order (returned when order was created)orderOwner: Must match the address that created the order
ProposeMatchParams
ProposeMatchParams
Parameters for manually proposing a match between two existing orders.Used by: proposeMatch()This is an advanced method for manually matching orders. Most developers should use market orders instead.
AmendOrderParams
AmendOrderParams
Parameters for amending (editing) an existing unfilled order.Used by: amendOrder()Allows changing the price, quantity, or slippage of an existing order without cancelling and recreating it.
CounterpartyMatch
CounterpartyMatch
Represents a counterparty order that can be matched against.Used by: Internal order matching logic and
CreateMarketOrderParams.matchingOrdersThe SDK automatically computes counterparty matches when creating market orders.CreateOrderResult
CreateOrderResult
Result returned after successfully creating an order.Returned by: createLimitOrder(), createMarketOrder()Key fields:
escrowAppId: Save this to cancel or amend the order latermatchedQuantity: How much was immediately filled (for market orders or matched limit orders)matchedPrice: The effective execution price
CancelOrderResult
CancelOrderResult
ProposeMatchResult
ProposeMatchResult
AmendOrderResult
AmendOrderResult
Orderbook Types
OrderbookEntry
OrderbookEntry
A single order entry in the orderbook.Used by:
OrderbookSide and getOrderbook()Represents a single resting order at a specific price level.OrderbookSide
OrderbookSide
One side of the orderbook (bids or asks).Used by:
Orderbook typebids: Buy orders (sorted descending by price)asks: Sell orders (sorted ascending by price)
Orderbook
Orderbook
Complete orderbook for a market, with both YES and NO positions.Returned by: getOrderbook()Contains the full order book with separate sides for YES and NO outcome tokens.
AggregatedOrderbookEntry
AggregatedOrderbookEntry
An aggregated orderbook entry combining multiple orders at the same price level.Used by:
AggregatedOrderbookSideUseful for UI displays that show total liquidity at each price level.AggregatedOrderbookSide
AggregatedOrderbookSide
One side of an aggregated orderbook.Used by:
AggregatedOrderbook typeAggregatedOrderbook
AggregatedOrderbook
Aggregated orderbook for display purposes, combining orders at the same price level.Returned by: getAggregatedOrderbook()Provides a simplified view of liquidity for UI rendering.
Position Types
SplitSharesParams
SplitSharesParams
MergeSharesParams
MergeSharesParams
ClaimParams
ClaimParams
Parameters for claiming resolved tokens and redeeming them for USDC.Used by: claim()After a market resolves, holders of the winning outcome token can claim USDC at 1:1 ratio.
SplitMergeResult
SplitMergeResult
ClaimResult
ClaimResult
Result returned after claiming resolved tokens.Returned by: claim()Key fields:
amountClaimed: The amount of USDC returned to the wallet
WalletPosition
WalletPosition
Represents a wallet’s token holdings in a specific market.Returned by: getWalletPositions()Shows the current holdings of YES and NO tokens for a specific market.
OpenOrder
OpenOrder
Represents an open (unfilled or partially filled) order belonging to a wallet.Returned by: getOpenOrders()Key fields:
escrowAppId: Use this to cancel or amend the orderquantityFilled: How much has been matched so far- Remaining quantity =
quantity - quantityFilled
Escrow Types
EscrowGlobalState
EscrowGlobalState
Raw global state of an escrow smart contract as read from the blockchain.Used by: Internal SDK methods that read order state from escrow contractsThis is the raw smart contract state. Most developers will work with the higher-level
OpenOrder type instead.Microunits
Most numeric values in the SDK use microunits (1,000,000 = 1.00). Examples:- Price of $0.50 =
500000microunits - 5 shares =
5000000microunits - 2% fee =
20000microunits
