Importing Transactions

Try to get Transactions from Exante

Go to /explorer/workflows/com/finmars/exante-broker/get-transactions/test.ipynb

And configure your script

Screenshot 2024-09-27 at 21.32.09.png

Set accounts (line 46) and date_from (line 48) and date_to (line 49)

Then try to execute it!

 

Screenshot 2024-09-27 at 21.33.11.png

Great success! Now you could inspect responses from Exante Broker


Download Transactions to Finmars

Go to Workflow Page

Screenshot 2024-09-27 at 21.51.04.png


Execute workflow com.finmars.exante-broker:get-transactions

{
    "secret": "finmars/exante",
    "date_from": "2024-01-01",
    "date_to": "2024-09-27",
    "currencies": ["USD"],
    "portfolios": ["ABCD1234.001"]
}

Screenshot 2024-09-27 at 21.51.55.png

Go to see status of your workflow

Screenshot 2024-09-27 at 21.52.38.png

Great success! You can find your downloaded instrument in /explorer/data/exante/transactions

Screenshot 2024-09-27 at 22.10.36.png

Example of content: 

[
    {
        "symbolId": "VCIT.NASDAQ",
        "timestamp": 1725510299999,
        "uuid": "000000000-4bf9-4766-8ac2-12ff79ded491",
        "orderPos": null,
        "accountId": "ABCD123.001",
        "valueDate": "2024-09-05",
        "id": 000000000,
        "sum": "166.46",
        "orderId": null,
        "operationType": "DIVIDEND",
        "parentUuid": null,
        "asset": "USD"
    },
    {
        "symbolId": "VCIT.NASDAQ",
        "timestamp": 1725510299999,
        "uuid": "000000000-118b-4182-be13-a2e94d0772e9",
        "orderPos": null,
        "accountId": "ABCD123.001",
        "valueDate": "2024-09-05",
        "id": 000000000,
        "sum": "-49.94",
        "orderId": null,
        "operationType": "US TAX",
        "parentUuid": null,
        "asset": "USD"
    }
]



Now see com.finmars.exante-data-transformer, it should have Transaction transformer to Finmars Standard Configuration 

Transform Transactions to Standard Configuration

Precondition: You downloaded some Transactions from Exante (Check your /explorer/data/exante/transactions folder)

Go to Worfklow Page

Screenshot 2024-09-28 at 00.42.51.png

Run Task  com.finmars.exante-data-transformer:transform-transactions

 

Screenshot 2024-09-28 at 00.43.55.png

Go to see you Task Status

Screenshot 2024-09-28 at 00.45.19.png

So all your downloaded Transactions files from Exante should be packed into one .json file that converted to Standard Configuration

You shall able to see it in 

/explorer/data/general/transactions

data/general - is a folder where data accumulates from all the sources, we keep transformed data there
Screenshot 2024-09-28 at 00.46.46.png

Example Content

[
    {
        "source_origin": "exante",
        "source": "Exante",
        "account_cash": "ABCD1234.001",
        "account_cash_to": "-",
        "account_interim": "-",
        "account_position": "ABCD1234.001",
        "account_position_to": "-",
        "accrued_price": "-",
        "accrued_price_multiplier": 1,
        "allocation_pl": "-",
        "broker_fee_with_sign": 0,
        "carry_with_sign": 166.46,
        "cash_consideration_with_sign": 166.46,
        "cash_movement_fx_adjusted": 0,
        "charges_with_sign": 0,
        "commission_with_sign": 0,
        "counterparty": "-",
        "date_accounting": "2024-09-05",
        "date_change": "2024-09-05",
        "factor": 1,
        "fees_with_sign": 0,
        "forward_buy_leg": "-",
        "forward_sell_leg": "-",
        "fx_account_buy": "-",
        "fx_account_sell": "-",
        "fx_amount_buy": "-",
        "fx_amount_sell": "-",
        "fx_currency_buy": "-",
        "fx_currency_sell": "-",
        "fx_rate": 1,
        "fx_rate_reverse": 1,
        "if_reverse": "-",
        "instrument": "US92206C8709",
        "is_canceled": false,
        "isin_code": "-",
        "linked_instrument": "-",
        "notes": "DIVIDEND",
        "notes_front_office": "-",
        "notes_middle_office": "-",
        "other_charges_with_sign": 0,
        "portfolio": "ABCD1234.001",
        "portfolio_to": "-",
        "position_adjusted_with_sign": 0,
        "position_nominal_with_sign": 0,
        "pricing_currency": "USD",
        "principal_price": 0,
        "principal_price_multiplier": 1,
        "principal_with_sign": 0,
        "ref_tr_code": "-",
        "responsible": "-",
        "selector": "Dividend",
        "settlement_currency": "USD",
        "stamp_duty_with_sign": 0,
        "strategy1": "-",
        "sub_type": "-",
        "tax_with_sign": 0,
        "tax_withholding_with_sign": 0,
        "trade_date": "2024-09-05",
        "trade_price": 0,
        "transaction_code": "1b7f5128-4bf9-4766-8ac2-12ff79ded491",
        "value_date": "2024-09-05",
        "vat_with_sign": 0
    }
]




Great, so this file will be dispatched to Standard Import (see schema com.finmars.standard-import-from-file:txn)  STD - TXN

P.S. Before we able to import Transactions, we must ensure that all Instruments/Currencies already present in Space. So after it, you free to import file either manually or via Standard AutoImport Schedule

Standard Workflow Transaction Autoimport

So far we have:

Exante Instruments 
Exante Positions
Exante Transactions

We assume that there is no exotic currencies (then you need Exante Currencies)

All these data converted to Standard Configuration. So we should be able to Import them!

Before creating an automation, lets try to do it manually

So, for that we will use /explorer/workflows/com/finmars/standard-workflow/simple-autoimport/tasks.py

its a relatively simple workflow that could import either data or transactions. Its payload structure is:

So you add any number of steps (Depends of your situation). Order is matter! Here for example we import Instruments and then only Positions


directory - optional: path to directory in explorer with files to import, trailing slash is important (/ on end)
file_path - optional: path to some file in explorer with data to import
import_type - required:"data" for Simple Import, "transaction" for Transaction Import
schema - required: user_code of schema to execute

Nota bene: Both directory and file_path are optional, but one must be present

If you pass directory it will tries to join all files in that directory into one file (List of Dictionaries)

So, lets try it out!

Go to Workflows Page and lets find com.finmars.standard-workflow:simple-autoimport

{
    "actions": [
        {
            "directory": "/data/general/instruments/",
            "import_type": "data",
            "schema": "com.finmars.standard-import-from-file:instruments.instrument:instruments"
        },
        {
            "file": "/data/general/transactions/exante_abcd1234_001_2024-09-05_2024-09-05.json",
            "import_type": "transaction",
            "schema": "com.finmars.standard-import-from-file:txn"
        }
    ]
}   

Screenshot 2024-09-27 at 09.26.04.png

Lets execute it!

Screenshot 2024-09-28 at 01.06.35.png

Go to see your Task Status

Screenshot 2024-09-28 at 01.07.34.png

Okay, so far we Imported only Instruments, let see (Go to Transactions / Transactions)

Screenshot 2024-09-28 at 01.08.49.png



Great success! We imported all the Transactions from files that we previously downloaded from Exante