proto - spot
Table of Contents
Top
nibiru/spot/v1/event.proto
EventAssetsSwapped
EventPoolCreated
EventPoolExited
EventPoolJoined
Top
nibiru/spot/v1/genesis.proto
GenesisState
GenesisState defines the spot module's genesis state.
Field | Type | Label | Description |
params | Params | | params defines all the parameters of the module. |
pools | Pool | repeated | pools defines all the pools of the module. |
Top
nibiru/spot/v1/params.proto
Params
Params defines the parameters for the module.
Field | Type | Label | Description |
starting_pool_number | uint64 | | The start pool number, i.e. the first pool number that isn't taken yet. |
pool_creation_fee | cosmos.base.v1beta1.Coin | repeated | The cost of creating a pool, taken from the pool creator's account. |
whitelisted_asset | string | repeated | The assets that can be used to create liquidity pools |
Top
nibiru/spot/v1/pool.proto
Pool
Field | Type | Label | Description |
id | uint64 | | The pool id. |
address | string | | The pool account address. |
pool_params | PoolParams | | Fees and other pool-specific parameters. |
pool_assets | PoolAsset | repeated | These are assumed to be sorted by denomiation. They contain the pool asset and the information about the weight |
total_weight | string | | sum of all non-normalized pool weights |
total_shares | cosmos.base.v1beta1.Coin | | sum of all LP tokens sent out |
PoolAsset
Which assets the pool contains.
Field | Type | Label | Description |
token | cosmos.base.v1beta1.Coin | | Coins we are talking about, the denomination must be unique amongst all PoolAssets for this pool. |
weight | string | | Weight that is not normalized. This weight must be less than 2^50 |
PoolParams
Configuration parameters for the pool.
Field | Type | Label | Description |
swap_fee | string | | |
exit_fee | string | | |
A | string | | Amplification Parameter (A): Larger value of A make the curve better resemble a straight line in the center (when pool is near balance). Highly volatile assets should use a lower value, while assets that are closer together may be best with a higher value. This is only used if the pool_type is set to 1 (stableswap) |
pool_type | PoolType | | |
PoolType
balancer
: Balancer are pools defined by the equation xy=k, extended by
the weighs introduced by Balancer. stableswap
: Stableswap pools are defined by a combination of
constant-product and constant-sum pool
Name | Number | Description |
BALANCER | 0 | |
STABLESWAP | 1 | |
Top
nibiru/spot/v1/query.proto
QueryExitExactAmountInRequest
Field | Type | Label | Description |
pool_id | uint64 | | |
pool_shares_in | string | | amount of pool shares to return to pool |
QueryExitExactAmountInResponse
QueryExitExactAmountOutRequest
Field | Type | Label | Description |
pool_id | uint64 | | |
QueryExitExactAmountOutResponse
QueryJoinExactAmountInRequest
QueryJoinExactAmountInResponse
Field | Type | Label | Description |
pool_shares_out | string | | amount of pool shares returned to user after join |
rem_coins | cosmos.base.v1beta1.Coin | repeated | coins remaining after pool join |
QueryJoinExactAmountOutRequest
Field | Type | Label | Description |
pool_id | uint64 | | |
QueryJoinExactAmountOutResponse
QueryNumPoolsRequest
QueryNumPoolsResponse
Field | Type | Label | Description |
num_pools | uint64 | | |
QueryParamsRequest
QueryParamsRequest is request type for the Query/Params RPC method.
QueryParamsResponse
QueryParamsResponse is response type for the Query/Params RPC method.
Field | Type | Label | Description |
params | Params | | params holds all the parameters of this module. |
QueryPoolNumberRequest
QueryPoolNumberResponse
Field | Type | Label | Description |
pool_id | uint64 | | |
QueryPoolParamsRequest
Field | Type | Label | Description |
pool_id | uint64 | | |
QueryPoolParamsResponse
Field | Type | Label | Description |
pool_params | PoolParams | | |
QueryPoolRequest
Field | Type | Label | Description |
pool_id | uint64 | | |
QueryPoolResponse
Field | Type | Label | Description |
pool | Pool | | |
QueryPoolsRequest
QueryPoolsResponse
QuerySpotPriceRequest
Returns the amount of tokenInDenom to produce 1 tokenOutDenom
For example, if the price of NIBI = 9.123 NUSD, then setting
tokenInDenom=NUSD and tokenOutDenom=NIBI would give "9.123".
Field | Type | Label | Description |
pool_id | uint64 | | |
token_in_denom | string | | the denomination of the token you are giving into the pool |
token_out_denom | string | | the denomination of the token you are taking out of the pool |
QuerySpotPriceResponse
Field | Type | Label | Description |
spot_price | string | | |
QuerySwapExactAmountInRequest
Given an exact amount of tokens in and a target tokenOutDenom, calculates
the expected amount of tokens out received from a swap.
QuerySwapExactAmountInResponse
QuerySwapExactAmountOutRequest
Given an exact amount of tokens out and a target tokenInDenom, calculates
the expected amount of tokens in required to do the swap.
QuerySwapExactAmountOutResponse
QueryTotalLiquidityRequest
Query total liquidity the protocol
QueryTotalLiquidityResponse
QueryTotalPoolLiquidityRequest
Query total liquidity for a pool
Field | Type | Label | Description |
pool_id | uint64 | | |
QueryTotalPoolLiquidityResponse
QueryTotalSharesRequest
Field | Type | Label | Description |
pool_id | uint64 | | |
QueryTotalSharesResponse
Query
Query defines the gRPC querier service.
Top
nibiru/spot/v1/tx.proto
MsgCreatePool
MsgCreatePoolResponse
Field | Type | Label | Description |
pool_id | uint64 | | |
MsgExitPool
MsgExitPoolResponse
MsgJoinPool
Message to join a pool (identified by poolId) with a set of tokens to deposit.
MsgJoinPoolResponse
Response when a user joins a pool.
Field | Type | Label | Description |
pool | Pool | | the final state of the pool after a join |
num_pool_shares_out | cosmos.base.v1beta1.Coin | | sum of LP tokens minted from the join |
remaining_coins | cosmos.base.v1beta1.Coin | repeated | remaining tokens from attempting to join the pool |
MsgSwapAssets
MsgSwapAssetsResponse
Msg
Msg defines the Msg service.
Scalar Value Types
.proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby |
double | | double | double | float | float64 | double | float | Float |
float | | float | float | float | float32 | float | float | Float |
int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum |
uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum |
fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) |
fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum |
sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |