if_pool

package
v0.0.0-...-09f7846 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DayRatePrecision = uint64(600)
View Source
var DecimalMap = map[string]uint64{
	"DAI":  18,
	"USDT": 6,
	"USDC": 6,
}
View Source
var MarketAddrMap = map[string]string{
	"DAI":  "96cf88356123592835a2fa75068a242260be1791",
	"USDT": "c6f91c11d740d39943b99a6b1c6fd2b5f476e2a3",
	"USDC": "07a12c0a6bdce4df04ef4b2045d1b0fd63a56e25",
}
View Source
var MarketNames = map[int]string{
	0: "DAI",
	1: "USDT",
	2: "USDC",
}
View Source
var OscLevelMap = map[uint8]uint64{
	0: 5,
	1: 5,
	2: 4,
	3: 3,
	4: 8,
	5: 10,
}
View Source
var RatePrecision = uint64(10000)

Functions

func BorrowRateCacl

func BorrowRateCacl(account *goSdk.Account, marketName, configFlash, configIFPool string)

func BorrowWithNewAddr

func BorrowWithNewAddr(account *goSdk.Account, marketName, configFlash, configIfPool string, level uint64) string

足额借贷、根据leve的等级0-1 压1贷1.1、依次类推

func GetExpUserRate

func GetExpUserRate(interestDay, normal, grace, borrowAmount uint64, userRateLevel uint8) uint64

func GetGovPoolWeights

func GetGovPoolWeights(account *goSdk.Account, configFlash, configIfPool string) (*big.Int, *big.Int)

func GetIfPool

func GetIfPool(account *goSdk.Account, marketName, configFlash, configIfPool string) (*IFPool, *IFPool)

func GetIfTokenConfig

func GetIfTokenConfig(marketName string, cfg *if_config.IfConfig) *if_config.IfToken

func Insurance

func Insurance(account *goSdk.Account, marketName, configFlash, configIfPool string)

func Liquidate

func Liquidate(liquidate, account *goSdk.Account, marketName, configFlash, configIfPool string)

liquidate account borrow

func NewMarkets

func NewMarkets(cfg *config.Config, account *ontSDK.Account, sdk *ontSDK.OntologySdk, makretAddr string) (*ftoken.FlashToken, error)

func RedeemAllInsurance

func RedeemAllInsurance(account *goSdk.Account, marketName, configFlash, configIfPool string)

func RedeemAllSupply

func RedeemAllSupply(account *goSdk.Account, marketName, configFlash, configIfPool string)

func ReduceCollateralAll

func ReduceCollateralAll(account *goSdk.Account, marketName, configFlash, configIfPool string)

func RepayBorrowAll

func RepayBorrowAll(account *goSdk.Account, marketName, configFlash, configIfPool string) string

func Supply

func Supply(account *goSdk.Account, marketName, configFlash, configIfPool string)

Types

type AllPoolWeight

type AllPoolWeight struct {
	FlashPoolWeights PoolWeight
	IFPoolWeights    PoolWeight
}

func GetPoolWeights

func GetPoolWeights(account *goSdk.Account, configFlash, configIfPool string) *AllPoolWeight

type IFPool

type IFPool struct {
	IfCtrl         *if_ctrl.Comptroller
	IfBorrow       *if_borrow.IfBorrowPool
	IfToken        *iftoken.IFToken
	IIToken        *iitoken.IIToken
	IfOracle       *if_oracle.IfOracle
	MarketDecimal  uint64
	UnderlyingAddr string
}

func NewIFPool

func NewIFPool(marketName string, ifCfg *if_config.IfConfig, signer *ontSDK.Account) *IFPool

type PoolWeight

type PoolWeight struct {
	TotalWeight   *big.Int
	MarketWeights map[string]*big.Int
}

type UserRateDay

type UserRateDay struct {
	NormalDay uint64 //正常计息天数
	GraceDay  uint64 // 宽限期天数
	PunishDay uint64 // 宽限期天数
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL