> ## 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.

# Open a Market Trade

> Open a market position on Ostium with the Builder SDK.

```ts theme={null}
import { OrderType } from '@ostium/builder-sdk';

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

## Inputs

* `pairId`: from `getPairs()`
* `buy`: `true` for long, `false` for short
* `price`: current market price
* `collateral`: USD string
* `leverage`: leverage string

## Notes

* slippage applies to market orders
* builder fees apply automatically if configured at client construction
