GenerAI / worldmonitor /docs /panels /trade-policy.mdx
amogaddy's picture
Fix build: ripristinata worldmonitor/docs/ (build:crawlable-corpus la richiede) (part 2)
d9ffd67 verified
Raw
History Blame Contribute Delete
3.86 kB
---
title: "Trade Policy"
description: "Six-tab trade-policy surface covering restrictions, tariff trends, trade flows, non-tariff barriers, US customs revenue, and bilateral Comtrade flows."
---
The **Trade Policy** panel (internal id `trade-policy`) is the dashboard's go-to surface for live trade-policy context β€” what's getting restricted, where tariffs are moving, how flows are shifting, what barriers exist, and how US customs revenue is tracking as a real-time signal of tariff pass-through.
## What the panel shows
Six tabs across one data-dense panel (`defaultRowSpan: 2`):
| Tab id | Shows |
|---|---|
| `restrictions` | Active trade restrictions β€” the default tab on mount. |
| `tariffs` | Tariff trends (`TariffDataPoint[]`) and `EffectiveTariffRate` series. |
| `flows` | Bilateral trade flows β€” `GetTradeFlowsResponse`. |
| `barriers` | Non-tariff barriers β€” `GetTradeBarriersResponse`. |
| `revenue` | US Treasury customs revenue β€” monthly data with FYTD year-over-year comparison and spike highlighting. |
| `comtrade` | Full Comtrade bilateral flow search β€” `ListComtradeFlowsResponse`. |
`TabId` is the union `'restrictions' | 'tariffs' | 'flows' | 'barriers' | 'revenue' | 'comtrade'` (`src/components/TradePolicyPanel.ts:17`).
Panel id is `trade-policy`; canonical component is `src/components/TradePolicyPanel.ts`. Title resolves from i18n (`panels.tradePolicy`).
## How you reach it
- **Cmd+K**: type *trade*, *tariff*, or *customs*.
- **Availability by variant**: registered and enabled by default in the **full/geopolitical** (`priority: 1`), **finance** (`priority: 1`), and **commodity** (`priority: 1`) variants. Not present in the tech or happy variants. Source: `'trade-policy'` entries in `FULL_PANELS`, `FINANCE_PANELS`, `COMMODITY_PANELS` of `src/config/panels.ts`.
## Data sources
Six response shapes from `@/services/trade`, each backed by a generated sebuf REST RPC in `TradeService`. The panel shell is free; tariff trends and Comtrade calls use `premiumFetch` because those two paths are premium transport paths, while restrictions, flows, barriers, and customs revenue use the public client. Customs revenue also checks the bootstrap cache key `customsRevenue` before falling back to the RPC.
| Tab | Method + route | Feeds |
|---|---|---|
| `restrictions` | `GET /api/trade/v1/get-trade-restrictions` | WTO restrictions list with country filters and upstream-unavailable state. |
| `tariffs` | `GET /api/trade/v1/get-tariff-trends` | Premium tariff-rate timeseries between reporting and partner countries. |
| `flows` | `GET /api/trade/v1/get-trade-flows` | Bilateral merchandise trade-flow rows and year-over-year context. |
| `barriers` | `GET /api/trade/v1/get-trade-barriers` | SPS/TBT barrier notifications filtered by country or measure type. |
| `revenue` | `GET /api/trade/v1/get-customs-revenue` | US Treasury customs duties revenue; bootstrap-first via `customsRevenue`. |
| `comtrade` | `GET /api/trade/v1/list-comtrade-flows` | Premium UN Comtrade strategic commodity flow search with anomaly flags. |
The `revenue` tab's US-Treasury feed is particularly sensitive β€” see the changelog entry for "US Treasury customs revenue in Trade Policy panel" (`#1663`).
## Refresh cadence
Per-tab fetches on mount and on tab switch; no polling. Upstream seeders run on varying cadences per dataset (tariffs daily, Comtrade monthly).
## Tier & gating
**Panel shell is free.** No `premium` flag in variant registrations. The generated REST service is mixed: restrictions, flows, barriers, and customs revenue are public; `get-tariff-trends` and `list-comtrade-flows` are premium RPC paths and degrade to empty data without an entitled session or API key.
## API reference
- [Trade service](/api/TradeService.openapi.yaml) β€” full schemas and query parameters for the six tab-backing RPCs.