You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

35 lines
926 B

from quart import Blueprint, current_app
from totrader.models import *
from totrader.tasks import trader
bp = Blueprint('tasks', 'tasks', url_prefix='/api/tasks')
@bp.route('/store_ticker_data')
async def store_ticker_data():
current_app.add_background_task(trader.store_ticker_data)
return 'ok'
@bp.route('/store_balances')
async def store_balances():
current_app.add_background_task(trader.store_balances)
return 'ok'
@bp.route('/store_orders')
async def store_orders():
current_app.add_background_task(trader.reconcile_orders)
current_app.add_background_task(trader.store_orders)
return 'ok'
@bp.route('/store_trade_history')
async def store_trade_history():
current_app.add_background_task(trader.store_trade_history)
return 'ok'
@bp.route('/store_bitcoin_price')
async def store_bitcoin_price():
current_app.add_background_task(trader.store_bitcoin_price)
return 'ok'