14 lines
575 B
Python
14 lines
575 B
Python
from datetime import datetime
|
|
|
|
def log_opportunity(opp: dict):
|
|
timestamp = datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S')
|
|
message = (
|
|
f"[{timestamp}] {opp['symbol']} | BUY on {opp['buy_exchange']} @ {opp['buy_price']} "
|
|
f"-> SELL on {opp['sell_exchange']} @ {opp['sell_price']} | "
|
|
f"Net Spread: {opp['spread_percent']:.2f}% | Size: {opp['size']:.4f} "
|
|
f"| Funding BUY: {opp['buy_funding']:.5f}, SELL: {opp['sell_funding']:.5f}"
|
|
)
|
|
print(message)
|
|
#with open("opportunities.txt", "a") as f:
|
|
#f.write(message + "\n")
|