:seo_title: Paradex Trading Bot in Python: AI Agent and Algorithmic Trading with LumiBot .. Generated by scripts/generate_ccxt_exchange_pages.py from docsrc/_data/. Edit the data, not this page. Paradex Trading Bot in Python ============================= .. meta:: :description: Build a Paradex trading bot in Python with LumiBot and CCXT. Set up Paradex API wallet keys, connect them, and run a regular or AI agent strategy. :keywords: Paradex trading bot, Paradex API, Paradex Python, agentic trading Paradex, AI trading bot Paradex, algorithmic trading Paradex, ccxt paradex This guide shows how to build a Paradex trading bot in Python with LumiBot, for both AI agent trading and algorithmic trading. LumiBot connects to Paradex through CCXT, the open source library that talks to more than 100 crypto exchanges. You will create a Paradex account and API wallet, connect it, and run two examples: a simple algorithmic trading bot and an agentic trading bot where an AI agent makes the calls. Paradex at a glance ------------------- .. list-table:: :widths: 35 65 * - CCXT exchange id - ``paradex`` * - Markets - Perpetual swaps * - Testnet (sandbox) - Yes * - Credentials - private key, wallet address * - Live data streams - prices, order book, trades, your orders * - CCXT request spacing - about 50 ms between requests * - Official site - https://www.paradex.trade/ * - API docs - https://docs.api.testnet.paradex.trade/ * - Fees - https://docs.paradex.trade/getting-started/trading-fees What is Paradex? ---------------- Paradex is a trading venue that runs on its own appchain on Starknet. It says you can trade perps, options and spot from one account with zero fees. Sign up for Paradex ------------------- #. Open https://app.paradex.trade and click Connect Wallet. Choose your Ethereum wallet, such as MetaMask. #. Sign the request that creates your Paradex (L2) key. The first time, Paradex asks you to sign twice. #. For practice, use the testnet at https://app.testnet.paradex.trade. It runs on Sepolia and credits each new account with $1,000,000 of test USDC. `Open a Paradex account `_ Set up a Paradex API wallet --------------------------- #. Make a new Ethereum wallet just for the bot, and connect it to Paradex as above. #. Set ``PARADEX_WALLET_ADDRESS`` to that wallet's Ethereum address. #. Set ``PARADEX_PRIVATE_KEY`` to that wallet's private key. CCXT signs with it to find your Paradex account and log in. #. Fund only what the bot will trade. #. Paradex also offers subkeys (Key Management, Subkeys, + Add New Key) that can trade but cannot withdraw. CCXT's Paradex login does not use the subkey flow, so they do not replace the key above. **Which permissions to turn on:** Paradex subkeys can place, cancel and change orders but cannot withdraw or transfer. However, CCXT logs in with the wallet's private key, and that key has full control, including withdrawals. Use a separate wallet that holds only the bot's funds, and never reuse your main wallet's key. .. warning:: A Paradex private key is as powerful as the money it controls. Use a separate wallet or API wallet that holds only what you want the bot to trade, keep the key out of your code and out of Git, and move your funds if the key ever leaks. Connect Paradex to LumiBot -------------------------- The simplest way: put these lines in a ``.env`` file next to your strategy. LumiBot loads the file, sees ``TRADING_BROKER=paradex`` and connects to Paradex for you, so your strategy needs no broker code. .. code-block:: bash TRADING_BROKER=paradex PARADEX_PRIVATE_KEY=your_privateKey PARADEX_WALLET_ADDRESS=your_walletAddress PARADEX_SANDBOX=true # testnet; remove this line for your live account LumiBot reads exactly the fields CCXT needs for Paradex (``privateKey``, ``walletAddress``). If one is missing, LumiBot stops at start-up and names the variable you still need. You can also build the broker in code. This is handy when one script talks to more than one exchange, or when you need extra CCXT options. The keys in the config are CCXT's own credential names for Paradex: .. code-block:: python import os PARADEX_CONFIG = { "exchange_id": "paradex", "privateKey": os.environ.get("PARADEX_PRIVATE_KEY"), "walletAddress": os.environ.get("PARADEX_WALLET_ADDRESS"), "sandbox": True, # testnet first; set False for your live account } from lumibot.brokers import Ccxt broker = Ccxt(PARADEX_CONFIG) # then: MyStrategy(broker=broker, ...) Either way, LumiBot turns on CCXT's built-in rate limiting for you. Practice on the Paradex testnet ------------------------------- Paradex runs a testnet at https://app.testnet.paradex.trade on Ethereum's Sepolia network, with free test USDC. Set ``PARADEX_SANDBOX=true`` (or ``"sandbox": True`` in a code config) to use it. Testnet accounts cannot be reset; make a sub-account or a new wallet to get more test funds. CCXT sends sandbox requests to: https://api.testnet.paradex.trade/v1, https://api.testnet.paradex.trade/v2. Testnet and live accounts use different keys. Algorithmic trading example: a simple Paradex bot ------------------------------------------------- CCXT lists no spot market for Paradex, so this example trades a perpetual contract. It opens one small long BTC position worth about 50 USDC and then holds it. It is a starting point to check that your keys, balances and orders work. If the exchange's minimum order is larger, raise the amount. If your account uses hedge mode, add ``position_side="long"`` to ``create_order``. .. code-block:: python from lumibot.entities import Asset from lumibot.strategies import Strategy class ParadexOpenOneLong(Strategy): """Open one small long BTC perpetual position, then hold it.""" def initialize(self): self.sleeptime = "1H" self.set_market("24/7") # crypto trades all day, every day def on_trading_iteration(self): # The full CCXT symbol keeps the settlement currency clear. contract = self.broker.get_asset("BTC/USD:USDC") if self.get_position(contract) is not None: return # already holding the position price = self.get_last_price(contract) if price: # Each contract covers contract.multiplier BTC; size the order to about 50 USDC. quantity = round(50 / (price * contract.multiplier), 6) order = self.create_order(contract, quantity, "buy") self.submit_order(order) if __name__ == "__main__": # LumiBot reads TRADING_BROKER and the keys from your .env file. strategy = ParadexOpenOneLong(quote_asset=Asset("USDC", asset_type=Asset.AssetType.CRYPTO)) strategy.run_live() Agentic trading example: an AI agent that trades on Paradex ----------------------------------------------------------- Agentic trading means an AI agent reads the market and decides what to do. In this example one LumiBot agent looks at prices and your Paradex account, then places the orders itself. There is no Python logic in between: you set the rules in plain English in the prompt, such as what it may trade and how big each order can be. This follows the same pattern as LumiBot's AI trading team examples. .. code-block:: python from lumibot.entities import Asset from lumibot.strategies import Strategy class ParadexAITrader(Strategy): """One AI agent researches the market and places the trades itself.""" def initialize(self): self.sleeptime = "4H" self.set_market("24/7") self.agents.create( name="trader", model="openai/gpt-6-luna", reasoning_effort="high", allow_trading=True, system_prompt=( "You manage a small crypto account on Paradex. " "You may trade the BTC/USD:USDC perpetual contract (asset_type 'crypto_future'), long or short, or stay flat. " "Before every order, call account_portfolio, account_positions and " "market_last_price for that exact symbol in the same run. " "Keep each order under 10% of the account value. " "Explain each decision in one short paragraph." ), ) def on_trading_iteration(self): self.agents["trader"].run( task_prompt="Review recent BTC/USD:USDC prices and your current position, then decide whether to buy, sell or hold.", context={"exchange": "Paradex", "quote": "USDC", "date": self.get_datetime().isoformat()}, ) if __name__ == "__main__": # LumiBot reads TRADING_BROKER and the keys from your .env file. strategy = ParadexAITrader(quote_asset=Asset("USDC", asset_type=Asset.AssetType.CRYPTO)) strategy.run_live() The agent needs a model key such as ``OPENAI_API_KEY`` in your environment. See the :doc:`AI agents quickstart ` for models, tools and memory. What you can trade on Paradex through CCXT ------------------------------------------ .. list-table:: :header-rows: 1 :widths: 40 60 * - Market - Listed by CCXT * - Spot - No * - Margin - No * - Perpetual swaps - Yes * - Dated futures - No * - Options - No CCXT lists these order features for Paradex: market orders, limit orders, stop orders, editing open orders, canceling orders. For perpetual contracts, use the full CCXT symbol so the settlement currency is clear, for example ``BTC/USD:USDC``. See :doc:`the CCXT guide ` for contract quantities, position modes and leverage. Paradex tips ------------ * In CCXT, Paradex lists perpetuals (and options) but no spot markets. The BTC perpetual is ``BTC/USD:USDC``, settled in USDC. * Paradex login tokens (JWTs) expire every 5 minutes. CCXT gets new ones for you. * Paradex supports sub-accounts. A separate sub-account per bot keeps bot trades apart from manual trades. Frequently asked questions -------------------------- **Can I build a Paradex trading bot in Python?** Yes. Install LumiBot (``pip install lumibot``), set your Paradex keys and use the ``paradex`` CCXT exchange id as shown above. **Does Paradex have a testnet?** Yes. Set ``PARADEX_SANDBOX=true`` and use keys from the Paradex testnet. **Which keys does a Paradex bot need?** Paradex subkeys can place, cancel and change orders but cannot withdraw or transfer. However, CCXT logs in with the wallet's private key, and that key has full control, including withdrawals. Use a separate wallet that holds only the bot's funds, and never reuse your main wallet's key. **Can an AI agent trade on Paradex by itself?** Yes. The agentic example above gives one agent permission to trade. You control what it may trade and how much through its prompt. **Can I trade Paradex perpetual futures with LumiBot?** CCXT lists perpetual swaps for this exchange. Use the full contract symbol, such as ``BTC/USD:USDC``. **Is LumiBot free?** Yes. LumiBot is open source on GitHub at https://github.com/Lumiwealth/lumibot. You pay only your exchange's trading fees and, for AI agents, your model provider. Run it in the cloud with BotSpot -------------------------------- Do not want to keep a computer running for your Paradex bot? BotSpot is the hosted home for LumiBot strategies and AI trading agents: build with AI, backtest, connect a broker, and watch every trade with logs and alerts. `Try BotSpot `_ Related guides -------------- * :doc:`CCXT crypto trading with LumiBot ` * :doc:`AI agents quickstart ` * :doc:`AftermathFinance trading bot ` * :doc:`Apex trading bot ` * :doc:`BloFin trading bot ` * :doc:`dYdX trading bot ` Sources ------- * `Paradex Docs: API Authentication `_ (read 2026-10-23) * `Paradex Docs: home `_ (read 2026-10-23) * `Paradex Docs: Testnet FAQs `_ (read 2026-10-23) * `Paradex Docs: Mobile Access Guide `_ (read 2026-10-23) * Exchange id, URLs, markets, credentials and stream support: CCXT 4.5.64 metadata, generated 2026-10-23