Documentation ¶
Index ¶
- type PairPrice
- type PurchaseInfo
- type ReadyTrade
- type TokenPair
- type TradeSend
- type TransactionData
- type UserBotSetting
- func (s *UserBotSetting) AnalyzeTransaction(t TransactionData, client *ethclient.Client, rds *redis.Client) (*ReadyTrade, error)
- func (s *UserBotSetting) SellAllTransaction(rdb *redis.Client, client *ethclient.Client) ([]*ReadyTrade, error)
- func (s *UserBotSetting) StopWinTransaction(price *big.Float, purchase PurchaseInfo, token *token.Token) (*ReadyTrade, error)
- func (s *UserBotSetting) UnmarshalJSON(data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PurchaseInfo ¶ added in v0.1.8
type PurchaseInfo struct { UserBotSettingID string `json:"user_bot_setting_id"` TokenAddress string `json:"token_address"` BaseAddress string `json:"base_address"` PurchasePrice string `json:"purchase_price"` Time int64 `json:"time"` }
func GetUserPurchasesByTokenPair ¶ added in v0.1.11
func GetUserPurchasesByTokenPair(rdb *redis.Client, tokenAddress, baseAddress string) ([]PurchaseInfo, error)
获取某个代币对下的所有买入信息
func (*PurchaseInfo) HasPurchasedToken ¶ added in v0.1.12
func (purchase *PurchaseInfo) HasPurchasedToken(rdb *redis.Client) (bool, error)
func (*PurchaseInfo) RemovePurchaseInfoFromRedis ¶ added in v0.1.12
func (purchase *PurchaseInfo) RemovePurchaseInfoFromRedis(rdb *redis.Client) error
删除买入信息
func (*PurchaseInfo) SavePurchaseInfoToRedis ¶ added in v0.1.8
func (purchase *PurchaseInfo) SavePurchaseInfoToRedis(rdb *redis.Client) error
第一次买入,存入 redis
type ReadyTrade ¶ added in v0.1.4
type ReadyTrade struct { Token0 string `json:"token0"` Token1 string `json:"token1"` DefiAddress string `json:"defi_address"` ChainId int64 `json:"chain_id"` Amount string `json:"amount"` Account string `json:"account"` IsBuy bool `json:"is_buy"` SettingId string `json:"setting_id"` Type int8 `json:"type"` // 1-正常分析(百分比买卖) 2-止盈分析(涨幅超过用户设置的全部卖出) 3-停止运行全部卖出 }
func (*ReadyTrade) Send ¶ added in v0.1.12
func (r *ReadyTrade) Send(rdb *redis.Client, ec *ethclient.Client) (*types.Transaction, error)
type TokenPair ¶ added in v0.1.10
func GetAllDistinctTokenPairs ¶ added in v0.1.10
获取平台所有已买入的代币对
func GetAllPurchasedTokenPairsForUser ¶ added in v0.1.16
func GetAllPurchasedTokenPairsForUser(rdb *redis.Client, userBotSettingID string) ([]TokenPair, error)
获取用户的所有币对儿
type TransactionData ¶
type TransactionData struct { ChainId *big.Int Hash common.Hash From common.Address To common.Address Value *big.Int Gas uint64 GasPrice *big.Int Data string BlockNumber *big.Int }
交易
func (TransactionData) MarshalJSON ¶
func (t TransactionData) MarshalJSON() ([]byte, error)
func (*TransactionData) ToMessage ¶
func (t *TransactionData) ToMessage() string
func (*TransactionData) UnmarshalJSON ¶
func (t *TransactionData) UnmarshalJSON(data []byte) error
type UserBotSetting ¶ added in v0.1.2
type UserBotSetting struct { ID int64 `json:"id"` WhaleAddress common.Address `json:"whale_address"` WhaleName string `json:"whale_name"` ChainID *big.Int `json:"chain_id"` ListenBase string `json:"listen_base"` MinWethAmount *big.Int `json:"min_weth_amount"` MinBusdAmount *big.Int `json:"min_busd_amount"` MinUsdtAmount *big.Int `json:"min_usdt_amount"` MinUsdcAmount *big.Int `json:"min_usdc_amount"` SellAllWethLine *big.Int `json:"sell_all_weth_line"` SellAllBusdLine *big.Int `json:"sell_all_busd_line"` SellAllUsdtLine *big.Int `json:"sell_all_usdt_line"` SellAllUsdcLine *big.Int `json:"sell_all_usdc_line"` StopAt int64 `json:"stop_at"` IsSellAll int8 `json:"is_sell_all"` StopWin int64 `json:"stop_win"` StopWinMin int64 `json:"stop_win_min"` AvoidHoneyPot int8 `json:"avoid_honey_pot"` IsZero int8 `json:"is_zero"` PrivateKey string `json:"private_key"` }
用户配置
func GetUserBotSettingById ¶ added in v0.1.11
func GetUserBotSettingById(id string, rds *redis.Client) (*UserBotSetting, error)
func MapToUserBotSetting ¶ added in v0.1.4
func MapToUserBotSetting(setting map[string]string) (*UserBotSetting, error)
func (*UserBotSetting) AnalyzeTransaction ¶ added in v0.1.4
func (s *UserBotSetting) AnalyzeTransaction(t TransactionData, client *ethclient.Client, rds *redis.Client) (*ReadyTrade, error)
分析交易
func (*UserBotSetting) SellAllTransaction ¶ added in v0.1.16
func (s *UserBotSetting) SellAllTransaction(rdb *redis.Client, client *ethclient.Client) ([]*ReadyTrade, error)
全部卖出- 停止跟单
func (*UserBotSetting) StopWinTransaction ¶ added in v0.1.12
func (s *UserBotSetting) StopWinTransaction(price *big.Float, purchase PurchaseInfo, token *token.Token) (*ReadyTrade, error)
止盈交易 price 现在价格 purchase 购买信息 token 要卖出的代币
func (*UserBotSetting) UnmarshalJSON ¶ added in v0.1.2
func (s *UserBotSetting) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.