پولی مارکیٹ بوٹ ٹیوٹوریل · 32 میں سے باب 24
پولی مارکیٹ perpetual futures (perps) bot: native 2-25x leverage، funding rate carry، liquidation distance math، ATR-based sizing، Binance/Bybit perps کے مقابلے میں۔ Production-grade rules اور code skeleton۔
اس باب میں کیا شامل ہے
پولی مارکیٹ Perps ایک نسبتاً نیا instrument ہے جس میں native 2-25x leverage اور funding rates شامل ہیں۔ یہ binary markets سے مختلف انداز میں کام کرتے ہیں - liquidation حقیقی ہے، sizing math مختلف ہے، اور edge sources prediction-market side جیسے نہیں ہوتے۔ اس باب میں perps-specific bot patterns شامل ہیں۔
- پرپس کیا ہیں اور یہ مختلف کیوں ہیں
- پولی مارکیٹ پر نیٹو لیوریج (2-25x)
- فنڈنگ ریٹ کی میکینکس
- لیکویڈیشن فاصلہ کی ریاضی
- ATR پر مبنی پوزیشن سائزنگ
- موازنہ: پولی مارکیٹ پرپس بمقابلہ Binance/Bybit
- خطرہ: لیکویڈیشن جھڑی کے منظرنامے
- Code: stop کے ساتھ leveraged perp order place کرنا
پرپس کیا ہیں اور یہ مختلف کیوں ہیں
پولی مارکیٹ Perpetual Futures (late 2025 میں launched) binary prediction markets سے مختلف instrument ہیں۔ Perps کسی underlying - BTC، ETH، یا دیگر - پر continuous price exposure دیتے ہیں، native leverage اور funding rate کے ساتھ۔
Binaries سے فرق:
- Continuous: کوئی expiration date نہیں، کوئی resolution نہیں۔
- Leveraged: 2x-25x native طور پر available ہے، proxy contract gymnastics کی ضرورت نہیں۔
- Funded: positive funding shorts کو pay کرتا ہے؛ negative funding longs کو pay کرتا ہے۔ Funding مسلسل accrue ہوتا ہے۔
- Liquidatable: اگر margin ختم ہو جائے تو exchange آپ کی position force-close کر دیتا ہے۔ حقیقی loss۔
Strategy کے لحاظ سے، perps CFD trading ہیں، prediction market trading نہیں۔ Edge sources بالکل مختلف ہیں - technicals، funding-arb، basis trades، جن میں سے کوئی بھی binaries پر apply نہیں ہوتا۔
پولی مارکیٹ پر نیٹو لیوریج (2-25x)
پولی مارکیٹ Perps 2x سے 25x تک leverage offer کرتے ہیں۔ جتنا زیادہ leverage ہوگا، اتنی ہی چھوٹی price move آپ کو liquidate کر دے گی۔
10x leverage پر، 10% adverse price move position کو wipe کر دیتا ہے۔ BTC ہفتے بھر میں 10% باقاعدگی سے move کر سکتا ہے، اس لیے days تک held 10x+ positions میں liquidation odds معمولی نہیں ہوتیں۔
Practical guidance: days-to-weeks held swing trades کے لیے 2-5x leverage؛ day trades کے لیے 5-10x؛ 10x+ صرف sub-hour trades کے لیے tight stops کے ساتھ۔ 10x سے اوپر retail کے لیے gambling ہے؛ funding cost + liquidation tail expected return کو کھا جاتی ہے۔
فنڈنگ ریٹ کی میکینکس
Funding وہ per-hour payment ہے جو longs shorts کو pay کرتے ہیں (یا vice versa) تاکہ perp price spot price سے tether رہے۔ Rate price gap سے compute ہوتا ہے: positive gap → longs pay; negative gap → shorts pay۔
Typical magnitudes: normal conditions میں 0.01-0.05% per 8-hour period؛ extreme moves میں 0.5% per period تک۔ Annualized، یہ 1-50% بنتا ہے - ایک ایسی strategy کے لیے کافی significant جو positions کو days تک hold کرتی ہے۔
Funding کسی strategy میں پورا edge ہو سکتا ہے: وہ side enter کریں جو paid ہو رہی ہو، اور price exposure کو spot یا دوسرے perp کے ساتھ hedge کریں۔ Classic basis-trade arb یہی ہے۔
لیکویڈیشن فاصلہ کی ریاضی
Long کے لیے liquidation price: entry × (1 - 1/leverage)۔ 10x پر، $50,000 BTC پر entered long $45,000 پر liquidate ہوتا ہے (10% adverse)۔
Short کے لیے: entry × (1 + 1/leverage)۔ $50k پر 10x short، liquidation $55k پر۔
یہ math maintenance margin buffer کو ignore کر کے simplify کیا گیا ہے (عام طور پر theoretical liquidation price سے 0.5-1% آپ کے حق میں)۔ سمجھنے کے لیے simple math استعمال کریں؛ precise number کے لیے exchange کی actual maintenance margin check کریں۔
Practical: position size + leverage ایسا ہونا چاہیے کہ liquidation distance underlying کی daily volatility کے 2x سے زیادہ ہو۔ BTC کی تقریباً 3% daily volatility کے لیے، no-stop position پر leverage ≤ 16x ہونا چاہیے۔
ATR پر مبنی پوزیشن سائزنگ
Average True Range (ATR) volatility measure ہے: پچھلے N days میں average daily price range۔ ATR-based position sizing risk کو current market conditions سے tie کرتا ہے۔
Pattern: ہر trade پر fixed dollar amount (مثلاً $50) risk کریں۔ Position size = risk / (ATR × leverage)۔ اگر BTC کا daily ATR $1,500 ہے ($50k کا 3%)، اور آپ 10x leveraged ہیں، تو position size = $50 / (1500 × 0.1) = تقریباً $3,300 notional۔
اس سے high-vol regimes میں positions خود بخود چھوٹی ہو جاتی ہیں اور low-vol regimes میں بڑھ جاتی ہیں۔ Key benefit: market regime سے قطع نظر ایک خراب دن آپ کی equity کو bounded amount تک ہی move کرتا ہے۔
موازنہ: پولی مارکیٹ پرپس بمقابلہ Binance/Bybit
May 2026 کے مطابق پولی مارکیٹ Perps اور major CEX perp venues کا comparison۔
| پولی مارکیٹ Perps | Binance Perps | Bybit Perps | |
|---|---|---|---|
| Max leverage | 25x | 125x | 100x |
| Settlement | USDC on Polygon | BSC/internal پر USDT | USDT |
| KYC required | region کے لحاظ سے مختلف | yes (most regions) | yes |
| API maturity | new, growing | mature, deep | mature |
| Liquidity (BTC) | moderate | extremely deep | deep |
پولی مارکیٹ Perps تب بہترین choice ہیں جب آپ پہلے ہی پولی مارکیٹ پر ہوں اور ایک venue کی operational simplicity اہم ہو۔ صرف-perp strategies at scale کے لیے liquidity کے لحاظ سے CEXes بہتر ہوتے ہیں۔ جن builders کو ہم جانتے ہیں ان میں سے اکثر پولی مارکیٹ Perps کو اپنی binary positions کے ساتھ basis-arb کے لیے استعمال کرتے ہیں، standalone perp venue کے طور پر نہیں۔
خطرہ: لیکویڈیشن جھڑی کے منظرنامے
Perp failure کا catastrophic scenario: ایک ایسا adverse move جو liquidate کرنے کے لیے کافی بڑا ہو، اور liquidation خود مزید positions liquidate کرنے والی book pressure پیدا کرے۔
2024-25 CEX history میں BTC نے multiple 10-20% intraday moves دیکھے ہیں جہاں 10x+ longs چند گھنٹوں میں cascade ہو کر نکل گئے۔ پولی مارکیٹ Perps اس سے immune نہیں ہیں؛ liquidity thinner ہے اور ایسا move اور بھی تیزی سے liquidate کرے گا۔
Defenses:
- Liquidation price سے اوپر manual stop: hard limit 30-50% اندر رکھیں، تاکہ auto-liquidator سے پہلے آپ exit کر جائیں (جس میں liquidation fee لگتی ہے)۔
- Position size limits: ایک single perp position پر کبھی بھی equity کا 10% سے زیادہ risk نہ کریں۔
- Regime change پر halt: اگر 24h volatility baseline کے 2x سے بڑھ جائے، position sizes کم کریں یا نئے entries pause کریں۔
Code: stop کے ساتھ leveraged perp order place کرنا
Reference: hard stop کے ساتھ پولی مارکیٹ Perp position کے لیے order-placement skeleton۔
def open_long_with_stop(symbol, entry_px, leverage, risk_usd):
# Compute position size from risk budget
liquidation_px = entry_px * (1 - 1/leverage)
stop_px = entry_px * (1 - 0.7/leverage) # 70% to liquidation
risk_per_share = entry_px - stop_px
shares = risk_usd / risk_per_share
# Place long entry
long_order = perp_api.place_order(
symbol=symbol, side="long", size=shares, leverage=leverage,
order_type="market"
)
if long_order.status != "filled": return None
# Place hard stop just below entry
stop_order = perp_api.place_order(
symbol=symbol, side="close", size=shares, stop_price=stop_px,
order_type="stop_market", reduce_only=True
)
return {"long": long_order, "stop": stop_order}
Reduce-only stop اس بات کو یقینی بناتا ہے کہ وہ صرف existing position کو close کر سکے، آپ کو short میں flip نہ کرے۔ Production additions: profit پر trailing stop، funding-cost monitor، position-size halt۔


