Paradex Trading Bot in Python¶
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.
What BotSpot MCP adds
Use Claude, ChatGPT, Codex, Cursor, VS Code or another MCP-compatible assistant? Connect the free BotSpot MCP for:
Skills: build LumiBot strategies.
Free data: news, economics and SEC filings.
Backtests: run tests and read charts.
Cloud hosting: low-cost scheduled bots.
Community: share bots and discuss trades.
Marketplace: discover and publish strategies.
Broker linking: connect accounts through BotSpot.
Paradex at a glance¶
CCXT exchange id |
|
Markets |
Spot, Perpetual swaps |
Testnet (sandbox) |
Yes |
Credentials |
private key, wallet address |
Live data streams |
prices, order book, trades, your orders, your balance, your positions |
CCXT request spacing |
about 50 ms between requests |
Official site |
|
API docs |
|
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.
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_ADDRESSto that wallet’s Ethereum address.Set
PARADEX_PRIVATE_KEYto that wallet’s private key. CCXT signs with it to find your Paradex account and log in.Fund only what the bot will trade.
Safer option: Paradex subkeys (Key Management, Subkeys, + Add New Key) can trade but cannot withdraw. Set
PARADEX_L2_PRIVATE_KEYto the subkey’s private key andPARADEX_L2_ADDRESSto your Paradex account address, and leavePARADEX_PRIVATE_KEYunset. LumiBot then hands CCXT the subkey directly, so the wallet’s private key never reaches the bot. LumiBot has not yet run this setup against a live Paradex account, so test it with a small amount first.
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.
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:
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¶
This bot buys about 50 USDC of BTC on Paradex once 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. Paradex accepts only limit orders through CCXT, so the example places a limit order just above the last price.
from lumibot.entities import Asset
from lumibot.strategies import Strategy
class ParadexBuyOnce(Strategy):
"""Buy a small amount of BTC once, 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):
coin = Asset("BTC", asset_type=Asset.AssetType.CRYPTO)
if self.get_position(coin) is not None:
return # already holding BTC
price = self.get_last_price(coin, quote=self.quote_asset)
if price:
quantity = round(50 / price, 6) # about 50 USDC worth
# This exchange takes only limit orders through CCXT.
order = self.create_order(coin, quantity, "buy", limit_price=price * 1.002, quote=self.quote_asset)
self.submit_order(order)
if __name__ == "__main__":
# LumiBot reads TRADING_BROKER and the keys from your .env file.
strategy = ParadexBuyOnce(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.
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 BTC and ETH against USDC (asset_type 'crypto', quote_symbol 'USDC'), or hold cash. "
"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/USDC and ETH/USDC prices and your current holdings, 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 AI agents quickstart for models, tools and memory.
What you can trade on Paradex¶
Market |
Listed by CCXT |
|---|---|
Spot |
Yes |
Margin |
No |
Perpetual swaps |
Yes |
Dated futures |
No |
Options |
No |
CCXT lists these order features for Paradex: stop orders, editing open orders, canceling orders.
For perpetual contracts, use the full CCXT symbol so the settlement currency is clear, for example BTC/USDT:USDT. See the CCXT guide for contract quantities, position modes and leverage.
Perpetual futures example on Paradex¶
Paradex also lists perpetual swaps. This bot opens one small long position in BTC/USD:USDC worth about 50 USDC and then holds it. LumiBot treats a perpetual as asset_type="crypto_future" and sizes it in contracts, the same model as LumiBot’s Bitunix futures broker. Contract symbols can differ by exchange, so check the symbol in self.broker.api.markets before going live. In hedge mode, add position_side="long" to create_order. Paradex accepts only limit orders through CCXT, so the example places a limit order just above the last price.
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)
# This exchange takes only limit orders through CCXT.
order = self.create_order(contract, quantity, "buy", limit_price=price * 1.002)
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()
Fees and partner IDs on Paradex¶
You pay Paradex’s normal trading fees. CCXT, the library underneath, normally tags Paradex orders with its own partner ID. LumiBot removes that tag. LumiBot may attach its own exchange partner ID instead. That costs you nothing extra. LumiBot never adds an extra builder fee unless one is turned on, and it logs a warning when one is.
Paradex tips¶
CCXT 4.5.91 lists spot, perpetuals and options for Paradex. The BTC perpetual is
BTC/USD:USDC, settled in USDC; use its full symbol to distinguish it from spot.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/USDT:USDT.
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.
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)
CCXT 4.5.91 paradex adapter source (read 2026-11-01)
Exchange id, URLs, markets, credentials and stream support: CCXT 4.5.91 metadata, generated 2026-11-01