Trader
Trader Quickstart
Approve USDC and place a first Ostium trade with the Builder SDK.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Approve USDC and place a first Ostium trade with the Builder SDK.
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!,
});
await client.approveUsdc('max');
const result = await client.openTrade({
pairId: 0,
buy: true,
price: '65000',
collateral: '100',
leverage: '10',
type: OrderType.Market,
});
const orders = await client.getOrders({
initiatedTxHashes: [result.txHash],
});