21 lines
618 B
Python
21 lines
618 B
Python
from utils import load_config, create_mqttc
|
|
from tastytrade import OAuthSession
|
|
from loguru import logger
|
|
from producers.sp500 import get_spx_market, stream_spx_greeks
|
|
import asyncio
|
|
import json
|
|
config = load_config()
|
|
session = OAuthSession(config.tasty_trade.client_secret,config.tasty_trade.refresh_token)
|
|
logger.info("Tasty Trade session instantiated")
|
|
|
|
async def main():
|
|
functions = [get_spx_market, stream_spx_greeks]
|
|
tasks = []
|
|
for function in functions:
|
|
task = asyncio.create_task(function(session))
|
|
tasks.append(task)
|
|
for task in tasks:
|
|
await task
|
|
|
|
asyncio.run(main())
|