Read Exchange SDK
Read-only CLOB operations (no wallet required)
The ReadExchangeSDK provides read-only CLOB operations without requiring a wallet connection.
Order Book Queries
getPair
Get the exchange contract address for a token pair.
Signature:
async getPair(tokenA: string, tokenB: string): Promise<string>Parameters:
tokenA: string- First token addresstokenB: string- Second token address
Returns: Promise<string> - Exchange contract address
getAllActiveSellOrders
Get all active sell orders for a trading pair.
Signature:
async getAllActiveSellOrders(tokenA: string, tokenB: string): Promise<any[]>Parameters:
tokenA: string- First token addresstokenB: string- Second token address
Returns: Promise<any[]> - Array of sell order objects
getAllActiveBuyOrders
Get all active buy orders for a trading pair.
Signature:
async getAllActiveBuyOrders(tokenA: string, tokenB: string): Promise<any[]>Parameters:
tokenA: string- First token addresstokenB: string- Second token address
Returns: Promise<any[]> - Array of buy order objects
getLimitedOrders
Get a limited number of orders from the order book.
Signature:
async getLimitedOrders(
tokenA: string,
tokenB: string,
maxOrders: number,
isBuyOrders: boolean
): Promise<{orders: any[], prices: string[]}>Parameters:
tokenA: string- First token addresstokenB: string- Second token addressmaxOrders: number- Maximum number of orders to fetchisBuyOrders: boolean- true for buy orders, false for sell orders
Returns: Promise<{orders: any[], prices: string[]}>
getAllSellOrders
Get all sell orders at a specific price level.
Signature:
async getAllSellOrders(exchangeAddress: string, price: bigint): Promise<any[]>Parameters:
exchangeAddress: string- Exchange contract addressprice: bigint- Price level
Returns: Promise<any[]> - Array of sell order objects
getAllBuyOrders
Get all buy orders at a specific price level.
Signature:
async getAllBuyOrders(exchangeAddress: string, price: bigint): Promise<any[]>Parameters:
exchangeAddress: string- Exchange contract addressprice: bigint- Price level
Returns: Promise<any[]> - Array of buy order objects
getAllActiveSellOrdersPaginated
Get active sell orders with pagination support.
Signature:
async getAllActiveSellOrdersPaginated(
exchangeAddress: string,
startPriceIndex: number,
maxPriceLevels: number,
maxOrdersPerPrice: number
): Promise<{orders: any[], prices: string[], nextStartIndex: number, totalProcessed: number}>Parameters:
exchangeAddress: string- Exchange contract addressstartPriceIndex: number- Starting price level indexmaxPriceLevels: number- Maximum price levels to fetchmaxOrdersPerPrice: number- Maximum orders per price level
Returns: Promise<{orders: any[], prices: string[], nextStartIndex: number, totalProcessed: number}>
getAllActiveBuyOrdersPaginated
Get active buy orders with pagination support.
Signature:
async getAllActiveBuyOrdersPaginated(
exchangeAddress: string,
startPriceIndex: number,
maxPriceLevels: number,
maxOrdersPerPrice: number
): Promise<{orders: any[], prices: string[], nextStartIndex: number, totalProcessed: number}>Parameters:
exchangeAddress: string- Exchange contract addressstartPriceIndex: number- Starting price level indexmaxPriceLevels: number- Maximum price levels to fetchmaxOrdersPerPrice: number- Maximum orders per price level
Returns: Promise<{orders: any[], prices: string[], nextStartIndex: number, totalProcessed: number}>
getPVobs
Get price-volume order book data.
Signature:
async getPVobs(exchangeAddress: string): Promise<{
sellOB: {price: bigint, volume: bigint}[],
buyOB: {price: bigint, volume: bigint}[]
}>Parameters:
exchangeAddress: string- Exchange contract address
Returns: Promise<{sellOB: {price: bigint, volume: bigint}[], buyOB: {price: bigint, volume: bigint}[]}>
Price and Output Queries
getAmountOut
Get the output amount for a given input.
Signature:
async getAmountOut(
tokenAAddress: string,
tokenBAddress: string,
inputToken: string,
inputAmount: bigint
): Promise<bigint>Parameters:
tokenAAddress: string- First token addresstokenBAddress: string- Second token addressinputToken: string- Input token addressinputAmount: bigint- Input amount
Returns: Promise<bigint> - Output amount
getOutputAmountWithIndex
Get output amount with a specific price index.
Signature:
async getOutputAmountWithIndex(
exchangeAddress: string,
inputToken: string,
inputAmount: bigint,
priceIndex: number
): Promise<{outputAmount: bigint, price: bigint}>Parameters:
exchangeAddress: string- Exchange contract addressinputToken: string- Input token addressinputAmount: bigint- Input amountpriceIndex: number- Price index
Returns: Promise<{outputAmount: bigint, price: bigint}>
Exchange Information
getPriceStep
Get the price step (tick size) for an exchange.
Signature:
async getPriceStep(exchangeAddress: string): Promise<bigint>Parameters:
exchangeAddress: string- Exchange contract address
Returns: Promise<bigint> - Price step value
getFeeReceiver
Get the fee receiver address for an exchange.
Signature:
async getFeeReceiver(exchangeAddress: string): Promise<string>Parameters:
exchangeAddress: string- Exchange contract address
Returns: Promise<string> - Fee receiver address
getBuyerFeePercent
Get the buyer fee percentage for an exchange.
Signature:
async getBuyerFeePercent(exchangeAddress: string): Promise<bigint>Parameters:
exchangeAddress: string- Exchange contract address
Returns: Promise<bigint> - Fee percentage
getSellerFeePercent
Get the seller fee percentage for an exchange.
Signature:
async getSellerFeePercent(exchangeAddress: string): Promise<bigint>Parameters:
exchangeAddress: string- Exchange contract address
Returns: Promise<bigint> - Fee percentage
getMinimumSellVolume
Get the minimum sell volume for an exchange.
Signature:
async getMinimumSellVolume(exchangeAddress: string): Promise<bigint>Parameters:
exchangeAddress: string- Exchange contract address
Returns: Promise<bigint> - Minimum sell volume
getMinimumBuyVolume
Get the minimum buy volume for an exchange.
Signature:
async getMinimumBuyVolume(exchangeAddress: string): Promise<bigint>Parameters:
exchangeAddress: string- Exchange contract address
Returns: Promise<bigint> - Minimum buy volume
getTokenA
Get the first token address of the trading pair.
Signature:
async getTokenA(exchangeAddress: string): Promise<string>Parameters:
exchangeAddress: string- Exchange contract address
Returns: Promise<string> - Token A address
getTokenB
Get the second token address of the trading pair.
Signature:
async getTokenB(exchangeAddress: string): Promise<string>Parameters:
exchangeAddress: string- Exchange contract address
Returns: Promise<string> - Token B address
getFactory
Get the factory contract address.
Signature:
async getFactory(exchangeAddress: string): Promise<string>Parameters:
exchangeAddress: string- Exchange contract address
Returns: Promise<string> - Factory address
getDeployer
Get the deployer address of the exchange.
Signature:
async getDeployer(exchangeAddress: string): Promise<string>Parameters:
exchangeAddress: string- Exchange contract address
Returns: Promise<string> - Deployer address
getGlobalNonce
Get the global nonce for the exchange.
Signature:
async getGlobalNonce(exchangeAddress: string): Promise<bigint>Parameters:
exchangeAddress: string- Exchange contract address
Returns: Promise<bigint> - Global nonce
getMaxPriceLevels
Get the maximum number of price levels.
Signature:
async getMaxPriceLevels(exchangeAddress: string): Promise<bigint>Parameters:
exchangeAddress: string- Exchange contract address
Returns: Promise<bigint> - Maximum price levels
getDeposits
Get deposit amount for a user and token.
Signature:
async getDeposits(exchangeAddress: string, account: string, tokenAddress: string): Promise<bigint>Parameters:
exchangeAddress: string- Exchange contract addressaccount: string- User account addresstokenAddress: string- Token address
Returns: Promise<bigint> - Deposit amount
getRescuableAmount
Get rescuable token amount for a user.
Signature:
async getRescuableAmount(exchangeAddress: string, user: string, token: string): Promise<bigint>Parameters:
exchangeAddress: string- Exchange contract addressuser: string- User addresstoken: string- Token address
Returns: Promise<bigint> - Rescuable amount
name
Get token symbols for a trading pair.
Signature:
async name(tokenAAddress: string, tokenBAddress: string): Promise<{ tokenA: string; tokenB: string }>Parameters:
tokenAAddress: string- First token addresstokenBAddress: string- Second token address
Returns: Promise<{ tokenA: string; tokenB: string }> - Token symbols

