if_pool

package
v0.0.0-...-29f768c Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2020 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DayRatePrecision = uint64(1800)
View Source
var DecimalMap = map[string]uint64{
	"DAI":  18,
	"USDT": 8,
	"USDC": 4,
}
View Source
var MarketAddrMap = map[string]string{
	"DAI":  "96cf88356123592835a2fa75068a242260be1791",
	"USDT": "c6f91c11d740d39943b99a6b1c6fd2b5f476e2a3",
	"USDC": "07a12c0a6bdce4df04ef4b2045d1b0fd63a56e25",
}
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)

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

func GetExpUserRate

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

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 RepayBorrowAll

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

func Supply

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

Types

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 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