anchor

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Anchor

type Anchor struct {
	Market       *Market
	Overseer     *Overseer
	PriceOracle  *PriceOracle
	BLUNACustody *BLUNACustody
}

func NewAnchor

func NewAnchor(querier *terra.Querier) (*Anchor, error)

func (*Anchor) NewProvideBLUNAMessages

func (a *Anchor) NewProvideBLUNAMessages(sender cosmos.AccAddress, amount decimal.Decimal) ([]cosmos.Msg, error)

func (*Anchor) NewWithdrawBLUNAMessages

func (a *Anchor) NewWithdrawBLUNAMessages(sender cosmos.AccAddress, amount decimal.Decimal) ([]cosmos.Msg, error)

type BLUNACustody

type BLUNACustody struct {
	*terra.Contract
}

func NewBLUNACustody

func NewBLUNACustody(querier *terra.Querier) (*BLUNACustody, error)

func (*BLUNACustody) NewDepositCollateralMessage

func (c *BLUNACustody) NewDepositCollateralMessage(sender cosmos.AccAddress, amount decimal.Decimal) (cosmos.Msg, error)

func (*BLUNACustody) NewWithdrawCollateralMessage

func (c *BLUNACustody) NewWithdrawCollateralMessage(sender cosmos.AccAddress, amount decimal.Decimal) (cosmos.Msg, error)

type BorrowerInfo

type BorrowerInfo struct {
	InterestIndex  decimal.Decimal
	RewardIndex    decimal.Decimal
	LoanAmount     decimal.Decimal
	PendingRewards decimal.Decimal
}

type Market

type Market struct {
	*terra.Contract
}

func NewMarket

func NewMarket(querier *terra.Querier) (*Market, error)

func (Market) BorrowerInfo

func (m Market) BorrowerInfo(ctx context.Context, borrower cosmos.AccAddress) (BorrowerInfo, error)

func (Market) NewBorrowStableMessage

func (m Market) NewBorrowStableMessage(sender cosmos.AccAddress, amount decimal.Decimal) (cosmos.Msg, error)

func (Market) NewClaimRewardsMessage

func (m Market) NewClaimRewardsMessage(sender cosmos.AccAddress) (cosmos.Msg, error)

func (Market) NewDepositUSTMessage

func (m Market) NewDepositUSTMessage(sender cosmos.AccAddress, amount decimal.Decimal) (cosmos.Msg, error)

func (Market) NewRedeemAUSTMessage

func (m Market) NewRedeemAUSTMessage(sender cosmos.AccAddress, amount decimal.Decimal) (cosmos.Msg, error)

func (Market) NewRepayStableMessage

func (m Market) NewRepayStableMessage(sender cosmos.AccAddress, amount decimal.Decimal) (cosmos.Msg, error)

type Overseer

type Overseer struct {
	*terra.Contract
}

func NewOverseer

func NewOverseer(querier *terra.Querier) (*Overseer, error)

func (*Overseer) BorrowLimit

func (o *Overseer) BorrowLimit(ctx context.Context, borrower cosmos.AccAddress) (decimal.Decimal, error)

func (*Overseer) Collateral

func (o *Overseer) Collateral(ctx context.Context, borrower cosmos.AccAddress, token terra.Token) (decimal.Decimal, error)

func (*Overseer) Collaterals

func (o *Overseer) Collaterals(ctx context.Context, borrower cosmos.AccAddress) (map[string]decimal.Decimal, error)

func (*Overseer) NewLockCollateralMessage

func (o *Overseer) NewLockCollateralMessage(sender cosmos.AccAddress, token terra.Cw20Token, amount decimal.Decimal) (cosmos.Msg, error)

func (*Overseer) NewUnlockCollateralMessage

func (o *Overseer) NewUnlockCollateralMessage(sender cosmos.AccAddress, token terra.Cw20Token, amount decimal.Decimal) (cosmos.Msg, error)

type PriceOracle

type PriceOracle struct {
	*terra.Contract
}

func NewPriceOracle

func NewPriceOracle(querier *terra.Querier) (*PriceOracle, error)

func (*PriceOracle) Price

func (o *PriceOracle) Price(ctx context.Context, token terra.Token) (decimal.Decimal, error)

func (*PriceOracle) Prices

func (o *PriceOracle) Prices(ctx context.Context) (map[string]decimal.Decimal, error)

Jump to

Keyboard shortcuts

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