Skip to main content
Glama
jjsteffen23

CME Prediction Markets MCP Server

by jjsteffen23
trades.py1.43 kB
from sqlalchemy import Column, String, DateTime, Float, Integer, ForeignKey, Index from sqlalchemy.orm import relationship from datetime import datetime from src.data.models.database import Base class Trade(Base): __tablename__ = "trades" id = Column(Integer, primary_key=True, index=True) trade_id = Column(String(100), unique=True, index=True, nullable=False) contract_id = Column(Integer, ForeignKey("contracts.id"), nullable=False, index=True) # CME-specific fields instrument_guid_long = Column(String(100), index=True, nullable=True) count_clr_trade_id = Column(Integer, nullable=True) trade_date = Column(DateTime, nullable=True, index=True) # Trade data timestamp = Column(DateTime, nullable=False, index=True) price = Column(Float, nullable=False) volume = Column(Integer, nullable=False) # Additional metadata side = Column(String(10), nullable=True) # BUY, SELL trade_type = Column(String(20), nullable=True) created_at = Column(DateTime, default=datetime.utcnow, nullable=False) # Relationships contract = relationship("Contract", back_populates="trades") __table_args__ = ( Index('idx_contract_timestamp', 'contract_id', 'timestamp'), Index('idx_timestamp_price', 'timestamp', 'price'), ) def __repr__(self): return f"<Trade(id='{self.trade_id}', price={self.price}, volume={self.volume})>"

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jjsteffen23/dk_mcp_2'

If you have feedback or need assistance with the MCP directory API, please join our Discord server