Documentation ¶
Index ¶
- type PairPrice
- type ParseRouterMethodAndParams
- type PurchaseInfo
- type ReadyTrade
- type TokenPair
- type TradeSend
- type TransactionData
- type UserTask
- func (s *UserTask) AnalyzeTransaction(t TransactionData, client *ethclient.Client, rds *redis.Client, ...) (*ReadyTrade, error)
- func (s *UserTask) SellAllTransaction(defiAddress common.Address, rdb *redis.Client, client *ethclient.Client) ([]*ReadyTrade, error)
- func (s *UserTask) StopWinTransaction(price *big.Float, purchase PurchaseInfo, token *token.Token) (*ReadyTrade, error)
- func (ut *UserTask) UnmarshalJSON(data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ParseRouterMethodAndParams ¶ added in v1.1.4
type ParseRouterMethodAndParams struct { Method *abi.Method `json:"method"` Params []interface{} `json:"params"` }
func GetMethodsAndParamsFromInputData ¶ added in v1.1.4
func GetMethodsAndParamsFromInputData(stringData string, routerVersion int64, swap string) (*ParseRouterMethodAndParams, error)
type PurchaseInfo ¶ added in v0.1.8
type PurchaseInfo struct { UserTaskId string `json:"user_task_id"` TokenAddress string `json:"token_address"` BaseAddress string `json:"base_address"` DefiAddress string `json:"defi_address"` ChainId string `json:"chain_id"` PurchasePrice string `json:"purchase_price"` Symbol string `json:"symbol"` Decimals int64 `json:"decimals"` 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 string `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 UserTask ¶ added in v1.0.2
type UserTask struct { ID int64 `json:"id"` UserId int64 `json:"user_id"` Name string `json:"name"` ChainId *big.Int `json:"chain_id"` FollowAddress common.Address `json:"follow_address"` BuyType int64 `json:"buy_type"` Amount *big.Int `json:"amount"` MinAmountAction int64 `json:"min_amount_action"` MinAmount *big.Int `json:"min_amount"` MaxAmountAction int64 `json:"max_amount_action"` MaxAmount *big.Int `json:"max_amount"` StopWin int64 `json:"stop_win"` StopWinMin int64 `json:"stop_win_min"` StopLost int64 `json:"stop_lost"` StopLostMin int64 `json:"stop_lost_min"` StopAt int64 `json:"stop_at"` IsSellAll int64 `json:"is_sell_all"` IsSell int64 `json:"is_sell"` AvoidHoneyPot int64 `json:"avoid_honey_pot"` IsZero int64 `json:"is_zero"` PreventSandwichAttacks int64 `json:"prevent_sandwich_attacks"` PrivateKey string `json:"private_key"` IsVip int64 `json:"is_vip"` }
用户配置
func GetUserTaskById ¶ added in v1.0.2
func MapToUserTask ¶ added in v1.0.2
func (*UserTask) AnalyzeTransaction ¶ added in v1.0.2
func (s *UserTask) AnalyzeTransaction(t TransactionData, client *ethclient.Client, rds *redis.Client, RouterV2Address common.Address) (*ReadyTrade, error)
分析交易
func (*UserTask) SellAllTransaction ¶ added in v1.0.2
func (s *UserTask) SellAllTransaction(defiAddress common.Address, rdb *redis.Client, client *ethclient.Client) ([]*ReadyTrade, error)
全部卖出- 停止跟单
func (*UserTask) StopWinTransaction ¶ added in v1.0.2
func (s *UserTask) StopWinTransaction(price *big.Float, purchase PurchaseInfo, token *token.Token) (*ReadyTrade, error)
止盈交易 price 现在价格 purchase 购买信息 token 要卖出的代币
func (*UserTask) UnmarshalJSON ¶ added in v1.0.2
Click to show internal directories.
Click to hide internal directories.