Documentation ¶
Index ¶
- Constants
- Variables
- func CalcAPY(contractAddr common.Address) (*big.Int, error)
- func CalcCurrentPriceOfStaking(poolAddr, userAddr common.Address) (*big.Int, *big.Float, error)
- func CalcInitPriceOfStaking(opsRecord []*StakingOps) (*big.Float, error)
- func GetAPYOfPools()
- func GetTotalSupplyAtHeight(poolAddr *common.Address, height *big.Int) (*big.Int, error)
- func UpdatePoolInfoDaemon(ctx context.Context)
- func UpdatePoolInfoEveryDay() error
- type APYOfPool
- type HarvestFarmInvest
- func (h *HarvestFarmInvest) ClaimReward(userAddr common.Address, pool common.Address) (*claimRewardResult, error)
- func (h *HarvestFarmInvest) Exit(user common.Address, pool common.Address) (*exitResult, error)
- func (h *HarvestFarmInvest) Stake(value *big.Int, amount *big.Int, userAddr common.Address, vault common.Address) (*stakeResult, error)
- func (h *HarvestFarmInvest) Withdraw(userAddr common.Address, pool common.Address, amount *big.Int) (*withdrawResult, error)
- type HarvestFarmReward
- func (r *HarvestFarmReward) ClaimReward(user common.Address, pool common.Address) (*claimRewardResult, error)
- func (r *HarvestFarmReward) Exit(userAddr common.Address, pool common.Address) (*exitResult, error)
- func (r *HarvestFarmReward) Stake(value *big.Int, amount *big.Int, userAddr common.Address, pool common.Address) (*stakeResult, error)
- func (r *HarvestFarmReward) Withdraw(userAddr common.Address, pool common.Address, amount *big.Int) (*withdrawResult, error)
- type IPoolStakingAgent
- type InfoOfPool
- type PoolInfoInMChif
- type Reserves
- type StakingOps
- type Sushiswap
- func (s *Sushiswap) ClaimReward(userAddr common.Address, pool common.Address) (*claimRewardResult, error)
- func (s *Sushiswap) Exit(userAddr common.Address, pool common.Address) (*exitResult, error)
- func (s *Sushiswap) Stake(value *big.Int, amount *big.Int, userAddr common.Address, pool common.Address) (*stakeResult, error)
- func (s *Sushiswap) Withdraw(userAddr common.Address, pool common.Address, amount *big.Int) (*withdrawResult, error)
- type UniswapV2
- func (u *UniswapV2) ClaimReward(userAddr common.Address, pool common.Address) (*claimRewardResult, error)
- func (u *UniswapV2) Exit(userAddr common.Address, pool common.Address) (*exitResult, error)
- func (u *UniswapV2) Stake(value *big.Int, amount *big.Int, userAddr common.Address, pool common.Address) (*stakeResult, error)
- func (u *UniswapV2) Withdraw(userAddr common.Address, pool common.Address, amount *big.Int) (*withdrawResult, error)
Constants ¶
View Source
const (
HarvestFarmInvestContract = "0x72c8757145bd5a39e4435461B8813d623EC1B5F4"
)
Variables ¶
View Source
var APYOfPoolInfo = make(map[common.Address]*APYOfPool)
View Source
var (
SushiswapStakingPool = common.HexToAddress("0xc2EdaD668740f1aA35E4D8f227fB8E17dcA888Cd")
)
View Source
var WETHAddr = common.HexToAddress("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2")
Functions ¶
func CalcCurrentPriceOfStaking ¶
CalcCurrentPriceOfStaking return user stakedAmount & stakedValue
func CalcInitPriceOfStaking ¶
func CalcInitPriceOfStaking(opsRecord []*StakingOps) (*big.Float, error)
func GetAPYOfPools ¶
func GetAPYOfPools()
func GetTotalSupplyAtHeight ¶
func UpdatePoolInfoDaemon ¶
func UpdatePoolInfoEveryDay ¶
func UpdatePoolInfoEveryDay() error
Types ¶
type HarvestFarmInvest ¶
type HarvestFarmInvest struct{}
func (*HarvestFarmInvest) ClaimReward ¶
type HarvestFarmReward ¶
type HarvestFarmReward struct{}
func (*HarvestFarmReward) ClaimReward ¶
type IPoolStakingAgent ¶
type IPoolStakingAgent interface { Stake(value *big.Int, amount *big.Int, userAddr common.Address, pool common.Address) (*stakeResult, error) ClaimReward(userAddr common.Address, pool common.Address) (*claimRewardResult, error) Withdraw(userAddr common.Address, pool common.Address, amount *big.Int) (*withdrawResult, error) Exit(userAddr common.Address, pool common.Address) (*exitResult, error) }
func New ¶
func New(dex string) (IPoolStakingAgent, error)
type InfoOfPool ¶
type InfoOfPool struct { LPTotalSupply *big.Int Reserve0 *big.Int Reserve1 *big.Int BalanceOfMasterChif *big.Int Token0Addr common.Address Token1Addr common.Address }
func GetInfoFromLPPool ¶
func GetInfoFromLPPool(lpContract common.Address) (*InfoOfPool, error)
type PoolInfoInMChif ¶
type StakingOps ¶
type StakingOps struct { Platform string Action string // deposit || withdraw Amount *big.Int Timestamp int64 BlockHeight string LPSymbol string LPAddr common.Address }
func GetUserOpsInMasterChif ¶
func GetUserOpsInMasterChif(userAddr common.Address) ([]*StakingOps, error)
get user deposit withdraw history in SushiMasterChif
type Sushiswap ¶
type Sushiswap struct{}
func (*Sushiswap) ClaimReward ¶
Click to show internal directories.
Click to hide internal directories.