Documentation ¶
Overview ¶
nolint:deadcode unused noalias
Index ¶
- Variables
- func NewQuerier(keeper Keeper) sdk.Querier
- func ParamKeyTable() params.KeyTable
- type Keeper
- func (k Keeper) ApplySwapToPool(ctx sdk.Context, offerCoin sdk.Coin, askCoin sdk.DecCoin) sdk.Error
- func (k Keeper) BasePool(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) Codespace() sdk.CodespaceType
- func (k Keeper) ComputeInternalSwap(ctx sdk.Context, offerCoin sdk.DecCoin, askDenom string) (sdk.DecCoin, sdk.Error)
- func (k Keeper) ComputeSwap(ctx sdk.Context, offerCoin sdk.Coin, askDenom string) (retDecCoin sdk.DecCoin, spread sdk.Dec, err sdk.Error)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetTerraPoolDelta(ctx sdk.Context) (delta sdk.Dec)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MinSpread(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) PoolRecoveryPeriod(ctx sdk.Context) (res int64)
- func (k Keeper) ReplenishPools(ctx sdk.Context)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetTerraPoolDelta(ctx sdk.Context, delta sdk.Dec)
- func (k Keeper) TobinTax(ctx sdk.Context) (res sdk.Dec)
- type TestInput
Constants ¶
This section is empty.
Variables ¶
var ( PubKeys = []crypto.PubKey{ secp256k1.GenPrivKey().PubKey(), secp256k1.GenPrivKey().PubKey(), secp256k1.GenPrivKey().PubKey(), } Addrs = []sdk.AccAddress{ sdk.AccAddress(PubKeys[0].Address()), sdk.AccAddress(PubKeys[1].Address()), sdk.AccAddress(PubKeys[2].Address()), } ValAddrs = []sdk.ValAddress{ sdk.ValAddress(PubKeys[0].Address()), sdk.ValAddress(PubKeys[1].Address()), sdk.ValAddress(PubKeys[2].Address()), } InitTokens = sdk.TokensFromConsensusPower(200) InitCoins = sdk.NewCoins(sdk.NewCoin(core.MicroLunaDenom, InitTokens)) )
Functions ¶
func NewQuerier ¶
NewQuerier is the module level router for state queries
Types ¶
type Keeper ¶
type Keeper struct { SupplyKeeper types.SupplyKeeper // contains filtered or unexported fields }
Keeper of the oracle store
func NewKeeper ¶
func NewKeeper(cdc *codec.Codec, storeKey sdk.StoreKey, paramspace params.Subspace, oracleKeeper types.OracleKeeper, supplyKeeper types.SupplyKeeper, codespace sdk.CodespaceType) Keeper
NewKeeper constructs a new keeper for oracle
func (Keeper) ApplySwapToPool ¶
ApplySwapToPool updates each pool with offerCoin and askCoin taken from swap operation, OfferPool = OfferPool + offerAmt (Fills the swap pool with offerAmt) AskPool = AskPool - askAmt (Uses askAmt from the swap pool)
func (Keeper) BasePool ¶
BasePool is Terra liquidity pool(usdr unit) which will be made available per PoolRecoveryPeriod
func (Keeper) Codespace ¶
func (k Keeper) Codespace() sdk.CodespaceType
Codespace returns a codespace of keeper
func (Keeper) ComputeInternalSwap ¶
func (k Keeper) ComputeInternalSwap(ctx sdk.Context, offerCoin sdk.DecCoin, askDenom string) (sdk.DecCoin, sdk.Error)
ComputeInternalSwap returns the amount of asked DecCoin should be returned for a given offerCoin at the effective exchange rate registered with the oracle. Different from ComputeSwap, ComputeInternalSwap does not charge a spread as its use is system internal.
func (Keeper) ComputeSwap ¶
func (k Keeper) ComputeSwap(ctx sdk.Context, offerCoin sdk.Coin, askDenom string) (retDecCoin sdk.DecCoin, spread sdk.Dec, err sdk.Error)
ComputeSwap returns the amount of asked coins should be returned for a given offerCoin at the effective exchange rate registered with the oracle. Returns an Error if the swap is recursive, or the coins to be traded are unknown by the oracle, or the amount to trade is too small.
func (Keeper) GetTerraPoolDelta ¶
GetTerraPoolDelta returns the gap between the TerraPool and the BasePool
func (Keeper) PoolRecoveryPeriod ¶
PoolRecoveryPeriod is the period required to recover Terra&Luna Pools to the BasePool
func (Keeper) ReplenishPools ¶
ReplenishPools replenishes each pool(Terra,Luna) to BasePool
func (Keeper) SetTerraPoolDelta ¶
SetTerraPoolDelta updates TerraPoolDelta which is gap between the TerraPool and the BasePool