import ccxt
import sys

def main():
    try:
        exchange = ccxt.okx()
        print("Loading markets...")
        markets = exchange.load_markets()
        
        # Filter for ETH perpetuals
        eth_perps = [
            symbol for symbol, market in markets.items() 
            if 'ETH' in symbol and 'USDT' in symbol and market.get('swap') and market.get('linear')
        ]
        
        print(f"\nFound {len(eth_perps)} ETH Linear Perps:")
        for symbol in eth_perps:
            market = markets[symbol]
            print(f"  CCXT Symbol: {symbol}")
            print(f"  Exchange ID: {market['id']}")
            print(f"  Type: {market['type']}")
            print("-" * 30)
            
    except Exception as e:
        print(f"Error: {e}")

if __name__ == "__main__":
    main()
