Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Thornsnake/MCRBot
/ functions
Functions
207 in github.com/Thornsnake/MCRBot
⨍
Functions
207
◇
Types & classes
83
↓ 31 callers
Method
all
(tradableCoins: string[])
class/Book.ts:9
↓ 30 callers
Function
formatNumber
(value: number, decimals = 2)
gui/src/lib/format.ts:6
↓ 28 callers
Method
get
(currency: string)
class/Account.ts:36
↓ 28 callers
Method
map
* Maps a single v1 `position_balances` entry onto the internal IAccount shape. * * The unified wallet reports a spendable figure as `max_wit
class/Account.ts:24
↓ 19 callers
Function
approx
(actual: number, expected: number, message: string)
test/run.ts:33
↓ 17 callers
Function
set
(key: K, value: BotConfig[K])
gui/src/pages/SettingsPage.tsx:89
↓ 15 callers
Method
fixNotional
(instrument: IInstrument, notional: number)
class/Calculation.ts:207
↓ 12 callers
Function
resetConfig
()
test/run.ts:55
↓ 12 callers
Function
test
(name: string, fn: () => void)
test/run.ts:21
↓ 9 callers
Method
execute
(command: string, params: any[] = [])
class/Database.ts:152
↓ 9 callers
Method
getOrderBookBidWorth
(coinAmmount: number, book: IBook)
class/Calculation.ts:11
↓ 9 callers
Method
getReinvestTarget
* The amount of an arbitrary sum (e.g. the proceeds of a sale during rebalancing) that should be * reinvested into a single coin, respecting the
class/Calculation.ts:298
↓ 9 callers
Method
stop
()
class/Trade.ts:1271
↓ 7 callers
Method
formatCurrency
(value: number)
class/WebHook.ts:65
↓ 7 callers
Method
getTradableCoins
(instruments: IInstrument[], stablecoins: string[], coins: string[], coinRemovalList?: ICoinRemoval[])
class/Calculation.ts:42
↓ 6 callers
Method
createSchedule
(name: "TRAILING_STOP" | "INVEST" | "REBALANCE")
index.ts:389
↓ 6 callers
Method
getCoinRemovalList
()
class/Trade.ts:115
↓ 6 callers
Method
getPortfolioATH
()
class/Trade.ts:133
↓ 6 callers
Method
getPortfolioWorth
(balance: IAccount[], tradableCoins: string[], book: IBook[])
class/Calculation.ts:106
↓ 6 callers
Method
isPasswordSet
()
class/gui/Auth.ts:22
↓ 6 callers
Method
minimumBuyNotional
(instrument: IInstrument, book: IBook)
class/Calculation.ts:220
↓ 6 callers
Method
minimumSellQuantity
(instrument: IInstrument)
class/Calculation.ts:234
↓ 6 callers
Method
sendToDiscord
(data: IMessageDataInvest | IMessageDataRebalance | null, type: EMessageType)
class/WebHook.ts:77
↓ 5 callers
Method
connection
* Returns the open connection, opening (and initializing) it synchronously on first use.
class/Database.ts:112
↓ 5 callers
Method
fixQuantity
(instrument: IInstrument, quantity: number)
class/Calculation.ts:215
↓ 5 callers
Function
retry
(fn: () => Promise<T>, retries: number = 2, delayMs: number = 1000)
class/Util.ts:42
↓ 5 callers
Function
setGui
(key: keyof BotConfig["GUI"], value: string | number | boolean)
gui/src/pages/SettingsPage.tsx:107
↓ 4 callers
Method
buy
(instrument: IInstrument, notional: number, minimumNotional: number, tradeType: ETradeType)
class/Trade.ts:177
↓ 4 callers
Method
emitTrade
(record: ITradeRecord)
class/Trade.ts:86
↓ 4 callers
Function
formatTimestamp
(ms: number)
gui/src/lib/format.ts:26
↓ 4 callers
Method
getAvailableFunds
(balance: IAccount[])
class/Calculation.ts:174
↓ 4 callers
Method
getCoins
(cached: boolean)
class/CoinGecko.ts:85
↓ 4 callers
Method
getStablecoins
(cached: boolean)
class/CoinGecko.ts:48
↓ 4 callers
Function
resetPageAnd
(setter: (v: string) => void)
gui/src/pages/TradesPage.tsx:43
↓ 4 callers
Function
setTrailing
(key: keyof BotConfig["TRAILING_STOP"], value: number | boolean)
gui/src/pages/SettingsPage.tsx:99
↓ 4 callers
Function
useDashboard
()
gui/src/api/hooks/useDashboard.ts:10
↓ 3 callers
Method
cappedInvestment
* The new trailing-stop cost basis after a DCA interval. The basis only ever grows by at most * CONFIG.INVESTMENT (the fresh capital the user int
class/Calculation.ts:308
↓ 3 callers
Method
close
()
class/Database.ts:145
↓ 3 callers
Method
createToken
()
class/gui/Auth.ts:54
↓ 3 callers
Function
deepClone
(obj: T)
gui/src/pages/SettingsPage.tsx:37
↓ 3 callers
Function
deepMerge
(target: any, source: any)
config.ts:113
↓ 3 callers
Function
delta
(name: string, percentage: number, deviation: number)
test/run.ts:51
↓ 3 callers
Function
extractApiError
(err: unknown, fallback = "Request failed")
gui/src/api/client.ts:38
↓ 3 callers
Function
instrument
(overrides: Partial<IInstrument> = {})
test/run.ts:37
↓ 3 callers
Method
sell
(instrument: IInstrument, quantity: number, tradeType: ETradeType, quoteWorth?: number)
class/Trade.ts:264
↓ 3 callers
Method
setCoinRemovalList
(coinRemovalList: ICoinRemoval[])
class/Trade.ts:120
↓ 3 callers
Method
setPortfolioATH
(portfolioATH: IPortfolioATH)
class/Trade.ts:157
↓ 3 callers
Function
setSchedule
(key: keyof BotConfig["SCHEDULE"], value: string)
gui/src/pages/SettingsPage.tsx:93
↓ 3 callers
Method
sign
(request: any)
class/Authentication.ts:40
↓ 3 callers
Method
snapshot
* Computes a read-only snapshot of the current portfolio (worth, available funds, per-coin * distribution, trailing-stop state, removal list) for
class/Trade.ts:1234
↓ 3 callers
Method
start
(deps: IGUIServerDeps)
class/gui/GUIServer.ts:44
↓ 3 callers
Function
toPlainString
(value: number)
class/Util.ts:17
↓ 3 callers
Method
weightedTarget
* Computes how much of `total` should be allocated to `coin` given the WEIGHT configuration and * the set of `coins` currently in play. A coin wi
class/Calculation.ts:261
↓ 2 callers
Method
broadcastSnapshot
(snapshot: ICycleSnapshot, fromCycle: boolean)
class/gui/DataBridge.ts:106
↓ 2 callers
Method
check
()
index.ts:105
↓ 2 callers
Function
disconnectSocket
()
gui/src/api/socket.ts:119
↓ 2 callers
Method
emitCycle
(type: string)
class/Trade.ts:95
↓ 2 callers
Method
getCoinInvestmentTarget
* The amount of fresh capital (CONFIG.INVESTMENT) that should be invested into a single coin * during a DCA interval, respecting the WEIGHT confi
class/Calculation.ts:289
↓ 2 callers
Method
getDistributionDelta
(portfolioWorth: number, tradableCoins: string[], balance: IAccount[], book: IBook[])
class/Calculation.ts:132
↓ 2 callers
Method
getLatestDistribution
()
class/gui/DataBridge.ts:280
↓ 2 callers
Method
getLowestPerformer
(distributionDelta: IDistributionDelta[], ignoreList: string[])
class/Calculation.ts:186
↓ 2 callers
Function
getSocket
()
gui/src/api/socket.ts:84
↓ 2 callers
Method
isValidToken
(token: string | undefined | null)
class/gui/Auth.ts:69
↓ 2 callers
Function
reconnectSocket
()
gui/src/api/socket.ts:130
↓ 2 callers
Method
reinvestSpread
* Spreads a leftover amount of quote currency evenly (weight-aware) across the buyable coins, * buying as much as the per-coin minimum order size
class/Trade.ts:355
↓ 2 callers
Function
remove
(v: string)
gui/src/components/config/fields.tsx:221
↓ 2 callers
Method
requestConfig
* Builds the axios request config, attaching the optional CoinGecko demo API key if one has been * configured. The key is read defensively so tha
class/CoinGecko.ts:37
↓ 2 callers
Method
run
()
index.ts:318
↓ 2 callers
Function
setDiscord
( key: K, value: BotConfig["WEBHOOKS"]["DISCORD"][K], )
gui/src/pages/SettingsPage.tsx:113
↓ 2 callers
Method
setPassword
(password: string)
class/gui/Auth.ts:26
↓ 2 callers
Method
setTrade
(trade: Trade)
class/gui/DataBridge.ts:25
↓ 2 callers
Method
startSchedules
()
index.ts:483
↓ 2 callers
Function
strip
(c: BotConfig)
gui/src/pages/SettingsPage.tsx:68
↓ 2 callers
Method
transaction
(fn: () => void)
class/Database.ts:164
↓ 2 callers
Function
useConfig
()
gui/src/api/hooks/useConfig.ts:9
↓ 2 callers
Method
verify
(password: string)
class/gui/Auth.ts:40
↓ 1 callers
Function
add
()
gui/src/components/config/fields.tsx:211
↓ 1 callers
Method
all
()
class/Account.ts:50
↓ 1 callers
Method
apply
* Merges a partial config into the live CONFIG object in place and returns the set of top-level * keys that changed (so the caller can fire the m
class/ConfigStore.ts:150
↓ 1 callers
Method
buildCandidate
* A deep clone of the live config with the proposed partial merged on top — used to validate a * change before it is applied to the live object.
class/ConfigStore.ts:15
↓ 1 callers
Function
check
()
gui/src/components/auth/AuthGate.tsx:21
↓ 1 callers
Method
createAutoUpdateSchedule
()
index.ts:421
↓ 1 callers
Function
deviationColor
* Diverging color for a coin's deviation: * - underweight (deviation < 0, room to buy) -> green * - overweight (deviation > 0) ->
gui/src/components/distribution/DistributionHeatmap.tsx:22
↓ 1 callers
Method
getDashboard
()
class/gui/DataBridge.ts:187
↓ 1 callers
Method
getDistributionHistory
(coin: string, startTime?: number, endTime?: number)
class/gui/DataBridge.ts:296
↓ 1 callers
Method
getPerformance
(filters: { startTime?: number; endTime?: number })
class/gui/DataBridge.ts:258
↓ 1 callers
Method
getPortfolioState
()
class/gui/DataBridge.ts:316
↓ 1 callers
Method
getRecentTrades
(limit = 10)
class/gui/DataBridge.ts:217
↓ 1 callers
Method
getTrades
(filters: { coin?: string; side?: string; type?: string; dry?: string; limit?: number; offset?: number })
class/gui/DataBridge.ts:224
↓ 1 callers
Method
getWeight
* Case-insensitive lookup of a coin's configured WEIGHT (in percent), or undefined if the coin * has no explicit weight. WEIGHT keys in the confi
class/Calculation.ts:242
↓ 1 callers
Method
invest
()
class/Trade.ts:1177
↓ 1 callers
Method
investMoney
(instruments: IInstrument[], tradableCoins: string[], buyableCoins: string[])
class/Trade.ts:930
↓ 1 callers
Function
loadConfig
()
config.ts:144
↓ 1 callers
Function
main
()
test/smoke.ts:11
↓ 1 callers
Function
maskSecret
(value: string)
class/ConfigStore.ts:208
↓ 1 callers
Method
notifyCycle
(snapshot: ICycleSnapshot)
class/gui/DataBridge.ts:99
↓ 1 callers
Method
notifyTrade
(record: ITradeRecord)
class/gui/DataBridge.ts:73
↓ 1 callers
Method
objectToString
* Serializes a params value into the deterministic string the Crypto.com Exchange v1 signature * is computed over: object keys sorted ascending a
class/Authentication.ts:18
↓ 1 callers
Method
open
()
class/Database.ts:139
↓ 1 callers
Method
persist
* Persists the live CONFIG object to the database (single atomic statement).
class/ConfigStore.ts:175
next →
1–100 of 207, ranked by callers