Documentation ¶
Index ¶
- type CDP
- func (cdp *CDP) EqualizeCDP(ethPrice, targetRatio, pethRatio *big.Float) (newCDP *CDP, err error)
- func (cdp *CDP) GetChangePrices(ethPrice, minRatio, maxRatio, pethRatio *big.Float) (minPrice, maxPrice *big.Float)
- func (cdp *CDP) GetDaiToDraw(ethPrice, pethRatio, target *big.Float) *big.Float
- func (cdp *CDP) GetEthToFree(ethPrice, target *big.Float) *big.Float
- func (cdp *CDP) GetMaxDaiToDraw(ethPrice *big.Float, pethRatio *big.Float) *big.Float
- func (cdp *CDP) GetMaxEthToFree(ethPrice *big.Float) *big.Float
- func (cdp *CDP) GetMaxPethToFree(ethPrice *big.Float, pethRatio *big.Float) *big.Float
- func (cdp *CDP) GetPethToFree(ethPrice, pethRatio, target *big.Float) *big.Float
- func (cdp *CDP) GetRatio(ethPrice *big.Float, pethRatio *big.Float) *big.Float
- func (cdp *CDP) GetStatus(ethPrice, pethRatio, target *big.Float) (status *Status, err error)
- func (cdp *CDP) Log(ethPrice, pethRatio, target *big.Float)
- type Float
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CDP ¶
type CDP struct { ID int64 BytesID [32]byte DaiDebt *big.Float PethCol *big.Float EthCol *big.Float }
CDP represents a CDP
func (*CDP) EqualizeCDP ¶
EqualizeCDP returns a new CDP equalized at targetRatio for a given price
func (*CDP) GetChangePrices ¶
func (cdp *CDP) GetChangePrices(ethPrice, minRatio, maxRatio, pethRatio *big.Float) (minPrice, maxPrice *big.Float)
GetChangePrices returns the prices (up and down) where this CDP must be equalized
func (*CDP) GetDaiToDraw ¶
GetDaiToDraw returns the number of DAI to draw to go to the target ratio
func (*CDP) GetEthToFree ¶
GetEthToFree returns the number of eth to free to go to the target ratio
func (*CDP) GetMaxDaiToDraw ¶
GetMaxDaiToDraw returns the maximum number of DAI to draw
func (*CDP) GetMaxEthToFree ¶
GetMaxEthToFree returns the maximum number of eth to free
func (*CDP) GetMaxPethToFree ¶
GetMaxPethToFree returns the maximum number of peth to free
func (*CDP) GetPethToFree ¶
GetPethToFree returns the number of peth to free to go to the target ratio
func (*CDP) GetRatio ¶
GetRatio returns the collateralization ratio of the CDP at the actual price and Peth / Eth ratio
type Float ¶
Float is for json purposes
func (*Float) MarshalJSON ¶
MarshalJSON transforms the Float in JSON number