Security

Non-Custodial Trading Bot: How It Works (and Why It Matters After FTX)

How non-custodial bots use ERC-7579 Smart Sessions to automate trading without holding your keys — and why this architecture survives an exchange collapse.

2026-05-04 11 min readBy DCA Bot Research
The short version. A non-custodial bot trades from your smart-contract wallet using on-chain permissions that limit it to a single function — typically a DEX swap. The blockchain itself enforces the limits, so an attacker who compromises the bot operator cannot withdraw your funds — the remaining risk is bad trades inside the allowed scope. After FTX, Celsius, and the Bybit incident, this design has become the default for serious DeFi traders.

Why This Question Matters Now

For ten years, “automated crypto trading” meant signing up to 3Commas or Cryptohopper and pasting your Binance API keys into their dashboard. The model worked because exchanges were fast, deep, and seemingly safe. Then 2022 happened. FTX collapsed with $8 billion of customer funds frozen. Celsius and BlockFi followed. In 2025, Bybit suffered the largest exchange hack in history.

Each event reset the question every retail trader has to answer: do I trust this venue with my keys, my balance, and my withdrawal queue? For a growing fraction of users, the answer is no. They have moved to non-custodial trading — and the bots have followed them.

What “Non-Custodial” Actually Means

Custody is the right to move someone’s assets. A custodial system holds your funds in its own wallet and you ask it nicely to do things; a non-custodial system holds your funds in a wallet you control, and any action requires a signature from a key only you possess.

Most “non-custodial” claims are weaker than the term suggests. Some platforms hold a master key that can theoretically override your account. Others use multi-sigs where the platform is one of the signers. The real test is simple:

If the company running this bot disappeared overnight, would you still be able to withdraw 100% of your funds with no help from anyone?

For a properly built non-custodial bot the answer is yes. Your funds live in a smart contract whose owner key you generated yourself. The bot has a scoped permission to call one function on one contract — usually the DEX router. If the bot operator vanished, you would simply revoke the session (or ignore it) and your assets would still be in your Safe, untouched.

Update, October 2026. Run the test above on DCA Bot itself. Before 11 October 2026 our server key could control the smart accounts it set up, so the “non-custodial” label was not yet accurate. Since then your wallet owns the account’s validator, and the bot holds only a session key pinned to one token pair per direction, with the Safe as the swap recipient. Accounts created earlier switch over via “Upgrade security” on the Smart Account page.

How a Non-Custodial Bot Is Built

Three components matter. Get any of them wrong and the “non-custodial” label is theatrical.

1. Smart Account (Safe)

The user’s funds live in a smart contract — typically a Safe (formerly Gnosis Safe), the most battle-tested smart account on Ethereum, securing tens of billions of dollars. Control of the Safe belongs to your externally-owned account (EOA), controlled by your MetaMask seed phrase. The bot is not an owner. The platform is not an owner. There is no admin key. Do not take this on trust: who controls the account is readable on-chain, and you should check it.

2. Module: ERC-7579 Smart Session

ERC-7579 is the modular smart account standard that turns a Safe into a programmable wallet. A Smart Session module attached to your Safe records, on-chain, exactly what the bot is allowed to do. The data structure is roughly:

  • Validator: a contract that checks the bot’s signature on each transaction.
  • Action policies: what contracts the bot can call (e.g., only Uniswap V3 SwapRouter02).
  • Selector restrictions: which functions on those contracts (e.g., only `exactInputSingle`).
  • Parameter pinning: which tokens may be swapped and where the output may go (e.g., back to the Safe only).
  • Optional spending limits and expiry: per-token caps and a timestamp after which the session is dead, where the platform uses them.

Read more about the standard in EIP-7579 and the Smart Sessions implementation by Rhinestone.

3. Bot Service

The bot itself is a backend service that holds a session signing key — a key that can only sign actions matching the policies above. It builds UserOps (ERC-4337 user operations), signs them, and submits them through a bundler. If the bot’s key is stolen, the attacker still cannot do anything outside the session’s limits — the Safe contract rejects unauthorized calls before they execute.

Smart Sessions: Scoped, Revocable, On-Chain

The unique property of a Smart Session is that the permissions are enforced by the blockchain, not by a server. A regular API key is enforced by Binance’s code. If Binance’s code has a bug, or an insider abuses access, the API key’s “read-only” promise can fail. A Smart Session, by contrast, is enforced by Ethereum consensus — the same mechanism that secures hundreds of billions of dollars across every smart contract.

