Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/MrFadiAi/Polymarket-bot
/ functions
Functions
792 in github.com/MrFadiAi/Polymarket-bot
⨍
Functions
792
◇
Types & classes
342
↓ 2,906 callers
Method
log
(message: string)
src/services/dip-arb-service.ts:2272
↓ 103 callers
Function
log
(level: LogLevel, message: string, data?: unknown)
bot-with-dashboard.ts:214
↓ 92 callers
Method
set
(key: string, value: T, ttlMs: number)
src/core/unified-cache.ts:25
↓ 88 callers
Function
log
(msg: string)
scripts/dip-arb/auto-trade.ts:111
↓ 88 callers
Method
log
(message: string)
src/services/arbitrage-service.ts:1606
↓ 62 callers
Function
log
(level: string, message: string, data?: unknown)
bot-config.ts:251
↓ 43 callers
Method
get
(key: string)
src/core/unified-cache.ts:24
↓ 31 callers
Function
updateDashboard
()
bot-with-dashboard.ts:230
↓ 29 callers
Method
createMarketOrder
* 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 callers
Function
log
(level: 'INFO' | 'WARN' | 'ERROR' | 'DEBUG' | 'SUCCESS', message: string, data?: unknown)
examples/12-trending-arb-monitor.ts:47
↓ 25 callers
Method
stop
* Stop SDK - disconnect all services and clean up
src/index.ts:548
↓ 24 callers
Method
execute
* Manually execute an arbitrage opportunity
src/services/arbitrage-service.ts:572
↓ 22 callers
Function
createUnifiedCache
( cache?: CacheAdapter | Cache )
src/core/unified-cache.ts:131
↓ 20 callers
Method
testCheckArbitrage
* Run a test case for checkArbitrage()
scripts/arb-tests/01-unit-tests.ts:86
↓ 18 callers
Method
getMarkets
* 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 callers
Method
clear
()
src/core/unified-cache.ts:28
↓ 17 callers
Method
connect
* Connect to WebSocket server
src/services/realtime-service-v2.ts:286
↓ 17 callers
Method
getBalance
* Get balance for a specific token
src/services/swap-service.ts:492
↓ 15 callers
Method
ensureInitialized
()
src/services/trading-service.ts:238
↓ 15 callers
Method
getAddress
* Get wallet address
src/clients/ctf-client.ts:207
↓ 15 callers
Method
getPositions
* 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 callers
Function
roundPrice
( price: number, tickSize: TickSize, direction: 'floor' | 'ceil' | 'round' = 'round' )
src/utils/price-utils.ts:36
↓ 15 callers
Method
split
* 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 callers
Method
getProcessedOrderbook
* Get processed orderbook with arbitrage analysis for a market
src/services/market-service.ts:409
↓ 13 callers
Method
fetchLeaderboard
* 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 callers
Method
getMarket
* Get market by slug or condition ID * Delegates to MarketService which handles merging Gamma and CLOB data
src/index.ts:568
↓ 13 callers
Method
getUsdcBalance
* 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 callers
Function
recordResult
(name: string, status: 'PASS' | 'FAIL' | 'SKIP', duration?: number, error?: string, data?: any)
scripts/arb-tests/03-e2e-tests.ts:85
↓ 12 callers
Method
buildQuery
* 构建查询字符串
src/clients/subgraph.ts:194
↓ 12 callers
Method
disconnect
* Disconnect from WebSocket server
src/services/realtime-service-v2.ts:307
↓ 12 callers
Method
execute
* Execute a function with rate limiting
src/core/rate-limiter.ts:57
↓ 12 callers
Method
getActivity
* 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 callers
Method
getStats
* Get current limiter statistics
src/core/rate-limiter.ts:77
↓ 11 callers
Method
initialize
()
src/services/trading-service.ts:182
↓ 11 callers
Function
runTest
(name: string, testFn: () => Promise<any>)
scripts/arb-tests/02-integration-tests.ts:50
↓ 10 callers
Method
fromHttpError
* Create error from HTTP response status
src/core/errors.ts:51
↓ 10 callers
Method
getTokenAddress
* Get token address from symbol
src/services/swap-service.ts:195
↓ 10 callers
Method
start
* Start monitoring a market
src/services/dip-arb-service.ts:297
↓ 10 callers
Method
subscribeMarkets
* 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 callers
Function
getArg
(name: string, defaultValue?: string)
scripts/arb/token-rebalancer.ts:57
↓ 9 callers
Method
getClobMarket
* Get market from CLOB by condition ID
src/services/market-service.ts:231
↓ 9 callers
Method
getPositionBalanceByTokenIds
* 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 callers
Method
getTrendingMarkets
* 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 callers
Method
scanUpcomingMarkets
* Scan for upcoming UP/DOWN markets * * Uses MarketService.scanCryptoShortTermMarkets()
src/services/dip-arb-service.ts:190
↓ 9 callers
Method
sendSubscription
(msg: { subscriptions: Array<{ topic: string; type: string; filters?: string; clob_auth?: ClobApiKeyCreds }> }
src/services/realtime-service-v2.ts:1227
↓ 9 callers
Method
sendUnsubscription
(msg: { subscriptions: Array<{ topic: string; type: string; filters?: string }> })
src/services/realtime-service-v2.ts:1235
↓ 9 callers
Method
updateConfig
* Update configuration
src/services/dip-arb-service.ts:168
↓ 9 callers
Function
validatePrice
( price: number, tickSize: TickSize )
src/utils/price-utils.ts:74
↓ 8 callers
Method
createDepositAddresses
* 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 callers
Method
ensureInitialized
()
src/services/market-service.ts:207
↓ 8 callers
Function
fetchAndAnalyze
(name: string, url: string, extractFirst = true)
scripts/verify/verify-all-apis.ts:39
↓ 8 callers
Function
formatPnL
(value: number)
dashboard/src/components/HistoryPage.tsx:70
↓ 8 callers
Function
formatPnL
(value: number)
dashboard/src/components/QuickStats.tsx:25
↓ 8 callers
Function
formatTime
(dateStr: string)
dashboard/src/components/HistoryPage.tsx:62
↓ 8 callers
Method
getAddress
()
src/services/trading-service.ts:602
↓ 8 callers
Method
getTokenDecimals
* Get token decimals
src/services/swap-service.ts:211
↓ 8 callers
Method
log
(message: string)
src/services/realtime-service-v2.ts:1241
↓ 8 callers
Function
query
(endpoint: string, q: string)
scripts/archive/api-verification-history/08-subgraph-explore.ts:14
↓ 8 callers
Method
scanMarkets
* Scan markets for arbitrage opportunities * * @param criteria Filter criteria for markets * @param minProfit Minimum profit threshold (defau
src/services/arbitrage-service.ts:1634
↓ 8 callers
Function
testEndpoint
(name: string, endpoint: string, testQuery: string)
scripts/archive/api-verification-history/10-subgraph-official.ts:64
↓ 7 callers
Function
checkArbitrage
( yesAsk: number, noAsk: number, yesBid: number, noBid: number )
src/utils/price-utils.ts:231
↓ 7 callers
Function
formatUSDC
(amount: number)
src/utils/price-utils.ts:278
↓ 7 callers
Method
getGasOptions
* 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 callers
Method
getOrderbook
* Get processed orderbook with analytics
src/index.ts:577
↓ 7 callers
Method
mergeByTokenIds
* 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 callers
Method
testGetEffectivePrices
* Run a test case for getEffectivePrices()
scripts/arb-tests/01-unit-tests.ts:40
↓ 7 callers
Method
updateBalance
()
src/services/arbitrage-service.ts:1363
↓ 6 callers
Method
categorizeMarket
* Categorize market based on title keywords
src/services/smart-money-service.ts:1920
↓ 6 callers
Method
connect
* Connect to realtime WebSocket (required for smart money tracking)
src/index.ts:523
↓ 6 callers
Method
createLeg1Signal
( side: DipArbSide, price: number, oppositeAsk: number, source: 'dip' | 'surge' | 'mispricing'
src/services/dip-arb-service.ts:1346
↓ 6 callers
Method
disconnect
()
src/services/smart-money-service.ts:2268
↓ 6 callers
Method
getActiveSubscriptions
* Get all active subscriptions
src/services/realtime-service-v2.ts:881
↓ 6 callers
Method
getBalanceAllowance
( assetType: 'COLLATERAL' | 'CONDITIONAL', tokenId?: string )
src/services/trading-service.ts:571
↓ 6 callers
Method
getGasOptions
* 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 callers
Method
getGasPrice
* Get current gas price info
src/clients/ctf-client.ts:777
↓ 6 callers
Method
getLeaderboardByPeriod
* 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 callers
Method
getOrSet
(key: string, ttlMs: number, factory: () => Promise<T>)
src/core/unified-cache.ts:26
↓ 6 callers
Method
getSupportedAssets
* 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 callers
Method
getTrades
(marketId?: string)
src/services/trading-service.ts:488
↓ 6 callers
Method
getWalletPositions
* Get positions for a wallet
src/services/wallet-service.ts:279
↓ 6 callers
Method
log
(level: LogLevel, message: string, data?: unknown)
src/dashboard/state-emitter.ts:47
↓ 6 callers
Function
logSeparator
(title?: string)
examples/12-trending-arb-monitor.ts:67
↓ 6 callers
Function
logTest
(name: string)
scripts/arb-tests/03-e2e-tests.ts:81
↓ 6 callers
Method
normalizeTimestamp
* Normalize timestamp to milliseconds * Polymarket WebSocket returns timestamps in seconds, need to convert to milliseconds
src/services/realtime-service-v2.ts:1251
↓ 6 callers
Function
saveCurrentLog
(suffix?: string)
scripts/dip-arb/auto-trade.ts:125
↓ 6 callers
Method
stop
* Stop monitoring
src/services/dip-arb-service.ts:463
↓ 6 callers
Function
testEndpoint
(name: string, endpoint: string, testQuery: string)
scripts/archive/api-verification-history/09-subgraph-correct.ts:34
↓ 6 callers
Method
validateSignalProfitability
(signal: DipArbLeg1Signal)
src/services/dip-arb-service.ts:1438
↓ 5 callers
Method
create
* Create and initialize SDK in one call * * @example * ```typescript * const sdk = await PolymarketSDK.create({ privateKey: '...' }); *
src/index.ts:475
↓ 5 callers
Function
exploreSubgraph
(name: string, endpoint: string)
scripts/archive/api-verification-history/10-subgraph-official.ts:81
↓ 5 callers
Method
findAndStart
* Find the best market and start monitoring
src/services/dip-arb-service.ts:261
↓ 5 callers
Function
formatPrice
(price: number, tickSize?: TickSize)
src/utils/price-utils.ts:270
↓ 5 callers
Function
getArgValue
(name: string, defaultVal: number)
scripts/dip-arb/auto-trade.ts:50
↓ 5 callers
Function
getEffectivePrices
( yesAsk: number, yesBid: number, noAsk: number, noBid: number )
src/utils/price-utils.ts:189
↓ 5 callers
Method
getMarketResolution
* Check if a market is resolved and get payout info
src/services/onchain-service.ts:418
↓ 5 callers
Method
getPositionBalance
* 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 callers
Method
getPositionBalanceByTokenIds
* 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 callers
Function
getSchemaFields
(endpoint: string, typeName: string)
scripts/archive/api-verification-history/10-subgraph-official.ts:40
↓ 5 callers
Method
getSmartMoneyList
* Get list of Smart Money wallets from leaderboard
src/services/smart-money-service.ts:727
↓ 5 callers
Method
getUserPeriodPnl
* 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