Skip to content

Commit

Permalink
feat: add amm update pool params msg
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmic-vagabond committed Nov 28, 2023
1 parent 0167d0a commit 154c0fe
Show file tree
Hide file tree
Showing 21 changed files with 1,358 additions and 93 deletions.
1 change: 1 addition & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,7 @@ func NewElysApp(
keys[ammmoduletypes.StoreKey],
tkeys[ammmoduletypes.TStoreKey],
app.GetSubspace(ammmoduletypes.ModuleName),
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
app.BankKeeper,
app.AccountKeeper,
app.OracleKeeper,
Expand Down
3 changes: 2 additions & 1 deletion config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@ genesis:
num_blocks: "0"
amount: "0"
amount_collected_by_other_tracker: "0"
max_eden_reward_apr: "0.30"
max_eden_reward_apr_stakers: "0.30"
max_eden_reward_apr_lps: "0.30"
fee_pool:
community_pool:
- amount: "0"
Expand Down
120 changes: 120 additions & 0 deletions docs/static/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38320,6 +38320,25 @@ paths:
Coin defines a token with a denomination and an amount.


NOTE: The amount field is an Int which implements the custom
method

signatures required by gogoproto.
swapFee:
type: string
discount:
type: string
available_liquidity:
type: object
properties:
denom:
type: string
amount:
type: string
description: >-
Coin defines a token with a denomination and an amount.


NOTE: The amount field is an Int which implements the custom
method

Expand Down Expand Up @@ -38351,6 +38370,10 @@ paths:
in: query
required: false
type: string
- name: discount
in: query
required: false
type: string
tags:
- Query
/elys-network/elys/amm/swap_estimation_by_denom:
Expand Down Expand Up @@ -38396,6 +38419,25 @@ paths:
Coin defines a token with a denomination and an amount.


NOTE: The amount field is an Int which implements the custom
method

signatures required by gogoproto.
swapFee:
type: string
discount:
type: string
available_liquidity:
type: object
properties:
denom:
type: string
amount:
type: string
description: >-
Coin defines a token with a denomination and an amount.


NOTE: The amount field is an Int which implements the custom
method

Expand Down Expand Up @@ -38435,6 +38477,10 @@ paths:
in: query
required: false
type: string
- name: discount
in: query
required: false
type: string
tags:
- Query
/elys-network/elys/assetprofile/entry:
Expand Down Expand Up @@ -82955,22 +83001,64 @@ definitions:
type: string
spot_price:
type: string
swap_fee:
type: string
discount:
type: string
recipient:
type: string
elys.amm.MsgSwapExactAmountInResponse:
type: object
properties:
token_out_amount:
type: string
swap_fee:
type: string
discount:
type: string
recipient:
type: string
elys.amm.MsgSwapExactAmountOutResponse:
type: object
properties:
token_in_amount:
type: string
swap_fee:
type: string
discount:
type: string
recipient:
type: string
elys.amm.MsgUpdatePoolParamsResponse:
type: object
properties:
pool_id:
type: string
format: uint64
pool_params:
type: object
properties:
swap_fee:
type: string
exit_fee:
type: string
use_oracle:
type: boolean
weight_breaking_fee_multiplier:
type: string
external_liquidity_ratio:
type: string
lp_fee_portion:
type: string
staking_fee_portion:
type: string
weight_recovery_fee_portion:
type: string
threshold_weight_difference:
type: string
fee_denom:
type: string
title: denom for fee collection
elys.amm.OraclePoolSlippageTrack:
type: object
properties:
Expand Down Expand Up @@ -83476,6 +83564,22 @@ definitions:

NOTE: The amount field is an Int which implements the custom method
signatures required by gogoproto.
swapFee:
type: string
discount:
type: string
available_liquidity:
type: object
properties:
denom:
type: string
amount:
type: string
description: |-
Coin defines a token with a denomination and an amount.

NOTE: The amount field is an Int which implements the custom method
signatures required by gogoproto.
elys.amm.QuerySwapEstimationResponse:
type: object
properties:
Expand All @@ -83493,6 +83597,22 @@ definitions:

NOTE: The amount field is an Int which implements the custom method
signatures required by gogoproto.
swapFee:
type: string
discount:
type: string
available_liquidity:
type: object
properties:
denom:
type: string
amount:
type: string
description: |-
Coin defines a token with a denomination and an amount.

NOTE: The amount field is an Int which implements the custom method
signatures required by gogoproto.
elys.amm.SwapAmountInRoute:
type: object
properties:
Expand Down
38 changes: 25 additions & 13 deletions proto/elys/amm/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ service Msg {
rpc SwapExactAmountOut (MsgSwapExactAmountOut ) returns (MsgSwapExactAmountOutResponse );
rpc SwapByDenom (MsgSwapByDenom ) returns (MsgSwapByDenomResponse );
rpc FeedMultipleExternalLiquidity (MsgFeedMultipleExternalLiquidity) returns (MsgFeedMultipleExternalLiquidityResponse);
rpc UpdatePoolParams (MsgUpdatePoolParams ) returns (MsgUpdatePoolParamsResponse );
}

message MsgCreatePool {
string sender = 1;
PoolParams pool_params = 2;
Expand Down Expand Up @@ -62,31 +62,31 @@ message MsgSwapExactAmountIn {
repeated SwapAmountInRoute routes = 2 [(gogoproto.nullable) = false ] ;
cosmos.base.v1beta1.Coin token_in = 3 [(gogoproto.nullable) = false ] ;
string token_out_min_amount = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false];
string discount = 5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
string recipient = 6;
string discount = 5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
string recipient = 6;
}

message MsgSwapExactAmountInResponse {
string token_out_amount = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false];
string swap_fee = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
string discount = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
string recipient = 4;
string swap_fee = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
string discount = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
string recipient = 4;
}