This matters because retail trust does not extend to “the bot operator promises to be careful.” The whole point is to assume the operator could be malicious and design the system so it doesn’t matter. With a Smart Session, even a fully compromised bot service can only execute swaps inside the session’s limits. Note the wording: a swap at a terrible price is still inside the limits, which is why how narrow the session is — and who computes the slippage floor — matters.

Three properties make Smart Sessions practical:

  1. Scoped. The session signs only specific functions on specific contracts. Anything outside that scope reverts on-chain.
  2. Revocable. The user can call removeSession(...) on their Safe at any time. The session goes dead instantly. No grace period, no support ticket.
  3. Optionally time-bounded. A session can carry an expiry so forgotten permissions die naturally. Where it does not, one-click revocation is the safeguard.

What the Bot Cannot Do (And Why)

Specifically, with a properly configured Smart Session for trading, the bot cannot:

  • Send tokens to an arbitrary address — the swap’s recipient is pinned to the Safe itself, and the only transfer the policy permits is the platform fee to the platform’s fee wallet.
  • Withdraw funds from the Safe — no transfer to any other destination is in the action policy.
  • Add itself as a Safe owner — that requires owner approval (your MetaMask).
  • Approve unlimited tokens to a malicious contract — the policy may pre-approve only the router, not arbitrary spenders.
  • Execute trades after revocation — once the session is removed, signed UserOps fail validation.
  • Touch funds on other chains or in other wallets — sessions are per-Safe.

What the bot can do is execute swaps on Uniswap V3 inside your Safe, in the token pair you allowed, and pay the platform fee. That is the whole authority. There is no override, no master key, no “admin can pause your withdrawals.” What it can still do wrong is trade at a bad price inside that pair: the minimum-output (slippage) limit on each swap is computed by the bot’s server, so a compromised server could set it loosely.

Compared to API-Based CEX Bots

The functional difference looks small from a user’s seat — both bots execute trades while you sleep. The risk surfaces are different in kind, not degree.

Risk vectorAPI-based CEX botNon-custodial on-chain bot
Bot operator hackDrains your exchange balance via APICannot withdraw; could still make bad trades in the allowed pair
Exchange insolvencyFunds frozen / lostNot applicable — no exchange
Insider abuse at platformPossible (API keys stored)Bounded by the session (no withdraw-capable key held)
Withdrawal freezeYes, exchange decisionNo — you withdraw with your own on-chain transaction
KYC compliance shiftAccount lockedNot applicable
Strategy implementation bugLost tradesLost trades (same risk)
Smart contract exploitNot applicablePossible if Safe, the session module or the platform’s own code has a bug

Strategy bugs and contract exploits are real. Safe and the Rhinestone Smart Sessions module have been reviewed by third-party auditors; a bot platform’s own backend often has not — DCA Bot’s has not — so ask. Operator-side risk is the dominant historical loss source for retail. Non-custodial designs remove its worst outcome, the withdrawal of your funds; what remains is the operator, or an attacker, trading badly inside the allowed scope.

Honest Tradeoffs

A non-custodial bot is not free of friction:

  • Setup is heavier. Deploying a Safe and granting a session takes 10–15 minutes versus the 60 seconds of pasting an API key.
  • Less leverage and fewer instruments. Most non-custodial bots cover spot DEX trading. Perpetuals, options, and high-leverage strategies live mostly on CEXes still.
  • You pay gas. On L2s like Arbitrum and Base this is a few cents per swap; on Ethereum mainnet it adds up fast — activating a smart-account trading pair alone costs roughly $25 in gas there.
  • Self-custody responsibility. If you lose your MetaMask seed phrase, no one can recover your funds. There is no “forgot password” flow.
  • Liquidity is DEX-bounded. For major pairs (ETH, BTC, USDC), Uniswap V3 has plenty. For obscure tokens, CEX liquidity is often deeper.

For most retail traders accumulating ETH, BTC, or stablecoins, none of these tradeoffs is meaningful. For perpetual scalpers chasing 100x leverage, a non-custodial bot is not the right tool.

Who Should Use a Non-Custodial Bot

The simplest filter: if your trading thesis includes any of the following, switch.

  • You hold more than $1,000 of crypto — non-custodial removes exchange counterparty risk.
  • You believe the next exchange failure has not happened yet — exchange risk is a fat-tail event.
  • You want long-horizon DCA without monthly stress about platform integrity.
  • You live in a jurisdiction where exchange access is unstable (geo-blocks, KYC freezes).
  • You already use a hardware wallet — you understand self-custody mental model.

