Spaces:
Running
Running
Deploy Aureon OS (deploy/selfhost stack: nginx edge + fusion API x2 + console + HNC organ + redis + postgres; paper mode) (part 19)
da0ce7b verified Download scripts/diagnostics/debug_opportunities.py from GaryLeckey/aureon-os: direct link, hf CLI and curl.
- Browser
- Download file 1.98 kB
-
https://huggingface.co/spaces/GaryLeckey/aureon-os/resolve/main/scripts/diagnostics/debug_opportunities.py
- Command line
-
hf download hf://spaces/GaryLeckey/aureon-os/scripts/diagnostics/debug_opportunities.py
-
curl -L -o debug_opportunities.py https://huggingface.co/spaces/GaryLeckey/aureon-os/resolve/main/scripts/diagnostics/debug_opportunities.py
1.98 kB
| #!/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() | |