Skip to content
guides·11 min read·8 April 2026

How to Trade Crypto Perpetual Futures with a Bot

A practical guide to crypto perpetuals trading with an automated bot. Understand funding rates, leverage, liquidation, and margin, then learn how to run a perpetuals strategy safely on Hyperliquid.

What Are Crypto Perpetual Futures

Perpetual futures, usually shortened to perps, are derivative contracts that let you speculate on the price of a cryptocurrency without owning the underlying asset. You can go long if you expect the price to rise or short if you expect it to fall, and you can use leverage to control a position larger than your collateral alone.

The word "perpetual" points to the feature that makes them distinct from traditional futures: there is no expiry date. A standard futures contract settles on a set date. A perpetual contract can be held indefinitely, which is why it has become the dominant instrument in crypto derivatives trading.

Perps are the natural home for automated trading. They offer deep liquidity on major pairs, they trade around the clock, and they let a strategy express both directions of a move. This guide explains the mechanics you must understand before automating them, and how to run a perpetuals bot without walking into the traps that catch newcomers.

A blunt warning before we go further: leverage cuts both ways. Perpetual futures can lose money faster than spot trading, and it is entirely possible to lose your whole collateral through liquidation. Only trade with capital you can afford to lose, and past performance does not guarantee future results.

How Perpetual Futures Differ from Spot Trading

In spot trading you buy the actual asset. Buy one coin, own one coin. Your risk is straightforward: if the price halves, your holding halves, and you cannot lose more than you put in.

Perpetual futures change three things at once:

  • No ownership: You hold a contract that tracks the price, not the asset itself.
  • Both directions: You can profit from falls as well as rises, since shorting is a first-class action rather than an afterthought.
  • Leverage: You can control a position worth several times your collateral, which magnifies both gains and losses.

That combination makes perps far more flexible than spot, and far less forgiving. The same tools that let a good strategy compress months of spot returns into weeks can empty an account in a single volatile session. Respect for the mechanics is not optional.

The Mechanics You Must Understand

Three concepts govern perpetual trading. If a bot is going to trade them on your behalf, you need to understand these well enough to judge whether it is behaving sensibly.

Funding rates

Because perps never expire, an exchange needs a mechanism to keep the contract price tethered to the underlying spot price. That mechanism is the funding rate: a periodic payment exchanged directly between longs and shorts, usually every eight hours.

When the perp trades above spot, the funding rate is positive and longs pay shorts. When it trades below spot, shorts pay longs. The rate is small per period but compounds, and on a leveraged position it can meaningfully erode returns or quietly add to them. A strategy that holds positions for days must account for funding as a real cost, not a footnote.

Leverage and margin

Leverage lets you open a position larger than your collateral. At 5x leverage, $1,000 of collateral controls a $5,000 position. Your collateral acts as margin, the deposit that backs the trade.

The trap is that leverage scales your exposure to price moves. At 5x, a 20 percent move against you wipes out your margin entirely. Higher leverage means a smaller adverse move does the same damage. Many exchanges advertise leverage up to 50x on some pairs, but responsible traders and well-built bots typically use a small fraction of that. High leverage is not a strategy; it is a way to lose faster.

Liquidation

If a position moves against you enough that your margin can no longer support it, the exchange automatically closes the position to prevent further loss. This is liquidation, and it is the mechanism that makes over-leverage so dangerous.

Liquidation happens at the exchange's discretion, at whatever price the market offers, often at the worst possible moment during a sharp move. It is not a graceful exit. Avoiding liquidation is one of the primary jobs of risk management in a perpetuals bot, which is why position sizing and stop losses matter so much.

Why Automate Perpetual Futures Trading

Perps reward attention that no human can sustain. Funding is charged at fixed times regardless of when you are awake. Liquidation levels must be watched continuously. Opportunities to enter and exit appear at any hour across many markets. A bot handles all of this without fatigue.

The practical advantages of automating perps are the same as automation in general, sharpened by the higher stakes of leverage:

  • Continuous monitoring: A bot watches your positions and the market 24 hours a day, so a liquidation threat at 4am does not go unnoticed.
  • Mechanical discipline: Leverage magnifies the cost of emotional decisions. A bot places the stop and holds it, rather than moving it out of hope.
  • Speed: In fast markets, the difference between a managed exit and a liquidation can be seconds. A bot reacts faster than a person can.
  • Consistent sizing: A bot can size every position to a fixed fraction of the account, keeping leverage under control across many trades.

Automation does not reduce market risk. It enforces whatever risk rules you set, reliably. Set poor rules and it will follow them into a loss just as faithfully.

How a Perpetuals Bot Manages Risk

Automating leveraged trading raises the bar for risk control. The signal is almost secondary; the risk layer is what keeps the account solvent. A capable perpetuals bot should enforce the following before any order is placed:

  • Position sizing tied to risk: The size of each trade should follow from how much you are willing to lose if the stop is hit, not from how confident the signal feels. This keeps the loss on any single trade bounded and consistent.
  • Automatic stop losses: Every position needs a predefined exit that the system enforces, well before the liquidation price. A stop that sits comfortably above liquidation is the difference between a small planned loss and a forced total loss.
  • Leverage caps: Sensible ceilings on effective leverage prevent a single bad move from being fatal.
  • Drawdown limits and circuit breakers: When losses accumulate or accelerate, the system should reduce exposure or pause. Leverage turns a losing streak into a spiral quickly, so breaking the loop matters.
  • Correlation guards: Several leveraged longs on correlated coins are really one large bet. Guarding against this prevents hidden concentration.