If you are still trading $50 lots and learning the basics, a CEX with one-click bots may be more forgiving for now. The migration to non-custodial usually happens after the first real loss to a custody event — but the lesson is cheaper to learn before that.

How to Set One Up Without the Footguns

  1. Use a hardware wallet for the owner key. Your Safe’s owner is the only party that can revoke or change permissions. Keep that key on a Ledger or Trezor, not in MetaMask alone.
  2. Start on testnet. Sepolia is free. Deploy a Safe, grant a session, run a strategy, verify the bot does what it says. Most platforms — including DCA Bot — support full testnet flow on the free plan.
  3. Read the action policy before signing. The session-grant transaction shows you exactly what the bot will be allowed to do. Verify the contract address (should be Uniswap V3 SwapRouter02 — 0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45 on Ethereum and Arbitrum; Base uses a different address) and that the function selector and token pair match what the docs claim.
  4. Fund only what the strategy needs. Even though the bot cannot transfer out, a Safe holding a proportionate amount limits the worst case of a strategy bug or a bad trade (e.g., a misconfigured grid placing oversized orders). Use per-token caps or a strategy budget where the platform offers them.
  5. Prefer short expiries where available. If sessions don’t expire, make revoking unused ones a habit.
  6. Verify on a block explorer. Every trade the bot executes is a public on-chain transaction. Spot-check the first 5–10 against your strategy log.

Red Flags to Avoid

Not every product calling itself non-custodial deserves the label. Watch for these warning signs:

  • “We hold your seed phrase encrypted.” Any product that touches your seed phrase is custodial in disguise.
  • Multi-sig with the platform as a co-signer. If the platform is needed to authorize a withdrawal, you are not in control.
  • Sessions you can’t end. A session should either expire or be revocable by you in one on-chain transaction — ideally both.
  • Vague permissions. If you can’t see exactly which contract and which function the bot will call, do not grant.
  • No revocation UI. Revocation must be one click and must happen entirely on-chain. If it requires emailing support, walk away.
  • Closed-source policy contracts. The contracts enforcing the session must be verified on Etherscan. Black boxes are not security.
The bottom line. Non-custodial trading bots are not a marketing label — they are a specific architecture where the blockchain, not the platform, enforces the bot’s limits. The setup is slightly heavier than a CEX API key, the custody profile is much better, and the remaining risks — bad trades inside the scope, contract bugs — are ones you can see and size. If you are running automated strategies on more than a few hundred dollars, this is the architecture to use. Read our deep-dive on Smart Sessions for the technical details.

Frequently Asked Questions

What is a non-custodial trading bot?

A non-custodial trading bot is an automated trading system that executes swaps from your own smart contract wallet without ever holding your funds or private keys. Permissions are granted on-chain via standards like ERC-7579 Smart Sessions: the bot can call a specific contract (e.g., Uniswap V3 SwapRouter02) for a specific token pair, with the output sent back to your account, but cannot withdraw to another address or change ownership. The blockchain enforces these limits — not the bot operator.

Is a non-custodial bot safer than 3Commas or Pionex?

Materially yes, because the failure mode is different. With API-based bots, a server breach or rogue insider can drain your exchange account using stored API keys. With a non-custodial bot, a server compromise cannot withdraw your funds: they remain in your Safe, and only your own wallet can move them out. What an attacker could still do is trade badly inside the permission — for example, swap the allowed pair at a poor price. That is a real but bounded risk, very different from an emptied account.

Can the bot lose my money?

A bot can execute losing trades — that is a strategy risk, not a custody risk. What it cannot do is move your funds anywhere except into another supported asset via the whitelisted DEX. It cannot send your funds to someone else’s address; it can only reallocate them within the rules of the session — which also means badly priced trades are possible, so the session should be as narrow as the strategy allows.

How do I revoke bot access?

You sign a transaction from your own wallet that removes the bot’s session from your Safe. In DCA Bot this is the Revoke button on the Smart Account page. Revocation is final and on-chain — there is no support ticket, waiting period, or appeal process. You can also withdraw funds without revoking, simply by sending tokens out of the Safe directly.

Do I need to be technical to use one?

Not really. You need a self-custody wallet (MetaMask, Rabby) and a few cents in ETH for gas. The actual setup — deploying a Safe, granting a session, picking a strategy — takes about 10 minutes and is mostly clicking through wizards. The understanding curve is shallower than learning a CEX with KYC.

Ready to automate your crypto trading?

Set up DCA, grid, or limit-order strategies on Uniswap V3 for Arbitrum and Base — from your own Safe, with a free demo to start.

Back to Blog