Documentation
¶
Index ¶
- type Protocol
- func (prot *Protocol) CheckNetwork() error
- func (p *Protocol) Token() string
- func (prot *Protocol) UpdateLending(underlyings ...string) error
- func (prot *Protocol) UpdateLendingPoolTokens() error
- func (prot *Protocol) UpdateLiquidity() error
- func (prot *Protocol) UpdateProtocolBasic(input ProtocolInput)
- type ProtocolInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Protocol ¶
type Protocol struct {
ProtocolBasic *model.ProtocolBasic
LiquidityPools []*liquidity.LiquidityPool
StakePools []*stake.StakePool
LendingPools []*lending.LendingPool
}
func New ¶
func New(input ProtocolInput) (*Protocol, error)
Create a new protocol, with basic info and empty pools.
func (*Protocol) CheckNetwork ¶ added in v0.2.1
func (*Protocol) UpdateLending ¶ added in v0.2.1
Update some of the protocol's lend pools apys by given underlying addresses.
If "underlyings" is empty, update all pools.
func (*Protocol) UpdateLendingPoolTokens ¶ added in v0.2.0
Update lending pool tokens.
func (*Protocol) UpdateLiquidity ¶ added in v0.2.1
func (*Protocol) UpdateProtocolBasic ¶ added in v0.2.0
func (prot *Protocol) UpdateProtocolBasic(input ProtocolInput)
Update the protocol basic info.
Will not update the empty params.
type ProtocolInput ¶ added in v0.2.0
type ProtocolInput struct {
Network string // Network of the protocol.
Name string // Name of the protocol, given by github.com/0xVanfer/ethaddr.
Client bind.ContractBackend // Contract backend to call the contracts. Can be nil, but most functions will not work properly.
Coingecko coingecko.Gecko // Coingecko. Can also input the key only.
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.