# Trading Simulations API

## Trading Strategies with Portfolios

> Get trading strategies with their associated portfolios

```json
{"openapi":"3.1.0","info":{"title":"Web3 Graph API","version":"1.0.0"},"servers":[{"url":"https://api.web3graph.xyz","description":"Web3 Graph API Production server"},{"url":"http://localhost:8000","description":"Web3 Graph API Local server"}],"security":[{"APIKeyQuery":[]},{"APIKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyQuery":{"type":"apiKey","in":"query","name":"api_key"},"APIKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key"}}},"paths":{"/api/v1/trading/get_strategies_with_portfolios":{"get":{"tags":["Trading Simulations API"],"summary":"Trading Strategies with Portfolios","description":"Get trading strategies with their associated portfolios","operationId":"get_trading_strategies_with_portfolios_api_v1_trading_get_strategies_with_portfolios_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}}}
```

## Closed Trades

> Get list of closed trades

```json
{"openapi":"3.1.0","info":{"title":"Web3 Graph API","version":"1.0.0"},"servers":[{"url":"https://api.web3graph.xyz","description":"Web3 Graph API Production server"},{"url":"http://localhost:8000","description":"Web3 Graph API Local server"}],"security":[{"APIKeyQuery":[]},{"APIKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyQuery":{"type":"apiKey","in":"query","name":"api_key"},"APIKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key"}},"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/api/v1/trading/get_closed_trades":{"get":{"tags":["Trading Simulations API"],"summary":"Closed Trades","description":"Get list of closed trades","operationId":"get_closed_trades_api_v1_trading_get_closed_trades_get","parameters":[{"name":"strategy_id","in":"query","required":true,"schema":{"type":"integer","title":"Strategy Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Live Trades

> Get list of live trades

```json
{"openapi":"3.1.0","info":{"title":"Web3 Graph API","version":"1.0.0"},"servers":[{"url":"https://api.web3graph.xyz","description":"Web3 Graph API Production server"},{"url":"http://localhost:8000","description":"Web3 Graph API Local server"}],"security":[{"APIKeyQuery":[]},{"APIKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyQuery":{"type":"apiKey","in":"query","name":"api_key"},"APIKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key"}},"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/api/v1/trading/get_live_trades":{"get":{"tags":["Trading Simulations API"],"summary":"Live Trades","description":"Get list of live trades","operationId":"get_live_trades_api_v1_trading_get_live_trades_get","parameters":[{"name":"strategy_id","in":"query","required":true,"schema":{"type":"integer","title":"Strategy Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Portfolio History

> Get portfolio history by strategy ID

```json
{"openapi":"3.1.0","info":{"title":"Web3 Graph API","version":"1.0.0"},"servers":[{"url":"https://api.web3graph.xyz","description":"Web3 Graph API Production server"},{"url":"http://localhost:8000","description":"Web3 Graph API Local server"}],"security":[{"APIKeyQuery":[]},{"APIKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyQuery":{"type":"apiKey","in":"query","name":"api_key"},"APIKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key"}},"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/api/v1/trading/get_portfolio_history":{"get":{"tags":["Trading Simulations API"],"summary":"Portfolio History","description":"Get portfolio history by strategy ID","operationId":"get_portfolio_history_api_v1_trading_get_portfolio_history_get","parameters":[{"name":"strategy_id","in":"query","required":true,"schema":{"type":"integer","title":"Strategy Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```
