> ## Documentation Index
> Fetch the complete documentation index at: https://api-trading-docs.vexprofx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Volume: lots and MT5 units

> Conversions, contract size and the volume fields of every partner endpoint.

## API volume unit

**Every public trading-volume field uses MT5 units: 10000 units = 1 lot.**
No partner endpoint accepts or returns volume directly in lots. Lots in examples
are explanatory equivalents. The API does not automatically convert lots to units.

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
API units = lots × 10000
lots = API units ÷ 10000
```

| Lots | API units |
| -: | -: |
| 0.0001 | 1 |
| 0.001 | 10 |
| 0.01 | 100 |
| 0.10 | 1000 |
| 0.50 | 5000 |
| 1 | 10000 |
| 2 | 20000 |

These are conversions, not universally permitted order sizes.
`"volume": 1` means 0.0001 lots, never 1 lot.

## Symbol settings and contract size

The factor 10000 is independent of the symbol, broker, account group and
`ContractSize` within this API contract. Contract size describes what one lot
represents economically; it is not the volume encoding factor.

Symbols with `ContractSize = 1` and `ContractSize = 10` both take `volume: 10000`
for a one-lot request. Their economic exposure can differ. Do not multiply or
divide API volume by contract size. Volume conversion alone does not calculate
margin or profit.

Effective account-group symbol settings determine `VolumeMin`, `VolumeMax` and
`VolumeStep`, all in MT5 units. Volume checks require an amount within the limits
and divisible by the step. A correct conversion is not proof that a volume is
allowed. The API does not silently adjust or round the requested amount.

Example: minimum 5000 and step 100 mean a minimum of 0.5 lots and a 0.01-lot step.
Although 0.01 lots correctly converts to 100 units, it is below that minimum.

## Fields by endpoint

Append these paths to the API base URL.

| Endpoint | Volume input | Volume output / meaning |
| - | - | - |
| `POST /api/v1/orders/market` | `volume`: integer MT5 units | Returns a request ID; query the execution result. |
| `POST /api/v1/orders/pending` | `volume`: integer MT5 units | Returns a request ID; placement is not a market fill. |
| `POST /api/v1/positions/{position}/close` | Optional `volume`: integer MT5 units | Omission requests the entire current volume; partial execution can leave a position. |
| `GET /api/v1/accounts/{login}/positions` | None | `Volume`: current position volume in MT5 units. |
| `GET /api/v1/accounts/{login}/orders` | None | `VolumeInitial`: original; `VolumeCurrent`: remaining. Both in MT5 units. |
| `GET /api/v1/trading/requests/{request_id}` | None | In `answer` events, `Volume` is requested and `ResultVolume` executed; in `result` events, `Volume` is confirmed. All use MT5 units. |
| `POST /api/v1/orders/{order}/cancel` | Not accepted | Cancels the identified pending order; no partial cancellation volume. |
| `POST /api/v1/orders/{order}/modify` | Not accepted | `price`, `stop_limit_price`, `sl` and `tp` are absolute prices. |
| `POST /api/v1/positions/{position}/modify` | Not accepted | `sl` and `tp` are absolute prices, not lots, volume units or distances. |

Other partner endpoints do not accept or expose a trading volume.
`GET /api/v1/accounts/{login}/positions/count` counts positions, not lots.
`offset` and `total` are pagination controls, not volume.
Grouped and flat execution results use the same units. Zero volume on a
cancellation or stop modification is not proof of failure; check `summary.status`
and `mt5_code`.

## Opening, closing and partial execution

To request 0.5 lots, submit `"volume": 5000`.
To request closing 0.2 lots of a 0.5-lot position, send:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{"login":104205,"volume":2000}
```

Use `POST /api/v1/positions/{position}/close` with the actual position ticket and
a new Idempotency-Key. To request closing the entire current position, omit
volume: `{"login":104205}`. Do not use `volume: 0` for a full close.

In an `answer` execution event, `Volume = "5000"` and `ResultVolume = "3000"`
mean 0.5 lots requested and 0.3 lots executed. Check the result and current
positions; the API does not automatically resubmit an unfilled IOC remainder.

## Client conversion

Send volume as an integer JSON number. Responses can encode numbers as strings:
`"Volume": "5000"` still means 0.5 lots. Missing or null fields are not zero and
do not establish whether execution occurred.

Use decimal arithmetic. The converted amount must be a positive finite integer;
do not truncate or round it silently. For example:

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
from decimal import Decimal

lots = Decimal("0.50")
units = lots * 10000
if not units.is_finite() or units <= 0:
    raise ValueError("Volume must be positive and finite")
if units != units.to_integral_value():
    raise ValueError("Volume cannot be represented as integer API units")
volume = int(units)  # 5000; also check symbol minimum, maximum and step
```

If the UI displays lots, convert once on submission and divide returned volume
by 10000 once for display. Internal `VolumeExt` fields use a different scale and
are not part of these public endpoint contracts.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.