Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/MarilynClarke/Hyperliquid-Copy-Trading-Bot
/ functions
Functions
71 in github.com/MarilynClarke/Hyperliquid-Copy-Trading-Bot
⨍
Functions
71
◇
Types & classes
33
↓ 24 callers
Method
formatError
* Format error for logging
src/utils/errors.ts:170
↓ 9 callers
Function
sendErrorNotification
( error: string | Error, context?: Record<string, unknown> )
src/notifications/telegram.ts:137
↓ 8 callers
Function
isTelegramEnabled
* Check if Telegram is enabled and bot is ready
src/notifications/telegram.ts:43
↓ 7 callers
Method
wrapError
* Wrap unknown error into AppError
src/utils/errors.ts:194
↓ 5 callers
Method
getAccountEquity
* Get account equity information
src/hyperliquidClient.ts:113
↓ 4 callers
Method
getErrorMessage
* Extract error message safely
src/utils/errors.ts:134
↓ 4 callers
Method
getPositions
* Get open positions for an address
src/hyperliquidClient.ts:155
↓ 3 callers
Method
checkHealth
* Perform health check
src/utils/healthCheck.ts:72
↓ 3 callers
Method
isRetryable
* Check if error is retryable
src/utils/errors.ts:113
↓ 3 callers
Function
retryWithBackoff
( fn: () => Promise<T>, config: RetryConfig = DEFAULT_RETRY_CONFIG, onRetry?: (error: unknown, attempt:
src/utils/errors.ts:239
↓ 3 callers
Function
shutdown
(signal: string)
src/index.ts:95
↓ 2 callers
Method
getAddress
* Get our wallet address
src/hyperliquidClient.ts:485
↓ 2 callers
Method
stop
* Stop monitoring
src/copyTrader.ts:64
↓ 2 callers
Method
subscribeToUserFills
* Subscribe to user fills via WebSocket * Returns unsubscribe function
src/hyperliquidClient.ts:311
↓ 1 callers
Function
calculatePositionSize
( targetSize: number, ourEquity: number, targetEquity: number )
src/utils/risk.ts:55
↓ 1 callers
Method
calculateTradeParams
* Calculate trade parameters for copying
src/copyTrader.ts:237
↓ 1 callers
Function
capLeverage
(leverage: number)
src/utils/risk.ts:36
↓ 1 callers
Function
capPositionSize
( calculatedSize: number, ourEquity: number )
src/utils/risk.ts:43
↓ 1 callers
Method
checkHealthPublic
* Perform health check (public method)
src/utils/healthCheck.ts:175
↓ 1 callers
Function
cleanupTelegramBot
()
src/notifications/telegram.ts:306
↓ 1 callers
Method
executeTrade
* Execute trade with retry logic
src/copyTrader.ts:318
↓ 1 callers
Method
getErrorCode
* Extract error code
src/utils/errors.ts:150
↓ 1 callers
Method
getErrorContext
* Extract error context
src/utils/errors.ts:160
↓ 1 callers
Function
getTradeAction
(fill: FillEvent)
src/utils/risk.ts:85
↓ 1 callers
Method
handleFill
* Handle incoming fill event from target wallet
src/copyTrader.ts:75
↓ 1 callers
Function
initTelegramBot
()
src/notifications/telegram.ts:17
↓ 1 callers
Method
initialize
* Initialize SDK clients (call after SDK is loaded)
src/hyperliquidClient.ts:91
↓ 1 callers
Function
isAssetBlocked
(coin: string)
src/utils/risk.ts:20
↓ 1 callers
Function
loadConfig
()
src/config.ts:83
↓ 1 callers
Function
loadSDK
()
src/hyperliquidClient.ts:37
↓ 1 callers
Function
main
* Main application entry point
src/index.ts:26
↓ 1 callers
Function
meetsMinimumNotional
(size: string, price: string)
src/utils/risk.ts:28
↓ 1 callers
Method
placeOrder
* Place an order * Returns order ID or throws error
src/hyperliquidClient.ts:209
↓ 1 callers
Method
reconnect
* Reconnect WebSocket with exponential backoff
src/hyperliquidClient.ts:453
↓ 1 callers
Function
removeTrailingZeros
(value: string)
src/utils/risk.ts:13
↓ 1 callers
Function
sendHealthCheckNotification
( healthCheck: HealthCheckResult )
src/notifications/telegram.ts:173
↓ 1 callers
Method
sendNotification
* Send notification (Telegram, etc.)
src/copyTrader.ts:389
↓ 1 callers
Function
sendShutdownNotification
()
src/notifications/telegram.ts:75
↓ 1 callers
Function
sendStartupNotification
()
src/notifications/telegram.ts:50
↓ 1 callers
Function
sendTradeNotification
( fill: FillEvent, params: CopyTradeParams, result: TradeResult )
src/notifications/telegram.ts:93
↓ 1 callers
Method
start
* Start monitoring target wallet and copying trades
src/copyTrader.ts:45
↓ 1 callers
Method
start
* Start periodic health checks
src/utils/healthCheck.ts:32
↓ 1 callers
Function
validateSetup
()
scripts/validate-setup.ts:12
↓ 1 callers
Function
validateTradeParams
( params: CopyTradeParams, price: string, ourEquity: number )
src/utils/risk.ts:104
Function
child
* Create a child logger with additional context
src/logger.ts:265
Method
constructor
(client: HyperliquidClientWrapper, targetWallet: string)
src/copyTrader.ts:36
Method
constructor
()
src/hyperliquidClient.ts:72
Method
constructor
( client: HyperliquidClientWrapper, ourAddress: string, targetAddress: string )
src/utils/healthCheck.ts:19
Method
constructor
( message: string, code: string, retryable = false, context?: Record<string, unknown> )
src/utils/errors.ts:13
Method
constructor
(message: string, context?: Record<string, unknown>)
src/utils/errors.ts:32
Method
constructor
(message: string, context?: Record<string, unknown>)
src/utils/errors.ts:41
Method
constructor
(message: string, context?: Record<string, unknown>)
src/utils/errors.ts:50
Method
constructor
(message: string, retryable = false, context?: Record<string, unknown>)
src/utils/errors.ts:60
Method
constructor
(message: string, context?: Record<string, unknown>)
src/utils/errors.ts:69
Method
constructor
(message: string, context?: Record<string, unknown>)
src/utils/errors.ts:78
Method
constructor
(message: string, retryAfter?: number, context?: Record<string, unknown>)
src/utils/errors.ts:87
Method
constructor
(message: string, context?: Record<string, unknown>)
src/utils/errors.ts:101
Method
getActiveTradesCount
* Get active trades count
src/copyTrader.ts:404
Method
getLastResult
* Get last health check result
src/utils/healthCheck.ts:58
Method
isWsConnected
* Check if WebSocket is connected
src/hyperliquidClient.ts:492
Function
logApiCall
* Log an API call
src/logger.ts:169
Function
logConfig
* Log configuration changes
src/logger.ts:247
Function
logHealthCheck
* Log health check results
src/logger.ts:231
Function
logPerformance
* Log performance metrics
src/logger.ts:200
Function
logTrade
* Log a trade operation
src/logger.ts:154
Function
logWebSocket
* Log WebSocket events
src/logger.ts:216
Method
runHealthCheck
* Manually trigger health check and return result
src/utils/healthCheck.ts:65
Function
sendInfoNotification
( info: string, context?: Record<string, unknown> )
src/notifications/telegram.ts:279
Function
sendSummaryNotification
(stats: { tradesCopied: number; successfulTrades: number; failedTrades: number; activePositions: numbe
src/notifications/telegram.ts:212
Function
sendWarningNotification
( warning: string, context?: Record<string, unknown> )
src/notifications/telegram.ts:252
Method
stop
* Stop health checks
src/utils/healthCheck.ts:47