Documentation contents

Trading

Execution

The trading server decides when and how much; the order is sent by the order executor — a separate server that holds the exchange keys. Orders go to the exchanges via the REST API, each with its own client ID. The order is written to the journal before it is sent, followed by the exchange's response.

Order type — market; closing on perpetual contracts is reduce-only. Where an exchange does not accept a market order of the required kind, a limit IOC order is sent at a price sufficient for the whole volume in the current book.

Volume. Volumes are calculated in coins, taking contract multipliers into account, and are rounded down to the order step. The minimum entry order is the largest of the exchange's minimum lot, the minimum order amount at the current price and the bundle's "Minimum order, base". An entry below the minimum is not sent; a close below the minimum is sent — the exchange decides. On a spot buy where the exchange takes the fee in the coin, the volume is increased by the fee.

Two legs and retries

Each leg is executed in its own retry cycle with a limited deadline. The cycle ends when the leg is filled, the remainder is below the minimum, the deadline has passed or the exchange has rejected the order definitively.

There is no rollback: a filled leg is not closed because the other one was not filled.

Imbalance and top-up

Levels send both legs at the same time. If one leg was filled and the other was not, the missing one is topped up in the background. Closing the window cancels background top-ups.

One leg without the other is shown in "Exchange positions" with the "One-sided" status, and a mismatch between the leg volumes with the "Imbalance" status (see "Position"); in the bundle list — "Open · no hedge" if one leg has been open for longer than 20 minutes. In a trading session, a lone leg does not close by itself — even it out in "Quick trade", in "Per exchange" mode.

Exchange rejections

Rejections on which retries stop immediately:

  • there is no position on the exchange — the leg is considered closed;
  • the volume is below the exchange's minimum;
  • a rejection by the order executor — for example, the bundle is not signed or the limit is exceeded;
  • insufficient funds on entry.

Insufficient funds on closing — the available volume is closed.

Account freeze: opening is prohibited, enabled entry levels are turned off, closing and exit levels work. Contract delisted: a new session does not open; in an open one, opening is prohibited, and entry levels and data collection are turned off; with an open position, the "Contract delisted" notification arrives.

Reconciliation of positions with the exchange — see "Position → Reconciliation with the exchange".

No connection to the executor

If the trading server's connection to the order executor has been lost for more than 60 seconds, all screens show the red "No connection to the order executor" bar listing the exchanges on which orders are not being sent (if you have connections to them). Trading buttons are not locked during this time: orders are not filled within the retry deadline. When the connection returns, the "Connection to the order executor restored" notification arrives, and the server immediately reconciles open sessions.