MCPcopy Create free account

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

Functions792 in github.com/MrFadiAi/Polymarket-bot

↓ 2,906 callersMethodlog
(message: string)
src/services/dip-arb-service.ts:2272
↓ 103 callersFunctionlog
(level: LogLevel, message: string, data?: unknown)
bot-with-dashboard.ts:214
↓ 92 callersMethodset
(key: string, value: T, ttlMs: number)
src/core/unified-cache.ts:25
↓ 88 callersFunctionlog
(msg: string)
scripts/dip-arb/auto-trade.ts:111
↓ 88 callersMethodlog
(message: string)
src/services/arbitrage-service.ts:1606
↓ 62 callersFunctionlog
(level: string, message: string, data?: unknown)
bot-config.ts:251
↓ 43 callersMethodget
(key: string)
src/core/unified-cache.ts:24
↓ 31 callersFunctionupdateDashboard
()
bot-with-dashboard.ts:230
↓ 29 callersMethodcreateMarketOrder
* Create and post a market order * * Note: Polymarket enforces minimum order requirements: * - Minimum value: $1 USDC (MIN_ORDER_VALUE_USDC)
src/services/trading-service.ts:359
↓ 25 callersFunctionlog
(level: 'INFO' | 'WARN' | 'ERROR' | 'DEBUG' | 'SUCCESS', message: string, data?: unknown)
examples/12-trending-arb-monitor.ts:47
↓ 25 callersMethodstop
* Stop SDK - disconnect all services and clean up
src/index.ts:548
↓ 24 callersMethodexecute
* Manually execute an arbitrage opportunity
src/services/arbitrage-service.ts:572
↓ 22 callersFunctioncreateUnifiedCache
( cache?: CacheAdapter | Cache )
src/core/unified-cache.ts:131
↓ 20 callersMethodtestCheckArbitrage
* Run a test case for checkArbitrage()
scripts/arb-tests/01-unit-tests.ts:86
↓ 18 callersMethodgetMarkets
* Get markets with optional filters and sorting * * @param params - Search and filter parameters * @returns Array of markets matching the cri
src/clients/gamma-api.ts:362
↓ 17 callersMethodclear
()
src/core/unified-cache.ts:28
↓ 17 callersMethodconnect
* Connect to WebSocket server
src/services/realtime-service-v2.ts:286
↓ 17 callersMethodgetBalance
* Get balance for a specific token
src/services/swap-service.ts:492
↓ 15 callersMethodensureInitialized
()
src/services/trading-service.ts:238
↓ 15 callersMethodgetAddress
* Get wallet address
src/clients/ctf-client.ts:207
↓ 15 callersMethodgetPositions
* Get positions for a wallet address * * @param address - Wallet address * @param params - Query parameters (P0/P1: limit, offset, sortBy, so
src/clients/data-api.ts:415
↓ 15 callersFunctionroundPrice
( price: number, tickSize: TickSize, direction: 'floor' | 'ceil' | 'round' = 'round' )
src/utils/price-utils.ts:36
↓ 15 callersMethodsplit
* Split USDC into YES + NO tokens * * @param conditionId - Market condition ID * @param amount - USDC amount (e.g., "100" for 100 USDC) *
src/clients/ctf-client.ts:320
↓ 14 callersMethodgetProcessedOrderbook
* Get processed orderbook with arbitrage analysis for a market
src/services/market-service.ts:409
↓ 13 callersMethodfetchLeaderboard
* Fetch leaderboard entries from Polymarket Data API * * @see https://docs.polymarket.com/api-reference/core/get-trader-leaderboard-rankings
src/clients/data-api.ts:739
↓ 13 callersMethodgetMarket
* Get market by slug or condition ID * Delegates to MarketService which handles merging Gamma and CLOB data
src/index.ts:568
↓ 13 callersMethodgetUsdcBalance
* Get USDC.e (bridged USDC) balance - the token used by Polymarket CTF * * ⚠️ Note: This returns USDC.e balance, NOT native USDC balance. * P
src/clients/ctf-client.ts:221
↓ 13 callersFunctionrecordResult
(name: string, status: 'PASS' | 'FAIL' | 'SKIP', duration?: number, error?: string, data?: any)
scripts/arb-tests/03-e2e-tests.ts:85
↓ 12 callersMethodbuildQuery
* 构建查询字符串
src/clients/subgraph.ts:194
↓ 12 callersMethoddisconnect
* Disconnect from WebSocket server
src/services/realtime-service-v2.ts:307
↓ 12 callersMethodexecute
* Execute a function with rate limiting
src/core/rate-limiter.ts:57
↓ 12 callersMethodgetActivity
* Get activity for a wallet address * * @param address - Wallet address * @param params - Query parameters (P0: start, end, offset; P1: marke
src/clients/data-api.ts:523
↓ 11 callersMethodgetStats
* Get current limiter statistics
src/core/rate-limiter.ts:77
↓ 11 callersMethodinitialize
()
src/services/trading-service.ts:182
↓ 11 callersFunctionrunTest
(name: string, testFn: () => Promise<any>)
scripts/arb-tests/02-integration-tests.ts:50
↓ 10 callersMethodfromHttpError
* Create error from HTTP response status
src/core/errors.ts:51
↓ 10 callersMethodgetTokenAddress
* Get token address from symbol
src/services/swap-service.ts:195
↓ 10 callersMethodstart
* Start monitoring a market
src/services/dip-arb-service.ts:297
↓ 10 callersMethodsubscribeMarkets
* Subscribe to market data (orderbook, prices, trades) * @param tokenIds - Array of token IDs to subscribe to * @param handlers - Event handlers
src/services/realtime-service-v2.ts:333
↓ 9 callersFunctiongetArg
(name: string, defaultValue?: string)
scripts/arb/token-rebalancer.ts:57
↓ 9 callersMethodgetClobMarket
* Get market from CLOB by condition ID
src/services/market-service.ts:231
↓ 9 callersMethodgetPositionBalanceByTokenIds
* Get token balances using CLOB API token IDs * * This is the recommended method for checking balances when working with * Polymarket CLOB ma
src/clients/ctf-client.ts:668
↓ 9 callersMethodgetTrendingMarkets
* Get trending markets sorted by 24-hour volume * * @param limit - Maximum number of markets to return (default: 20) * @returns Array of acti
src/clients/gamma-api.ts:546
↓ 9 callersMethodscanUpcomingMarkets
* Scan for upcoming UP/DOWN markets * * Uses MarketService.scanCryptoShortTermMarkets()
src/services/dip-arb-service.ts:190
↓ 9 callersMethodsendSubscription
(msg: { subscriptions: Array<{ topic: string; type: string; filters?: string; clob_auth?: ClobApiKeyCreds }> }
src/services/realtime-service-v2.ts:1227
↓ 9 callersMethodsendUnsubscription
(msg: { subscriptions: Array<{ topic: string; type: string; filters?: string }> })
src/services/realtime-service-v2.ts:1235
↓ 9 callersMethodupdateConfig
* Update configuration
src/services/dip-arb-service.ts:168
↓ 9 callersFunctionvalidatePrice
( price: number, tickSize: TickSize )
src/utils/price-utils.ts:74
↓ 8 callersMethodcreateDepositAddresses
* Get unique deposit addresses for a Polymarket wallet * * The Bridge API returns a universal deposit address structure: * - A single EVM add
src/clients/bridge-client.ts:258
↓ 8 callersMethodensureInitialized
()
src/services/market-service.ts:207
↓ 8 callersFunctionfetchAndAnalyze
(name: string, url: string, extractFirst = true)
scripts/verify/verify-all-apis.ts:39
↓ 8 callersFunctionformatPnL
(value: number)
dashboard/src/components/HistoryPage.tsx:70
↓ 8 callersFunctionformatPnL
(value: number)
dashboard/src/components/QuickStats.tsx:25
↓ 8 callersFunctionformatTime
(dateStr: string)
dashboard/src/components/HistoryPage.tsx:62
↓ 8 callersMethodgetAddress
()
src/services/trading-service.ts:602
↓ 8 callersMethodgetTokenDecimals
* Get token decimals
src/services/swap-service.ts:211
↓ 8 callersMethodlog
(message: string)
src/services/realtime-service-v2.ts:1241
↓ 8 callersFunctionquery
(endpoint: string, q: string)
scripts/archive/api-verification-history/08-subgraph-explore.ts:14
↓ 8 callersMethodscanMarkets
* Scan markets for arbitrage opportunities * * @param criteria Filter criteria for markets * @param minProfit Minimum profit threshold (defau
src/services/arbitrage-service.ts:1634
↓ 8 callersFunctiontestEndpoint
(name: string, endpoint: string, testQuery: string)
scripts/archive/api-verification-history/10-subgraph-official.ts:64
↓ 7 callersFunctioncheckArbitrage
( yesAsk: number, noAsk: number, yesBid: number, noBid: number )
src/utils/price-utils.ts:231
↓ 7 callersFunctionformatUSDC
(amount: number)
src/utils/price-utils.ts:278
↓ 7 callersMethodgetGasOptions
* Get gas options for Polygon network using EIP-1559 * * Polygon requires higher priority fees than default ethers.js estimates. * Uses minim
src/clients/ctf-client.ts:1143
↓ 7 callersMethodgetOrderbook
* Get processed orderbook with analytics
src/index.ts:577
↓ 7 callersMethodmergeByTokenIds
* Merge YES and NO tokens using explicit token IDs * * Use this for Polymarket CLOB markets where token IDs * don't match the calculated posi
src/services/onchain-service.ts:282
↓ 7 callersMethodtestGetEffectivePrices
* Run a test case for getEffectivePrices()
scripts/arb-tests/01-unit-tests.ts:40
↓ 7 callersMethodupdateBalance
()
src/services/arbitrage-service.ts:1363
↓ 6 callersMethodcategorizeMarket
* Categorize market based on title keywords
src/services/smart-money-service.ts:1920
↓ 6 callersMethodconnect
* Connect to realtime WebSocket (required for smart money tracking)
src/index.ts:523
↓ 6 callersMethodcreateLeg1Signal
( side: DipArbSide, price: number, oppositeAsk: number, source: 'dip' | 'surge' | 'mispricing'
src/services/dip-arb-service.ts:1346
↓ 6 callersMethoddisconnect
()
src/services/smart-money-service.ts:2268
↓ 6 callersMethodgetActiveSubscriptions
* Get all active subscriptions
src/services/realtime-service-v2.ts:881
↓ 6 callersMethodgetBalanceAllowance
( assetType: 'COLLATERAL' | 'CONDITIONAL', tokenId?: string )
src/services/trading-service.ts:571
↓ 6 callersMethodgetGasOptions
* Get dynamic gas options for Polygon network * Uses RPC fee data with minimum priority fee of 30 gwei
src/services/swap-service.ts:171
↓ 6 callersMethodgetGasPrice
* Get current gas price info
src/clients/ctf-client.ts:777
↓ 6 callersMethodgetLeaderboardByPeriod
* Get leaderboard by time period using official Polymarket API * * Uses the official Data API which supports time period filtering. * This is
src/services/wallet-service.ts:415
↓ 6 callersMethodgetOrSet
(key: string, ttlMs: number, factory: () => Promise<T>)
src/core/unified-cache.ts:26
↓ 6 callersMethodgetSupportedAssets
* Get all supported assets for bridge deposits * * @returns Array of supported assets with their chain/token details * * @example * ```
src/clients/bridge-client.ts:201
↓ 6 callersMethodgetTrades
(marketId?: string)
src/services/trading-service.ts:488
↓ 6 callersMethodgetWalletPositions
* Get positions for a wallet
src/services/wallet-service.ts:279
↓ 6 callersMethodlog
(level: LogLevel, message: string, data?: unknown)
src/dashboard/state-emitter.ts:47
↓ 6 callersFunctionlogSeparator
(title?: string)
examples/12-trending-arb-monitor.ts:67
↓ 6 callersFunctionlogTest
(name: string)
scripts/arb-tests/03-e2e-tests.ts:81
↓ 6 callersMethodnormalizeTimestamp
* Normalize timestamp to milliseconds * Polymarket WebSocket returns timestamps in seconds, need to convert to milliseconds
src/services/realtime-service-v2.ts:1251
↓ 6 callersFunctionsaveCurrentLog
(suffix?: string)
scripts/dip-arb/auto-trade.ts:125
↓ 6 callersMethodstop
* Stop monitoring
src/services/dip-arb-service.ts:463
↓ 6 callersFunctiontestEndpoint
(name: string, endpoint: string, testQuery: string)
scripts/archive/api-verification-history/09-subgraph-correct.ts:34
↓ 6 callersMethodvalidateSignalProfitability
(signal: DipArbLeg1Signal)
src/services/dip-arb-service.ts:1438
↓ 5 callersMethodcreate
* Create and initialize SDK in one call * * @example * ```typescript * const sdk = await PolymarketSDK.create({ privateKey: '...' }); *
src/index.ts:475
↓ 5 callersFunctionexploreSubgraph
(name: string, endpoint: string)
scripts/archive/api-verification-history/10-subgraph-official.ts:81
↓ 5 callersMethodfindAndStart
* Find the best market and start monitoring
src/services/dip-arb-service.ts:261
↓ 5 callersFunctionformatPrice
(price: number, tickSize?: TickSize)
src/utils/price-utils.ts:270
↓ 5 callersFunctiongetArgValue
(name: string, defaultVal: number)
scripts/dip-arb/auto-trade.ts:50
↓ 5 callersFunctiongetEffectivePrices
( yesAsk: number, yesBid: number, noAsk: number, noBid: number )
src/utils/price-utils.ts:189
↓ 5 callersMethodgetMarketResolution
* Check if a market is resolved and get payout info
src/services/onchain-service.ts:418
↓ 5 callersMethodgetPositionBalance
* Get token balances for a market using calculated position IDs * * NOTE: This method calculates position IDs from conditionId, which may not ma
src/clients/ctf-client.ts:625
↓ 5 callersMethodgetPositionBalanceByTokenIds
* Get token balances using CLOB API token IDs * * This is the recommended method for checking balances when working with * Polymarket CLOB ma
src/services/onchain-service.ts:351
↓ 5 callersFunctiongetSchemaFields
(endpoint: string, typeName: string)
scripts/archive/api-verification-history/10-subgraph-official.ts:40
↓ 5 callersMethodgetSmartMoneyList
* Get list of Smart Money wallets from leaderboard
src/services/smart-money-service.ts:727
↓ 5 callersMethodgetUserPeriodPnl
* Get a specific user's PnL and ranking for a time period * * Uses the official Data API's user filter to get a single user's stats. * * @
src/services/wallet-service.ts:570
next →1–100 of 792, ranked by callers