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/validation/verify_balances.py from GaryLeckey/aureon-os: direct link, hf CLI and curl.
- Browser
- Download file 2.42 kB
-
https://huggingface.co/spaces/GaryLeckey/aureon-os/resolve/main/scripts/validation/verify_balances.py
- Command line
-
hf download hf://spaces/GaryLeckey/aureon-os/scripts/validation/verify_balances.py
-
curl -L -o verify_balances.py https://huggingface.co/spaces/GaryLeckey/aureon-os/resolve/main/scripts/validation/verify_balances.py
2.42 kB
| from aureon_baton_link import link_system as _baton_link; _baton_link(__name__) | |
| import os | |
| import asyncio | |
| try: | |
| from dotenv import load_dotenv | |
| except ImportError: # Fallback when python-dotenv is not installed | |
| def load_dotenv(*args, **kwargs): # type: ignore[unused-arg] | |
| return None | |
| # Load env vars | |
| load_dotenv() | |
| async def check_balances(): | |
| print("๐ VERIFYING REAL BALANCES FROM EXCHANGES...") | |
| # Check Alpaca | |
| try: | |
| from alpaca_client import AlpacaClient | |
| alpaca = AlpacaClient() | |
| acct = alpaca.get_account() | |
| print(f"\n๐ฆ ALPACA ACCOUNT ({'PAPER' if alpaca.use_paper else 'LIVE'}):") | |
| if isinstance(acct, dict) and 'equity' in acct: | |
| print(f" Status: {acct.get('status', 'Unknown')}") | |
| print(f" Equity: ${float(acct.get('equity', 0)):,.2f}") | |
| print(f" Cash: ${float(acct.get('cash', 0)):,.2f}") | |
| print(f" Buying Power: ${float(acct.get('buying_power', 0)):,.2f}") | |
| else: | |
| print(f" โ ๏ธ Unexpected response: {acct}") | |
| except Exception as e: | |
| print(f"\n๐ฆ Alpaca Error: {e}") | |
| # Check Kraken | |
| try: | |
| from kraken_client import KrakenClient, get_kraken_client | |
| kraken = get_kraken_client() | |
| bal = kraken.get_account_balance() | |
| print(f"\n๐ KRAKEN BALANCES:") | |
| if bal: | |
| for asset, amount in bal.items(): | |
| if float(amount) > 0: | |
| print(f" {asset}: {amount}") | |
| else: | |
| print(" No balances found or error.") | |
| except Exception as e: | |
| print(f"\n๐ Kraken Error: {e}") | |
| # Check Binance | |
| try: | |
| from binance_client import BinanceClient | |
| binance = get_binance_client() | |
| # Use simple account() method | |
| info = binance.account() | |
| print(f"\n๐ก BINANCE BALANCES:") | |
| if info and 'balances' in info: | |
| for b in info['balances']: | |
| free = float(b['free']) | |
| locked = float(b['locked']) | |
| if free + locked > 0: | |
| print(f" {b['asset']}: {free} (Locked: {locked})") | |
| else: | |
| print(" No balances found or error.") | |
| except Exception as e: | |
| print(f"\n๐ก Binance Error: {e}") | |
| if __name__ == "__main__": | |
| asyncio.run(check_balances()) | |