Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/MystenLabs/capybot
/ functions
Functions
103 in github.com/MystenLabs/capybot
⨍
Functions
103
◇
Types & classes
37
↓ 37 callers
Function
signedShiftRight
(n0: BN, shiftBy: number, bitWidth: number)
src/dexs/turbos/turbos.ts:537
↓ 9 callers
Method
toString
()
src/types/percentage.ts:37
↓ 8 callers
Function
getTickerPrice
* Get the ticker price for a given symbol. * @param symbol The symbol to get the ticker price for. * @returns The ticker price for the given symbol.
src/utils/binance-ticker-price.ts:11
↓ 7 callers
Method
addStrategy
Add a strategy to this bot. The pools it subscribes to must have been added first.
src/capybot.ts:138
↓ 6 callers
Function
exchangeFetchTickers
( exchange: binance | bitget | coinbaseprime | kraken | kucoin | okx, pairs: string[] )
src/utils/ccxt-fetchTickers.ts:20
↓ 5 callers
Method
addPool
Add a new pool for this bot to use for trading.
src/capybot.ts:161
↓ 4 callers
Function
getTotalBalanceByCoinType
( provider: JsonRpcProvider, owner: SuiAddress, coinType: string )
src/utils/utils.ts:167
↓ 3 callers
Method
createSwapTransaction
* Create swap transaction * @param transactionBlock Transaction block * @param params Cetus parameters * @returns Transaction block
src/dexs/cetus/cetus.ts:46
↓ 3 callers
Method
getLatestRate
(pool: string, a2b: boolean)
src/strategies/arbitrage.ts:103
↓ 3 callers
Function
sortByBalance
* Sort coin by balance in an ascending order
src/utils/utils.ts:310
↓ 2 callers
Method
add
* Compute the sum of two `TokenAmount`s. * * @param other Another `TokenAmount`. * @returns The sum of this and the other amount, assuming th
src/types/token_amount.ts:26
↓ 2 callers
Method
addDataSource
Add a new price data source for this bot to use
src/capybot.ts:150
↓ 2 callers
Function
buildInputCoinForAmount
( txb: TransactionBlock, amount: bigint, coinType: string, owner: SuiAddress, provider: JsonRpcProvi
src/utils/utils.ts:203
↓ 2 callers
Function
composeType
(address: string, ...args: unknown[])
src/utils/utils.ts:114
↓ 2 callers
Function
getCoinDecimals
(coinType: string)
src/utils/utils.ts:329
↓ 2 callers
Function
getCoinInfo
(coin_type: string)
src/coins/coins.ts:21
↓ 2 callers
Function
isSuiCoin
(coinType: string)
src/utils/utils.ts:53
↓ 2 callers
Method
ofAmount
Compute this percentage of a given `TokenAmount`.
src/types/percentage.ts:23
↓ 2 callers
Function
selectCoinAssetGreaterThanOrEqual
( coins: CoinAsset[], amount: bigint, exclude: ObjectId[] = [] )
src/utils/utils.ts:261
↓ 2 callers
Method
toRatio
Returns the percentage as a a multiplier, e.g. 10% is returner as 0.1.
src/types/percentage.ts:14
↓ 1 callers
Function
BTCtoUSDC
()
src/utils/binance-ticker-price.ts:33
↓ 1 callers
Function
amountOutWithSlippage
( amountOut: Decimal.Value, slippage: string, amountSpecifiedIsInput: boolean )
src/dexs/turbos/turbos.ts:257
↓ 1 callers
Function
buildSdkOptions
()
src/dexs/cetus/cetus.ts:22
↓ 1 callers
Function
calculateTotalBalance
(coins: CoinAsset[])
src/utils/utils.ts:325
↓ 1 callers
Method
convert
Convert the amount of `coinTo` returned if a given amount of `coinFrom` is traded for this price.
src/types/token_price.ts:24
↓ 1 callers
Method
createCetusTransactionBlockWithSDK
( params: CetusParams )
src/dexs/cetus/cetus.ts:147
↓ 1 callers
Method
createTurbosTransactionBlockWithSDK
( transactionBlock: TransactionBlock, params: TurbosParams )
src/dexs/turbos/turbos.ts:176
↓ 1 callers
Method
estimatePriceAndFee
()
src/dexs/cetus/cetus.ts:132
↓ 1 callers
Method
evaluate
(data: DataPoint)
src/strategies/arbitrage.ts:39
↓ 1 callers
Method
executeTransactionBlock
( transactionBlock: TransactionBlock, strategy: Strategy )
src/capybot.ts:115
↓ 1 callers
Function
extractStructTagFromType
(type: string)
src/utils/utils.ts:57
↓ 1 callers
Method
fromRatio
(ratio: number)
src/types/percentage.ts:18
↓ 1 callers
Method
getData
()
src/data_sources/binance/BinanceBTCtoUSDC.ts:13
↓ 1 callers
Function
isSUI
(coinType: string)
src/utils/utils.ts:49
↓ 1 callers
Method
loop
(duration: number, delay: number)
src/capybot.ts:39
↓ 1 callers
Function
selectTradeCoins
( provider: JsonRpcProvider, owner: SuiAddress, coinType: string, expectedAmount: Decimal )
src/utils/utils.ts:129
↓ 1 callers
Method
subscribes_to
()
src/strategies/arbitrage.ts:99
↓ 1 callers
Method
subtract
* Compute the difference of two `TokenAmount`s. * * @param other Another `TokenAmount`. * @returns The difference of this and the other amoun
src/types/token_amount.ts:39
↓ 1 callers
Method
subtractFrom
Remove this percentage to a given `TokenAmount`.
src/types/percentage.ts:33
↓ 1 callers
Function
tickIndexToSqrtPriceNegative
(tickIndex: number)
src/dexs/turbos/turbos.ts:278
↓ 1 callers
Function
tickIndexToSqrtPricePositive
(tick: number)
src/dexs/turbos/turbos.ts:398
↓ 1 callers
Function
tickIndexToSqrtPriceX64
(tickIndex: number)
src/dexs/turbos/turbos.ts:270
↓ 1 callers
Method
toString
()
src/types/token_amount.ts:46
Function
BTCtoUSDT
()
src/utils/binance-ticker-price.ts:22
Function
SUItoBNB
()
src/utils/binance-ticker-price.ts:77
Function
SUItoBTC
()
src/utils/binance-ticker-price.ts:66
Function
SUItoEUR
()
src/utils/binance-ticker-price.ts:88
Function
SUItoTRY
()
src/utils/binance-ticker-price.ts:99
Function
SUItoTUSD
()
src/utils/binance-ticker-price.ts:55
Function
SUItoUSDT
()
src/utils/binance-ticker-price.ts:44
Method
addTo
Add this percentage to a given `TokenAmount`.
src/types/percentage.ts:28
Method
addToTransactionBlock
( transactionBlock: TransactionBlock, txbToBeAdded: TransactionBlock )
src/dexs/turbos/turbos.ts:238
Function
binanceFetchTickers
(pairs: string[])
src/utils/ccxt-fetchTickers.ts:34
Function
binanceFetchTickersAll
()
src/utils/ccxt-fetchTickers.ts:64
Function
binanceWatchOrderBook
(symbol)
src/utils/binance-watch-order-book.js:5
Function
bitgetFetchTickers
(pairs: string[])
src/utils/ccxt-fetchTickers.ts:39
Function
buildSdkOptions
()
src/dexs/suiswap/suiswap.ts:27
Function
buildSdkOptions
()
src/dexs/turbos/turbos.ts:35
Function
coinbaseprimeFetchTickers
(pairs: string[])
src/utils/ccxt-fetchTickers.ts:44
Method
combine
Assuming `this.coinTo` equals `other.coinFrom`, this method returns the combined price of `this.coinFrom` as `other.coinTo`.
src/types/token_price.ts:32
Function
constructor
(parameters: any)
src/strategies/strategy.ts:10
Function
constructor
* Creates an instance of Pool. * @param address The address of the pool. * @param coinTypeA The coin type A for the pool. * @param coinTypeB
src/dexs/pool.ts:33
Function
constructor
(uri: string)
src/data_sources/data_source.ts:7
Method
constructor
(keypair: Keypair)
src/capybot.ts:33
Method
constructor
(price: number, coinFrom: CoinType, coinTo: CoinType)
src/types/token_price.ts:12
Method
constructor
(amount: number, coin: CoinType)
src/types/token_amount.ts:15
Method
constructor
(percentage: number)
src/types/percentage.ts:9
Method
constructor
(fee_in_percent: number)
src/types/percentage.ts:43
Method
constructor
* * @param pool The swap pool to make trades on. * @param data_source The source of pricing data. * @param short The length of the short movi
src/strategies/ride_the_external_trend.ts:34
Method
constructor
* Create a new trend-riding strategy. * * @param pool The address of the pool to watch. * @param short The length of the short moving a
src/strategies/ride_the_trend.ts:31
Method
constructor
* Create a new market difference strategy. This strategy compare prices between a pool and various exchanges and * will buy the token that is too c
src/strategies/market_difference.ts:25
Method
constructor
* Create a new arbitrage strategy. * * @param poolChain The chain of pools to consider for an arbitrage. The order should be defined such th
src/strategies/arbitrage.ts:27
Method
constructor
(address: string, coinTypeA: string, coinTypeB: string)
src/dexs/cetus/cetus.ts:31
Method
constructor
(address: string, coinTypeA: string, coinTypeB: string)
src/dexs/suiswap/suiswap.ts:41
Method
constructor
( address: string, coinTypeA: string, coinTypeB: string, coinTypeC: string )
src/dexs/turbos/turbos.ts:53
Method
constructor
()
src/data_sources/binance/BinanceBTCtoUSDC.ts:9
Function
convertTradeCoins
( txb: TransactionBlock, coinIds: string[], coinType: string, amount: Decimal )
src/utils/utils.ts:16
Method
createSwapTransaction
* Create swap transaction * @param transactionBlock Transaction block * @param params Suiswap parameters * @returns Transaction block
src/dexs/suiswap/suiswap.ts:55
Method
createSwapTransaction
* Create swap transaction * @param transactionBlock Transaction block * @param params Turbos parameters * @returns Transaction block
src/dexs/turbos/turbos.ts:81
Method
createTransactionBlock
( a2b: boolean, amountIn: number, amountSpecifiedIsInput: boolean, slippage: number )
src/dexs/turbos/turbos.ts:114
Method
deductFee
Remove this fee from a `TokenAmount`.
src/types/percentage.ts:48
Method
difference
Compute the ratio of this `TokenPrice` over other as a {@link Percentage}.
src/types/token_price.ts:53
Method
estimatePriceAndFee
()
src/dexs/suiswap/suiswap.ts:108
Method
estimatePriceAndFee
()
src/dexs/turbos/turbos.ts:212
Method
evaluate
(data: DataPoint)
src/strategies/ride_the_external_trend.ts:60
Method
evaluate
(data: DataPoint)
src/strategies/ride_the_trend.ts:45
Method
evaluate
(data: DataPoint)
src/strategies/market_difference.ts:43
Function
getBalancesForCoinTypes
( provider: JsonRpcProvider, owner: SuiAddress, coinTypes: Set<string> )
src/utils/utils.ts:184
Function
getData
* Method for getting data about the pool. * @returns A Promise of type DataPoint representing data about the pool.
src/dexs/pool.ts:63
Method
includingFee
Combine this `TokenPrice` with a {@link Fee} computing the gross price including the fee.
src/types/token_price.ts:44
Method
invert
Get the price where `coinFrom` and `coinTo` are swapped.
src/types/token_price.ts:19
Function
krakenFetchTickers
(pairs: string[])
src/utils/ccxt-fetchTickers.ts:49
Function
kucoinFetchTickers
(pairs: string[])
src/utils/ccxt-fetchTickers.ts:54
Function
logStatus
* Report key statistics to the logger. * @param status A map of key-value pairs to report. * @protected
src/strategies/strategy.ts:35
Function
moveCallCoinZero
(txb: TransactionBlock, coinType: string)
src/utils/utils.ts:42
Function
okxFetchTickers
(pairs: string[])
src/utils/ccxt-fetchTickers.ts:59
Function
selectCoinObjectIdGreaterThanOrEqual
( coins: CoinAsset[], amount: bigint, exclude: ObjectId[] = [] )
src/utils/utils.ts:243
Function
sortByBalanceDes
(coins: CoinAsset[])
src/utils/utils.ts:317
Function
sqrtPriceX64ToPrice
( sqrtPriceX64: BN, decimalsA: number, decimalsB: number )
src/dexs/turbos/turbos.ts:246
Method
subscribes_to
()
src/strategies/ride_the_external_trend.ts:148
next →
1–100 of 103, ranked by callers