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.

createSelfAndSelf() is the simplest mode.
  • the trader EOA owns USDC and positions
  • the same trader EOA signs transactions
  • transactions are submitted directly on Arbitrum and the trader pays gas

When to use it

  • bots and scripts
  • server-side systems trading a house account
  • wallet-driven apps where the user is comfortable paying gas
  • client-side apps that only need unsigned EOA transaction payloads

Submit-capable client

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

Build-only client

const client = await OstiumClient.createSelfAndSelf({
  traderAddress: '0xTraderAddress',
});

const tx = client.getOpenTradeTx({
  pairId: 0,
  buy: true,
  price: '65000',
  collateral: '100',
  leverage: '5',
  type: OrderType.Market,
});
In build-only mode, get*Tx() returns an EOA request with from, to, data, and value so your app can pass it to a wallet for signing.