import logging
import time


def execute_trade(market, action):
    """
    Makes a trade via the API and responds once completed.
    May have multiple retrys before raising exception if it failed.

    Likely steps:
    1. Initialise the trading API
    2. Post trade to the API
    3. Confirm success in response or retry if it failed
    4. Return the response once successful

    Returns: dict of trade_information or raises Exception
    """

    logging.info(f"{market} - Posting {action} trade.")
    time.sleep(5)
    logging.info(f"{market} - {action} trade successful.")

    return {"success": True, "trade_details": {}}