---
title: "When macro meets markets"
description: "Compose official macro prints with market quotes and indicators in one client workflow."
slug: compose-macro-finance
status: published
published_at: 2026-07-07
author: Arman Obosyan
author_url: https://sugra.systems/about
section: composition
series_order: 8
primary_keyword: sugra macro finance composition
hero_image: /blog/images/posts/compose-macro-finance-hero.jpg
hero_alt: "When macro meets markets - Sugra API blog"
og_image: /blog/images/posts/compose-macro-finance-hero.jpg
tags:
  - composition
  - macro
  - finance
---

# Composition: Macro + Finance desk

**Series:** compositions (1 of 4)  
**Prerequisites:** [Platform intro](/blog/platform-intro), [Finance](/blog/sugra-finance), [Macro](/blog/sugra-macro)  
**Directions:** Macro + Finance only  
**Auth:** `x-api-key`  

This article does **not** re-explain each direction. It shows how to **compose** official macro prints with market surfaces in one client workflow.

Not investment advice.

---

## Goal

Answer in one scheduled job:

1. What is the official US growth / inflation / curve / policy stance?  
2. How are equities (or a sector leader) printing against that backdrop?  

You keep logic client-side. Sugra does not return a blackbox "regime score" for trading.

---

## Call sequence

```text
[Macro]  FRED GDPC1?units=pc1
[Macro]  FRED CPIAUCSL?units=pc1
[Macro]  FRED UNRATE
[Macro]  FRED T10Y2Y
[Macro]  BIS cb-rates/US
[Macro]  Treasury yield-curve
[Finance] quote for benchmark (e.g. SPY or sector leader)
[Finance] optional RSI or historical window
         -> client reduce to {regime, market_snapshot}
```

### 1-6 Macro (see Macro article / `macro-regime-monitor` recipe)

```bash
H="x-api-key: $SUGRA_API_KEY"
B=https://sugra.ai

curl -H "$H" "$B/api/v1/fred/series/GDPC1?limit=2&units=pc1"
curl -H "$H" "$B/api/v1/fred/series/CPIAUCSL?limit=2&units=pc1"
curl -H "$H" "$B/api/v1/fred/series/UNRATE?limit=2"
curl -H "$H" "$B/api/v1/fred/series/T10Y2Y?limit=2"
curl -H "$H" "$B/api/v1/bis/cb-rates/US?last_n=2"
curl -H "$H" "$B/api/v2/fixed-income/treasury/yield-curve"
```

### 7-8 Finance

```bash
curl -H "$H" "$B/api/v2/quotes/SPY/price"
curl -H "$H" "$B/api/v1/indicators/rsi?symbol=SPY&time_period=14&interval=1d&outputsize=5"
```

---

## Client reduce (example)

```python
def compose(macro, finance):
    gdp = macro["gdp_yoy"]
    cpi = macro["cpi_yoy"]
    t10y2y = macro["t10y2y"]
    policy = macro["policy_rate"]
    px = finance["price"]
    chg = finance["change_pct"]
    return {
        "as_of": {
            "macro_sources": ["fred", "bis", "us_treasury"],
            "market_source": "sugra_finance",
        },
        "regime": {
            "growth": "expansion" if gdp > 0 else "contraction",
            "inflation": "above_target" if cpi > 2 else "at_or_below_target",
            "curve": "inverted" if t10y2y < 0 else "normal",
            "real_policy_approx": round(policy - cpi, 2),
        },
        "market": {
            "symbol": finance["symbol"],
            "price": px,
            "change_pct": chg,
            "rsi_14": finance.get("rsi_14"),
        },
        "disclaimer": "Data composition only. Not investment advice.",
    }
```

Persist `meta.data_time` / `meta.source` from each leg into your output for audit.

---

## Why this composition works

| Leg | Strength carried in |
|---|---|
| Macro | Official record, transforms, multi-institution cross-check |
| Finance | Fat quote + platform RSI under same key |

You get **context + market print** without a second vendor auth stack.

---

## Cadence and quota

| Leg | Natural refresh |
|---|---|
| GDP | quarterly |
| CPI / UNRATE | monthly |
| T10Y2Y / curve | daily |
| Equity quote / RSI | session / daily bar |

Do not poll all six macro series every minute. Cache macro until release calendars move; refresh market more often if your product needs it. Count against one daily plan quota.

Rough cost: **8 calls** per full refresh (or fewer if you cache macro).

---

## Failure modes

| Failure | Handling |
|---|---|
| FRED or BIS 503 | Keep last good macro JSON; mark `macro_stale: true` |
| Quote fails | Return regime without market; do not invent prices |
| 429 | Stop job; wait for UTC reset |
| Partial curve holiday | Document last curve date from response |

---

## What not to claim in product copy

- "Sugra says buy/sell"  
- "Real-time macro nowcast"  
- That client thresholds are official Fed communications  

---

## Read next

- Previous direction deep-dives: [Macro](/blog/sugra-macro) · [Finance](/blog/sugra-finance)  
- Next composition: [Entity + News](/blog/compose-entity-news)  
- [Series TOC (platform intro)](/blog/platform-intro) · [Conclusion](/blog/series-conclusion)
