# Market Reporting

This document explains how market reporting works.

## Overview

The MarketReportingService aggregates bridge metrics and reports them to external crypto and FX market APIs.

## Supported APIs

### Crypto Exchanges

- Binance API
- Coinbase API
- Kraken API

### FX Markets

- FXCM API (if API key provided)
- Alpha Vantage API (if API key provided)

## Reporting Data

### Price Reports

- Symbol (e.g., USDT, USDC)
- Price
- 24h volume
- Timestamp

### FX Rate Reports

- Currency pair (e.g., USD/EUR)
- Exchange rate
- Timestamp

## Configuration

Set environment variables:

```
FXCM_API_KEY=your_key
ALPHA_VANTAGE_API_KEY=your_key
```

## Usage

```typescript
import MarketReportingService from './services/market-reporting/market-reporting.service';

const service = new MarketReportingService();

// Start periodic reporting (every 60 seconds)
service.startReporting(60000);

// Report a price
await service.reportCryptoPrice({
  symbol: 'USDT',
  price: 1.0,
  volume24h: 1000000,
  timestamp: Date.now(),
});
```

## Monitoring

Check API connection status via admin dashboard or API endpoint:

```
GET /api/admin/market/status
```

