DZERO
Guides

Funding bot

You need: Trading keys on two DEXs.

What it does

Each DEX sets its own funding rate. When the same market pays longs more on one DEX than on the other, a long on the cheaper side and a short on the dearer side earn the gap every hour, while price moves cancel out.

The bot reads every market both DEXs list, keeps the ones that pass every entry check, and enters the one that earns most after fees over the hold.

Settings

  • DEX pair: the two DEXs it trades between.
  • Markets: highest APR (any market) or one you pick. RWA only keeps it to stocks, indices, commodities and FX (Arcus with Lighter RH); High volume only skips markets under $10M a day.
  • Margin and leverage: up to 10x. A market that allows less trades at its own maximum on the same margin, so the position is smaller (a 6x market on a 10x bot opens 60% of the size).
  • Hold: a fixed time, a random range drawn again for each trade, or Until better.
  • Market rules: Strict, Recommended or Wide. They set how busy a market must be, the largest price gap between the DEXs and the slippage allowed.
  • Trade even when unprofitable: with no paying route, it takes the cheapest one instead of waiting. Useful for volume; it costs money.

How a trade opens

  • Right before entering, it re-reads funding, both order books and the last 15 minutes of price. A market moving fast waits.
  • A limit order goes on one DEX, one tick inside the spread when there's room, so it's first in line.
  • When it fills, the hedge goes on the other DEX for exactly the filled size: a limit order for up to 30 seconds, then a market order for the rest.
  • If no one takes the limit order in 4 minutes, it moves it to the other DEX. If that isn't taken either (a quiet market, like stocks at the weekend), it tries again in 10 minutes. Nothing is open while it waits.

When it closes

Fixed or random hold: when the time is up.

Until better: no timer. It closes when funding has cost more than closing for two checks 15 minutes apart, or switches when another route on its DEXs pays enough more to cover the switch within 8 hours. It holds a trade at least 8 hours before switching and switches at most twice a day.

Closes rest limit orders on both DEXs first and use a market order only for what's left. Any guard can close earlier; see Safety.

DZERO

Perpetual futures are risky. A hedge removes most price risk, not all of it: orders can fill unevenly, DEXs can go down and funding can turn against you. Rates shown are past readings, not a promise. Nothing here is financial advice.