| Actor | Fragment | Worker | State |
|---|---|---|---|
| 740210 | 61842 | 51 | running |
| 740211 | 61842 | 51 | running |
| 740224 | 61853 | 51 | running |
| 740225 | 61853 | 51 | running |
| 740310 | 61843 | 51 | running |
| 740311 | 61843 | 51 | running |
| 740312 | 61844 | 51 | running |
| 740313 | 61844 | 51 | running |
| 740324 | 61845 | 51 | running |
| 740325 | 61845 | 51 | running |
| 740326 | 61846 | 51 | running |
| 740327 | 61846 | 51 | running |
CREATE MATERIALIZED VIEW opportunity.portfolio_fx_exposure_delta_mv AS
SELECT
pag.portfolio_id,
c.dim_balance_date,
p.base_currency_code AS currency_code,
SUM(c.weight) AS fx_exposure_pct
FROM insights.position_by_currency_mv AS c
JOIN insights.portfolio_to_account_groups_mv AS pag
ON pag.account_group_id = c.account_group_id AND pag.type = 'all'
JOIN olap.portfolios_dm AS p
ON p.portfolio_id = pag.portfolio_id
LEFT JOIN asset_service.currencies_dm AS cur
ON cur.code = p.base_currency_code
WHERE
c.position_type = 'POSITION'
AND c.source_entity_type = 'portfolio'
AND NOT c.item_id IS NULL
AND (
p.base_currency_code IS NULL OR c.item_id <> p.base_currency_code
)
AND (
cur.anchor_currency_code IS NULL OR c.item_id <> cur.anchor_currency_code
)
AND CAST(c.dim_balance_date AS TIMESTAMPTZ) >= CURRENT_TIMESTAMP - INTERVAL '30 DAYS'
GROUP BY
pag.portfolio_id,
c.dim_balance_date,
p.base_currency_code