Skip to content

Info API ​

The Info API handles all read operations — fetching orders, positions, market data, and account info.

Access via sdk.info.

Order Queries ​

INFO

Order queries require authentication. Use HundredX.create() to initialize an authenticated SDK.

getOrders() ​

Get all orders for the authenticated subaccount.

typescript
const result = await sdk.info.getOrders();
console.log('Orders:', result.orders);

Returns: GetOrdersResponse

typescript
{
  orders: [
    {
      id: 12345,
      subaccountId: '1_0xABC..._1',
      brokerId: 1,
      marketType: 'PERPETUAL',
      marketSymbol: 'ETH-USD',
      type: 'LIMIT',
      side: 'BUY',
      amountx18: '1000000000000000000',
      totalFilledx18: '0',
      pricex18: '2500000000000000000000',
      expiryTs: 1700000000000,
      status: 'OPEN',
      createdAt: '2024-01-01T00:00:00Z',
      updatedAt: '2024-01-01T00:00:00Z',
    }
  ]
}

getOrder() ​

Get a specific order by ID.

typescript
const order = await sdk.info.getOrder(12345);

Parameters:

ParameterTypeDescription
orderIdnumberOrder ID

Returns: OrderResponse

User Queries ​

INFO

User queries require authentication. Use HundredX.create() to initialize an authenticated SDK.

getPositions() ​

Get all open positions and trade history.

typescript
const result = await sdk.info.getPositions();

for (const pos of result.positions) {
  console.log(`Product ${pos.productID}: amount=${pos.vBalanceAmount}, leverage=${pos.leverage}`);
}

for (const trade of result.tradeHistory) {
  console.log(`${trade.type}: ${trade.amountx18} @ ${trade.pricex18}, pnl=${trade.pnl}`);
}

Returns: PositionsResponse

typescript
{
  positions: [
    {
      productID: 1,
      vQuoteBalance: '2500000000000000000000',
      vBalanceAmount: '1000000000000000000',
      leverage: 5,
      InitialMarginFraction: '0.1',
      MaintenanceMarginFraction: '0.05',
    }
  ],
  tradeHistory: [
    {
      productId: 1,
      type: 'BUY',
      amountx18: '1000000000000000000',
      pricex18: '2500000000000000000000',
      timestamp: 1700000000,
      feex18: '2500000000000000',
      pnl: '0',
      feebonusx18: '0',
      isLiquidation: false,
    }
  ]
}

getUserOrders() ​

Get open orders for the authenticated subaccount (from the user endpoint).

typescript
const result = await sdk.info.getUserOrders();

for (const order of result.orders) {
  console.log(`[${order.OrderType}] ${order.operation} product=${order.productID}: ${order.amountx18} @ ${order.pricex18}`);
}

Returns: UserOrdersResponse

typescript
{
  orders: [
    {
      orderID: 12345,
      productID: 1,
      pricex18: '2500000000000000000000',
      amountx18: '1000000000000000000',
      operation: 'BUY',
      OrderType: 'LIMIT',
      filledAmountx18: '0',
      isTPSL: false,
      isReduce: false,
    }
  ]
}

getBuyingPower() ​

Get total buying power for the authenticated subaccount.

typescript
const result = await sdk.info.getBuyingPower();
console.log('Buying power:', result.totalBuyingPower);

Returns: BuyingPowerResponse

typescript
{ totalBuyingPower: '50000000000000000000000' }

getDeposits() ​

Get deposit history.

typescript
const result = await sdk.info.getDeposits();

Returns: DepositsResponse — { deposits: DepositRecord[] }

getWithdrawals() ​

Get withdrawal history.

typescript
const result = await sdk.info.getWithdrawals();

Returns: WithdrawalsResponse — { withdrawals: WithdrawalRecord[] }

getWithdrawableBalance() ​

Get withdrawable token balances by product ID.

typescript
const result = await sdk.info.getWithdrawableBalance();

Returns: WithdrawableBalanceResponse — { withdrawableBalance: Record<string, string> }

getNonce() ​

Get the current sequential nonce for deposit/withdraw operations.

typescript
const nonce = await sdk.info.getNonce(sdk.subaccountId!);

Parameters:

ParameterTypeDescription
subaccountIdstringSubaccount ID (e.g., "1_0xABC..._1")

Returns: number — the current nonce value

Market Data (Public) ​

These endpoints do not require any credentials.

getMarkets() ​

Get all available markets.

typescript
const result = await sdk.info.getMarkets();
const perpetuals = await sdk.info.getMarkets('PERPETUAL');

Parameters:

ParameterTypeRequiredDescription
typeMarketTypeNoFilter by "SPOT" or "PERPETUAL"

Returns: MarketsResponse — { markets: Market[] }

getMarketById() ​

Get a specific market by ID.

typescript
const result = await sdk.info.getMarketById(1);
console.log(result.market.Symbol); // 'ETH-USD'

Returns: MarketByIdResponse — { market: Market }

getFundingRate() ​

Get the current funding rate for a market symbol.

typescript
const result = await sdk.info.getFundingRate('ETH-USD');
console.log('Funding rate:', result.fundingRateX18);

Returns: FundingRate — { fundingRateX18: number }

getFundingRates() ​

Get funding rates for all active markets.

typescript
const result = await sdk.info.getFundingRates();
for (const rate of result.rates) {
  console.log(`${rate.Symbol}: ${rate.Funding.fundingRate}`);
}

Returns: FundingRatesResponse — { rates: FundingRateData[] }

100x Exchange Market Maker SDK