sdk

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 31 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeMaxDTECap

func ComputeMaxDTECap(agentValue *big.Int, principal *big.Int) *big.Int

func ComputeMaxDTICap

func ComputeMaxDTICap(epochRate *big.Int, edr *big.Int, agentExistingPrincipal *big.Int, maxDTI *big.Int) *big.Int

func ComputeMaxLTVCap

func ComputeMaxLTVCap(liquidationValue *big.Int, principal *big.Int, recoveryRate *big.Int) *big.Int

ComputeMaxLTVCap returns the max borrowable amount from the agent's liquidation value maxBorrow = (-1*((LTV*(LV - P*RR)/(LTV * RR) - 1)) - P you can also use equity instead of liquidation value to compute this: maxBorrow = (-1*((LTV*(E*RR)/(LTV * RR) - 1)) - P recovery rate % is expressed as wad math whole number - 1e18 is 100%, 9e17 is 90%, etc

func Init

func Init(
	ctx context.Context,
	sdk *types.PoolsSDK,
	agentPolice common.Address,
	minerRegistry common.Address,
	router common.Address,
	poolRegistry common.Address,
	agentFactory common.Address,
	iFIL common.Address,
	wFIL common.Address,
	infinityPool common.Address,
	simpleRamp common.Address,
	adoAddr string,
	adoNamespace string,
	dialAddr string,
	token string,
) error

func InitFEVMConnection

func InitFEVMConnection(
	agentPolice common.Address,
	minerRegistry common.Address,
	router common.Address,
	poolRegistry common.Address,
	agentFactory common.Address,
	iFIL common.Address,
	wFIL common.Address,
	infinityPool common.Address,
	simpleRamp common.Address,
	adoAddr string,
	adoNamespace string,
	dialAddr string,
	token string,
	chainID *big.Int,
) *fevmConnection

func LazyInit

func LazyInit(
	ctx context.Context,
	sdk *types.PoolsSDK,
	router common.Address,
	adoAddr string,
	adoNamespace string,
	dialAddr string,
	token string,
) error

func MaxBorrowFromAgentData

func MaxBorrowFromAgentData(agentData *vc.AgentData, rate *big.Int, liquidationValue *big.Int, recoveryRate *big.Int) *big.Int

func New

func New(
	ctx context.Context,
	chainID *big.Int,
	extern types.Extern,
) (types.PoolsSDK, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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