Docs

maxMarketOrderNtls - HyperCore Info Endpoint

Get maximum market order notional values on Hyperliquid. Understand order size limits and market impact constraints.

Get maximum market order notional values for trading pairs on Hyperliquid, helping traders understand order size limits.

Authenticate HyperCore Info requests by sending your Dwellir API key in the x-api-key header to https://api-hyperliquid-mainnet-info.n.dwellir.com/info.

When to Use This Endpoint

The maxMarketOrderNtls endpoint is essential for:

  • Order Validation — Check if order size is within allowed limits
  • Trading Strategy — Plan large orders based on market constraints
  • Risk Management — Understand maximum position sizes
  • Market Impact — Estimate potential market impact of large orders

Common Use Cases

1. Check Maximum Order Size

Verify if an order size is within limits:

JavaScript
async function checkOrderSize(asset, orderValue) {
  const data = await getMaxMarketOrderNtls();
  const maxNotional = data.limits[asset];

  if (!maxNotional) {
    console.log(`No limit data for ${asset}`);
    return null;
  }

  const isValid = orderValue <= parseFloat(maxNotional);

  console.log(`Order size: $${orderValue.toLocaleString()}`);
  console.log(`Maximum allowed: $${parseFloat(maxNotional).toLocaleString()}`);
  console.log(`Valid: ${isValid ? 'Yes' : 'No - exceeds limit'}`);

  return isValid;
}

// Usage
await checkOrderSize('BTC', 50000);

2. Validate Order Before Submission

Pre-validate orders against limits:

JavaScript
async function validateMarketOrder(asset, orderValue) {
  const data = await getMaxMarketOrderNtls();
  const maxNotional = parseFloat(data.limits[asset] || 0);

  if (orderValue > maxNotional) {
    return {
      valid: false,
      reason: `Order size $${orderValue} exceeds maximum $${maxNotional}`,
      maxAllowed: maxNotional
    };
  }

  return {
    valid: true,
    reason: 'Order size within limits',
    maxAllowed: maxNotional
  };
}

// Usage
const validation = await validateMarketOrder('ETH', 100000);
if (!validation.valid) {
  console.error(`Cannot place order: ${validation.reason}`);
}

3. Calculate Maximum Position Size

Determine maximum position that can be opened:

JavaScript
async function getMaxPositionSize(asset, currentPrice) {
  const data = await getMaxMarketOrderNtls();
  const maxNotional = parseFloat(data.limits[asset] || 0);

  const maxPositionSize = maxNotional / currentPrice;

  return {
    asset: asset,
    currentPrice: currentPrice,
    maxNotionalValue: maxNotional,
    maxPositionSize: maxPositionSize,
    unit: asset
  };
}

// Usage
const maxPosition = await getMaxPositionSize('BTC', 45000);
console.log(`Maximum position: ${maxPosition.maxPositionSize.toFixed(4)} ${maxPosition.unit}`);
console.log(`Notional value: $${maxPosition.maxNotionalValue.toLocaleString()}`);

4. Build Order Size Calculator

Create an order size calculator with validation:

JavaScript
async function calculateOrderSizes(asset, currentPrice) {
  const data = await getMaxMarketOrderNtls();
  const maxNotional = parseFloat(data.limits[asset] || 0);

  const suggestions = [0.25, 0.5, 0.75, 1.0].map(percent => {
    const notionalValue = maxNotional * percent;
    const positionSize = notionalValue / currentPrice;

    return {
      percentage: percent * 100,
      notionalValue: notionalValue,
      positionSize: positionSize
    };
  });

  console.log(`=== Order Size Suggestions for ${asset} ===\n`);
  suggestions.forEach(s => {
    console.log(`${s.percentage}% of max: ${s.positionSize.toFixed(4)} ${asset} ($${s.notionalValue.toLocaleString()})`);
  });

  return suggestions;
}

// Usage
await calculateOrderSizes('BTC', 45000);

5. Monitor Limit Changes

Track changes in order limits:

JavaScript
class OrderLimitMonitor {
  constructor(checkIntervalMs = 300000) {
    this.checkIntervalMs = checkIntervalMs; // 5 minutes
    this.lastLimits = null;
  }

  async start() {
    const check = async () => {
      const data = await getMaxMarketOrderNtls();

      if (this.lastLimits) {
        for (const [asset, limit] of Object.entries(data.limits)) {
          const lastLimit = this.lastLimits[asset];
          if (lastLimit && lastLimit !== limit) {
            console.log(`Limit changed for ${asset}: ${lastLimit} -> ${limit}`);
          }
        }
      }

      this.lastLimits = data.limits;
    };

    await check();
    setInterval(check, this.checkIntervalMs);
  }
}

// Usage
const monitor = new OrderLimitMonitor();
monitor.start();

6. Split Large Orders

Suggest order splitting for sizes exceeding limits:

JavaScript
async function splitLargeOrder(asset, desiredValue) {
  const data = await getMaxMarketOrderNtls();
  const maxNotional = parseFloat(data.limits[asset] || 0);

  if (desiredValue <= maxNotional) {
    return {
      needsSplit: false,
      message: 'Order within limits',
      orders: [{ value: desiredValue }]
    };
  }

  const numOrders = Math.ceil(desiredValue / maxNotional);
  const orderSize = desiredValue / numOrders;

  const orders = Array(numOrders).fill(null).map((_, i) => ({
    orderNumber: i + 1,
    value: orderSize
  }));

  return {
    needsSplit: true,
    message: `Split into ${numOrders} orders`,
    totalValue: desiredValue,
    maxPerOrder: maxNotional,
    orders: orders
  };
}

// Usage
const split = await splitLargeOrder('BTC', 200000);
if (split.needsSplit) {
  console.log(`Order needs splitting: ${split.message}`);
  split.orders.forEach(order => {
    console.log(`Order ${order.orderNumber}: $${order.value.toLocaleString()}`);
  });
}

Best Practices

  1. Cache limits — Order limits change infrequently, cache for 5-10 minutes
  2. Validate before submission — Always check limits before placing orders
  3. Handle missing data — Some assets may not have limit data
  4. Use buffer — Stay 5-10% below maximum to account for price fluctuations
  5. Monitor changes — Track limit changes that may affect trading strategies

Performance Tips

Cached Limit Service

JavaScript
class CachedOrderLimitService {
  constructor(cacheDurationMs = 300000) {
    this.cache = null;
    this.cacheTime = 0;
    this.cacheDurationMs = cacheDurationMs; // 5 minutes
  }

  async getLimits() {
    const now = Date.now();

    if (this.cache && (now - this.cacheTime) < this.cacheDurationMs) {
      return this.cache;
    }

    const data = await getMaxMarketOrderNtls();
    this.cache = data;
    this.cacheTime = now;

    return data;
  }

  async getLimitForAsset(asset) {
    const data = await this.getLimits();
    return parseFloat(data.limits[asset] || 0);
  }

  invalidate() {
    this.cache = null;
    this.cacheTime = 0;
  }
}

// Usage
const limitService = new CachedOrderLimitService();
const btcLimit = await limitService.getLimitForAsset('BTC');

Optimize your trading with order limit information from Dwellir's HyperCore Info Endpoint. Get your API key →