Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.ostium.com/llms.txt

Use this file to discover all available pages before exploring further.

1. Create a client

import { OrderType, OstiumClient } from '@ostium/builder-sdk';

const client = await OstiumClient.createSelfAndSelf({
  traderPrivateKey: process.env.TRADER_PRIVATE_KEY as `0x${string}`,
  rpcUrl: process.env.ARB_RPC_URL!,
});

2. Approve USDC

await client.approveUsdc('max');

3. Submit your first trade

const result = await client.openTrade({
  pairId: 0,
  buy: true,
  price: '65000',
  collateral: '100',
  leverage: '10',
  type: OrderType.Market,
});

4. Track status

const orders = await client.getOrders({
  initiatedTxHashes: [result.txHash],
});