v0_15

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName name that will be used throughout the module
	ModuleName = "swap"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowedPool

type AllowedPool struct {
	TokenA string `json:"token_a" yaml:"token_a"`
	TokenB string `json:"token_b" yaml:"token_b"`
}

AllowedPool defines a tradable pool

type AllowedPools

type AllowedPools []AllowedPool

AllowedPools is a slice of AllowedPool

type GenesisState

type GenesisState struct {
	Params       Params `json:"params" yaml:"params"`
	PoolRecords  `json:"pool_records" yaml:"pool_records"`
	ShareRecords `json:"share_records" yaml:"share_records"`
}

GenesisState is the state that must be provided at genesis.

type Params

type Params struct {
	AllowedPools AllowedPools `json:"allowed_pools" yaml:"allowed_pools"`
	SwapFee      sdk.Dec      `json:"swap_fee" yaml:"swap_fee"`
}

Params are governance parameters for the swap module

type PoolRecord

type PoolRecord struct {
	// primary key
	PoolID      string      `json:"pool_id" yaml:"pool_id"`
	ReservesA   sdk.Coin    `json:"reserves_a" yaml:"reserves_a"`
	ReservesB   sdk.Coin    `json:"reserves_b" yaml:"reserves_b"`
	TotalShares sdkmath.Int `json:"total_shares" yaml:"total_shares"`
}

PoolRecord represents the state of a liquidity pool and is used to store the state of a denominated pool

type PoolRecords

type PoolRecords []PoolRecord

PoolRecords is a slice of PoolRecord

type ShareRecord

type ShareRecord struct {
	// primary key
	Depositor sdk.AccAddress `json:"depositor" yaml:"depositor"`
	// secondary / sort key
	PoolID      string      `json:"pool_id" yaml:"pool_id"`
	SharesOwned sdkmath.Int `json:"shares_owned" yaml:"shares_owned"`
}

ShareRecord stores the shares owned for a depositor and pool

type ShareRecords

type ShareRecords []ShareRecord

ShareRecords is a slice of ShareRecord

Jump to

Keyboard shortcuts

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