Spaces:
Running
Running
File size: 1,982 Bytes
da0ce7b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | #!/usr/bin/env python3
"""Quick debug script to see why no opportunities are being found."""
from aureon_baton_link import link_system as _baton_link; _baton_link(__name__)
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
# Load env
from dotenv import load_dotenv
load_dotenv()
from kraken_client import KrakenClient, get_kraken_client
def main():
print("=" * 60)
print("π DEBUGGING OPPORTUNITY SCANNER")
print("=" * 60)
# Connect to Kraken
kraken = get_kraken_client()
# Get balances
print("\nπ Getting balances from Kraken...")
balances = kraken.get_balances()
for asset, amount in balances.items():
if amount > 0:
print(f" {asset}: {amount}")
# Get ticker info
print("\nπ Getting trading pairs...")
pairs_resp = kraken.get_tradeable_pairs()
pairs = pairs_resp.get('result', {})
print(f" Total pairs: {len(pairs)}")
# Check what pairs exist for our assets
print("\nπ Checking trading pairs for held assets...")
held_assets = {k: v for k, v in balances.items() if v > 0}
for asset in held_assets:
print(f"\n {asset}:")
# Find USD pairs
usd_pairs = [p for p in pairs.keys()
if (asset in p and 'USD' in p) or
(pairs[p].get('base') == asset) or
(pairs[p].get('quote') == asset)]
if usd_pairs:
print(f" USD pairs: {usd_pairs[:5]}...") # First 5
else:
print(f" β No USD pairs found!")
# Check if the asset can be converted
# Kraken uses weird names - e.g., XBT for BTC
alt_names = pairs.get(f"{asset}USD", {}).get('altname', '')
if alt_names:
print(f" Alt name: {alt_names}")
if __name__ == "__main__":
main()
|