message MsgSwapExactAmountOut {
string sender = 1;
repeated SwapAmountOutRoute routes = 2 [(gogoproto.nullable) = false ] ;
cosmos.base.v1beta1.Coin token_out = 3 [(gogoproto.nullable) = false ] ;
string token_in_max_amount = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false];
string discount = 5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
string recipient = 6;
string discount = 5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
string recipient = 6;
}

message MsgSwapExactAmountOutResponse {
string token_in_amount = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false];
string swap_fee = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
string discount = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
string recipient = 4;
string swap_fee = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
string discount = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
string recipient = 4;
}

message MsgFeedMultipleExternalLiquidity {
Expand Down Expand Up @@ -116,7 +116,7 @@ message MsgSwapByDenom {
string denom_in = 5;
string denom_out = 6;
string discount = 7 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
string recipient = 8;
string recipient = 8;
}

message MsgSwapByDenomResponse {
Expand All @@ -126,5 +126,17 @@ message MsgSwapByDenomResponse {
string spot_price = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
string swap_fee = 5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
string discount = 6 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
string recipient = 7;
string recipient = 7;
}

message MsgUpdatePoolParams {
string sender = 1;
uint64 pool_id = 2;
PoolParams pool_params = 3;
}

message MsgUpdatePoolParamsResponse {
uint64 pool_id = 1;
PoolParams pool_params = 2;
}

1 change: 1 addition & 0 deletions wasmbindings/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ type ElysMsg struct {
AmmSwapExactAmountOut *ammtypes.MsgSwapExactAmountOut `json:"amm_swap_exact_amount_out,omitempty"`
AmmSwapByDenom *ammtypes.MsgSwapByDenom `json:"amm_swap_by_denom,omitempty"`
AmmFeedMultipleExternalLiquidity *ammtypes.MsgFeedMultipleExternalLiquidity `json:"amm_feed_multiple_external_liquidity,omitempty"`
AmmUpdatePoolParams *ammtypes.MsgUpdatePoolParams `json:"amm_update_pool_params,omitempty"`

// assetprofile messages
AssetProfileCreateEntry *assetprofiletypes.MsgCreateEntry `json:"asset_profile_create_entry,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions x/amm/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func GetTxCmd() *cobra.Command {
cmd.AddCommand(CmdSwapExactAmountIn())
cmd.AddCommand(CmdSwapExactAmountOut())
cmd.AddCommand(CmdSwapByDenom())
cmd.AddCommand(CmdUpdatePoolParams())
// this line is used by starport scaffolding # 1

return cmd
Expand Down
Loading

0 comments on commit 154c0fe

Please sign in to comment.