Balyasny Asset Management needs a daily view of execution activity across instruments to support portfolio and trading analysis.
Write a PostgreSQL query that joins trade executions to instrument metadata, aggregates filled executions by ticker and trading day, and calculates running and sliding-window metrics.
execution_status = 'FILLED'.RANGE window, not a row-count window.| Column | Type | Description |
|---|---|---|
| execution_idPK | INT | Unique execution identifier |
| instrument_id | INT | References instruments.instrument_id |
| executed_at | TIMESTAMPTZ | Execution timestamp |
| quantity | NUMERIC(18,2) | Executed quantity |
| execution_price | NUMERIC(18,4) | Execution price |
| execution_status | VARCHAR(20) | Execution lifecycle status |
| trader_id | VARCHAR(30) | BAM trader identifier |
| Column | Type | Description |
|---|---|---|
| instrument_idPK | INT | Unique instrument identifier |
| ticker | VARCHAR(20) | Instrument ticker |
| asset_class | VARCHAR(30) | Instrument asset classification |