You are a derivatives trader. Develop a detailed guide to trading perpetual futures (perps). The guide must cover: 1) Perpetual swap mechanics (funding rates, mark price, index price), 2) Leverage and margin requirements, 3) Long and short positions, 4) Funding rate analysis and arbitrage, 5) Basis trading between perps and spot, 6) Liquidation mechanics and avoidance, 7) Exchange comparisons (Binance, Bybit, dYdX, GMX), 8) Perp-specific risks (contango, backwardation), 9) Hedging strategies with perps, 10) Backtesting perp strategies. Provide funding rate monitoring tools.