From 17dd5d3e6f2dfbc45a59e591631beb63a7b5b592 Mon Sep 17 00:00:00 2001 From: jelysn Date: Fri, 15 Dec 2023 21:13:36 +0800 Subject: [PATCH] Update query to return weightBalance info & update weight breaking fee calculation --- proto/elys/amm/query.proto | 25 +- proto/elys/amm/tx.proto | 1 - x/amm/client/cli/tx_join_pool.go | 7 +- x/amm/client/wasm/msg_join_pool.go | 5 +- x/amm/keeper/calc_in_route_spot_price.go | 27 +- x/amm/keeper/calc_in_route_spot_price_test.go | 8 +- x/amm/keeper/calc_out_route_spot_price.go | 22 +- .../keeper/calc_out_route_spot_price_test.go | 8 +- x/amm/keeper/calc_swap_estimation_by_denom.go | 19 +- .../calc_swap_estimation_by_denom_test.go | 6 +- x/amm/keeper/keeper_join_pool_no_swap.go | 3 +- x/amm/keeper/msg_server_join_pool.go | 2 +- x/amm/keeper/msg_server_swap_by_denom.go | 2 +- x/amm/keeper/query_swap_estimation.go | 3 +- .../keeper/query_swap_estimation_by_denom.go | 3 +- x/amm/keeper/update_pool_for_swap.go | 4 +- x/amm/types/calc_exit_pool.go | 16 +- x/amm/types/message_join_pool.go | 3 +- x/amm/types/pool_join_pool_no_swap.go | 48 +-- x/amm/types/query.pb.go | 276 ++++++++++++------ x/amm/types/query.pb.gw.go | 40 +-- x/amm/types/swap_in_amt_given_out.go | 11 +- x/amm/types/swap_out_amt_given_in.go | 21 +- x/amm/types/tx.pb.go | 204 +++++-------- x/leveragelp/keeper/position_open.go | 2 +- x/leveragelp/types/expected_keepers.go | 2 +- 26 files changed, 403 insertions(+), 365 deletions(-) diff --git a/proto/elys/amm/query.proto b/proto/elys/amm/query.proto index b80dace3b..8dbd872dc 100644 --- a/proto/elys/amm/query.proto +++ b/proto/elys/amm/query.proto @@ -17,73 +17,54 @@ option go_package = "github.com/elys-network/elys/x/amm/types"; // Query defines the gRPC querier service. service Query { - // Parameters queries the parameters of the module. rpc Params (QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/elys-network/elys/amm/params"; - } - // Queries a list of Pool items. rpc Pool (QueryGetPoolRequest) returns (QueryGetPoolResponse) { option (google.api.http).get = "/elys-network/elys/amm/pool/{pool_id}"; - } rpc PoolAll (QueryAllPoolRequest) returns (QueryAllPoolResponse) { option (google.api.http).get = "/elys-network/elys/amm/pool"; - } - // Queries a list of DenomLiquidity items. rpc DenomLiquidity (QueryGetDenomLiquidityRequest) returns (QueryGetDenomLiquidityResponse) { option (google.api.http).get = "/elys-network/elys/amm/denom_liquidity/{denom}"; - } rpc DenomLiquidityAll (QueryAllDenomLiquidityRequest) returns (QueryAllDenomLiquidityResponse) { option (google.api.http).get = "/elys-network/elys/amm/denom_liquidity"; - } - // Queries a list of SwapEstimation items. rpc SwapEstimation (QuerySwapEstimationRequest) returns (QuerySwapEstimationResponse) { option (google.api.http).get = "/elys-network/elys/amm/swap_estimation"; - } - // Queries slippage track for a week. rpc SlippageTrack (QuerySlippageTrackRequest) returns (QuerySlippageTrackResponse) { option (google.api.http).get = "/elys-network/elys/amm/slippage_track/{pool_id}"; - } - // Queries all slippage tracks for a week. rpc SlippageTrackAll (QuerySlippageTrackAllRequest) returns (QuerySlippageTrackAllResponse) { option (google.api.http).get = "/elys-network/elys/amm/slippage_tracks"; - } - // Queries a list of Balance items. rpc Balance (QueryBalanceRequest) returns (QueryBalanceResponse) { option (google.api.http).get = "/elys-network/elys/amm/balance/{address}/{denom}"; - } // Queries a list of InRouteByDenom items. rpc InRouteByDenom (QueryInRouteByDenomRequest) returns (QueryInRouteByDenomResponse) { option (google.api.http).get = "/elys-network/elys/amm/in_route_by_denom/{denom_in}/{denom_out}"; - } // Queries a list of OutRouteByDenom items. rpc OutRouteByDenom (QueryOutRouteByDenomRequest) returns (QueryOutRouteByDenomResponse) { option (google.api.http).get = "/elys-network/elys/amm/out_route_by_denom/{denom_out}/{denom_in}"; - } // Queries a list of SwapEstimationByDenom items. rpc SwapEstimationByDenom (QuerySwapEstimationByDenomRequest) returns (QuerySwapEstimationByDenomResponse) { option (google.api.http).get = "/elys-network/elys/amm/swap_estimation_by_denom"; - } } // QueryParamsRequest is request type for the Query/Params RPC method. @@ -141,7 +122,8 @@ message QuerySwapEstimationResponse { cosmos.base.v1beta1.Coin token_out = 2 [(gogoproto.nullable) = false ] ; string swap_fee = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; string discount = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; - cosmos.base.v1beta1.Coin available_liquidity = 5 [(gogoproto.nullable) = false ] ; + cosmos.base.v1beta1.Coin available_liquidity = 5 [(gogoproto.nullable) = false]; + string weight_balance_ratio = 6 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; } message QuerySlippageTrackRequest { @@ -199,7 +181,8 @@ message QuerySwapEstimationByDenomResponse { cosmos.base.v1beta1.Coin amount = 4 [(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]; - cosmos.base.v1beta1.Coin available_liquidity = 7 [(gogoproto.nullable) = false ] ; + cosmos.base.v1beta1.Coin available_liquidity = 7 [(gogoproto.nullable) = false ] ; + string weight_balance_ratio = 8 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; } message QueryAMMPriceRequest { diff --git a/proto/elys/amm/tx.proto b/proto/elys/amm/tx.proto index 051789de4..f453ad57d 100644 --- a/proto/elys/amm/tx.proto +++ b/proto/elys/amm/tx.proto @@ -37,7 +37,6 @@ message MsgJoinPool { uint64 pool_id = 2; repeated cosmos.base.v1beta1.Coin max_amounts_in = 3 [(gogoproto.nullable) = false ] ; string share_amount_out = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; - bool no_remaining = 5; } message MsgJoinPoolResponse { diff --git a/x/amm/client/cli/tx_join_pool.go b/x/amm/client/cli/tx_join_pool.go index 81a8e8cd6..7d69a4bbd 100644 --- a/x/amm/client/cli/tx_join_pool.go +++ b/x/amm/client/cli/tx_join_pool.go @@ -1,8 +1,6 @@ package cli import ( - "strconv" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" @@ -16,7 +14,7 @@ func CmdJoinPool() *cobra.Command { cmd := &cobra.Command{ Use: "join-pool [pool-id] [max-amounts-in] [share-amount-out]", Short: "join a new pool and provide the liquidity to it", - Example: `elysd tx amm join-pool 0 2000uatom,2000uusdc 200000000000000000 true --from=treasury --keyring-backend=test --chain-id=elystestnet-1 --yes --gas=1000000`, + Example: `elysd tx amm join-pool 0 2000uatom,2000uusdc 200000000000000000 --from=treasury --keyring-backend=test --chain-id=elystestnet-1 --yes --gas=1000000`, Args: cobra.ExactArgs(4), RunE: func(cmd *cobra.Command, args []string) (err error) { poolId, err := cast.ToUint64E(args[0]) @@ -37,14 +35,11 @@ func CmdJoinPool() *cobra.Command { return err } - noRemaining, err := strconv.ParseBool(args[3]) - msg := types.NewMsgJoinPool( clientCtx.GetFromAddress().String(), poolId, maxAmountsIn, shareAmountOut, - noRemaining, ) if err := msg.ValidateBasic(); err != nil { return err diff --git a/x/amm/client/wasm/msg_join_pool.go b/x/amm/client/wasm/msg_join_pool.go index 203c3c62c..646e21f3f 100644 --- a/x/amm/client/wasm/msg_join_pool.go +++ b/x/amm/client/wasm/msg_join_pool.go @@ -25,10 +25,7 @@ func (m *Messenger) msgJoinPool(ctx sdk.Context, contractAddr sdk.AccAddress, ms return nil, nil, errorsmod.Wrap(err, "failed validating msg") } - res, err := msgServer.JoinPool( - sdk.WrapSDKContext(ctx), - msg, - ) + res, err := msgServer.JoinPool(sdk.WrapSDKContext(ctx), msg) if err != nil { return nil, nil, errorsmod.Wrap(err, "join pool msg") } diff --git a/x/amm/keeper/calc_in_route_spot_price.go b/x/amm/keeper/calc_in_route_spot_price.go index 9f7e883c5..5e45498b9 100644 --- a/x/amm/keeper/calc_in_route_spot_price.go +++ b/x/amm/keeper/calc_in_route_spot_price.go @@ -6,9 +6,9 @@ import ( ) // CalcInRouteSpotPrice calculates the spot price of the given token and in route -func (k Keeper) CalcInRouteSpotPrice(ctx sdk.Context, tokenIn sdk.Coin, routes []*types.SwapAmountInRoute, discount sdk.Dec, overrideSwapFee sdk.Dec) (sdk.Dec, sdk.Coin, sdk.Dec, sdk.Dec, sdk.Coin, error) { +func (k Keeper) CalcInRouteSpotPrice(ctx sdk.Context, tokenIn sdk.Coin, routes []*types.SwapAmountInRoute, discount sdk.Dec, overrideSwapFee sdk.Dec) (sdk.Dec, sdk.Coin, sdk.Dec, sdk.Dec, sdk.Coin, sdk.Dec, error) { if routes == nil || len(routes) == 0 { - return sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, types.ErrEmptyRoutes + return sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), types.ErrEmptyRoutes } // Start with the initial token input @@ -23,13 +23,15 @@ func (k Keeper) CalcInRouteSpotPrice(ctx sdk.Context, tokenIn sdk.Coin, routes [ // Track the total available liquidity in the pool for final token out denom var availableLiquidity sdk.Coin + weightBalance := sdk.ZeroDec() + for _, route := range routes { poolId := route.PoolId tokenOutDenom = route.TokenOutDenom pool, found := k.GetPool(ctx, poolId) if !found { - return sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, types.ErrPoolNotFound + return sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), types.ErrPoolNotFound } // Get Pool swap fee @@ -48,29 +50,32 @@ func (k Keeper) CalcInRouteSpotPrice(ctx sdk.Context, tokenIn sdk.Coin, routes [ // Estimate swap snapshot := k.GetPoolSnapshotOrSet(ctx, pool) - swapResult, err := k.CalcOutAmtGivenIn(ctx, pool.PoolId, k.oracleKeeper, &snapshot, tokensIn, tokenOutDenom, swapFee) + cacheCtx, _ := ctx.CacheContext() + tokenOut, _, weightBalanceBonus, err := k.SwapOutAmtGivenIn(cacheCtx, pool.PoolId, k.oracleKeeper, &snapshot, tokensIn, tokenOutDenom, swapFee) if err != nil { - return sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, err + return sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), err } - if swapResult.IsZero() { - return sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, types.ErrAmountTooLow + if tokenOut.IsZero() { + return sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), types.ErrAmountTooLow } // Use the current swap result as the input for the next iteration - tokensIn = sdk.Coins{swapResult} + tokensIn = sdk.Coins{tokenOut} // Get the available liquidity for the final token out denom _, poolAsset, err := pool.GetPoolAssetAndIndex(tokenOutDenom) if err != nil { - return sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, err + return sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), err } availableLiquidity = poolAsset.Token + + weightBalance = weightBalanceBonus } // Ensure tokenIn.Amount is not zero to avoid division by zero if tokenIn.IsZero() { - return sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, types.ErrAmountTooLow + return sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), types.ErrAmountTooLow } // Calculate the spot price given the initial token in and the final token out @@ -82,5 +87,5 @@ func (k Keeper) CalcInRouteSpotPrice(ctx sdk.Context, tokenIn sdk.Coin, routes [ // Construct the token out coin tokenOut := sdk.NewCoin(tokenOutDenom, tokenOutAmt.TruncateInt()) - return spotPrice, tokenOut, totalDiscountedSwapFee, discount, availableLiquidity, nil + return spotPrice, tokenOut, totalDiscountedSwapFee, discount, availableLiquidity, weightBalance, nil } diff --git a/x/amm/keeper/calc_in_route_spot_price_test.go b/x/amm/keeper/calc_in_route_spot_price_test.go index 1ab5e85d5..10865962c 100644 --- a/x/amm/keeper/calc_in_route_spot_price_test.go +++ b/x/amm/keeper/calc_in_route_spot_price_test.go @@ -20,7 +20,7 @@ func TestCalcInRouteSpotPrice(t *testing.T) { accountedPoolKeeper.On("GetAccountedBalance", ctx, uint64(1), "denom1").Return(sdk.NewInt(1000)) accountedPoolKeeper.On("GetAccountedBalance", ctx, uint64(1), "denom2").Return(sdk.NewInt(1000)) routes := []*types.SwapAmountInRoute{{PoolId: 1, TokenOutDenom: "denom2"}} - spotPrice, _, _, _, _, err := k.CalcInRouteSpotPrice(ctx, tokenIn, routes, sdk.ZeroDec(), sdk.ZeroDec()) + spotPrice, _, _, _, _, _, err := k.CalcInRouteSpotPrice(ctx, tokenIn, routes, sdk.ZeroDec(), sdk.ZeroDec()) require.NoError(t, err) require.NotZero(t, spotPrice) accountedPoolKeeper.AssertExpectations(t) @@ -34,17 +34,17 @@ func TestCalcInRouteSpotPrice(t *testing.T) { {PoolId: 2, TokenOutDenom: "baseCurrency"}, {PoolId: 3, TokenOutDenom: "denom3"}, } - spotPrice, _, _, _, _, err = k.CalcInRouteSpotPrice(ctx, tokenIn, routes, sdk.ZeroDec(), sdk.ZeroDec()) + spotPrice, _, _, _, _, _, err = k.CalcInRouteSpotPrice(ctx, tokenIn, routes, sdk.ZeroDec(), sdk.ZeroDec()) require.NoError(t, err) require.NotZero(t, spotPrice) accountedPoolKeeper.AssertExpectations(t) // Test no routes - _, _, _, _, _, err = k.CalcInRouteSpotPrice(ctx, tokenIn, nil, sdk.ZeroDec(), sdk.ZeroDec()) + _, _, _, _, _, _, err = k.CalcInRouteSpotPrice(ctx, tokenIn, nil, sdk.ZeroDec(), sdk.ZeroDec()) require.Error(t, err) // Test invalid pool routes = []*types.SwapAmountInRoute{{PoolId: 9999, TokenOutDenom: "denom2"}} - _, _, _, _, _, err = k.CalcInRouteSpotPrice(ctx, tokenIn, routes, sdk.ZeroDec(), sdk.ZeroDec()) + _, _, _, _, _, _, err = k.CalcInRouteSpotPrice(ctx, tokenIn, routes, sdk.ZeroDec(), sdk.ZeroDec()) require.Error(t, err) } diff --git a/x/amm/keeper/calc_out_route_spot_price.go b/x/amm/keeper/calc_out_route_spot_price.go index c2f12d112..312ff3e7b 100644 --- a/x/amm/keeper/calc_out_route_spot_price.go +++ b/x/amm/keeper/calc_out_route_spot_price.go @@ -6,9 +6,9 @@ import ( ) // CalcOutRouteSpotPrice calculates the spot price of the given token and out route -func (k Keeper) CalcOutRouteSpotPrice(ctx sdk.Context, tokenOut sdk.Coin, routes []*types.SwapAmountOutRoute, discount sdk.Dec, overrideSwapFee sdk.Dec) (sdk.Dec, sdk.Coin, sdk.Dec, sdk.Dec, sdk.Coin, error) { +func (k Keeper) CalcOutRouteSpotPrice(ctx sdk.Context, tokenOut sdk.Coin, routes []*types.SwapAmountOutRoute, discount sdk.Dec, overrideSwapFee sdk.Dec) (sdk.Dec, sdk.Coin, sdk.Dec, sdk.Dec, sdk.Coin, sdk.Dec, error) { if routes == nil || len(routes) == 0 { - return sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, types.ErrEmptyRoutes + return sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), types.ErrEmptyRoutes } // Start with the initial token input @@ -23,13 +23,15 @@ func (k Keeper) CalcOutRouteSpotPrice(ctx sdk.Context, tokenOut sdk.Coin, routes // Track the total available liquidity in the pool for final token out denom var availableLiquidity sdk.Coin + weightBonus := sdk.ZeroDec() + for _, route := range routes { poolId := route.PoolId tokenInDenom = route.TokenInDenom pool, found := k.GetPool(ctx, poolId) if !found { - return sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, types.ErrPoolNotFound + return sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), types.ErrPoolNotFound } // Get Pool swap fee @@ -48,13 +50,14 @@ func (k Keeper) CalcOutRouteSpotPrice(ctx sdk.Context, tokenOut sdk.Coin, routes // Estimate swap snapshot := k.GetPoolSnapshotOrSet(ctx, pool) - swapResult, err := k.CalcInAmtGivenOut(ctx, pool.PoolId, k.oracleKeeper, &snapshot, tokensOut, tokenInDenom, swapFee) + cacheCtx, _ := ctx.CacheContext() + swapResult, _, weightBalanceBonus, err := k.SwapInAmtGivenOut(cacheCtx, pool.PoolId, k.oracleKeeper, &snapshot, tokensOut, tokenInDenom, swapFee) if err != nil { - return sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, err + return sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), err } if swapResult.IsZero() { - return sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, types.ErrAmountTooLow + return sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), types.ErrAmountTooLow } // Use the current swap result as the input for the next iteration @@ -63,14 +66,15 @@ func (k Keeper) CalcOutRouteSpotPrice(ctx sdk.Context, tokenOut sdk.Coin, routes // Get the available liquidity for the final token in denom _, poolAsset, err := pool.GetPoolAssetAndIndex(tokenInDenom) if err != nil { - return sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, err + return sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), err } availableLiquidity = poolAsset.Token + weightBonus = weightBalanceBonus } // Ensure tokenIn.Amount is not zero to avoid division by zero if tokenOut.IsZero() { - return sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, types.ErrAmountTooLow + return sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), types.ErrAmountTooLow } // Calculate the spot price given the initial token in and the final token in @@ -82,5 +86,5 @@ func (k Keeper) CalcOutRouteSpotPrice(ctx sdk.Context, tokenOut sdk.Coin, routes // Construct the token out coin tokenIn := sdk.NewCoin(tokenInDenom, tokenInAmt.TruncateInt()) - return spotPrice, tokenIn, totalDiscountedSwapFee, discount, availableLiquidity, nil + return spotPrice, tokenIn, totalDiscountedSwapFee, discount, availableLiquidity, weightBonus, nil } diff --git a/x/amm/keeper/calc_out_route_spot_price_test.go b/x/amm/keeper/calc_out_route_spot_price_test.go index 00c4d2a5f..f61acfa2b 100644 --- a/x/amm/keeper/calc_out_route_spot_price_test.go +++ b/x/amm/keeper/calc_out_route_spot_price_test.go @@ -18,7 +18,7 @@ func TestCalcOutRouteSpotPrice(t *testing.T) { accountedPoolKeeper.On("GetAccountedBalance", ctx, uint64(1), "denom2").Return(sdk.NewInt(1000)) accountedPoolKeeper.On("GetAccountedBalance", ctx, uint64(1), "denom1").Return(sdk.NewInt(1000)) routes := []*types.SwapAmountOutRoute{{PoolId: 1, TokenInDenom: "denom1"}} - spotPrice, _, _, _, _, err := k.CalcOutRouteSpotPrice(ctx, tokenOut, routes, sdk.ZeroDec(), sdk.ZeroDec()) + spotPrice, _, _, _, _, _, err := k.CalcOutRouteSpotPrice(ctx, tokenOut, routes, sdk.ZeroDec(), sdk.ZeroDec()) require.NoError(t, err) require.NotZero(t, spotPrice) accountedPoolKeeper.AssertExpectations(t) @@ -33,17 +33,17 @@ func TestCalcOutRouteSpotPrice(t *testing.T) { {PoolId: 3, TokenInDenom: "baseCurrency"}, {PoolId: 2, TokenInDenom: "denom1"}, } - spotPrice, _, _, _, _, err = k.CalcOutRouteSpotPrice(ctx, tokenOut, routes, sdk.ZeroDec(), sdk.ZeroDec()) + spotPrice, _, _, _, _, _, err = k.CalcOutRouteSpotPrice(ctx, tokenOut, routes, sdk.ZeroDec(), sdk.ZeroDec()) require.NoError(t, err) require.NotZero(t, spotPrice) accountedPoolKeeper.AssertExpectations(t) // Test no routes - _, _, _, _, _, err = k.CalcOutRouteSpotPrice(ctx, tokenOut, nil, sdk.ZeroDec(), sdk.ZeroDec()) + _, _, _, _, _, _, err = k.CalcOutRouteSpotPrice(ctx, tokenOut, nil, sdk.ZeroDec(), sdk.ZeroDec()) require.Error(t, err) // Test invalid pool routes = []*types.SwapAmountOutRoute{{PoolId: 9999, TokenInDenom: "denom2"}} - _, _, _, _, _, err = k.CalcOutRouteSpotPrice(ctx, tokenOut, routes, sdk.ZeroDec(), sdk.ZeroDec()) + _, _, _, _, _, _, err = k.CalcOutRouteSpotPrice(ctx, tokenOut, routes, sdk.ZeroDec(), sdk.ZeroDec()) require.Error(t, err) } diff --git a/x/amm/keeper/calc_swap_estimation_by_denom.go b/x/amm/keeper/calc_swap_estimation_by_denom.go index 582daad62..b2f3e0ed0 100644 --- a/x/amm/keeper/calc_swap_estimation_by_denom.go +++ b/x/amm/keeper/calc_swap_estimation_by_denom.go @@ -22,34 +22,35 @@ func (k Keeper) CalcSwapEstimationByDenom( swapFeeOut sdk.Dec, discountOut sdk.Dec, availableLiquidity sdk.Coin, + weightBonus sdk.Dec, err error, ) { // if amount denom is equal to denomIn, calculate swap estimation by denomIn if amount.Denom == denomIn { inRoute, err := k.CalcInRouteByDenom(ctx, denomIn, denomOut, baseCurrency) if err != nil { - return nil, nil, sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, err + return nil, nil, sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), err } - spotPrice, tokenOut, swapFeeOut, _, availableLiquidity, err := k.CalcInRouteSpotPrice(ctx, amount, inRoute, discount, overrideSwapFee) + spotPrice, tokenOut, swapFeeOut, _, availableLiquidity, weightBonus, err := k.CalcInRouteSpotPrice(ctx, amount, inRoute, discount, overrideSwapFee) if err != nil { - return nil, nil, sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, err + return nil, nil, sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), err } - return inRoute, nil, tokenOut, spotPrice, swapFeeOut, discount, availableLiquidity, nil + return inRoute, nil, tokenOut, spotPrice, swapFeeOut, discount, availableLiquidity, weightBonus, nil } // if amount denom is equal to denomOut, calculate swap estimation by denomOut if amount.Denom == denomOut { outRoute, err := k.CalcOutRouteByDenom(ctx, denomIn, denomOut, baseCurrency) if err != nil { - return nil, nil, sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, err + return nil, nil, sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), err } - spotPrice, tokenIn, swapFeeOut, _, availableLiquidity, err := k.CalcOutRouteSpotPrice(ctx, amount, outRoute, discount, overrideSwapFee) + spotPrice, tokenIn, swapFeeOut, _, availableLiquidity, weightBonus, err := k.CalcOutRouteSpotPrice(ctx, amount, outRoute, discount, overrideSwapFee) if err != nil { - return nil, nil, sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, err + return nil, nil, sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), err } - return nil, outRoute, tokenIn, spotPrice, swapFeeOut, discount, availableLiquidity, nil + return nil, outRoute, tokenIn, spotPrice, swapFeeOut, discount, availableLiquidity, weightBonus, nil } // if amount denom is neither equal to denomIn nor denomOut, return error - return nil, nil, sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, types.ErrInvalidDenom + return nil, nil, sdk.Coin{}, sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec(), sdk.Coin{}, sdk.ZeroDec(), types.ErrInvalidDenom } diff --git a/x/amm/keeper/calc_swap_estimation_by_denom_test.go b/x/amm/keeper/calc_swap_estimation_by_denom_test.go index 0825e9fa9..0d94c6e32 100644 --- a/x/amm/keeper/calc_swap_estimation_by_denom_test.go +++ b/x/amm/keeper/calc_swap_estimation_by_denom_test.go @@ -16,7 +16,7 @@ func TestCalcSwapEstimationByDenom(t *testing.T) { amount := sdk.NewCoin("denom1", sdk.NewInt(100)) accountedPoolKeeper.On("GetAccountedBalance", ctx, uint64(1), "denom1").Return(sdk.NewInt(1000)) accountedPoolKeeper.On("GetAccountedBalance", ctx, uint64(1), "denom2").Return(sdk.NewInt(1000)) - inRoute, outRoute, tokenOut, spotPrice, _, _, _, err := k.CalcSwapEstimationByDenom(ctx, amount, "denom1", "denom2", "baseCurrency", sdk.ZeroDec(), sdk.ZeroDec()) + inRoute, outRoute, tokenOut, spotPrice, _, _, _, _, err := k.CalcSwapEstimationByDenom(ctx, amount, "denom1", "denom2", "baseCurrency", sdk.ZeroDec(), sdk.ZeroDec()) require.NoError(t, err) require.NotNil(t, inRoute) require.Nil(t, outRoute) @@ -27,7 +27,7 @@ func TestCalcSwapEstimationByDenom(t *testing.T) { amount = sdk.NewCoin("denom2", sdk.NewInt(100)) accountedPoolKeeper.On("GetAccountedBalance", ctx, uint64(1), "denom2").Return(sdk.NewInt(1000)) accountedPoolKeeper.On("GetAccountedBalance", ctx, uint64(1), "denom1").Return(sdk.NewInt(1000)) - inRoute, outRoute, tokenOut, spotPrice, _, _, _, err = k.CalcSwapEstimationByDenom(ctx, amount, "denom1", "denom2", "baseCurrency", sdk.ZeroDec(), sdk.ZeroDec()) + inRoute, outRoute, tokenOut, spotPrice, _, _, _, _, err = k.CalcSwapEstimationByDenom(ctx, amount, "denom1", "denom2", "baseCurrency", sdk.ZeroDec(), sdk.ZeroDec()) require.NoError(t, err) require.Nil(t, inRoute) require.NotNil(t, outRoute) @@ -36,6 +36,6 @@ func TestCalcSwapEstimationByDenom(t *testing.T) { // Test with invalid amount denom amount = sdk.NewCoin("invalid", sdk.NewInt(1000)) - _, _, _, _, _, _, _, err = k.CalcSwapEstimationByDenom(ctx, amount, "denom1", "denom2", "baseCurrency", sdk.ZeroDec(), sdk.ZeroDec()) + _, _, _, _, _, _, _, _, err = k.CalcSwapEstimationByDenom(ctx, amount, "denom1", "denom2", "baseCurrency", sdk.ZeroDec(), sdk.ZeroDec()) require.Error(t, err) } diff --git a/x/amm/keeper/keeper_join_pool_no_swap.go b/x/amm/keeper/keeper_join_pool_no_swap.go index c709e42dd..0881898ea 100644 --- a/x/amm/keeper/keeper_join_pool_no_swap.go +++ b/x/amm/keeper/keeper_join_pool_no_swap.go @@ -21,7 +21,6 @@ func (k Keeper) JoinPoolNoSwap( poolId uint64, shareOutAmount sdk.Int, tokenInMaxs sdk.Coins, - noRemaining bool, ) (tokenIn sdk.Coins, sharesOut sdk.Int, err error) { // defer to catch panics, in case something internal overflows. defer func() { @@ -39,7 +38,7 @@ func (k Keeper) JoinPoolNoSwap( if !pool.PoolParams.UseOracle { tokensIn := tokenInMaxs - if !noRemaining { + if len(tokensIn) != 1 { // we do an abstract calculation on the lp liquidity coins needed to have // the designated amount of given shares of the pool without performing swap neededLpLiquidity, err := types.GetMaximalNoSwapLPAmount(pool, shareOutAmount) diff --git a/x/amm/keeper/msg_server_join_pool.go b/x/amm/keeper/msg_server_join_pool.go index 0c425329e..bb0077f1a 100644 --- a/x/amm/keeper/msg_server_join_pool.go +++ b/x/amm/keeper/msg_server_join_pool.go @@ -27,7 +27,7 @@ func (k msgServer) JoinPool(goCtx context.Context, msg *types.MsgJoinPool) (*typ return nil, err } - neededLp, sharesOut, err := k.Keeper.JoinPoolNoSwap(ctx, sender, msg.PoolId, msg.ShareAmountOut, msg.MaxAmountsIn, msg.NoRemaining) + neededLp, sharesOut, err := k.Keeper.JoinPoolNoSwap(ctx, sender, msg.PoolId, msg.ShareAmountOut, msg.MaxAmountsIn) if err != nil { return nil, err } diff --git a/x/amm/keeper/msg_server_swap_by_denom.go b/x/amm/keeper/msg_server_swap_by_denom.go index cab03859a..38b1d7ae7 100644 --- a/x/amm/keeper/msg_server_swap_by_denom.go +++ b/x/amm/keeper/msg_server_swap_by_denom.go @@ -24,7 +24,7 @@ func (k msgServer) SwapByDenom(goCtx context.Context, msg *types.MsgSwapByDenom) } baseCurrency := entry.Denom - inRoute, outRoute, _, spotPrice, _, _, _, err := k.CalcSwapEstimationByDenom(ctx, msg.Amount, msg.DenomIn, msg.DenomOut, baseCurrency, msg.Discount, sdk.ZeroDec()) + inRoute, outRoute, _, spotPrice, _, _, _, _, err := k.CalcSwapEstimationByDenom(ctx, msg.Amount, msg.DenomIn, msg.DenomOut, baseCurrency, msg.Discount, sdk.ZeroDec()) if err != nil { return nil, err } diff --git a/x/amm/keeper/query_swap_estimation.go b/x/amm/keeper/query_swap_estimation.go index d21aba4ea..ce2e6bd75 100644 --- a/x/amm/keeper/query_swap_estimation.go +++ b/x/amm/keeper/query_swap_estimation.go @@ -16,7 +16,7 @@ func (k Keeper) SwapEstimation(goCtx context.Context, req *types.QuerySwapEstima ctx := sdk.UnwrapSDKContext(goCtx) - spotPrice, tokenOut, swapFee, discount, availableLiquidity, err := k.CalcInRouteSpotPrice(ctx, req.TokenIn, req.Routes, req.Discount, sdk.ZeroDec()) + spotPrice, tokenOut, swapFee, discount, availableLiquidity, weightBonus, err := k.CalcInRouteSpotPrice(ctx, req.TokenIn, req.Routes, req.Discount, sdk.ZeroDec()) if err != nil { return nil, err } @@ -27,5 +27,6 @@ func (k Keeper) SwapEstimation(goCtx context.Context, req *types.QuerySwapEstima SwapFee: swapFee, Discount: discount, AvailableLiquidity: availableLiquidity, + WeightBalanceRatio: weightBonus, }, nil } diff --git a/x/amm/keeper/query_swap_estimation_by_denom.go b/x/amm/keeper/query_swap_estimation_by_denom.go index 922a88560..9124708cd 100644 --- a/x/amm/keeper/query_swap_estimation_by_denom.go +++ b/x/amm/keeper/query_swap_estimation_by_denom.go @@ -27,7 +27,7 @@ func (k Keeper) SwapEstimationByDenom(goCtx context.Context, req *types.QuerySwa _ = baseCurrency - inRoute, outRoute, amount, spotPrice, swapFee, discount, availableLiquidity, err := k.CalcSwapEstimationByDenom(ctx, req.Amount, req.DenomIn, req.DenomOut, baseCurrency, req.Discount, sdk.ZeroDec()) + inRoute, outRoute, amount, spotPrice, swapFee, discount, availableLiquidity, weightBonus, err := k.CalcSwapEstimationByDenom(ctx, req.Amount, req.DenomIn, req.DenomOut, baseCurrency, req.Discount, sdk.ZeroDec()) if err != nil { return nil, err } @@ -40,5 +40,6 @@ func (k Keeper) SwapEstimationByDenom(goCtx context.Context, req *types.QuerySwa SwapFee: swapFee, Discount: discount, AvailableLiquidity: availableLiquidity, + WeightBalanceRatio: weightBonus, }, nil } diff --git a/x/amm/keeper/update_pool_for_swap.go b/x/amm/keeper/update_pool_for_swap.go index 7011fdd46..ae0e833fe 100644 --- a/x/amm/keeper/update_pool_for_swap.go +++ b/x/amm/keeper/update_pool_for_swap.go @@ -35,7 +35,7 @@ func (k Keeper) UpdatePoolForSwap( // apply swap fee when weight balance bonus is not available swapFeeInCoins := sdk.Coins{} - if weightBalanceBonus.IsZero() { + if !weightBalanceBonus.IsPositive() { swapFeeInCoins = PortionCoins(tokensIn, swapFeeIn) } @@ -59,7 +59,7 @@ func (k Keeper) UpdatePoolForSwap( // apply swap fee when weight balance bonus is not available swapFeeOutCoins := sdk.Coins{} - if weightBalanceBonus.IsZero() { + if !weightBalanceBonus.IsPositive() { swapFeeOutCoins = PortionCoins(tokensOut, swapFeeOut) } if swapFeeOutCoins.IsAllPositive() { diff --git a/x/amm/types/calc_exit_pool.go b/x/amm/types/calc_exit_pool.go index e4ad1b45b..8710a2827 100644 --- a/x/amm/types/calc_exit_pool.go +++ b/x/amm/types/calc_exit_pool.go @@ -127,8 +127,20 @@ func CalcExitPool(ctx sdk.Context, oracleKeeper OracleKeeper, pool Pool, account distanceDiff := weightDistance.Sub(initialWeightDistance) weightBreakingFee := sdk.ZeroDec() if distanceDiff.IsPositive() { - weightBreakingFee = pool.PoolParams.WeightBreakingFeeMultiplier.Mul(distanceDiff) - // TODO: weight breaking fee might need to be changed for exit pool + // old weight breaking fee implementation + // weightBreakingFee = pool.PoolParams.WeightBreakingFeeMultiplier.Mul(distanceDiff) + + // target weight + targetWeightOut := NormalizedWeight(ctx, pool.PoolAssets, tokenOutDenom) + targetWeightIn := sdk.OneDec().Sub(targetWeightOut) + + // weight breaking fee as in Plasma pool + weightOut := OracleAssetWeight(ctx, oracleKeeper, newAssetPools, tokenOutDenom) + weightIn := sdk.OneDec().Sub(weightOut) + + // (45/55*60/40) ^ 2.5 + weightBreakingFee = pool.PoolParams.WeightBreakingFeeMultiplier. + Mul(Pow(weightIn.Mul(targetWeightOut).Quo(weightOut).Quo(targetWeightIn), pool.PoolParams.WeightBreakingFeeExponent)) } tokenOutAmount := oracleOutAmount.Mul(sdk.OneDec().Sub(weightBreakingFee)).RoundInt() diff --git a/x/amm/types/message_join_pool.go b/x/amm/types/message_join_pool.go index 9a7e0f97b..75fcf10e4 100644 --- a/x/amm/types/message_join_pool.go +++ b/x/amm/types/message_join_pool.go @@ -9,13 +9,12 @@ const TypeMsgJoinPool = "join_pool" var _ sdk.Msg = &MsgJoinPool{} -func NewMsgJoinPool(sender string, poolId uint64, maxAmountsIn sdk.Coins, shareAmountOut sdk.Int, noRemaining bool) *MsgJoinPool { +func NewMsgJoinPool(sender string, poolId uint64, maxAmountsIn sdk.Coins, shareAmountOut sdk.Int) *MsgJoinPool { return &MsgJoinPool{ Sender: sender, PoolId: poolId, MaxAmountsIn: maxAmountsIn, ShareAmountOut: shareAmountOut, - NoRemaining: noRemaining, } } diff --git a/x/amm/types/pool_join_pool_no_swap.go b/x/amm/types/pool_join_pool_no_swap.go index 2977f9d6f..3c9ad35e3 100644 --- a/x/amm/types/pool_join_pool_no_swap.go +++ b/x/amm/types/pool_join_pool_no_swap.go @@ -117,17 +117,8 @@ func (p *Pool) CalcJoinValueWithoutSlippage(ctx sdk.Context, oracleKeeper Oracle // JoinPool calculates the number of shares needed for an all-asset join given tokensIn with swapFee applied. // It updates the liquidity if the pool is joined successfully. If not, returns error. func (p *Pool) JoinPool(ctx sdk.Context, oracleKeeper OracleKeeper, accountedPoolKeeper AccountedPoolKeeper, tokensIn sdk.Coins) (numShares math.Int, err error) { - if !p.PoolParams.UseOracle { - if len(tokensIn) == 1 { - numShares, tokensJoined, err := p.CalcSingleAssetJoinPoolShares(tokensIn) - if err != nil { - return math.Int{}, err - } - - // update pool with the calculated share and liquidity needed to join pool - p.IncreaseLiquidity(numShares, tokensJoined) - return numShares, nil - } + // if it's not single sided liquidity, add at pool ratio + if len(tokensIn) != 1 { numShares, tokensJoined, err := p.CalcJoinPoolNoSwapShares(tokensIn) if err != nil { return math.Int{}, err @@ -138,6 +129,17 @@ func (p *Pool) JoinPool(ctx sdk.Context, oracleKeeper OracleKeeper, accountedPoo return numShares, nil } + if !p.PoolParams.UseOracle { + numShares, tokensJoined, err := p.CalcSingleAssetJoinPoolShares(tokensIn) + if err != nil { + return math.Int{}, err + } + + // update pool with the calculated share and liquidity needed to join pool + p.IncreaseLiquidity(numShares, tokensJoined) + return numShares, nil + } + joinValueWithoutSlippage, err := p.CalcJoinValueWithoutSlippage(ctx, oracleKeeper, accountedPoolKeeper, tokensIn) if err != nil { return sdk.ZeroInt(), err @@ -148,15 +150,13 @@ func (p *Pool) JoinPool(ctx sdk.Context, oracleKeeper OracleKeeper, accountedPoo if err != nil { return sdk.ZeroInt(), err } + // Ensure tvl is not zero to avoid division by zero if tvl.IsZero() { return sdk.ZeroInt(), ErrAmountTooLow } - newAssetPools, err := p.NewPoolAssetsAfterSwap( - tokensIn, - sdk.Coins{}, - ) + newAssetPools, err := p.NewPoolAssetsAfterSwap(tokensIn, sdk.Coins{}) if err != nil { return sdk.ZeroInt(), err } @@ -165,8 +165,22 @@ func (p *Pool) JoinPool(ctx sdk.Context, oracleKeeper OracleKeeper, accountedPoo distanceDiff := weightDistance.Sub(initialWeightDistance) weightBreakingFee := sdk.ZeroDec() if distanceDiff.IsPositive() { - weightBreakingFee = p.PoolParams.WeightBreakingFeeMultiplier.Mul(distanceDiff) - // TODO: weight breaking fee might need to be changed for exit pool + // old weight breaking fee implementation + // weightBreakingFee = p.PoolParams.WeightBreakingFeeMultiplier.Mul(distanceDiff) + + // we only allow + tokenInDenom := tokensIn[0].Denom + // target weight + targetWeightIn := NormalizedWeight(ctx, p.PoolAssets, tokenInDenom) + targetWeightOut := sdk.OneDec().Sub(targetWeightIn) + + // weight breaking fee as in Plasma pool + weightIn := OracleAssetWeight(ctx, oracleKeeper, newAssetPools, tokenInDenom) + weightOut := sdk.OneDec().Sub(weightIn) + + // (45/55*60/40) ^ 2.5 + weightBreakingFee = p.PoolParams.WeightBreakingFeeMultiplier. + Mul(Pow(weightIn.Mul(targetWeightOut).Quo(weightOut).Quo(targetWeightIn), p.PoolParams.WeightBreakingFeeExponent)) } weightBalanceBonus := sdk.ZeroDec() if initialWeightDistance.GT(p.PoolParams.ThresholdWeightDifference) && distanceDiff.IsNegative() { diff --git a/x/amm/types/query.pb.go b/x/amm/types/query.pb.go index 2dc76d51e..79ad0d8e2 100644 --- a/x/amm/types/query.pb.go +++ b/x/amm/types/query.pb.go @@ -542,6 +542,7 @@ type QuerySwapEstimationResponse struct { SwapFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=swap_fee,json=swapFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"swap_fee"` Discount github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=discount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"discount"` AvailableLiquidity types.Coin `protobuf:"bytes,5,opt,name=available_liquidity,json=availableLiquidity,proto3" json:"available_liquidity"` + WeightBalanceRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=weight_balance_ratio,json=weightBalanceRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"weight_balance_ratio"` } func (m *QuerySwapEstimationResponse) Reset() { *m = QuerySwapEstimationResponse{} } @@ -1116,6 +1117,7 @@ type QuerySwapEstimationByDenomResponse struct { SwapFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=swap_fee,json=swapFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"swap_fee"` Discount github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=discount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"discount"` AvailableLiquidity types.Coin `protobuf:"bytes,7,opt,name=available_liquidity,json=availableLiquidity,proto3" json:"available_liquidity"` + WeightBalanceRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=weight_balance_ratio,json=weightBalanceRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"weight_balance_ratio"` } func (m *QuerySwapEstimationByDenomResponse) Reset() { *m = QuerySwapEstimationByDenomResponse{} } @@ -1255,96 +1257,98 @@ func init() { func init() { proto.RegisterFile("elys/amm/query.proto", fileDescriptor_763da04a7298bbac) } var fileDescriptor_763da04a7298bbac = []byte{ - // 1415 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff,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, 0x3c, 0xeb, 0x8d, 0xe6, 0xa0, 0x21, 0x90, 0x90, 0xac, 0x61, 0x58, 0x01, 0xa4, - 0x37, 0x84, 0xec, 0x90, 0x5f, 0x14, 0x38, 0x1a, 0x9b, 0xb1, 0x48, 0x9c, 0x21, 0x7d, 0xb4, 0x2b, - 0xaf, 0x4c, 0x12, 0x43, 0xd6, 0xf7, 0x05, 0x6b, 0x8d, 0x5c, 0x1f, 0xc1, 0x1a, 0x8e, 0x12, 0x09, - 0x58, 0x8f, 0x30, 0x02, 0x4e, 0x7e, 0x55, 0xe0, 0x44, 0xea, 0x44, 0x43, 0x5e, 0x1d, 0x7b, 0xef, - 0x62, 0xe0, 0xaf, 0x4d, 0x27, 0x3c, 0xed, 0xf5, 0x90, 0xef, 0x6a, 0x18, 0x44, 0xad, 0xf6, 0xf8, - 0x79, 0x45, 0x79, 0xf2, 0xbc, 0xa2, 0x3c, 0x7b, 0x5e, 0x51, 0xbe, 0xdf, 0xab, 0xcc, 0x3c, 0xd9, - 0xab, 0xcc, 0xfc, 0xb9, 0x57, 0x99, 0xf9, 0x74, 0x2d, 0xf2, 0x48, 0x26, 0x8d, 0x7e, 0x2d, 0xcc, - 0x8a, 0xa7, 0xb2, 0x99, 0x17, 0xff, 0x59, 0x77, 0xf9, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x99, - 0x8e, 0xf8, 0x0f, 0xec, 0x14, 0x00, 0x00, + // 1447 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x98, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xc0, 0xb3, 0x89, 0x63, 0x3b, 0x0f, 0x35, 0x2d, 0xd3, 0x54, 0x24, 0x4e, 0xe3, 0xd2, 0x6d, + 0x9b, 0x44, 0x40, 0x77, 0xfb, 0x01, 0x2d, 0x20, 0x50, 0x1b, 0xd3, 0x36, 0x04, 0x51, 0x25, 0x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x94, 0x73, 0xc4, 0xea, 0x83, 0x12, 0x7b, 0x44, 0xd8, 0x0f, 0xe4, 0xc0, 0x0e, + 0xf9, 0xde, 0x80, 0x97, 0x75, 0x93, 0x22, 0x2f, 0x4b, 0xc9, 0xc0, 0x47, 0x03, 0xec, 0xfb, 0x90, + 0x31, 0x2d, 0x09, 0xb8, 0x4c, 0x16, 0x47, 0x03, 0x24, 0xdf, 0x1a, 0x30, 0xad, 0x17, 0x67, 0x72, + 0x3a, 0xe6, 0x2c, 0xf5, 0x01, 0x52, 0x38, 0x33, 0x44, 0x6a, 0x44, 0x1e, 0x59, 0xfc, 0x68, 0xd7, + 0xf9, 0x23, 0x03, 0x0e, 0x69, 0xdd, 0x12, 0x39, 0x15, 0x77, 0x94, 0xd2, 0x3c, 0x16, 0x4e, 0x0f, + 0x16, 0x42, 0x98, 0xcb, 0x12, 0xe6, 0x3c, 0xb1, 0xfb, 0xc1, 0xa0, 0x56, 0x45, 0xb6, 0x66, 0x3d, + 0x7b, 0xf9, 0x91, 0x01, 0x47, 0xe2, 0x1d, 0x20, 0x59, 0x1c, 0xe4, 0xb3, 0xdb, 0x42, 0x16, 0x96, + 0x86, 0xca, 0x8d, 0x9a, 0x2b, 0x0d, 0x2f, 0x20, 0x0f, 0x0d, 0xc8, 0x61, 0x05, 0x4c, 0x1c, 0x31, + 0xbd, 0x9b, 0x4c, 0x1c, 0xb1, 0x58, 0x97, 0x68, 0xbe, 0x2d, 0x5d, 0x5f, 0x20, 0xe7, 0xfa, 0xb8, + 0xc6, 0x9a, 0x6d, 0x3f, 0xc0, 0x26, 0x74, 0x27, 0xda, 0xd9, 0x3f, 0x19, 0x30, 0xad, 0xb7, 0x72, + 0x89, 0x0d, 0x94, 0xda, 0x3f, 0x26, 0x36, 0x50, 0x7a, 0x3f, 0x68, 0xae, 0x4a, 0xb2, 0x15, 0x72, + 0xa5, 0x0f, 0x59, 0xd8, 0x38, 0x54, 0xaa, 0xdb, 0x15, 0x89, 0x84, 0x64, 0x15, 0xd7, 0x0f, 0x21, + 0x45, 0x9b, 0xb3, 0x43, 0x7e, 0x36, 0xe0, 0x70, 0xac, 0x8b, 0x23, 0x71, 0x86, 0xf4, 0xe6, 0xb1, + 0xb0, 0x38, 0x4c, 0x0c, 0x59, 0x3f, 0x94, 0xac, 0x25, 0x72, 0xb5, 0x0f, 0x6b, 0xd4, 0xac, 0x24, + 0x60, 0x05, 0x61, 0x0f, 0x38, 0xf9, 0xc5, 0x80, 0x63, 0xa9, 0x3d, 0x13, 0x79, 0x7d, 0xe0, 0xb9, + 0x8b, 0x81, 0xbf, 0x31, 0x9a, 0xf0, 0xa8, 0xc7, 0x43, 0x3f, 0xab, 0x51, 0x10, 0xa5, 0xd2, 0xe3, + 0xe7, 0x45, 0xe3, 0xc9, 0xf3, 0xa2, 0xf1, 0xec, 0x79, 0xd1, 0xf8, 0x6e, 0xb7, 0x38, 0xf6, 0x64, + 0xb7, 0x38, 0xf6, 0xc7, 0x6e, 0x71, 0xec, 0xf3, 0xe5, 0x9e, 0x4b, 0x32, 0x69, 0xf4, 0x6b, 0x69, + 0x56, 0x5e, 0x95, 0xd5, 0xac, 0xfc, 0x87, 0xe3, 0xc5, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x64, + 0x59, 0xc1, 0x01, 0xb0, 0x15, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2268,6 +2272,16 @@ func (m *QuerySwapEstimationResponse) MarshalToSizedBuffer(dAtA []byte) (int, er _ = i var l int _ = l + { + size := m.WeightBalanceRatio.Size() + i -= size + if _, err := m.WeightBalanceRatio.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 { size, err := m.AvailableLiquidity.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -2737,6 +2751,16 @@ func (m *QuerySwapEstimationByDenomResponse) MarshalToSizedBuffer(dAtA []byte) ( _ = i var l int _ = l + { + size := m.WeightBalanceRatio.Size() + i -= size + if _, err := m.WeightBalanceRatio.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 { size, err := m.AvailableLiquidity.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -3038,6 +3062,8 @@ func (m *QuerySwapEstimationResponse) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) l = m.AvailableLiquidity.Size() n += 1 + l + sovQuery(uint64(l)) + l = m.WeightBalanceRatio.Size() + n += 1 + l + sovQuery(uint64(l)) return n } @@ -3229,6 +3255,8 @@ func (m *QuerySwapEstimationByDenomResponse) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) l = m.AvailableLiquidity.Size() n += 1 + l + sovQuery(uint64(l)) + l = m.WeightBalanceRatio.Size() + n += 1 + l + sovQuery(uint64(l)) return n } @@ -4461,6 +4489,40 @@ func (m *QuerySwapEstimationResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WeightBalanceRatio", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.WeightBalanceRatio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -5807,6 +5869,40 @@ func (m *QuerySwapEstimationByDenomResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WeightBalanceRatio", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.WeightBalanceRatio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) diff --git a/x/amm/types/query.pb.gw.go b/x/amm/types/query.pb.gw.go index 389049bcc..3d2479816 100644 --- a/x/amm/types/query.pb.gw.go +++ b/x/amm/types/query.pb.gw.go @@ -20,7 +20,6 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -31,7 +30,6 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage -var _ = metadata.Join func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryParamsRequest @@ -606,14 +604,12 @@ func local_request_Query_SwapEstimationByDenom_0(ctx context.Context, marshaler // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -621,7 +617,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -635,8 +630,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Pool_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -644,7 +637,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Pool_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -658,8 +650,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_PoolAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -667,7 +657,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_PoolAll_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -681,8 +670,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_DenomLiquidity_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -690,7 +677,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_DenomLiquidity_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -704,8 +690,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_DenomLiquidityAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -713,7 +697,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_DenomLiquidityAll_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -727,8 +710,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_SwapEstimation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -736,7 +717,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_SwapEstimation_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -750,8 +730,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_SlippageTrack_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -759,7 +737,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_SlippageTrack_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -773,8 +750,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_SlippageTrackAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -782,7 +757,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_SlippageTrackAll_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -796,8 +770,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Balance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -805,7 +777,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Balance_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -819,8 +790,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_InRouteByDenom_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -828,7 +797,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_InRouteByDenom_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -842,8 +810,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_OutRouteByDenom_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -851,7 +817,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_OutRouteByDenom_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -865,8 +830,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_SwapEstimationByDenom_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -874,7 +837,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_SwapEstimationByDenom_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) diff --git a/x/amm/types/swap_in_amt_given_out.go b/x/amm/types/swap_in_amt_given_out.go index f0728432e..88a1becc6 100644 --- a/x/amm/types/swap_in_amt_given_out.go +++ b/x/amm/types/swap_in_amt_given_out.go @@ -81,9 +81,6 @@ func (p *Pool) SwapInAmtGivenOut( initialWeightDistance := p.WeightDistanceFromTarget(ctx, oracleKeeper, p.PoolAssets) - startWeightIn := OracleAssetWeight(ctx, oracleKeeper, p.PoolAssets, tokenIn.Denom) - startWeightOut := OracleAssetWeight(ctx, oracleKeeper, p.PoolAssets, tokenOut.Denom) - // in amount is calculated in this formula // balancer slippage amount = Max(oracleOutAmount-balancerOutAmount, 0) // resizedAmount = tokenIn / externalLiquidityRatio @@ -126,17 +123,21 @@ func (p *Pool) SwapInAmtGivenOut( // old weight breaking fee implementation // weightBreakingFee = p.PoolParams.WeightBreakingFeeMultiplier.Mul(distanceDiff) + // target weight + targetWeightIn := NormalizedWeight(ctx, p.PoolAssets, tokenIn.Denom) + targetWeightOut := NormalizedWeight(ctx, p.PoolAssets, tokenOut.Denom) + // weight breaking fee as in Plasma pool weightIn := OracleAssetWeight(ctx, oracleKeeper, newAssetPools, tokenIn.Denom) weightOut := OracleAssetWeight(ctx, oracleKeeper, newAssetPools, tokenOut.Denom) // (45/55*60/40) ^ 2.5 weightBreakingFee = p.PoolParams.WeightBreakingFeeMultiplier. - Mul(Pow(weightIn.Mul(startWeightOut).Quo(weightOut).Quo(startWeightIn), p.PoolParams.WeightBreakingFeeExponent)) + Mul(Pow(weightIn.Mul(targetWeightOut).Quo(weightOut).Quo(targetWeightIn), p.PoolParams.WeightBreakingFeeExponent)) } // bonus is valid when distance is lower than original distance and when threshold weight reached - weightBalanceBonus = sdk.ZeroDec() + weightBalanceBonus = weightBreakingFee.Neg() if initialWeightDistance.GT(p.PoolParams.ThresholdWeightDifference) && distanceDiff.IsNegative() { weightBalanceBonus = p.PoolParams.WeightBreakingFeeMultiplier.Mul(distanceDiff).Abs() } diff --git a/x/amm/types/swap_out_amt_given_in.go b/x/amm/types/swap_out_amt_given_in.go index 900fc074e..12c19b9b3 100644 --- a/x/amm/types/swap_out_amt_given_in.go +++ b/x/amm/types/swap_out_amt_given_in.go @@ -117,6 +117,16 @@ func OracleAssetWeight(ctx sdk.Context, oracleKeeper OracleKeeper, poolAssets [] return sdk.ZeroDec() } +func NormalizedWeight(ctx sdk.Context, poolAssets []PoolAsset, denom string) sdk.Dec { + targetWeights := NormalizedWeights(poolAssets) + for _, weight := range targetWeights { + if weight.Asset == denom { + return weight.Weight + } + } + return sdk.ZeroDec() +} + func (p Pool) CalcGivenInSlippage( ctx sdk.Context, oracleKeeper OracleKeeper, @@ -195,9 +205,6 @@ func (p *Pool) SwapOutAmtGivenIn( initialWeightDistance := p.WeightDistanceFromTarget(ctx, oracleKeeper, p.PoolAssets) - startWeightIn := OracleAssetWeight(ctx, oracleKeeper, p.PoolAssets, tokenIn.Denom) - startWeightOut := OracleAssetWeight(ctx, oracleKeeper, p.PoolAssets, tokenOutDenom) - // out amount is calculated in this formula // balancer slippage amount = Max(oracleOutAmount-balancerOutAmount, 0) // resizedAmount = tokenIn / externalLiquidityRatio @@ -282,17 +289,21 @@ func (p *Pool) SwapOutAmtGivenIn( // old weight breaking fee implementation // weightBreakingFee = p.PoolParams.WeightBreakingFeeMultiplier.Mul(distanceDiff) + // target weight + targetWeightIn := NormalizedWeight(ctx, p.PoolAssets, tokenIn.Denom) + targetWeightOut := NormalizedWeight(ctx, p.PoolAssets, tokenOutDenom) + // weight breaking fee as in Plasma pool weightIn := OracleAssetWeight(ctx, oracleKeeper, newAssetPools, tokenIn.Denom) weightOut := OracleAssetWeight(ctx, oracleKeeper, newAssetPools, tokenOutDenom) // (45/55*60/40) ^ 2.5 weightBreakingFee = p.PoolParams.WeightBreakingFeeMultiplier. - Mul(Pow(weightIn.Mul(startWeightOut).Quo(weightOut).Quo(startWeightIn), p.PoolParams.WeightBreakingFeeExponent)) + Mul(Pow(weightIn.Mul(targetWeightOut).Quo(weightOut).Quo(targetWeightIn), p.PoolParams.WeightBreakingFeeExponent)) } // bonus is valid when distance is lower than original distance and when threshold weight reached - weightBalanceBonus = sdk.ZeroDec() + weightBalanceBonus = weightBreakingFee.Neg() if initialWeightDistance.GT(p.PoolParams.ThresholdWeightDifference) && distanceDiff.IsNegative() { weightBalanceBonus = p.PoolParams.WeightBreakingFeeMultiplier.Mul(distanceDiff).Abs() } diff --git a/x/amm/types/tx.pb.go b/x/amm/types/tx.pb.go index 33b5a26f4..c0da94118 100644 --- a/x/amm/types/tx.pb.go +++ b/x/amm/types/tx.pb.go @@ -139,7 +139,6 @@ type MsgJoinPool struct { PoolId uint64 `protobuf:"varint,2,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"` MaxAmountsIn []types.Coin `protobuf:"bytes,3,rep,name=max_amounts_in,json=maxAmountsIn,proto3" json:"max_amounts_in"` ShareAmountOut github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=share_amount_out,json=shareAmountOut,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"share_amount_out"` - NoRemaining bool `protobuf:"varint,5,opt,name=no_remaining,json=noRemaining,proto3" json:"no_remaining,omitempty"` } func (m *MsgJoinPool) Reset() { *m = MsgJoinPool{} } @@ -196,13 +195,6 @@ func (m *MsgJoinPool) GetMaxAmountsIn() []types.Coin { return nil } -func (m *MsgJoinPool) GetNoRemaining() bool { - if m != nil { - return m.NoRemaining - } - return false -} - type MsgJoinPoolResponse struct { ShareAmountOut github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=share_amount_out,json=shareAmountOut,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"share_amount_out"` TokenIn []types.Coin `protobuf:"bytes,2,rep,name=token_in,json=tokenIn,proto3" json:"token_in"` @@ -1084,88 +1076,87 @@ func init() { func init() { proto.RegisterFile("elys/amm/tx.proto", fileDescriptor_ed7ddafd861f6b7f) } var fileDescriptor_ed7ddafd861f6b7f = []byte{ - // 1291 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0x5f, 0x6f, 0x1b, 0x45, - 0x10, 0xcf, 0xd9, 0xf1, 0xbf, 0x71, 0xd3, 0x34, 0xd7, 0xb4, 0x75, 0x9c, 0xc4, 0x31, 0x87, 0x08, - 0x56, 0xa5, 0xda, 0x6a, 0x10, 0xa0, 0x46, 0x15, 0x50, 0x37, 0x09, 0x72, 0x55, 0x2b, 0xd1, 0x55, - 0x54, 0x08, 0x04, 0xd6, 0xc5, 0xde, 0x38, 0xab, 0xf8, 0x76, 0x0f, 0xef, 0x9a, 0x38, 0x20, 0x84, - 0x04, 0x0f, 0xbc, 0xf2, 0xcc, 0x57, 0x00, 0xde, 0x10, 0x9f, 0x21, 0x8f, 0x7d, 0x44, 0x3c, 0x44, - 0x28, 0xf9, 0x02, 0x88, 0x4f, 0x80, 0x76, 0x6f, 0xef, 0xce, 0xe7, 0x7f, 0x71, 0xac, 0x08, 0x89, - 0x27, 0xdf, 0xcd, 0xec, 0xcc, 0xed, 0xfc, 0x7e, 0x33, 0xb3, 0x3b, 0x86, 0x05, 0xd4, 0x3a, 0x61, - 0x25, 0xcb, 0xb6, 0x4b, 0xbc, 0x5b, 0x74, 0xda, 0x94, 0x53, 0x3d, 0x29, 0x44, 0x45, 0xcb, 0xb6, - 0xb3, 0x8b, 0x4d, 0xda, 0xa4, 0x52, 0x58, 0x12, 0x4f, 0xae, 0x3e, 0x9b, 0xab, 0x53, 0x66, 0x53, - 0x56, 0xda, 0xb7, 0x18, 0x2a, 0x7d, 0xf9, 0x70, 0x1f, 0x71, 0xeb, 0x61, 0xa9, 0x4e, 0x31, 0x51, - 0xfa, 0x3b, 0xbe, 0x4b, 0xc7, 0x6a, 0x5b, 0x36, 0x53, 0xe2, 0x25, 0x5f, 0xcc, 0x8e, 0x2d, 0xa7, - 0xd6, 0xa6, 0x1d, 0x8e, 0x94, 0x2a, 0x1b, 0x58, 0x50, 0xda, 0xaa, 0x8d, 0x30, 0x93, 0x3a, 0x8b, - 0x31, 0xc4, 0x5d, 0x95, 0xf1, 0x93, 0x06, 0x73, 0x55, 0xd6, 0x7c, 0xda, 0x46, 0x16, 0x47, 0x7b, - 0x94, 0xb6, 0xf4, 0xbb, 0x10, 0x67, 0x88, 0x34, 0x50, 0x3b, 0xa3, 0xe5, 0xb5, 0x42, 0xca, 0x54, - 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0x1a, 0x47, 0x25, 0x7e, 0xe2, 0x20, 0x56, 0xac, - 0x10, 0x6e, 0xde, 0x94, 0x7e, 0x5c, 0xcf, 0xbb, 0x1d, 0xae, 0xbf, 0x06, 0x37, 0x08, 0xad, 0xb5, - 0x91, 0x6d, 0x61, 0x82, 0x49, 0x33, 0x13, 0xcb, 0x6b, 0x85, 0xa4, 0x99, 0x26, 0xd4, 0xf4, 0x44, - 0xc6, 0xcf, 0x1a, 0xdc, 0xee, 0x01, 0xc1, 0x47, 0x70, 0xd8, 0xa6, 0xb4, 0x6b, 0xd9, 0xd4, 0x26, - 0x24, 0x39, 0x3d, 0x42, 0x44, 0xe0, 0x15, 0x99, 0x0c, 0xaf, 0x84, 0x34, 0xa8, 0x10, 0xe3, 0x07, - 0x97, 0xb2, 0xed, 0x2e, 0xe6, 0xd3, 0x51, 0xf6, 0x21, 0xcc, 0xdb, 0x98, 0xf8, 0x94, 0x89, 0xa8, - 0x26, 0xe4, 0x6c, 0xce, 0xc6, 0x44, 0x71, 0x26, 0xa2, 0x78, 0x09, 0xf3, 0x21, 0x7c, 0x30, 0x99, - 0x92, 0xb3, 0xb9, 0x1e, 0x78, 0x2a, 0x44, 0x5f, 0x87, 0x79, 0x17, 0x1d, 0xda, 0xe1, 0xb5, 0x06, - 0x22, 0xd4, 0x96, 0xac, 0xa5, 0xcc, 0x39, 0x29, 0xde, 0xed, 0xf0, 0x2d, 0x21, 0x34, 0x5e, 0x48, - 0xda, 0x3c, 0x20, 0x7c, 0xda, 0x1e, 0x43, 0xca, 0x37, 0x9f, 0x14, 0xdd, 0xa4, 0xe7, 0xd9, 0xf8, - 0x3b, 0x02, 0x8b, 0x55, 0xd6, 0x7c, 0x71, 0x6c, 0x39, 0xdb, 0x5d, 0xab, 0xce, 0xfd, 0x5d, 0x8d, - 0xc2, 0xf9, 0x11, 0xc4, 0x65, 0x8f, 0x61, 0xea, 0x5b, 0xcb, 0x41, 0xdd, 0x0a, 0x27, 0x9e, 0xbd, - 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, 0x9e, 0xb8, 0xcf, 0xc3, 0xc0, 0xd4, 0xf1, 0x29, 0x2c, 0x0c, 0xce, 0x0c, 0xb9, - 0x90, 0xcd, 0x80, 0x3e, 0xbb, 0x3e, 0x5e, 0xef, 0x3b, 0xff, 0x1c, 0xf4, 0x21, 0xb7, 0xbd, 0xb5, - 0x71, 0xd6, 0xbb, 0x1d, 0x9e, 0x7d, 0xf3, 0x92, 0x05, 0xbe, 0xff, 0x0a, 0xa4, 0x7b, 0x7b, 0x79, - 0x66, 0xc0, 0x4e, 0x69, 0xb2, 0xf9, 0x51, 0x1a, 0xdf, 0xd5, 0xb7, 0xb0, 0x3a, 0xfe, 0xd4, 0xbf, - 0x1f, 0x72, 0x31, 0x76, 0x6d, 0x76, 0x63, 0xf2, 0xb5, 0xbd, 0xc3, 0xc2, 0x40, 0x1d, 0x85, 0xb9, - 0xeb, 0x57, 0x67, 0xdf, 0x18, 0xab, 0xf6, 0x3c, 0x97, 0xcb, 0xa7, 0xe7, 0x39, 0xed, 0xd5, 0x79, - 0x4e, 0xfb, 0xeb, 0x3c, 0xa7, 0xfd, 0x78, 0x91, 0x9b, 0x79, 0x75, 0x91, 0x9b, 0xf9, 0xe3, 0x22, - 0x37, 0xf3, 0x49, 0xa1, 0xa7, 0x1d, 0x08, 0x57, 0x0f, 0x08, 0xe2, 0xc7, 0xb4, 0x7d, 0x24, 0x5f, - 0x4a, 0x5d, 0xf7, 0x7f, 0x2f, 0xd1, 0x14, 0xf6, 0xe3, 0xf2, 0x2f, 0xa5, 0xb7, 0xfe, 0x0d, 0x00, - 0x00, 0xff, 0xff, 0x84, 0x89, 0xcc, 0xeb, 0x10, 0x13, 0x00, 0x00, + // 1267 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0x5f, 0x4f, 0x23, 0x55, + 0x14, 0x67, 0x5a, 0xfa, 0xef, 0x20, 0xcb, 0x32, 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0a, 0x23, 0x78, 0xcb, 0x3d, 0x08, + 0x7d, 0x53, 0xc7, 0xa7, 0x30, 0xdb, 0x3f, 0x33, 0xe4, 0x43, 0x3a, 0x7d, 0xf2, 0xdc, 0xc6, 0x68, + 0xb9, 0x02, 0xff, 0x1c, 0xf4, 0x01, 0xaf, 0xbd, 0xb5, 0x51, 0xda, 0xfb, 0x1d, 0x96, 0x7b, 0xf3, + 0x9a, 0x0d, 0x0a, 0xbf, 0x0c, 0x53, 0xc1, 0x5a, 0x9e, 0xed, 0xd3, 0x93, 0x92, 0xdc, 0xfa, 0x30, + 0x89, 0x82, 0xfa, 0x16, 0x56, 0x47, 0x77, 0xfd, 0xfb, 0x21, 0x88, 0x91, 0x7b, 0x73, 0x5b, 0xd1, + 0xf7, 0x06, 0x87, 0x85, 0xbe, 0x3c, 0x0a, 0xfb, 0xae, 0x57, 0x9c, 0x7b, 0x63, 0xa4, 0xd8, 0x43, + 0x2e, 0x95, 0xce, 0x2f, 0xf3, 0xda, 0xab, 0xcb, 0xbc, 0xf6, 0xd7, 0x65, 0x5e, 0xfb, 0xe1, 0x2a, + 0x3f, 0xf1, 0xea, 0x2a, 0x3f, 0xf1, 0xfb, 0x55, 0x7e, 0xe2, 0x93, 0xcd, 0x40, 0x39, 0xe0, 0x50, + 0x0f, 0x30, 0x62, 0xa7, 0xa4, 0x7d, 0x22, 0x3e, 0x8a, 0x5d, 0xf7, 0x9f, 0x5a, 0xbc, 0x28, 0x1c, + 0x26, 0xc5, 0xff, 0x8b, 0xde, 0xfa, 0x37, 0x00, 0x00, 0xff, 0xff, 0x49, 0x96, 0x98, 0x6d, 0xed, + 0x12, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1604,16 +1595,6 @@ func (m *MsgJoinPool) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.NoRemaining { - i-- - if m.NoRemaining { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } { size := m.ShareAmountOut.Size() i -= size @@ -2587,9 +2568,6 @@ func (m *MsgJoinPool) Size() (n int) { } l = m.ShareAmountOut.Size() n += 1 + l + sovTx(uint64(l)) - if m.NoRemaining { - n += 2 - } return n } @@ -3289,26 +3267,6 @@ func (m *MsgJoinPool) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NoRemaining", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.NoRemaining = bool(v != 0) default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/x/leveragelp/keeper/position_open.go b/x/leveragelp/keeper/position_open.go index 99259748b..cc408526c 100644 --- a/x/leveragelp/keeper/position_open.go +++ b/x/leveragelp/keeper/position_open.go @@ -123,7 +123,7 @@ func (k Keeper) ProcessOpenLong(ctx sdk.Context, position *types.Position, lever return nil, err } - _, shares, err := k.amm.JoinPoolNoSwap(ctx, position.GetPositionAddress(), poolId, sdk.OneInt(), sdk.Coins{leverageCoin}, true) + _, shares, err := k.amm.JoinPoolNoSwap(ctx, position.GetPositionAddress(), poolId, sdk.OneInt(), sdk.Coins{leverageCoin}) if err != nil { return nil, err } diff --git a/x/leveragelp/types/expected_keepers.go b/x/leveragelp/types/expected_keepers.go index 8d89bc522..c4ffcbd18 100644 --- a/x/leveragelp/types/expected_keepers.go +++ b/x/leveragelp/types/expected_keepers.go @@ -29,7 +29,7 @@ type AmmKeeper interface { CalcOutAmtGivenIn(ctx sdk.Context, poolId uint64, oracle ammtypes.OracleKeeper, snapshot *ammtypes.Pool, tokensIn sdk.Coins, tokenOutDenom string, swapFee sdk.Dec) (sdk.Coin, error) CalcInAmtGivenOut(ctx sdk.Context, poolId uint64, oracle ammtypes.OracleKeeper, snapshot *ammtypes.Pool, tokensOut sdk.Coins, tokenInDenom string, swapFee sdk.Dec) (tokenIn sdk.Coin, err error) - JoinPoolNoSwap(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, shareOutAmount sdk.Int, tokenInMaxs sdk.Coins, noRemaining bool) (tokenIn sdk.Coins, sharesOut sdk.Int, err error) + JoinPoolNoSwap(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, shareOutAmount sdk.Int, tokenInMaxs sdk.Coins) (tokenIn sdk.Coins, sharesOut sdk.Int, err error) ExitPool(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, shareInAmount sdk.Int, tokenOutMins sdk.Coins, tokenOutDenom string) (exitCoins sdk.Coins, err error) }