Skip to content

glacez-soa-core

Lane: backend · Repo: glacez/glacez-soa-core · Editing rules: Glacez/SOAs/glacez-soa-core/AGENTS.md

Core business logic: the strategy engine and the reconciliation loop. It is the service that decides what should happen and hands the execution to someone else.

Responsibility

Area What it means
Strategy control start/pause/execute a strategy, evaluate its conditions, place the resulting orders
Synchronization reconcile platform state (orders, transfers, wallets) against what the exchanges report
Lifecycle order and transfer state, including the transition that turns a strategy decision into an executable order
Tracking StrategyTrack / ActionTrack — the per-strategy timeline the UI charts
Events publish order/ROI/transfer status events (via webservice's fanout path)

It does not own: exchange connectivity (never XChange — that is worker), portfolio math (portfolio), market data (findata), the user-facing API (webservice). It also does not run its own scheduler: the four cron controls are triggered externally (see below).

Data it writes

Strategy, Action, StrategyTrack, ActionTrack, Order, Transfer, TransactionTrack, Event, Credential (state observed during synchronization). It reads Wallet directly rather than calling portfolio — see Data ownership.

Surface

  • POST /strategies/{id}/control — start/pause/execute
  • Orders and transfers CRUD; the actions/conditions contract lives in glacez-lib-model and glacez-lib-factory
  • RabbitMQ producers: TradingJob, SimulationJob, RecordJob, EmailJob on glacez.direct

Downstream: findata (prices for condition evaluation) and portfolio (positions) — both over Feign.

Jobs

Externally triggered, all bodyless POST:

Endpoint ctlq prod
/jobs/synchronize/all every minute every minute
/jobs/control/strategies every 3 min every 3 min
/jobs/control/lift every 2 min every minute
/jobs/control/roi every 5 min every 2 min

lift and roi move a strategy's price levels; strategies is the evaluation pass. A stalled strategy usually means the synchronization loop is not running, not that the evaluator is wrong.

How an order is born

  1. strategies control pass evaluates the strategy's actions against current prices.
  2. Core writes the Order document and a track entry, and publishes a TradingJob.
  3. worker executes it against the exchange and reports back through the record path.
  4. Synchronization reconciles the result into Order/Transfer/Wallet state.

credentials are read here during synchronization — the credential document is core's to mutate, worker's to observe.

The full chain — all four producers, the ten reconciliation buckets, the balancing deposits and the cron cadence — is in Transaction lifecycle.