Documentation
¶
Index ¶
- type Float
- type Status
- type Vault
- func (vault *Vault) EqualizeVault(colPrice, targetRatio *big.Float) (newVault *Vault, err error)
- func (vault *Vault) GetChangePrices(colPrice, minRatio, maxRatio *big.Float) (minPrice, maxPrice *big.Float)
- func (vault *Vault) GetColToFree(colPrice, target *big.Float) *big.Float
- func (vault *Vault) GetDaiToDraw(colPrice, target *big.Float) *big.Float
- func (vault *Vault) GetMaxColToFree(colPrice *big.Float) *big.Float
- func (vault *Vault) GetMaxDaiToDraw(colPrice *big.Float) *big.Float
- func (vault *Vault) GetRatio(colPrice *big.Float) *big.Float
- func (vault *Vault) GetStatus(colPrice *big.Float) (status *Status, err error)
- func (vault *Vault) Log(colPrice, target *big.Float)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Float ¶
Float is for json purposes
func (*Float) MarshalJSON ¶
MarshalJSON transforms the Float in JSON number
type Status ¶
type Status struct { ID *Float DaiDebt *Float Locked *Float Price *Float Ratio *Float DaiNet *Float ColNet *Float }
Status represents the status of a Vault at a given price
type Vault ¶
type Vault struct { ID *big.Int BytesID [32]byte Debt *big.Float Col *big.Float LiquidationRatio *big.Float IlkID [32]byte Address common.Address }
Vault represents a Vault
func (*Vault) EqualizeVault ¶
EqualizeVault returns a new Vault equalized at targetRatio for a given price
func (*Vault) GetChangePrices ¶
func (vault *Vault) GetChangePrices(colPrice, minRatio, maxRatio *big.Float) (minPrice, maxPrice *big.Float)
GetChangePrices returns the prices (up and down) where this vault must be equalized
func (*Vault) GetColToFree ¶
GetColToFree returns the number of collateral to free to go to the target ratio
func (*Vault) GetDaiToDraw ¶
GetDaiToDraw returns the number of DAI to draw to go to the target ratio
func (*Vault) GetMaxColToFree ¶
GetMaxColToFree returns the maximum number of collateral to free Returns nil if there is no collateral
func (*Vault) GetMaxDaiToDraw ¶
GetMaxDaiToDraw returns the maximum number of DAI to draw
func (*Vault) GetRatio ¶
GetRatio returns the collateralization ratio of the vault at the actual collateral price Returns nil if there is no debt