Documentation
¶
Index ¶
- type Calculator
- func (c *Calculator) BalanceFromPrincipal(principal *big.Int, asset string) *big.Int
- func (c *Calculator) BalanceFromValue(balance *big.Int, asset string) *big.Int
- func (c *Calculator) PrincipalFromBalance(balance *big.Int, asset string) *big.Int
- func (c *Calculator) PrincipalFromValue(value *big.Int, asset string) *big.Int
- func (c *Calculator) ValueFromBalance(value *big.Int, asset string) *big.Int
- func (c *Calculator) ValueFromPrincipal(principal *big.Int, asset string) *big.Int
- type Health
- type Service
- func (s *Service) AggregatedBalances(user UserBalancer, assets assetManager, prices priceProvider) (*big.Int, *big.Int)
- func (s *Service) CalculateHealth(user UserBalancer, assets assetManager, prices priceProvider) *Health
- func (s *Service) CalculateLiquidationData(user UserBalancer, assets assetManager, prices priceProvider) (health *Health, liquidationAmount, collateralAmount *big.Int, ok bool)
- func (s *Service) CalculateMaximumWithdrawAmount(user UserBalancer, assets assetManager, prices priceProvider, asset string) *big.Int
- func (s *Service) CalculateUserSCAddress(userAddress *address.Address) (*address.Address, error)
- func (s *Service) GetAvailableToBorrow(user UserBalancer, assets assetManager, prices priceProvider) *big.Int
- func (s *Service) PredictHealthFactor(user UserBalancer, assets assetManager, prices priceProvider, asset string, ...) float64
- type UserBalancer
- type UserSC
- func (u *UserSC) Address() *address.Address
- func (u *UserSC) BackupCell1() *cell.Cell
- func (u *UserSC) BackupCell2() *cell.Cell
- func (u *UserSC) Balance(asset string, assetData *asset.Data, applyDust bool, assetConfig *asset.Config) *big.Int
- func (u *UserSC) ChangePrincipal(asset string, amount *big.Int) UserBalancer
- func (u *UserSC) CheckNotInDebtAtAll() bool
- func (u *UserSC) CodeVersion() uint64
- func (u *UserSC) MasterAddress() *address.Address
- func (u *UserSC) Principal(asset string) *big.Int
- func (u *UserSC) Principals() map[string]*big.Int
- func (u *UserSC) Rewards() *cell.Dictionary
- func (u *UserSC) SetAccData(userData *cell.Cell) (UserBalancer, error)
- func (u *UserSC) SetData(userData *ton.ExecutionResult) (UserBalancer, error)
- func (u *UserSC) SetPrincipals(principals map[string]*big.Int) UserBalancer
- func (u *UserSC) UserAddress() *address.Address
- func (u *UserSC) UserState() int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Calculator ¶
type Calculator struct {
// contains filtered or unexported fields
}
func NewCalculator ¶
func NewCalculator(assets assetManager, prices priceProvider, config *config.Config) *Calculator
func (*Calculator) BalanceFromPrincipal ¶
func (*Calculator) BalanceFromValue ¶
func (*Calculator) PrincipalFromBalance ¶
func (*Calculator) PrincipalFromValue ¶
func (*Calculator) ValueFromBalance ¶
func (*Calculator) ValueFromPrincipal ¶
type Health ¶
type Health struct {
GreatestCollateralValue *big.Int
GreatestCollateralAsset *big.Int
GreatestLoanValue *big.Int
GreatestLoanAsset *big.Int
TotalDebt *big.Int
TotalLimit *big.Int
TotalSupply *big.Int
}
func (*Health) IsLiquidatable ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) AggregatedBalances ¶
func (*Service) CalculateHealth ¶
func (s *Service) CalculateHealth(user UserBalancer, assets assetManager, prices priceProvider) *Health
func (*Service) CalculateLiquidationData ¶
func (*Service) CalculateMaximumWithdrawAmount ¶
func (s *Service) CalculateMaximumWithdrawAmount(user UserBalancer, assets assetManager, prices priceProvider, asset string) *big.Int
func (*Service) CalculateUserSCAddress ¶
func (*Service) GetAvailableToBorrow ¶
func (s *Service) GetAvailableToBorrow(user UserBalancer, assets assetManager, prices priceProvider) *big.Int
func (*Service) PredictHealthFactor ¶
type UserBalancer ¶
type UserSC ¶
type UserSC struct {
// contains filtered or unexported fields
}
func (*UserSC) BackupCell1 ¶
func (*UserSC) BackupCell2 ¶
func (*UserSC) ChangePrincipal ¶
func (u *UserSC) ChangePrincipal(asset string, amount *big.Int) UserBalancer
func (*UserSC) CheckNotInDebtAtAll ¶
func (*UserSC) CodeVersion ¶
func (*UserSC) MasterAddress ¶
func (*UserSC) Rewards ¶
func (u *UserSC) Rewards() *cell.Dictionary
func (*UserSC) SetAccData ¶
func (u *UserSC) SetAccData(userData *cell.Cell) (UserBalancer, error)
func (*UserSC) SetData ¶
func (u *UserSC) SetData(userData *ton.ExecutionResult) (UserBalancer, error)
func (*UserSC) SetPrincipals ¶
func (u *UserSC) SetPrincipals(principals map[string]*big.Int) UserBalancer
func (*UserSC) UserAddress ¶
Click to show internal directories.
Click to hide internal directories.