# Slave Orders

The Slave Orders table explains the order details of slave accounts. The fields for the SlaveOrders table are:

**Table Name:&#x20;*****SlaveOrders***

| **Column Name**        | **Data Type**   | **Valid Values** | **Allow Nulls** | **Description**                                                                                                                                                                                                                                                                            |
| ---------------------- | --------------- | ---------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| PK\_OrderID            | bigint identity |                  | No              | TradeID of the order                                                                                                                                                                                                                                                                       |
| LPOrdID                | varchar         |                  | Yes             | It is used in the case of partial close, it contains the ID of the original PK Order ID. Default it is kept as null                                                                                                                                                                        |
| OrigOrdID              |                 |                  |                 |                                                                                                                                                                                                                                                                                            |
| FK\_AccountID          | int             |                  | No              | Account ID (TS ID)                                                                                                                                                                                                                                                                         |
| PositionSize           | bigint          |                  | Yes             | Order quantity                                                                                                                                                                                                                                                                             |
| Price                  | decimal         |                  | Yes             | request price of the symbol                                                                                                                                                                                                                                                                |
| FK\_OrderType          | int             |                  | No              | <p>1 = MARKET</p><p>2 = LIMIT</p><p>3 = STOP</p><p>4 = STOP-LIMIT</p>                                                                                                                                                                                                                      |
| FK\_OrderStatusID      | int             |                  | No              | <p>1 = NEW</p><p>2 = PARTIALLY\_FILLED</p><p>3 = FILLED</p><p>4 = CANCEL</p><p>5 = CANCEL\_ACK</p><p>6 = REPLACED</p><p>7 = PENDING\_CANCEL</p><p>8 = REJECTED</p><p>9 = PENDING\_NEW</p><p>10 = EXPIRED</p><p>11 = PENDING\_REPLACE</p><p>12 = UNDEFINED</p><p>13 = ORDER\_NOT\_FOUND</p> |
| FK\_Side               | int             |                  | No              | <p>1 = BUY      </p><p>2 = SELL     </p>                                                                                                                                                                                                                                                   |
| OrderDateTimeRequested | datetime        |                  | Yes             | Time when the order is placed. In UTC format.                                                                                                                                                                                                                                              |
| Contract               | varchar         |                  | No              | Symbols                                                                                                                                                                                                                                                                                    |
| Product                | varchar         |                  | No              | Symbols                                                                                                                                                                                                                                                                                    |
| LastUpdateTime         | datetime        | (getutcdate())   | Yes             | The time when the last update took place.                                                                                                                                                                                                                                                  |
| FilledQty              | int             |                  | Yes             | filled position size                                                                                                                                                                                                                                                                       |
| AvgFillPRice           | decimal         |                  | Yes             | Open price                                                                                                                                                                                                                                                                                 |
| CancelQty              | int             |                  | Yes             | At the event of a partial close, the remaining position size that will be opened as a new trade is the cancel quantity.                                                                                                                                                                    |
| ProfitValue            | decimal         |                  | Yes             | Profit value                                                                                                                                                                                                                                                                               |
| Reason                 | varchar         |                  | Yes             | In case of trade rejection, error codes are listed here.                                                                                                                                                                                                                                   |
| CloseQty               | int             |                  | Yes             | At the event of a partial close, the position size closed partially is the closed quantity.                                                                                                                                                                                                |
| PositionEffect         | char            |                  | Yes             | <p>O = Open</p><p>C = Closed</p>                                                                                                                                                                                                                                                           |
| LinkedOrderID          | varchar         |                  | Yes             | It is the PK order ID of the coverage in current orders table.                                                                                                                                                                                                                             |
| SL                     | decimal         |                  | Yes             | Stop loss                                                                                                                                                                                                                                                                                  |
| TP                     | decimal         |                  | Yes             | Take profit                                                                                                                                                                                                                                                                                |
| ClosePrice             | decimal         |                  | Yes             | Close price                                                                                                                                                                                                                                                                                |
| CurrentAllocation      | decimal         |                  | Yes             | Current allocation                                                                                                                                                                                                                                                                         |
| UsedMargin             | decimal         | ((0))            | Yes             | Used margin                                                                                                                                                                                                                                                                                |
| SlaveEquity            | decimal         |                  | Yes             | Equity of the slave                                                                                                                                                                                                                                                                        |
| MasterEquity           | decimal         |                  | Yes             | Equity of the master                                                                                                                                                                                                                                                                       |
| SlaveCurrency          | varchar         |                  | Yes             | Slave currency                                                                                                                                                                                                                                                                             |
| MasterCurrency         | varchar         |                  | Yes             | Master currency                                                                                                                                                                                                                                                                            |
| ClosePriceRequested    | decimal         |                  | Yes             | Request close price                                                                                                                                                                                                                                                                        |
| PSType                 | int             |                  | Yes             | <p>1 = Fixed</p><p>2 = Percentage</p>                                                                                                                                                                                                                                                      |
| PSValue                | decimal         |                  | Yes             | Profit share value                                                                                                                                                                                                                                                                         |
| PSCommission           | decimal         |                  | Yes             |                                                                                                                                                                                                                                                                                            |
| WalletPSCommission     | decimal         |                  | Yes             | Profit share commission in wallet account                                                                                                                                                                                                                                                  |
| RBType                 | int             |                  | Yes             |                                                                                                                                                                                                                                                                                            |
| RBValue                | decimal         |                  | Yes             |                                                                                                                                                                                                                                                                                            |
| RBCommission           | decimal         |                  | Yes             |                                                                                                                                                                                                                                                                                            |
| WalletRBCommission     | decimal         |                  | Yes             | Not in use                                                                                                                                                                                                                                                                                 |
| BSType                 | int             |                  | Yes             | <p>1 = Fixed</p><p>2 = Percentage</p>                                                                                                                                                                                                                                                      |
| BSValue                | decimal         |                  | Yes             | Broker share value                                                                                                                                                                                                                                                                         |
| BSCommission           | decimal         |                  | Yes             |                                                                                                                                                                                                                                                                                            |
| WalletBSCommission     | decimal         |                  | Yes             | Broker share commission in wallet account                                                                                                                                                                                                                                                  |
| WalletCurrency         | varchar         |                  | Yes             | Currency of the wallet account                                                                                                                                                                                                                                                             |
| SwapType               | int             |                  | Yes             | <p>0 = By point</p><p>1 = By money</p><p>2 = By interest</p><p>3 = By money in margin currency</p>                                                                                                                                                                                         |
| Swap                   | decimal         | ((0))            | Yes             | Swap                                                                                                                                                                                                                                                                                       |
| SlaveContractSize      | decimal         | ((0))            | No              | Contract size of the symbol in USD.                                                                                                                                                                                                                                                        |
| MasterContractSize     | decimal         | ((0))            | No              | Master Contract Size                                                                                                                                                                                                                                                                       |
| ReturnPerc             | decimal         | ((0))            | No              | Return value in percentage.                                                                                                                                                                                                                                                                |
| RetunPercMapping       | decimal         | ((0))            | No              | Mapping Return value in percentage.                                                                                                                                                                                                                                                        |
| VAMI                   | decimal         | ((0))            | No              | This field lists the VAMI, i.e., a measure to track the monthly performance of an investment.                                                                                                                                                                                              |
| MappingVAMI            | decimal         | ((0))            | No              | This field lists the Mapping VAMI,                                                                                                                                                                                                                                                         |
| Profit\_Mode           | int             | ((0))            | No              | By default, it is 0.                                                                                                                                                                                                                                                                       |
| ContractSize           | decimal         | ((0))            | No              |                                                                                                                                                                                                                                                                                            |
| ExternalSecurity       | int             | ((0))            | No              |                                                                                                                                                                                                                                                                                            |
| AllocationID           | int             |                  | Yes             |                                                                                                                                                                                                                                                                                            |
