# How to Import Trades

If you have a number of trades to manually book into the system, you can easily do so using the trade import template.

#### Usage <a href="#usage" id="usage"></a>

To find the template, click ACTIONS > DOWNLOAD TEMPLATE on the Trades screen. You will receive an Excel file titled "**trade\_import\_upload\_template.xlsx**". Just fill out the template and upload it back to Molecule via ACTIONS > UPLOAD.

#### Tips

* If an upload fails, read the error message in the notifications panel, and then clear the message so that subsequent errors aren't confusing.
* Molecule de-duplicates uploads, so if you upload a file with the same name twice in the same minute, one of them may be ignored.
* The maximum row count on an upload spreadsheet is 1,000 rows. Additional rows get ignored.
* Note that some columns are required to be in the template, even if they do not get filled in.

#### Fields <a href="#fields" id="fields"></a>

**Required Fields**

These fields are included in the template by default. Note that the headers must exist in the file, even if the values are not needed.

<table data-header-hidden><thead><tr><th></th><th width="279.25390625"></th><th></th><th></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td><strong>Description</strong></td><td><strong>Format (Example)</strong></td><td><strong>Required?</strong></td></tr><tr><td><strong>trade_date</strong></td><td>The date of the trade. It is formatted as YYYY-MM-DD.</td><td>2023-04-01</td><td>Yes</td></tr><tr><td><strong>quantity</strong></td><td>The quantity of the trade. Note: <code>buy/sell</code> is inferred from this value, so buys will be positive numbers and sells should be prefixed with <code>-</code>.</td><td>-200</td><td>Yes</td></tr><tr><td><strong>quantity_type</strong></td><td><p>Specifies how the quantity of the trade should be determined. Quantity types are <code>unit</code>, <code>contract</code>, (per) <code>month</code>, or (per) <code>day</code></p><p>Exchange trades should be uploaded with a contract quantity type.</p></td><td>unit</td><td>Yes</td></tr><tr><td><strong>mark</strong></td><td>If you would like your trade to mark with a different product's curve price, you can do that here by filling out the product's ticker symbol. You can also specify a contract month, but it is not required. Should be in v1 or v2 formula format, depending on the Product.</td><td><code>JAN 2023 NG</code> (v1) or <code>NG:1</code> (v2)</td><td>Header Only</td></tr><tr><td><strong>primary_product_code</strong></td><td>The ticker symbol of the trade.</td><td>NG</td><td>Yes</td></tr><tr><td><strong>price</strong></td><td>The price of the trade can be static or formula. Can be a fixed price, or a formula (v1 or v2 formula, depending on the Product).</td><td><p><code>3.25</code> (static example)</p><p><code>38.3%(JAN 2020 NG + 0.0) + 0.035</code> (v1)</p><p><code>best(NG:1, H:1)</code> (v2)</p></td><td>Yes</td></tr><tr><td><strong>strike</strong></td><td>The strike price of the trade (for options only).</td><td>1.5</td><td>Header Only</td></tr><tr><td><strong>right</strong></td><td>Specifies whether the trade is a 'call' or a 'put' (for options only).</td><td>call</td><td>Header Only</td></tr><tr><td><strong>counterparty</strong></td><td>The counterparty of the trade, using their handle (aka short name).</td><td>NYMEX</td><td>Header Only</td></tr><tr><td><strong>tenor_start</strong></td><td>The beginning of the first contract period of the trade. It is formatted as YYYY-MM-DD.</td><td>2025-04-01</td><td>Yes</td></tr><tr><td><strong>tenor_end</strong></td><td>The end of the last contract period of the trade. As trades can have multiple legs and frequencies, this may not simply be the end of the tenor_start month.It is formatted as YYYY-MM-DD.</td><td>2025-04-01</td><td>Yes</td></tr><tr><td><strong>tags</strong></td><td>Specifies which book the trade will be assigned to. You may also include secondary tags (beginning with @). All tags will need to be separated by a 'space'. Note: tag names may not have 'spaces' in their names.</td><td>#demo @strategy_1</td><td>Yes (book only)</td></tr><tr><td><strong>fcm</strong></td><td>The FCM of the trade, using their handle (short name)</td><td>STONEX</td><td>Header Only</td></tr><tr><td><strong>settlement_date_override</strong></td><td>If you would like to specify your own settlement date for the trade, you can do that here. Populated as a date, if this field is specified, the imported trade's legs will be given this value as its realization date. It is formatted as YYYY-MM-DD.</td><td>2023-04-01</td><td>Header Only</td></tr><tr><td><strong>notes</strong></td><td>Any notes you would like to include with the trade can be filled out here.</td><td>any string</td><td>Header Only</td></tr><tr><td><strong>po/so</strong></td><td>A field for purchase order/sales order.</td><td>any string</td><td>Header Only</td></tr><tr><td><strong>custom_field_values</strong></td><td>For accounts with "custom fields" set up. Custom fields for trades are done in JSON format.</td><td><code>{"Account": "first", "Priority": "moderate"}</code></td><td>Header Only (unless the field is created as "required")</td></tr></tbody></table>

#### Optional Fields <a href="#optional_fields" id="optional_fields"></a>

These fields' headers are not in the template by default, but can be added.

* `mg_id` - text field; set multiple rows to the same value to group them upon uploading
* `broker` - handle (short name)
* `origin` - long name
* `agreement_id`
* `underlying_price_formula` - a v2 Formula
* `tplus_payment_date` - an integer representing T+x.
* `trader_email` - the e-mail associated with the Trader of the trade. Must be a valid user in Molecule.

#### Fees

Fees may be added via a column entitled `fees`. The format required is JSON-based:

```
[{"name": "clearing", "type": "contract", "price": 0.77},{"name":"commission", "type": "contract", "price": 1.77}]
```

#### Hourly/Sub-Hourly Trades

For these columns, enter the hours in the "interval ending" format `hhmm+`, where the + represents the repeated hour related to DST/Summer Time changeover.

* `tenor_start_ie`
* `tenor_end_ie`

<mark style="background-color:blue;">The repeated hour is 01:00-02:00 in most cases. This would be entered as</mark> <mark style="background-color:blue;"></mark><mark style="background-color:blue;">`0200+`</mark><mark style="background-color:blue;">.</mark>

#### IR Swaps

These optional fields are exclusively for Interest Rate swaps.

* `fixed_day_count_fraction`
* `float_day_count_fraction`
* `initial_rate`
* `payment_day`
* `spread`
* `business_day_convention`
