bug fixes

This commit is contained in:
2026-04-27 17:57:58 +00:00
parent a94c0a55be
commit 484fe4ba0b
18 changed files with 775 additions and 188 deletions

View File

@@ -150,3 +150,32 @@ async def create_fr_extended_user_position(
else:
raise ValueError('Only MySQL engine is implemented')
### Market Trades Table ####
async def create_fr_extended_mkt_trades(
CON: AsyncContextManager,
engine: str = 'mysql', # mysql | duckdb
) -> None:
if CON is None:
logging.info("NO DB CONNECTION, SKIPPING Create Statements")
else:
if engine == 'mysql':
logging.info('Creating Table if Does Not Exist: fr_extended_mkt_trades')
await CON.execute(text("""
CREATE TABLE IF NOT EXISTS fr_extended_mkt_trades (
sequence_id INT,
timestamp_arrival BIGINT,
timestamp_msg BIGINT,
timestamp_trade BIGINT,
symbol VARCHAR(20),
side_taker VARCHAR(20),
trade_type VARCHAR(20),
price DOUBLE,
qty DOUBLE,
trade_id VARCHAR(100),
is_buyer_mkt_maker BOOL
);
"""))
await CON.commit()
else:
raise ValueError('Only MySQL engine is implemented')