Quart, Async, Terra, and accessing connection globally?

I am creating a program to buy and sell cryptocurrency in response to a POST request. I have based this on working code that does this using the Binance API and I thought that learning how to use the Terra SDK would allow me to swap out the Binance code for Terra code, but it seems I must use the async client and it has made this more complex, though I appreciate this will improve performance and later allow me to place multiple transactions asynchronously.

I have some experience with other languages so although I plan on finishing Eric Matthees Python Crash Course book I should be able to find my way through the basics of python but I am really struggling with the added quart and async aspect. I have completed the Terra SDK basics video tutorial, searched github for code where AsyncLCDClient and @app.before_serving and async def startup() are used, read through the quart tutorials, watched tutorials from the quart dev and on async but I am still stuck trying to get the basic setup of instantiating the connection, and then being able to access it and methods of it in the same function and globally as will be required, eg terra.wallet etc.

Current code:

from quart import Quart, request
# from terra_sdk.client.lcd import LCDClient
from terra_sdk.client.lcd import AsyncLCDClient
from terra_sdk.key.mnemonic import MnemonicKey
import json, config

from terra_sdk.client.lcd.api.bank import BankAPI

# Sync version which allows global access but generates an *ASync* error on POST.
# terra = LCDClient("https://bombay-lcd.terra.dev", "bombay-12")
# wallet = terra.wallet(mk)

app = Quart(__name__)

# mk = MnemonicKey(mnemonic=config.MNEMONIC) // Production
mk = MnemonicKey()

async def startup():
    app.terra = AsyncLCDClient("https://bombay-lcd.terra.dev", "bombay-12")
    # Not recognised:
    # wallet = await app.terra.wallet(mk)
    # wallet = await terra.wallet(mk)

@app.route('/webhook', methods=['POST'])
async def webhook():
    data = json.loads(await request.data)

    # Not recognised:
    # info = await terra.tendermint.node_info()
    # info = await app.terra.tendermint.node_info()

    if (data['passphrase']) != config.WEBHOOK_PASSPHRASE: #Upgrade to bcrypt.
        return {
            "code": "error",
            "message": "invalid passphrase"
            # Placeholder for order function call
            return {
             "code": "success",
             "message": "authorised"

# async def order():
    # Not recognised:
    # balance = await terra.bank.balance(mk.acc_address)
    # Other order logic to swap tokens using functions from AsyncLCDClient

if __name__ == "__main__":

Using the sync LCDClient ran but on sending a POST generated the following error:

Traceback (most recent call last):
  File "/home/hashewnuts/cloud/code/VisualStudioCode/terrabot-tradingview/app.py", line 11, in <module>
    terra = LCDClient("https://bombay-lcd.terra.dev", "bombay-12")
  File "/home/hashewnuts/cloud/code/VisualStudioCode/terrabot-tradingview/venv/lib/python3.8/site-packages/terra_sdk/client/lcd/lcdclient.py", line 197, in __init__
  File "/usr/lib/python3.8/asyncio/events.py", line 639, in get_event_loop
    raise RuntimeError('There is no current event loop in thread %r.'
RuntimeError: There is no current event loop in thread 'Thread-1'.

Someone more experienced recommended I use the AsyncLCDClient with Quart instead of the sync client with flask, that I use @app.before_serving, instantiate it to app.terra, and that I should then be able to access it but I am not able to either in the same function or globally as I will need to.

Someone else recommended today I instantiate AsyncLCDClient instead in the global scope and then use modules and methods of it in async functions:

terra = AsyncLCDClient("https://bombay-lcd.terra.dev", "bombay-12")

@app.route('/webhook', methods=['POST'])
async def webhook():
    data = json.loads(await request.data)

    info = await terra.tendermint.node_info()
    print(f"Node info {info}")

Although I could then access terra globally this resulted in the following error:

   File "/home/hashewnuts/cloud/code/VisualStudioCode/quart-test/venv/lib/python3.8/site-packages/aiohttp/helpers.py", line 701, in __enter__
    raise RuntimeError(
RuntimeError: Timeout context manager should be used inside a task

I have seen aiohttp referred to as outdated and unmaintained, and as I understand it quart should be used without it. Searching for the error I also found this thread where pgjones recommends using a startup function as I have been.

I would really appreciate if someone could tell me where I am going wrong, and if possible provide me with a very basic template of how to properly instantiate terra Async using quart and access it globally that I can follow as I progress through my project.

For reference: