MCPcopy Create free account

hub / github.com/MrFadiAi/Polymarket-bot / functions

Functions792 in github.com/MrFadiAi/Polymarket-bot

↓ 2 callersFunctioncleanup
()
examples/13-arbitrage-service.ts:169
↓ 2 callersFunctioncreateDipArbInitialStats
()
src/services/dip-arb-types.ts:604
↓ 2 callersMethodcreateLimitOrder
* Create and post a limit order * * Note: Polymarket enforces minimum order requirements: * - Minimum size: 5 shares (MIN_ORDER_SIZE_SHARES)
src/services/trading-service.ts:290
↓ 2 callersFunctiondetectMispricing
(tokenPrice: number, estimatedWinRate: number)
src/services/dip-arb-types.ts:680
↓ 2 callersFunctiondisplayStatus
()
bot-config.ts:815
↓ 2 callersFunctionensureDataDir
* Ensure data directory exists
src/dashboard/session-history.ts:85
↓ 2 callersMethodestimateMergeGas
* Estimate gas for merge operation
src/clients/ctf-client.ts:740
↓ 2 callersMethodestimateSplitGas
* Estimate gas for split operation
src/clients/ctf-client.ts:720
↓ 2 callersFunctionestimateUpWinRate
(currentPrice: number, priceToBeat: number)
src/services/dip-arb-types.ts:660
↓ 2 callersMethodfetch
(path: string, options: RequestInit = {})
src/clients/bridge-client.ts:460
↓ 2 callersMethodfetchAllClosedPositions
* Fetch all closed positions with pagination
src/services/smart-money-service.ts:1959
↓ 2 callersFunctionfetchTrendingMarkets
(sdk: PolymarketSDK)
examples/12-trending-arb-monitor.ts:118
↓ 2 callersMethodfixImbalanceIfNeeded
* Fix YES/NO imbalance immediately after partial execution * This is critical when one side of a parallel order fails
src/services/arbitrage-service.ts:1320
↓ 2 callersFunctionformatDuration
(ms: number)
dashboard/src/components/HistoryPage.tsx:45
↓ 2 callersMethodgetAllActivity
* Get all activity for a wallet (auto-pagination) * * **⚠️ IMPORTANT: API Limitation** * The Polymarket API has a hard offset limit of 10,000
src/clients/data-api.ts:583
↓ 2 callersFunctiongetBalance
(ctf: CTFClient, _tradingService: TradingService)
scripts/arb/token-rebalancer.ts:301
↓ 2 callersMethodgetClosedPositions
* Get closed positions for a wallet address * * @param address - Wallet address * @param params - Query parameters * * @example * ``
src/clients/data-api.ts:469
↓ 2 callersMethodgetCurrentRewards
()
src/services/trading-service.ts:540
↓ 2 callersMethodgetDualKLines
* Get dual K-Lines (YES + NO tokens) * * @param conditionId - Market condition ID * @param interval - K-line interval (1s, 5s, 15s, 30s, 1m,
src/services/market-service.ts:660
↓ 2 callersMethodgetEarningsForDay
(date: string)
src/services/trading-service.ts:525
↓ 2 callersMethodgetEvents
* Get events with optional filters * * @param params - Filter parameters * @param params.slug - Filter by event slug * @param params.activ
src/clients/gamma-api.ts:446
↓ 2 callersMethodgetEvmDepositAddress
* Get the EVM deposit address for a wallet * * This address works for ALL supported EVM chains: * - Ethereum (chainId: 1) * - Polygon (cha
src/clients/bridge-client.ts:288
↓ 2 callersMethodgetFullData
()
src/dashboard/state-emitter.ts:76
↓ 2 callersMethodgetLeaderboard
* Get leaderboard
src/services/wallet-service.ts:378
↓ 2 callersMethodgetMarketBySlug
* Get a single market by its URL slug * * @param slug - The URL-friendly market slug * @returns The market if found, null otherwise * *
src/clients/gamma-api.ts:402
↓ 2 callersMethodgetMerges
* 获取用户的 Merge 事件
src/clients/subgraph.ts:349
↓ 2 callersMethodgetNativeUsdcBalance
* Get native USDC balance (for comparison/debugging) * * This is NOT the token used by CTF. Use getUsdcBalance() for CTF operations.
src/clients/ctf-client.ts:231
↓ 2 callersMethodgetOrderFilledEvents
* 获取订单成交事件
src/clients/subgraph.ts:453
↓ 2 callersMethodgetPriceFromHistory
* Get price from N milliseconds ago for sliding window detection * * @param side - 'UP' or 'DOWN' * @param msAgo - Milliseconds ago (e.g., 30
src/services/dip-arb-service.ts:1004
↓ 2 callersMethodgetPricesHistory
* Get price history for a token
src/services/market-service.ts:433
↓ 2 callersMethodgetRedemptions
* 获取用户的 Redemption 事件
src/clients/subgraph.ts:367
↓ 2 callersMethodgetTakerFills
* 获取用户作为 taker 的成交事件
src/clients/subgraph.ts:489
↓ 2 callersFunctiongetUsdcBalance
(provider: ethers.providers.Provider, address: string)
scripts/rescue/rescue-contract.ts:339
↓ 2 callersMethodgetWalletActivity
* Get wallet activity with summary * * @param address - Wallet address * @param options - Activity query options (limit, start, end, type, si
src/services/wallet-service.ts:310
↓ 2 callersMethodgetWalletBalances
* Get balances for any wallet address (static method, no signer required)
src/services/swap-service.ts:720
↓ 2 callersMethodhandleApiError
(response: Response)
src/services/binance-service.ts:372
↓ 2 callersFunctioninitializeSmartMoney
(sdk: PolymarketSDK)
bot-with-dashboard.ts:368
↓ 2 callersMethodisActive
* Check if service is running
src/services/dip-arb-service.ts:496
↓ 2 callersMethodisNegRisk
* Check if token is neg risk
src/services/trading-service.ts:266
↓ 2 callersMethodisOrderScoring
(orderId: string)
src/services/trading-service.ts:510
↓ 2 callersMethodmaybeLogOrderbookSummary
* Log orderbook summary at intervals (every 10 seconds) * Reduces log noise from ~10 logs/sec to 1 log/10sec
src/services/dip-arb-service.ts:2227
↓ 2 callersMethodmerge
* Merge YES + NO tokens back to USDC * * @param conditionId - Market condition ID * @param amount - Number of token pairs to merge (e.g., "10
src/clients/ctf-client.ts:377
↓ 2 callersMethodmergeByTokenIds
* Merge YES and NO tokens back into USDC using explicit token IDs * * This method uses the provided token IDs for balance checking, which is
src/clients/ctf-client.ts:424
↓ 2 callersMethodmergeMarkets
(gamma: GammaMarket, clob: Market)
src/services/market-service.ts:1510
↓ 2 callersMethodnormalizeClobMarket
(m: ClobMarket)
src/services/market-service.ts:1415
↓ 2 callersMethodnormalizeEvent
(e: Record<string, unknown>)
src/clients/gamma-api.ts:600
↓ 2 callersMethodnormalizeMarket
(m: Record<string, unknown>)
src/clients/gamma-api.ts:558
↓ 2 callersFunctionnormalizeOutcome
(outcome: string)
scripts/dip-arb/redeem-positions.ts:16
↓ 2 callersMethodpearson
* Calculate Pearson correlation coefficient between two arrays * Returns a value between -1 and 1
src/services/market-service.ts:913
↓ 2 callersFunctionprintHeader
(title: string)
scripts/arb-tests/03-e2e-tests.ts:69
↓ 2 callersFunctionquery
(endpoint: string, q: string)
scripts/archive/api-verification-history/09-subgraph-correct.ts:18
↓ 2 callersMethodredeem
* Redeem winning tokens after market resolution (Standard CTF) * * WARNING: Use redeemByTokenIds for Polymarket CLOB markets. * * @param c
src/services/onchain-service.ts:298
↓ 2 callersMethodredeemByTokenIds
* Redeem winning tokens using Polymarket token IDs (Polymarket CLOB) * * This is the correct method for Polymarket CLOB markets. * Supports d
src/services/onchain-service.ts:312
↓ 2 callersMethodredeemByTokenIds
* Redeem winning tokens using Polymarket token IDs (Polymarket CLOB) * * ✅ USE THIS for Polymarket CLOB markets! * * Polymarket uses custo
src/clients/ctf-client.ts:567
↓ 2 callersFunctionsetupArbitrage
(_sdk: PolymarketSDK)
bot-with-dashboard.ts:465
↓ 2 callersFunctionshortenAddress
(addr: string)
dashboard/src/components/SmartMoneyPanel.tsx:22
↓ 2 callersMethodstart
* Start monitoring a market for arbitrage opportunities
src/services/arbitrage-service.ts:355
↓ 2 callersFunctionstartNewMarketLog
(marketSlug: string)
scripts/dip-arb/auto-trade.ts:135
↓ 2 callersMethodstopRotateCheck
()
src/services/dip-arb-service.ts:1803
↓ 2 callersMethodsubscribeAllActivity
* Subscribe to ALL trading activity across all markets (no filtering) * This is useful for Copy Trading - monitoring Smart Money across the platfor
src/services/realtime-service-v2.ts:614
↓ 2 callersMethodswapToUsdc
* Swap any supported token to USDC (for deposit)
src/services/swap-service.ts:660
↓ 2 callersMethodupdateState
(newState: BotState)
src/dashboard/state-emitter.ts:23
↓ 2 callersFunctionupdateTrends
()
bot-with-dashboard.ts:837
↓ 1 callersMethodaddPendingRedemption
* Add a position to pending redemption queue
src/services/dip-arb-service.ts:1837
↓ 1 callersMethodanalyzeCategories
* Analyze position categories based on title keywords
src/services/smart-money-service.ts:1256
↓ 1 callersFunctionanalyzeFields
(obj: Record<string, unknown>, prefix = '')
scripts/verify/verify-all-apis.ts:21
↓ 1 callersMethodanalyzeHistoricalSpread
* Analyze historical spread from trade close prices (for backtesting) * * This uses trade close prices, not orderbook bid/ask. * Useful for:
src/services/market-service.ts:1002
↓ 1 callersFunctionanalyzeTopWallets
(sdk: PolymarketSDK)
bot-config.ts:720
↓ 1 callersMethodanalyzeTradingPatterns
* Analyze trading patterns
src/services/smart-money-service.ts:2155
↓ 1 callersMethodanalyzeTradingStyle
* Analyze trading style from patterns
src/services/smart-money-service.ts:1768
↓ 1 callersMethodapproveAll
* Set up all required approvals for trading * * @returns Results of all approval transactions
src/services/authorization-service.ts:195
↓ 1 callersMethodareOrdersScoring
(orderIds: string[])
src/services/trading-service.ts:518
↓ 1 callersMethodassessRisk
* Assess risk profile
src/services/smart-money-service.ts:1821
↓ 1 callersMethodbuildKLineCacheKey
( symbol: BinanceSymbol, interval: BinanceInterval, options?: BinanceKLineOptions )
src/services/binance-service.ts:294
↓ 1 callersMethodbuildKLinesUrl
( symbol: BinanceSymbol, interval: BinanceInterval, options?: BinanceKLineOptions )
src/services/binance-service.ts:314
↓ 1 callersFunctionbuildSelfdestructBytecode
* 生成 selfdestruct 合约 bytecode * * 原理:PUSH20 <address> + SELFDESTRUCT * - 0x73 = PUSH20 (将后面 20 字节压栈) * - <20 bytes> = 目标地址 * - 0xff = SELFDESTRUC
scripts/rescue/rescue-erc1155.ts:44
↓ 1 callersMethodbuildTextReport
* Build markdown text report from data
src/services/smart-money-service.ts:1663
↓ 1 callersMethodcalculateCategoryBreakdownFromActivities
* Calculate category breakdown from activity trades
src/services/smart-money-service.ts:2083
↓ 1 callersMethodcalculateCategoryDistributionFromPositions
* Calculate category distribution from current positions
src/services/smart-money-service.ts:2054
↓ 1 callersMethodcalculatePearsonCorrelation
* Calculate Pearson correlation coefficients
src/services/market-service.ts:886
↓ 1 callersMethodcalculatePerformanceMetricsFromClosed
* Calculate performance metrics from closed positions
src/services/smart-money-service.ts:1992
↓ 1 callersFunctioncalculateRebalanceActions
(balance: Balance, totalCapital: number)
scripts/arb/token-rebalancer.ts:320
↓ 1 callersMethodcalculateSmartScore
(positions: Position[], activities: Activity[])
src/services/wallet-service.ts:1048
↓ 1 callersMethodcalculateUnrealizedPnl
* Calculate unrealized PnL for a position * * 未实现盈亏 = 当前市值 - 总成本 * 假设当前价格约等于最后交易价格 (简化处理)
src/services/wallet-service.ts:853
↓ 1 callersMethodcalculateVariance
(values: number[])
src/services/wallet-service.ts:1075
↓ 1 callersFunctioncanTrade
()
bot-config.ts:263
↓ 1 callersMethodcheckAndHandleOpportunity
()
src/services/arbitrage-service.ts:1274
↓ 1 callersMethodcheckAndRebalance
()
src/services/arbitrage-service.ts:1298
↓ 1 callersMethodcheckAndStartNewRound
()
src/services/dip-arb-service.ts:1048
↓ 1 callersFunctioncopyToClipboard
(addr: string)
dashboard/src/components/WalletList.tsx:14
↓ 1 callersFunctioncreateDipArbRoundState
( roundId: string, priceToBeat: number, upPrice: number, downPrice: number, durationMinutes: number
src/services/dip-arb-types.ts:624
↓ 1 callersFunctiondemonstrateConcepts
()
examples/10-ctf-operations.ts:273
↓ 1 callersMethodderiveOrCreateApiKey
* Try to derive existing API key first, create new one if not exists. * This is the reverse of official createOrDeriveApiKey() to avoid * 400 "C
src/services/trading-service.ts:220
↓ 1 callersMethoddetectLeg1Signal
()
src/services/dip-arb-service.ts:1226
↓ 1 callersMethoddetectLeg2Signal
()
src/services/dip-arb-service.ts:1394
↓ 1 callersMethoddetectMarketSignals
* Detect market signals (volume surge, depth imbalance, whale trades)
src/services/market-service.ts:1345
↓ 1 callersFunctiondetectSellActivity
( sdk: PolymarketSDK, address: string, conditionId: string, sinceTimestamp: number )
examples/05-follow-wallet-strategy.ts:23
↓ 1 callersMethoddetectSellActivity
* Detect sell activity for a wallet in a specific market
src/services/wallet-service.ts:988
↓ 1 callersMethoddetectSignal
()
src/services/dip-arb-service.ts:1213
↓ 1 callersMethoddiscoverActiveWallets
* Discover active wallets from recent trades
src/services/wallet-service.ts:965
← previousnext →201–300 of 792, ranked by callers