-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Feature Request: Market Data API
Overview
Add market data capabilities to the Mesh API to support fetching available asset pairs and real-time/historical price data.
Requirements
1. Asset Pair Discovery
- Endpoint to list all available trading pairs
- Filter by base/quote assets
- Include metadata (tick size, min/max order sizes, trading status)
2. Price Data Retrieval
- Current spot prices for asset pairs
- Historical price data (OHLCV - Open, High, Low, Close, Volume)
- Configurable time intervals (1m, 5m, 1h, 1d, etc.)
- Timestamp precision for price updates
Proposed API Structure
// proto/meshtrade/market_data/pair/v1/service.proto
service PairService {
rpc ListPairs(ListPairsRequest) returns (ListPairsResponse);
rpc GetPair(GetPairRequest) returns (Pair);
}
// proto/meshtrade/market_data/price/v1/service.proto
service PriceService {
rpc GetCurrentPrice(GetCurrentPriceRequest) returns (Price);
rpc GetHistoricalPrices(GetHistoricalPricesRequest) returns (stream Price);
rpc SubscribePriceUpdates(SubscribePriceUpdatesRequest) returns (stream Price);
}Use Cases
- Display available trading pairs in UI
- Show real-time price quotes for instruments
- Chart historical price data for analysis
- Calculate order values before submission
- Market data for algorithmic trading strategies
Acceptance Criteria
- Protobuf definitions for market data services
- Generated SDKs for Go, Python, TypeScript
- Role-based access control (viewer roles should have access)
- Documentation with code examples
- Unit tests for all language SDKs
Technical Considerations
- Use
meshtrade/type/v1/Tokenfor asset identification - Use
meshtrade/type/v1/Amountandmeshtrade/type/v1/Decimalfor prices - Consider rate limiting for price streaming endpoints
- Define appropriate
METHOD_TYPE_READfor all methods - Create
ROLE_MARKET_DATA_VIEWERrole
Priority
High - Essential for trading operations and UI functionality
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels