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.

This page is the starting point for builder integrations. Builders typically care about two things first:
  • how to attach builder fees to trades
  • which client mode matches the way their product handles signing and submission

Builder fees

Builder fees are configured once at client creation and then applied automatically to opening trades sent through that client.
  • builder.address is where your fee share is routed
  • builder.feeBps is the fee amount in basis points
  • the allowed range is 0 to 50 bps
  • builder fees apply on open, not on close
const client = await OstiumClient.createSelfAndSelf({
  traderPrivateKey: userPrivateKey,
  rpcUrl: process.env.ARB_RPC_URL!,
  builder: {
    address: '0xYourBuilderAddress',
    feeBps: 20,
  },
});
If you do not want to charge builder fees, omit the builder config entirely.

Which client mode to use

Wallet-driven frontend

Use self-self when the user signs and pays gas in their own wallet. Use self-gasless when the user should still own the account but you want gasless trading after one-time setup. This is usually the right fit for:
  • React apps
  • embedded trading widgets
  • client-side wallet integrations

Backend execution on behalf of users

Use delegated-self when your backend should sign and submit using a delegate EOA that pays gas. Use delegated-gasless when your backend should sign but submit through a Safe user operation. This is usually the right fit for:
  • managed execution products
  • server-side order routing
  • apps that want users to keep custody while your backend handles execution

Read-only market data

Use createReadOnly() when you only need prices, pairs, positions, candles, or order history in your app and you do not need transaction building or submission.
  • Start with SDK Overview for the current API surface.
  • Use Client Modes to choose the right mode for your integration.
  • Use Getting keys from the App if you want users to export a delegated gasless SDK account from app.ostium.com/sdk-export.
  • Use React Example if your app needs wallet-driven transaction building and live position updates.

Legacy note

If you are maintaining an older Python integration, the old docs are preserved under Legacy, but new integrations should use the current TypeScript SDK.