Skip to content

Virtufin Portfolio Workers

Deployable portfolio workers for the WorkManager -- a fourth domain-repo pillar alongside strategy-workers (producer: strategy workers deciding trades), execution-workers (consumer: executor workers placing/simulating trades) and market-data-workers (ingesting market data). Workers here ingest the venue-side view of a user portfolio -- balances, holdings, the ledger of cash and asset movements, open orders -- as the venue reports it. They observe; they never place, amend or cancel orders.

flowchart LR
    WS["WebSocketManager\n(user data / trading stream)"]
    HS["<Venue>Handshake\n(login from worker secrets)"]
    TRIG["Trigger\n(Dapr Jobs, periodic snapshot)"]
    RAW(["act.portfolio.&lt;venue&gt;.&lt;account&gt;.update"])
    PW["<Venue>Portfolio\n(one instance per account)"]
    BAL(["...balance.changed / .snapshot"])
    LED(["...ledger.posted"])
    DB[("portfolio tables\n(balance, holding, ledger, open_order)")]
    WS <-.-> HS
    WS --> RAW --> PW
    TRIG --> PW
    PW --> BAL
    PW --> LED
    PW --> DB

Workers

No worker is deployed yet. The first two are specified in the repo's issues:

Worker What it ingests Issue
BinancePortfolio Binance user data stream + REST account snapshots #1
AlpacaPortfolio Alpaca trading stream (trade_updates) + REST account, positions, activities #2

Whether the shared contracts, naming fragment and base class get their own portfolio-devkit repo is #3.

Where to start

  • Overview -- how a portfolio worker fits into the platform and where its boundary with the executors lies.
  • Getting Started -- build, test, and deploy a worker.