TradingGenie runs every signal through a 7-layer risk management system designed specifically for leveraged perpetual trading, and it sizes positions so that the loss at the stop matches the risk you configured. You can see the full set of controls on the features page. The point of all this machinery is simple: keep the account alive long enough for a decent strategy to work.

Trading Perpetuals on Hyperliquid

Hyperliquid is a decentralised perpetual futures exchange built on its own high-performance Layer 1 blockchain. It offers an on-chain order book, sub-second execution, and deep liquidity on major pairs, which together make it well suited to automated perpetuals trading. Our Hyperliquid trading guide covers the platform in detail, and the Hyperliquid DEX explainer explains the underlying architecture.

The feature that matters most for automation is custody. On Hyperliquid your funds stay in your own vault, and you connect external tools using API keys that can be scoped to trade-only permissions. A bot can open, manage, and close positions but it cannot withdraw or transfer your collateral. This is a materially safer arrangement than depositing funds onto a platform that controls them.

TradingGenie is built specifically for Hyperliquid perpetuals. It is non-custodial: your USDC collateral sits in your vault, the platform connects with trade-only keys, and you can revoke access at any time by deleting those keys. Our safety page walks through this model, and the connection process is on the how it works page.

Setting Up a Perpetuals Bot Safely

The setup below reflects a cautious, evidence-first approach to leveraged automation. Skipping steps here is how accounts get liquidated.

  1. Understand the instrument first. Do not automate what you cannot explain. If funding, leverage, and liquidation are not yet clear, reread the mechanics section before continuing.
  2. Fund a non-custodial account. On Hyperliquid, deposit USDC into your own vault as collateral. Your funds stay under your control throughout.
  3. Connect with trade-only keys. Generate API keys scoped to trading only, never withdrawal. This is the guardrail that keeps your collateral safe even in the worst case.
  4. Backtest the strategy. Run it against historical data, including volatile and falling periods, to understand how it behaves under stress. Our backtesting guide explains what to look for and why walk-forward validation matters.
  5. Paper trade for weeks, not days. Run the bot on live data with simulated funds for at least two to four weeks across different market conditions. Watch how it handles losing streaks and volatility, not just calm uptrends.
  6. Start live small and low-leverage. When you commit real capital, use a small amount and conservative leverage. Scale up only when live results match your expectations, never on confidence alone.

TradingGenie is currently in a paper-trading validation phase, so its published figures come from simulated trading and backtests rather than a live profitable track record. That makes free paper trading the natural place to evaluate it before risking anything real. You can compare the approach with other tools in our best crypto trading bots comparison.

Mistakes That Liquidate Accounts

Leveraged trading is unforgiving of the following habits:

  • Excess leverage. The most common cause of blown accounts. High leverage turns ordinary volatility into liquidation. Keep it low.
  • No stop loss, or a stop near liquidation. A stop that sits just above the liquidation price offers almost no protection. Give it room.
  • Ignoring funding costs. On held positions, funding compounds. A strategy that looks profitable before funding can be a loser after it.
  • Revenge trading a loss. Doubling down to recover a loss with more size or leverage is how a bad day becomes a catastrophe. A bot with circuit breakers helps prevent this.
  • Trading money you need. Leverage plus essential capital is a recipe for stress-driven mistakes. Only risk what you can lose.

Frequently Asked Questions

What is a funding rate in perpetual futures?

A funding rate is a periodic payment exchanged between long and short traders to keep a perpetual contract's price aligned with the underlying spot price, usually every eight hours. When the perp trades above spot, longs pay shorts; when it trades below spot, shorts pay longs. On leveraged and longer-held positions, funding is a real cost or income that a bot should account for rather than ignore.

How much leverage should a perpetuals bot use?

Less than you might think. While some exchanges offer leverage up to 50x, responsible traders and well-built bots typically use a small fraction of that, because higher leverage means a smaller adverse move can liquidate the position. Sensible position sizing and low leverage are what keep an account alive; high leverage simply increases the speed of losses. The right level depends on your risk tolerance and the strategy, but conservative is the default for a reason.

Can I get liquidated when using a trading bot?

Yes. A bot does not remove liquidation risk; it can only manage it through position sizing, leverage caps, and stop losses set well above the liquidation price. A well-designed bot reduces the chance of liquidation by controlling exposure, but no automation can eliminate the risk of leveraged trading. This is why testing and conservative sizing matter so much.

Is automated perpetuals trading safe on a decentralised exchange?

Custody is safer on a non-custodial venue like Hyperliquid, because your funds stay in your own vault and a bot connects with trade-only API keys that cannot withdraw them. That protects you from platform failure and theft. It does not, however, reduce the market risk of leveraged trading itself, which remains substantial regardless of where you trade.

Do I need to watch a perpetuals bot constantly?

No, but automation is not the same as abandonment. A good bot monitors positions and enforces risk controls around the clock, which is more than a person can do. You should still review performance regularly, understand what the bot is doing, and confirm it is behaving as expected, because leverage leaves little room for unnoticed problems.


Trading cryptocurrency and perpetual futures involves substantial risk of loss. Leveraged trading can result in losing your entire collateral through liquidation and, in some cases, losses beyond your initial deposit. TradingGenie is in a paper-trading validation phase, and any figures come from simulated trading rather than a live track record. Past performance does not guarantee future results. This article is educational and not financial advice. Only trade with capital you can afford to lose.

Past performance does not guarantee future results. All trading involves risk of loss.

This article is educational and does not constitute financial advice. Past performance does not guarantee future results.

Start Smarter Trading Today

Start with free paper trading. No credit card required.