From 05f897082d51818e4cef21bba6dfb66530cb1c7c Mon Sep 17 00:00:00 2001 From: Unique-Divine Date: Fri, 7 Apr 2023 16:03:07 -0500 Subject: [PATCH 1/4] refactor: #wip convert vpool to perp/amm | move types --- CHANGELOG.md | 1 + app/app.go | 2 +- proto/{vpool => perp/amm}/v1/event.proto | 12 +- proto/perp/amm/v1/genesis.proto | 12 ++ proto/{vpool => perp/amm}/v1/gov.proto | 12 +- proto/{vpool => perp/amm}/v1/query.proto | 12 +- proto/{vpool => perp/amm}/v1/state.proto | 6 +- proto/perp/v1/event.proto | 4 +- proto/util/v1/query.proto | 4 +- proto/vpool/v1/genesis.proto | 12 -- x/common/testutil/cli/query.go | 2 +- x/common/testutil/mock/perp_interfaces.go | 2 +- x/{vpool => perp/amm}/types/codec.go | 0 x/{vpool => perp/amm}/types/errors.go | 0 x/{vpool => perp/amm}/types/event.pb.go | 89 +++++----- .../amm}/types/expected_keepers.go | 0 x/{vpool => perp/amm}/types/genesis.go | 0 x/{vpool => perp/amm}/types/genesis.pb.go | 40 ++--- x/{vpool => perp/amm}/types/genesis_test.go | 0 x/{vpool => perp/amm}/types/gov.go | 0 x/{vpool => perp/amm}/types/gov.pb.go | 92 +++++----- x/{vpool => perp/amm}/types/gov_test.go | 0 x/{vpool => perp/amm}/types/keys.go | 0 x/{vpool => perp/amm}/types/pool.go | 0 x/{vpool => perp/amm}/types/pool_test.go | 0 x/{vpool => perp/amm}/types/query.pb.go | 133 +++++++-------- x/{vpool => perp/amm}/types/query.pb.gw.go | 8 +- x/{vpool => perp/amm}/types/snapshot.go | 0 x/{vpool => perp/amm}/types/snapshot_test.go | 0 x/{vpool => perp/amm}/types/state.pb.go | 158 +++++++++--------- x/perp/client/cli/cli_test.go | 2 +- x/perp/integration/action/vpool.go | 2 +- x/perp/keeper/calc.go | 2 +- x/perp/keeper/calc_test.go | 2 +- x/perp/keeper/calc_unit_test.go | 2 +- x/perp/keeper/clearing_house.go | 2 +- .../keeper/clearing_house_integration_test.go | 2 +- x/perp/keeper/clearing_house_unit_test.go | 2 +- x/perp/keeper/grpc_query_test.go | 2 +- x/perp/keeper/liquidate.go | 2 +- x/perp/keeper/liquidate_test.go | 2 +- x/perp/keeper/liquidate_unit_test.go | 2 +- x/perp/keeper/margin.go | 2 +- x/perp/keeper/margin_test.go | 2 +- x/perp/keeper/margin_unit_test.go | 2 +- x/perp/keeper/migrations_test.go | 2 +- x/perp/keeper/msg_server_test.go | 2 +- x/perp/keeper/perp_test.go | 2 +- x/perp/simulation/operations.go | 2 +- x/perp/types/event.pb.go | 4 +- x/perp/types/expected_keepers.go | 2 +- x/util/types/query.pb.go | 58 +++---- x/vpool/abci.go | 2 +- x/vpool/abci_test.go | 2 +- x/vpool/client/cli/cli_test.go | 2 +- x/vpool/client/cli/genvpool.go | 2 +- x/vpool/client/cli/gov_client.go | 2 +- x/vpool/client/cli/query.go | 2 +- x/vpool/genesis.go | 2 +- x/vpool/genesis_test.go | 2 +- x/vpool/handler.go | 2 +- x/vpool/integration/assertion/vpool.go | 2 +- x/vpool/keeper/bias_test.go | 2 +- x/vpool/keeper/keeper.go | 2 +- x/vpool/keeper/keeper_test.go | 2 +- x/vpool/keeper/pool_state.go | 2 +- x/vpool/keeper/pool_state_test.go | 2 +- x/vpool/keeper/prices.go | 2 +- x/vpool/keeper/prices_test.go | 2 +- x/vpool/keeper/query_server.go | 2 +- x/vpool/keeper/query_server_test.go | 2 +- x/vpool/keeper/snapshot.go | 2 +- x/vpool/keeper/snapshot_test.go | 2 +- x/vpool/keeper/util_test.go | 4 +- x/vpool/module.go | 2 +- x/vpool/simulation/decoder.go | 2 +- x/vpool/simulation/genesis.go | 2 +- x/wasm/cli/cli_test.go | 2 +- 78 files changed, 382 insertions(+), 375 deletions(-) rename proto/{vpool => perp/amm}/v1/event.proto (85%) create mode 100644 proto/perp/amm/v1/genesis.proto rename proto/{vpool => perp/amm}/v1/gov.proto (92%) rename proto/{vpool => perp/amm}/v1/query.proto (86%) rename proto/{vpool => perp/amm}/v1/state.proto (97%) delete mode 100644 proto/vpool/v1/genesis.proto rename x/{vpool => perp/amm}/types/codec.go (100%) rename x/{vpool => perp/amm}/types/errors.go (100%) rename x/{vpool => perp/amm}/types/event.pb.go (87%) rename x/{vpool => perp/amm}/types/expected_keepers.go (100%) rename x/{vpool => perp/amm}/types/genesis.go (100%) rename x/{vpool => perp/amm}/types/genesis.pb.go (81%) rename x/{vpool => perp/amm}/types/genesis_test.go (100%) rename x/{vpool => perp/amm}/types/gov.go (100%) rename x/{vpool => perp/amm}/types/gov.pb.go (90%) rename x/{vpool => perp/amm}/types/gov_test.go (100%) rename x/{vpool => perp/amm}/types/keys.go (100%) rename x/{vpool => perp/amm}/types/pool.go (100%) rename x/{vpool => perp/amm}/types/pool_test.go (100%) rename x/{vpool => perp/amm}/types/query.pb.go (87%) rename x/{vpool => perp/amm}/types/query.pb.gw.go (96%) rename x/{vpool => perp/amm}/types/snapshot.go (100%) rename x/{vpool => perp/amm}/types/snapshot_test.go (100%) rename x/{vpool => perp/amm}/types/state.pb.go (88%) diff --git a/CHANGELOG.md b/CHANGELOG.md index baa898c1a..cea9f8d87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Breaking +* [#xxx](https://github.com/NibiruChain/nibiru/pull/xxx) - refactor(perp)!: xxx * [#1243](https://github.com/NibiruChain/nibiru/pull/1243) - feat(vpool): sqrt of liquidity depth tracked on pool * [#1220](https://github.com/NibiruChain/nibiru/pull/1220) - feat: reduce gas fees when posting price * [#1229](https://github.com/NibiruChain/nibiru/pull/1229) - feat: upgrade ibc to v4.2.0 and wasm v0.30.0 diff --git a/app/app.go b/app/app.go index abdc4695d..6ca01e20f 100644 --- a/app/app.go +++ b/app/app.go @@ -114,6 +114,7 @@ import ( oraclekeeper "github.com/NibiruChain/nibiru/x/oracle/keeper" oracletypes "github.com/NibiruChain/nibiru/x/oracle/types" "github.com/NibiruChain/nibiru/x/perp" + vpooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" perpkeeper "github.com/NibiruChain/nibiru/x/perp/keeper" perptypes "github.com/NibiruChain/nibiru/x/perp/types" "github.com/NibiruChain/nibiru/x/spot" @@ -127,7 +128,6 @@ import ( "github.com/NibiruChain/nibiru/x/vpool" vpoolcli "github.com/NibiruChain/nibiru/x/vpool/client/cli" vpoolkeeper "github.com/NibiruChain/nibiru/x/vpool/keeper" - vpooltypes "github.com/NibiruChain/nibiru/x/vpool/types" ) const ( diff --git a/proto/vpool/v1/event.proto b/proto/perp/amm/v1/event.proto similarity index 85% rename from proto/vpool/v1/event.proto rename to proto/perp/amm/v1/event.proto index c2ae9131f..924a08255 100644 --- a/proto/vpool/v1/event.proto +++ b/proto/perp/amm/v1/event.proto @@ -1,13 +1,13 @@ syntax = "proto3"; -package nibiru.vpool.v1; +package nibiru.perp.amm.v1; import "cosmos/base/v1beta1/coin.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; -option go_package = "github.com/NibiruChain/nibiru/x/vpool/types"; +option go_package = "github.com/NibiruChain/nibiru/x/perp/amm/types"; message ReserveSnapshotSavedEvent { string pair = 1 [ @@ -40,22 +40,22 @@ message ReserveSnapshotSavedEvent { ]; } -// A swap on the vpool represented by 'pair'. +// A swap on the perp.amm represented by 'pair'. // Amounts are negative or positive base on the perspective of the pool, i.e. -// a negative quote means the trader has gained quote and the vpool lost quote. +// a negative quote means the trader has gained quote and the perp.amm lost quote. message SwapOnVpoolEvent { string pair = 1 [ (gogoproto.customtype) = "github.com/NibiruChain/nibiru/x/common/asset.Pair", (gogoproto.nullable) = false ]; - // delta in the quote reserves of the vpool + // delta in the quote reserves of the perp.amm string quote_amount = 2 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; - // delta in the base reserves of the vpool + // delta in the base reserves of the perp.amm string base_amount = 3 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false diff --git a/proto/perp/amm/v1/genesis.proto b/proto/perp/amm/v1/genesis.proto new file mode 100644 index 000000000..f30ed6ffd --- /dev/null +++ b/proto/perp/amm/v1/genesis.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package nibiru.perp.amm.v1; + +import "gogoproto/gogo.proto"; +import "perp/amm/v1/state.proto"; + +option go_package = "github.com/NibiruChain/nibiru/x/perp/amm/types"; + +// GenesisState defines the perp.amm module's genesis state. +message GenesisState { + repeated Vpool vpools = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/vpool/v1/gov.proto b/proto/perp/amm/v1/gov.proto similarity index 92% rename from proto/vpool/v1/gov.proto rename to proto/perp/amm/v1/gov.proto index 54afa5919..cc4825001 100644 --- a/proto/vpool/v1/gov.proto +++ b/proto/perp/amm/v1/gov.proto @@ -1,11 +1,11 @@ syntax = "proto3"; -package nibiru.vpool.v1; +package nibiru.perp.amm.v1; import "gogoproto/gogo.proto"; -import "vpool/v1/state.proto"; +import "perp/amm/v1/state.proto"; -option go_package = "github.com/NibiruChain/nibiru/x/vpool/types"; +option go_package = "github.com/NibiruChain/nibiru/x/perp/amm/types"; message CreatePoolProposal { string title = 1; @@ -17,12 +17,14 @@ message CreatePoolProposal { (gogoproto.nullable) = false ]; - // quote_asset_reserve is the amount of quote asset the pool will be initialized with. + // quote_asset_reserve is the amount of quote asset the pool will be + // initialized with. string quote_asset_reserve = 5 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; - // base_asset_reserve is the amount of base asset the pool will be initialized with. + // base_asset_reserve is the amount of base asset the pool will be + // initialized with. string base_asset_reserve = 6 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false diff --git a/proto/vpool/v1/query.proto b/proto/perp/amm/v1/query.proto similarity index 86% rename from proto/vpool/v1/query.proto rename to proto/perp/amm/v1/query.proto index e39711aee..699c6f6f2 100644 --- a/proto/vpool/v1/query.proto +++ b/proto/perp/amm/v1/query.proto @@ -1,29 +1,29 @@ syntax = "proto3"; -package nibiru.vpool.v1; +package nibiru.perp.amm.v1; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; -import "vpool/v1/state.proto"; +import "perp/amm/v1/state.proto"; -option go_package = "github.com/NibiruChain/nibiru/x/vpool/types"; +option go_package = "github.com/NibiruChain/nibiru/x/perp/amm/types"; // Query defines the gRPC querier service. service Query { // Queries the reserve assets in a given pool, identified by a token pair. rpc ReserveAssets(QueryReserveAssetsRequest) returns (QueryReserveAssetsResponse) { - option (google.api.http).get = "/nibiru/vpool/reserve_assets"; + option (google.api.http).get = "/nibiru/perp/amm/reserve_assets"; } // Queries all virtual pools. rpc AllPools(QueryAllPoolsRequest) returns (QueryAllPoolsResponse) { - option (google.api.http).get = "/nibiru/vpool/all_pools"; + option (google.api.http).get = "/nibiru/perp/amm/all_pools"; } // Queries prices rpc BaseAssetPrice(QueryBaseAssetPriceRequest) returns (QueryBaseAssetPriceResponse) { - option (google.api.http).get = "/nibiru/vpool/base_asset_price"; + option (google.api.http).get = "/nibiru/perp/amm/base_asset_price"; } } diff --git a/proto/vpool/v1/state.proto b/proto/perp/amm/v1/state.proto similarity index 97% rename from proto/vpool/v1/state.proto rename to proto/perp/amm/v1/state.proto index af6b11183..86f919338 100644 --- a/proto/vpool/v1/state.proto +++ b/proto/perp/amm/v1/state.proto @@ -1,8 +1,8 @@ syntax = "proto3"; -package nibiru.vpool.v1; +package nibiru.perp.amm.v1; -option go_package = "github.com/NibiruChain/nibiru/x/vpool/types"; +option go_package = "github.com/NibiruChain/nibiru/x/perp/amm/types"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; @@ -115,7 +115,7 @@ message CurrentTWAP { string price = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; } -// a snapshot of the vpool's reserves at a given point in time +// a snapshot of the perp.amm's reserves at a given point in time message ReserveSnapshot { string pair = 5 [ (gogoproto.customtype) = "github.com/NibiruChain/nibiru/x/common/asset.Pair", diff --git a/proto/perp/v1/event.proto b/proto/perp/v1/event.proto index 599f367da..1fe1c23ee 100644 --- a/proto/perp/v1/event.proto +++ b/proto/perp/v1/event.proto @@ -116,7 +116,7 @@ message PositionLiquidatedEvent { // owner of the position. string trader_address = 2; - // margin * leverage * vPrice. 'notional' is the virtual size times the virtual price on 'vpool'. + // margin * leverage * vPrice. 'notional' is the virtual size times the virtual price on 'perp.amm'. string exchanged_quote_amount = 3 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false @@ -197,7 +197,7 @@ message PositionSettledEvent { // Owner of the position. string trader_address = 2; - // Settled coin as dictated by the settlement price of the vpool. + // Settled coin as dictated by the settlement price of the perp.amm. repeated cosmos.base.v1beta1.Coin settled_coins = 3 [ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.moretags) = "yaml:\"settled_coins\"", diff --git a/proto/util/v1/query.proto b/proto/util/v1/query.proto index 9fe63a85c..ffaeb5ed0 100644 --- a/proto/util/v1/query.proto +++ b/proto/util/v1/query.proto @@ -2,10 +2,10 @@ syntax = "proto3"; package nibiru.util.v1; +import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "vpool/v1/state.proto"; +import "perp/amm/v1/state.proto"; option go_package = "github.com/NibiruChain/nibiru/x/util/types"; diff --git a/proto/vpool/v1/genesis.proto b/proto/vpool/v1/genesis.proto deleted file mode 100644 index c08842c53..000000000 --- a/proto/vpool/v1/genesis.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; -package nibiru.vpool.v1; - -import "gogoproto/gogo.proto"; -import "vpool/v1/state.proto"; - -option go_package = "github.com/NibiruChain/nibiru/x/vpool/types"; - -// GenesisState defines the vpool module's genesis state. -message GenesisState { - repeated Vpool vpools = 1 [(gogoproto.nullable) = false]; -} diff --git a/x/common/testutil/cli/query.go b/x/common/testutil/cli/query.go index b66cb71a0..6476cbd28 100644 --- a/x/common/testutil/cli/query.go +++ b/x/common/testutil/cli/query.go @@ -13,10 +13,10 @@ import ( "github.com/NibiruChain/nibiru/x/common/asset" oraclecli "github.com/NibiruChain/nibiru/x/oracle/client/cli" oracletypes "github.com/NibiruChain/nibiru/x/oracle/types" + vpooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" perpcli "github.com/NibiruChain/nibiru/x/perp/client/cli" perptypes "github.com/NibiruChain/nibiru/x/perp/types" vpoolcli "github.com/NibiruChain/nibiru/x/vpool/client/cli" - vpooltypes "github.com/NibiruChain/nibiru/x/vpool/types" ) // ExecQueryOption defines a type which customizes a CLI query operation. diff --git a/x/common/testutil/mock/perp_interfaces.go b/x/common/testutil/mock/perp_interfaces.go index 528260eba..56aa35ad6 100644 --- a/x/common/testutil/mock/perp_interfaces.go +++ b/x/common/testutil/mock/perp_interfaces.go @@ -10,7 +10,7 @@ import ( asset "github.com/NibiruChain/nibiru/x/common/asset" types "github.com/NibiruChain/nibiru/x/epochs/types" - types0 "github.com/NibiruChain/nibiru/x/vpool/types" + types0 "github.com/NibiruChain/nibiru/x/perp/amm/types" types1 "github.com/cosmos/cosmos-sdk/types" types2 "github.com/cosmos/cosmos-sdk/x/auth/types" gomock "github.com/golang/mock/gomock" diff --git a/x/vpool/types/codec.go b/x/perp/amm/types/codec.go similarity index 100% rename from x/vpool/types/codec.go rename to x/perp/amm/types/codec.go diff --git a/x/vpool/types/errors.go b/x/perp/amm/types/errors.go similarity index 100% rename from x/vpool/types/errors.go rename to x/perp/amm/types/errors.go diff --git a/x/vpool/types/event.pb.go b/x/perp/amm/types/event.pb.go similarity index 87% rename from x/vpool/types/event.pb.go rename to x/perp/amm/types/event.pb.go index b93c6a0c5..dd9bbc4b7 100644 --- a/x/vpool/types/event.pb.go +++ b/x/perp/amm/types/event.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: vpool/v1/event.proto +// source: perp/amm/v1/event.proto package types @@ -46,7 +46,7 @@ func (m *ReserveSnapshotSavedEvent) Reset() { *m = ReserveSnapshotSavedE func (m *ReserveSnapshotSavedEvent) String() string { return proto.CompactTextString(m) } func (*ReserveSnapshotSavedEvent) ProtoMessage() {} func (*ReserveSnapshotSavedEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_faeff0bc76489252, []int{0} + return fileDescriptor_b5ed53a6cacb22fd, []int{0} } func (m *ReserveSnapshotSavedEvent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -89,14 +89,14 @@ func (m *ReserveSnapshotSavedEvent) GetBlockTimestamp() time.Time { return time.Time{} } -// A swap on the vpool represented by 'pair'. +// A swap on the perp.amm represented by 'pair'. // Amounts are negative or positive base on the perspective of the pool, i.e. -// a negative quote means the trader has gained quote and the vpool lost quote. +// a negative quote means the trader has gained quote and the perp.amm lost quote. type SwapOnVpoolEvent struct { Pair github_com_NibiruChain_nibiru_x_common_asset.Pair `protobuf:"bytes,1,opt,name=pair,proto3,customtype=github.com/NibiruChain/nibiru/x/common/asset.Pair" json:"pair"` - // delta in the quote reserves of the vpool + // delta in the quote reserves of the perp.amm QuoteAmount github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=quote_amount,json=quoteAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"quote_amount"` - // delta in the base reserves of the vpool + // delta in the base reserves of the perp.amm BaseAmount github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=base_amount,json=baseAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"base_amount"` } @@ -104,7 +104,7 @@ func (m *SwapOnVpoolEvent) Reset() { *m = SwapOnVpoolEvent{} } func (m *SwapOnVpoolEvent) String() string { return proto.CompactTextString(m) } func (*SwapOnVpoolEvent) ProtoMessage() {} func (*SwapOnVpoolEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_faeff0bc76489252, []int{1} + return fileDescriptor_b5ed53a6cacb22fd, []int{1} } func (m *SwapOnVpoolEvent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -143,7 +143,7 @@ func (m *MarkPriceChangedEvent) Reset() { *m = MarkPriceChangedEvent{} } func (m *MarkPriceChangedEvent) String() string { return proto.CompactTextString(m) } func (*MarkPriceChangedEvent) ProtoMessage() {} func (*MarkPriceChangedEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_faeff0bc76489252, []int{2} + return fileDescriptor_b5ed53a6cacb22fd, []int{2} } func (m *MarkPriceChangedEvent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -180,46 +180,47 @@ func (m *MarkPriceChangedEvent) GetBlockTimestamp() time.Time { } func init() { - proto.RegisterType((*ReserveSnapshotSavedEvent)(nil), "nibiru.vpool.v1.ReserveSnapshotSavedEvent") - proto.RegisterType((*SwapOnVpoolEvent)(nil), "nibiru.vpool.v1.SwapOnVpoolEvent") - proto.RegisterType((*MarkPriceChangedEvent)(nil), "nibiru.vpool.v1.MarkPriceChangedEvent") + proto.RegisterType((*ReserveSnapshotSavedEvent)(nil), "nibiru.perp.amm.v1.ReserveSnapshotSavedEvent") + proto.RegisterType((*SwapOnVpoolEvent)(nil), "nibiru.perp.amm.v1.SwapOnVpoolEvent") + proto.RegisterType((*MarkPriceChangedEvent)(nil), "nibiru.perp.amm.v1.MarkPriceChangedEvent") } -func init() { proto.RegisterFile("vpool/v1/event.proto", fileDescriptor_faeff0bc76489252) } +func init() { proto.RegisterFile("perp/amm/v1/event.proto", fileDescriptor_b5ed53a6cacb22fd) } -var fileDescriptor_faeff0bc76489252 = []byte{ - // 495 bytes of a gzipped FileDescriptorProto +var fileDescriptor_b5ed53a6cacb22fd = []byte{ + // 499 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x94, 0xbf, 0x6f, 0xd3, 0x40, - 0x14, 0xc7, 0xe3, 0xa6, 0xad, 0xe8, 0x25, 0x50, 0x64, 0x15, 0xc9, 0xcd, 0xe0, 0x84, 0x0c, 0x28, - 0x12, 0xe2, 0x4e, 0x86, 0x89, 0x91, 0xb4, 0x95, 0x58, 0x42, 0x5b, 0x07, 0x31, 0xb0, 0x58, 0x67, - 0xf7, 0xb0, 0x4f, 0x89, 0xfd, 0x8c, 0xef, 0x6c, 0xe0, 0x0f, 0x60, 0xef, 0x9f, 0xd5, 0xb1, 0x12, - 0x0b, 0x62, 0x28, 0x28, 0xf9, 0x33, 0x58, 0xd0, 0xdd, 0xd9, 0x11, 0x03, 0x12, 0x92, 0xa5, 0x4c, - 0xc9, 0xfb, 0xf5, 0xb9, 0xf7, 0xde, 0xf7, 0xc9, 0xe8, 0xa8, 0xca, 0x01, 0x96, 0xa4, 0xf2, 0x08, - 0xab, 0x58, 0x26, 0x71, 0x5e, 0x80, 0x04, 0xfb, 0x30, 0xe3, 0x21, 0x2f, 0x4a, 0xac, 0x83, 0xb8, - 0xf2, 0x06, 0x6e, 0x04, 0x22, 0x05, 0x41, 0x42, 0x2a, 0x18, 0xa9, 0xbc, 0x90, 0x49, 0xea, 0x91, - 0x08, 0x78, 0x66, 0x0a, 0x06, 0xc7, 0x26, 0x1e, 0x68, 0x8b, 0x18, 0xa3, 0x0e, 0x1d, 0xc5, 0x10, - 0x83, 0xf1, 0xab, 0x7f, 0xb5, 0x77, 0x18, 0x03, 0xc4, 0x4b, 0x46, 0xb4, 0x15, 0x96, 0x1f, 0x88, - 0xe4, 0x29, 0x13, 0x92, 0xa6, 0xb9, 0x49, 0x18, 0x7f, 0xeb, 0xa2, 0x63, 0x9f, 0x09, 0x56, 0x54, - 0x6c, 0x9e, 0xd1, 0x5c, 0x24, 0x20, 0xe7, 0xb4, 0x62, 0x57, 0x67, 0xaa, 0x4d, 0x7b, 0x86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d, 0xc1, 0x16, 0xff, 0xeb, 0x0a, 0xba, 0xed, 0xaf, + 0x60, 0x76, 0x72, 0xb5, 0xf6, 0x9c, 0xeb, 0xb5, 0xe7, 0xfc, 0x5a, 0x7b, 0xce, 0xe5, 0xc6, 0xeb, + 0x5c, 0x6f, 0xbc, 0xce, 0xf7, 0x8d, 0xd7, 0x79, 0x8f, 0xff, 0x37, 0xe7, 0xf6, 0xa3, 0x65, 0x7a, + 0x8c, 0xf6, 0xcd, 0xbb, 0x2f, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0x20, 0x49, 0x79, 0x12, 0xcd, + 0x04, 0x00, 0x00, } func (m *ReserveSnapshotSavedEvent) Marshal() (dAtA []byte, err error) { diff --git a/x/vpool/types/expected_keepers.go b/x/perp/amm/types/expected_keepers.go similarity index 100% rename from x/vpool/types/expected_keepers.go rename to x/perp/amm/types/expected_keepers.go diff --git a/x/vpool/types/genesis.go b/x/perp/amm/types/genesis.go similarity index 100% rename from x/vpool/types/genesis.go rename to x/perp/amm/types/genesis.go diff --git a/x/vpool/types/genesis.pb.go b/x/perp/amm/types/genesis.pb.go similarity index 81% rename from x/vpool/types/genesis.pb.go rename to x/perp/amm/types/genesis.pb.go index 319048901..9130b5781 100644 --- a/x/vpool/types/genesis.pb.go +++ b/x/perp/amm/types/genesis.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: vpool/v1/genesis.proto +// source: perp/amm/v1/genesis.proto package types @@ -23,7 +23,7 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// GenesisState defines the vpool module's genesis state. +// GenesisState defines the perp.amm module's genesis state. type GenesisState struct { Vpools []Vpool `protobuf:"bytes,1,rep,name=vpools,proto3" json:"vpools"` } @@ -32,7 +32,7 @@ func (m *GenesisState) Reset() { *m = GenesisState{} } func (m *GenesisState) String() string { return proto.CompactTextString(m) } func (*GenesisState) ProtoMessage() {} func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_fc3ffc8cca622811, []int{0} + return fileDescriptor_f58d73ddbc212d42, []int{0} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -69,26 +69,26 @@ func (m *GenesisState) GetVpools() []Vpool { } func init() { - proto.RegisterType((*GenesisState)(nil), "nibiru.vpool.v1.GenesisState") + proto.RegisterType((*GenesisState)(nil), "nibiru.perp.amm.v1.GenesisState") } -func init() { proto.RegisterFile("vpool/v1/genesis.proto", fileDescriptor_fc3ffc8cca622811) } +func init() { proto.RegisterFile("perp/amm/v1/genesis.proto", fileDescriptor_f58d73ddbc212d42) } -var fileDescriptor_fc3ffc8cca622811 = []byte{ - // 194 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2b, 0x2b, 0xc8, 0xcf, - 0xcf, 0xd1, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, - 0x2f, 0xc9, 0x17, 0xe2, 0xcf, 0xcb, 0x4c, 0xca, 0x2c, 0x2a, 0xd5, 0x03, 0x4b, 0xeb, 0x95, 0x19, - 0x4a, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0xe5, 0xf4, 0x41, 0x2c, 0x88, 0x32, 0x29, 0x11, 0xb8, - 0xf6, 0xe2, 0x92, 0xc4, 0x92, 0x54, 0x88, 0xa8, 0x92, 0x0b, 0x17, 0x8f, 0x3b, 0xc4, 0xb4, 0x60, - 0x90, 0xa8, 0x90, 0x09, 0x17, 0x1b, 0x58, 0x5d, 0xb1, 0x04, 0xa3, 0x02, 0xb3, 0x06, 0xb7, 0x91, - 0x98, 0x1e, 0x9a, 0xe9, 0x7a, 0x61, 0x20, 0x86, 0x13, 0xcb, 0x89, 0x7b, 0xf2, 0x0c, 0x41, 0x50, - 0xb5, 0x4e, 0xae, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, - 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x9d, 0x9e, - 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0xef, 0x07, 0x36, 0xc9, 0x39, 0x23, 0x31, - 0x33, 0x4f, 0x1f, 0x62, 0xaa, 0x7e, 0x85, 0x3e, 0xc4, 0x55, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, - 0x6c, 0x60, 0x37, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x79, 0x81, 0x21, 0x67, 0xea, 0x00, - 0x00, 0x00, +var fileDescriptor_f58d73ddbc212d42 = []byte{ + // 205 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2c, 0x48, 0x2d, 0x2a, + 0xd0, 0x4f, 0xcc, 0xcd, 0xd5, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, + 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0xca, 0xcb, 0x4c, 0xca, 0x2c, 0x2a, 0xd5, 0x03, 0xa9, + 0xd0, 0x4b, 0xcc, 0xcd, 0xd5, 0x2b, 0x33, 0x94, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x4b, 0xeb, + 0x83, 0x58, 0x10, 0x95, 0x52, 0xe2, 0xc8, 0x86, 0x14, 0x97, 0x24, 0x96, 0xa4, 0x42, 0x24, 0x94, + 0xdc, 0xb9, 0x78, 0xdc, 0x21, 0x66, 0x06, 0x83, 0x44, 0x85, 0xcc, 0xb9, 0xd8, 0xca, 0x0a, 0xf2, + 0xf3, 0x73, 0x8a, 0x25, 0x18, 0x15, 0x98, 0x35, 0xb8, 0x8d, 0x24, 0xf5, 0x30, 0xed, 0xd0, 0x0b, + 0x03, 0xa9, 0x70, 0x62, 0x39, 0x71, 0x4f, 0x9e, 0x21, 0x08, 0xaa, 0xdc, 0xc9, 0xe3, 0xc4, 0x23, + 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, + 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xf4, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, + 0x92, 0xf3, 0x73, 0xf5, 0xfd, 0xc0, 0x86, 0x39, 0x67, 0x24, 0x66, 0xe6, 0xe9, 0x43, 0x0c, 0xd6, + 0xaf, 0xd0, 0x87, 0xbb, 0xad, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x32, 0x63, 0x40, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x32, 0xb6, 0xeb, 0x32, 0xf9, 0x00, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/vpool/types/genesis_test.go b/x/perp/amm/types/genesis_test.go similarity index 100% rename from x/vpool/types/genesis_test.go rename to x/perp/amm/types/genesis_test.go diff --git a/x/vpool/types/gov.go b/x/perp/amm/types/gov.go similarity index 100% rename from x/vpool/types/gov.go rename to x/perp/amm/types/gov.go diff --git a/x/vpool/types/gov.pb.go b/x/perp/amm/types/gov.pb.go similarity index 90% rename from x/vpool/types/gov.pb.go rename to x/perp/amm/types/gov.pb.go index 93a506300..f316f5d60 100644 --- a/x/vpool/types/gov.pb.go +++ b/x/perp/amm/types/gov.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: vpool/v1/gov.proto +// source: perp/amm/v1/gov.proto package types @@ -30,9 +30,11 @@ type CreatePoolProposal struct { Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` // pair represents the pair of the vpool. Pair github_com_NibiruChain_nibiru_x_common_asset.Pair `protobuf:"bytes,3,opt,name=pair,proto3,customtype=github.com/NibiruChain/nibiru/x/common/asset.Pair" json:"pair"` - // quote_asset_reserve is the amount of quote asset the pool will be initialized with. + // quote_asset_reserve is the amount of quote asset the pool will be + // initialized with. QuoteAssetReserve github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=quote_asset_reserve,json=quoteAssetReserve,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"quote_asset_reserve"` - // base_asset_reserve is the amount of base asset the pool will be initialized with. + // base_asset_reserve is the amount of base asset the pool will be + // initialized with. BaseAssetReserve github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=base_asset_reserve,json=baseAssetReserve,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"base_asset_reserve"` Config VpoolConfig `protobuf:"bytes,7,opt,name=config,proto3" json:"config"` } @@ -41,7 +43,7 @@ func (m *CreatePoolProposal) Reset() { *m = CreatePoolProposal{} } func (m *CreatePoolProposal) String() string { return proto.CompactTextString(m) } func (*CreatePoolProposal) ProtoMessage() {} func (*CreatePoolProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_8a393460ab414204, []int{0} + return fileDescriptor_bc2fa0293738799b, []int{0} } func (m *CreatePoolProposal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -102,7 +104,7 @@ func (m *EditPoolConfigProposal) Reset() { *m = EditPoolConfigProposal{} func (m *EditPoolConfigProposal) String() string { return proto.CompactTextString(m) } func (*EditPoolConfigProposal) ProtoMessage() {} func (*EditPoolConfigProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_8a393460ab414204, []int{1} + return fileDescriptor_bc2fa0293738799b, []int{1} } func (m *EditPoolConfigProposal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -169,7 +171,7 @@ func (m *EditSwapInvariantsProposal) Reset() { *m = EditSwapInvariantsPr func (m *EditSwapInvariantsProposal) String() string { return proto.CompactTextString(m) } func (*EditSwapInvariantsProposal) ProtoMessage() {} func (*EditSwapInvariantsProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_8a393460ab414204, []int{2} + return fileDescriptor_bc2fa0293738799b, []int{2} } func (m *EditSwapInvariantsProposal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -233,7 +235,7 @@ func (m *EditSwapInvariantsProposal_SwapInvariantMultiple) Reset() { } func (*EditSwapInvariantsProposal_SwapInvariantMultiple) ProtoMessage() {} func (*EditSwapInvariantsProposal_SwapInvariantMultiple) Descriptor() ([]byte, []int) { - return fileDescriptor_8a393460ab414204, []int{2, 0} + return fileDescriptor_bc2fa0293738799b, []int{2, 0} } func (m *EditSwapInvariantsProposal_SwapInvariantMultiple) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -263,47 +265,47 @@ func (m *EditSwapInvariantsProposal_SwapInvariantMultiple) XXX_DiscardUnknown() var xxx_messageInfo_EditSwapInvariantsProposal_SwapInvariantMultiple proto.InternalMessageInfo func init() { - proto.RegisterType((*CreatePoolProposal)(nil), "nibiru.vpool.v1.CreatePoolProposal") - proto.RegisterType((*EditPoolConfigProposal)(nil), "nibiru.vpool.v1.EditPoolConfigProposal") - proto.RegisterType((*EditSwapInvariantsProposal)(nil), "nibiru.vpool.v1.EditSwapInvariantsProposal") - proto.RegisterType((*EditSwapInvariantsProposal_SwapInvariantMultiple)(nil), "nibiru.vpool.v1.EditSwapInvariantsProposal.SwapInvariantMultiple") + proto.RegisterType((*CreatePoolProposal)(nil), "nibiru.perp.amm.v1.CreatePoolProposal") + proto.RegisterType((*EditPoolConfigProposal)(nil), "nibiru.perp.amm.v1.EditPoolConfigProposal") + proto.RegisterType((*EditSwapInvariantsProposal)(nil), "nibiru.perp.amm.v1.EditSwapInvariantsProposal") + proto.RegisterType((*EditSwapInvariantsProposal_SwapInvariantMultiple)(nil), "nibiru.perp.amm.v1.EditSwapInvariantsProposal.SwapInvariantMultiple") } -func init() { proto.RegisterFile("vpool/v1/gov.proto", fileDescriptor_8a393460ab414204) } +func init() { proto.RegisterFile("perp/amm/v1/gov.proto", fileDescriptor_bc2fa0293738799b) } -var fileDescriptor_8a393460ab414204 = []byte{ - // 484 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x94, 0x3f, 0x6f, 0x13, 0x31, - 0x18, 0xc6, 0xef, 0xc8, 0x1f, 0xc0, 0x19, 0xa0, 0x6e, 0x40, 0xa7, 0x08, 0x5d, 0xa2, 0x0e, 0x28, - 0x12, 0xc2, 0x56, 0xca, 0x44, 0xb7, 0x26, 0x74, 0x60, 0x68, 0x15, 0x1d, 0x12, 0x03, 0x42, 0x44, - 0xce, 0xc5, 0x5c, 0x2d, 0xee, 0xee, 0x35, 0xb6, 0x73, 0x81, 0x6f, 0xc0, 0xd8, 0x05, 0x89, 0xb1, - 0x1f, 0x85, 0xb1, 0x63, 0x47, 0x04, 0x52, 0x85, 0x92, 0x2f, 0x82, 0xce, 0x77, 0x94, 0xa4, 0x80, - 0x50, 0x80, 0xa1, 0x53, 0x9c, 0xf7, 0x79, 0xdf, 0x9f, 0x9f, 0xc7, 0x3e, 0x19, 0xe1, 0x4c, 0x02, - 0xc4, 0x34, 0xeb, 0xd1, 0x08, 0x32, 0x22, 0x15, 0x18, 0xc0, 0x37, 0x52, 0x31, 0x16, 0x6a, 0x4a, - 0xac, 0x44, 0xb2, 0x5e, 0xab, 0x19, 0x41, 0x04, 0x56, 0xa3, 0xf9, 0xaa, 0x68, 0x6b, 0x35, 0xcf, - 0x47, 0xb5, 0x61, 0x86, 0x17, 0xd5, 0xad, 0xf7, 0x15, 0x84, 0x07, 0x8a, 0x33, 0xc3, 0x87, 0x00, - 0x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xf6, 0xde, 0x44, 0x98, 0xe1, 0x79, 0xc3, 0x65, 0xbb, - 0x9b, 0x1f, 0xe9, 0xaa, 0x6b, 0xa7, 0x3b, 0xaa, 0xa0, 0x56, 0x9e, 0xee, 0xc9, 0x8c, 0xc9, 0xc7, - 0x69, 0xc6, 0x94, 0x60, 0xa9, 0xd1, 0xff, 0x9c, 0x70, 0x86, 0x36, 0xf5, 0x8c, 0xc9, 0x91, 0xf8, - 0x8e, 0x1c, 0x25, 0x4c, 0x6a, 0xaf, 0xd6, 0xa9, 0x74, 0x1b, 0xdb, 0xbb, 0x3f, 0xf9, 0xfb, 0xbd, - 0x03, 0xb2, 0x52, 0xde, 0x9f, 0xc6, 0x46, 0xc8, 0x98, 0x97, 0x21, 0x36, 0xf4, 0x8a, 0xc8, 0xa4, - 0x6e, 0x7d, 0x74, 0xd1, 0xad, 0x5f, 0x8e, 0xfc, 0xef, 0x43, 0x3f, 0x40, 0x28, 0x29, 0xd0, 0x82, - 0x2b, 0x7b, 0xf0, 0xeb, 0x7f, 0xa8, 0x4b, 0x84, 0x9d, 0x6b, 0xef, 0x8e, 0xdb, 0xce, 0x87, 0xe3, - 0xb6, 0xd3, 0xdf, 0x3b, 0x99, 0xfb, 0xee, 0xe9, 0xdc, 0x77, 0xbf, 0xce, 0x7d, 0xf7, 0x68, 0xe1, - 0x3b, 0xa7, 0x0b, 0xdf, 0xf9, 0xb4, 0xf0, 0x9d, 0x67, 0xf7, 0xfe, 0x64, 0xb6, 0x78, 0x58, 0xec, - 0x06, 0xe3, 0xba, 0x7d, 0x56, 0x1e, 0x7c, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x41, 0x59, 0xe9, 0x17, - 0xa9, 0x04, 0x00, 0x00, +var fileDescriptor_bc2fa0293738799b = []byte{ + // 489 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x94, 0x31, 0x6f, 0xd3, 0x40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x69, 0xee, + 0xec, 0x9e, 0x67, 0xf1, 0xd7, 0x26, 0xc8, 0xca, 0xf2, 0xde, 0x24, 0xb3, 0x42, 0x65, 0x7c, 0x91, + 0x63, 0xdd, 0xac, 0x88, 0x4c, 0x99, 0xd6, 0x47, 0x1f, 0x6d, 0x9d, 0xbb, 0xe5, 0x5f, 0x5f, 0xfd, + 0x3e, 0x42, 0xb2, 0x42, 0x0b, 0xae, 0xdd, 0xf5, 0xff, 0xf9, 0x1f, 0xbb, 0x44, 0xb8, 0x7b, 0xe5, + 0xdd, 0x71, 0xe4, 0x1d, 0x1d, 0x47, 0x5e, 0xef, 0xe1, 0xc9, 0x2c, 0xf4, 0x4f, 0x67, 0xa1, 0xff, + 0x65, 0x16, 0xfa, 0xef, 0xe7, 0xa1, 0x77, 0x3a, 0x0f, 0xbd, 0x4f, 0xf3, 0xd0, 0x7b, 0x4a, 0x7e, + 0x67, 0xf6, 0x6c, 0xc8, 0xb8, 0x33, 0x46, 0x0d, 0x37, 0x62, 0x6e, 0x7f, 0x0d, 0x00, 0x00, 0xff, + 0xff, 0x91, 0xc0, 0xb0, 0x88, 0xbe, 0x04, 0x00, 0x00, } func (m *CreatePoolProposal) Marshal() (dAtA []byte, err error) { diff --git a/x/vpool/types/gov_test.go b/x/perp/amm/types/gov_test.go similarity index 100% rename from x/vpool/types/gov_test.go rename to x/perp/amm/types/gov_test.go diff --git a/x/vpool/types/keys.go b/x/perp/amm/types/keys.go similarity index 100% rename from x/vpool/types/keys.go rename to x/perp/amm/types/keys.go diff --git a/x/vpool/types/pool.go b/x/perp/amm/types/pool.go similarity index 100% rename from x/vpool/types/pool.go rename to x/perp/amm/types/pool.go diff --git a/x/vpool/types/pool_test.go b/x/perp/amm/types/pool_test.go similarity index 100% rename from x/vpool/types/pool_test.go rename to x/perp/amm/types/pool_test.go diff --git a/x/vpool/types/query.pb.go b/x/perp/amm/types/query.pb.go similarity index 87% rename from x/vpool/types/query.pb.go rename to x/perp/amm/types/query.pb.go index d1ff4fe86..89968c9ce 100644 --- a/x/vpool/types/query.pb.go +++ b/x/perp/amm/types/query.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: vpool/v1/query.proto +// source: perp/amm/v1/query.proto package types @@ -40,7 +40,7 @@ func (m *QueryReserveAssetsRequest) Reset() { *m = QueryReserveAssetsReq func (m *QueryReserveAssetsRequest) String() string { return proto.CompactTextString(m) } func (*QueryReserveAssetsRequest) ProtoMessage() {} func (*QueryReserveAssetsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e2294d8bbf3b156d, []int{0} + return fileDescriptor_be29a9ea93e41df1, []int{0} } func (m *QueryReserveAssetsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -80,7 +80,7 @@ func (m *QueryReserveAssetsResponse) Reset() { *m = QueryReserveAssetsRe func (m *QueryReserveAssetsResponse) String() string { return proto.CompactTextString(m) } func (*QueryReserveAssetsResponse) ProtoMessage() {} func (*QueryReserveAssetsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e2294d8bbf3b156d, []int{1} + return fileDescriptor_be29a9ea93e41df1, []int{1} } func (m *QueryReserveAssetsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -116,7 +116,7 @@ func (m *QueryAllPoolsRequest) Reset() { *m = QueryAllPoolsRequest{} } func (m *QueryAllPoolsRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllPoolsRequest) ProtoMessage() {} func (*QueryAllPoolsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e2294d8bbf3b156d, []int{2} + return fileDescriptor_be29a9ea93e41df1, []int{2} } func (m *QueryAllPoolsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -154,7 +154,7 @@ func (m *QueryAllPoolsResponse) Reset() { *m = QueryAllPoolsResponse{} } func (m *QueryAllPoolsResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllPoolsResponse) ProtoMessage() {} func (*QueryAllPoolsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e2294d8bbf3b156d, []int{3} + return fileDescriptor_be29a9ea93e41df1, []int{3} } func (m *QueryAllPoolsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -199,7 +199,7 @@ func (m *QueryAllPoolsResponse) GetPrices() []PoolPrices { type QueryBaseAssetPriceRequest struct { Pair github_com_NibiruChain_nibiru_x_common_asset.Pair `protobuf:"bytes,1,opt,name=pair,proto3,customtype=github.com/NibiruChain/nibiru/x/common/asset.Pair" json:"pair"` - Direction Direction `protobuf:"varint,2,opt,name=direction,proto3,enum=nibiru.vpool.v1.Direction" json:"direction,omitempty"` + Direction Direction `protobuf:"varint,2,opt,name=direction,proto3,enum=nibiru.perp.amm.v1.Direction" json:"direction,omitempty"` // base asset is the crypto asset, e.g. BTC or ETH BaseAssetAmount github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=base_asset_amount,json=baseAssetAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"base_asset_amount"` } @@ -208,7 +208,7 @@ func (m *QueryBaseAssetPriceRequest) Reset() { *m = QueryBaseAssetPriceR func (m *QueryBaseAssetPriceRequest) String() string { return proto.CompactTextString(m) } func (*QueryBaseAssetPriceRequest) ProtoMessage() {} func (*QueryBaseAssetPriceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e2294d8bbf3b156d, []int{4} + return fileDescriptor_be29a9ea93e41df1, []int{4} } func (m *QueryBaseAssetPriceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -252,7 +252,7 @@ func (m *QueryBaseAssetPriceResponse) Reset() { *m = QueryBaseAssetPrice func (m *QueryBaseAssetPriceResponse) String() string { return proto.CompactTextString(m) } func (*QueryBaseAssetPriceResponse) ProtoMessage() {} func (*QueryBaseAssetPriceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e2294d8bbf3b156d, []int{5} + return fileDescriptor_be29a9ea93e41df1, []int{5} } func (m *QueryBaseAssetPriceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -282,56 +282,57 @@ func (m *QueryBaseAssetPriceResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryBaseAssetPriceResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*QueryReserveAssetsRequest)(nil), "nibiru.vpool.v1.QueryReserveAssetsRequest") - proto.RegisterType((*QueryReserveAssetsResponse)(nil), "nibiru.vpool.v1.QueryReserveAssetsResponse") - proto.RegisterType((*QueryAllPoolsRequest)(nil), "nibiru.vpool.v1.QueryAllPoolsRequest") - proto.RegisterType((*QueryAllPoolsResponse)(nil), "nibiru.vpool.v1.QueryAllPoolsResponse") - proto.RegisterType((*QueryBaseAssetPriceRequest)(nil), "nibiru.vpool.v1.QueryBaseAssetPriceRequest") - proto.RegisterType((*QueryBaseAssetPriceResponse)(nil), "nibiru.vpool.v1.QueryBaseAssetPriceResponse") -} - -func init() { proto.RegisterFile("vpool/v1/query.proto", fileDescriptor_e2294d8bbf3b156d) } - -var fileDescriptor_e2294d8bbf3b156d = []byte{ - // 607 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0x4d, 0x6f, 0xd3, 0x40, - 0x14, 0x8c, 0x93, 0xb6, 0xa2, 0x8b, 0x68, 0xc9, 0x12, 0x4a, 0xea, 0x56, 0x4e, 0x64, 0x41, 0x54, - 0x51, 0xb0, 0x95, 0x70, 0xa1, 0xc7, 0x84, 0x70, 0xe0, 0x00, 0x4a, 0x7d, 0xe0, 0x50, 0x21, 0x2c, - 0xc7, 0x59, 0xa5, 0x06, 0x7b, 0xd7, 0xf1, 0xae, 0x23, 0xca, 0x01, 0x09, 0x0e, 0x1c, 0x11, 0x52, - 0xff, 0x05, 0xbf, 0xa4, 0xc7, 0x4a, 0x5c, 0x50, 0x0f, 0x15, 0x4a, 0xf8, 0x21, 0x68, 0x3f, 0x42, - 0xf3, 0x55, 0xb5, 0x8a, 0xc4, 0x29, 0x56, 0x76, 0xde, 0xbc, 0xd9, 0x37, 0xf3, 0x16, 0x14, 0xfa, - 0x31, 0x21, 0xa1, 0xdd, 0xaf, 0xda, 0xbd, 0x14, 0x25, 0x47, 0x56, 0x9c, 0x10, 0x46, 0xe0, 0x3a, - 0x0e, 0xda, 0x41, 0x92, 0x5a, 0xe2, 0xd0, 0xea, 0x57, 0xf5, 0x42, 0x97, 0x74, 0x89, 0x38, 0xb3, - 0xf9, 0x97, 0x84, 0xe9, 0xdb, 0x5d, 0x42, 0xba, 0x21, 0xb2, 0xbd, 0x38, 0xb0, 0x3d, 0x8c, 0x09, - 0xf3, 0x58, 0x40, 0x30, 0x55, 0xa7, 0x17, 0xd4, 0x94, 0x79, 0x0c, 0xc9, 0x7f, 0xcd, 0x77, 0x60, - 0x73, 0x9f, 0x77, 0x72, 0x10, 0x45, 0x49, 0x1f, 0xd5, 0x29, 0x45, 0x8c, 0x3a, 0xa8, 0x97, 0x22, - 0xca, 0xe0, 0x4b, 0xb0, 0x14, 0x7b, 0x41, 0x52, 0xd4, 0xca, 0xda, 0xce, 0x6a, 0x63, 0xef, 0xe4, - 0xbc, 0x94, 0x39, 0x3b, 0x2f, 0x55, 0xbb, 0x01, 0x3b, 0x4c, 0xdb, 0x96, 0x4f, 0x22, 0xfb, 0x95, - 0x10, 0xf6, 0xec, 0xd0, 0x0b, 0xb0, 0x2d, 0x45, 0xda, 0x1f, 0x6c, 0x9f, 0x44, 0x11, 0xc1, 0xb6, - 0xc7, 0xb9, 0xac, 0x96, 0x17, 0x24, 0x8e, 0xa0, 0x31, 0xcf, 0x34, 0xa0, 0xcf, 0x6b, 0x46, 0x63, - 0x82, 0x29, 0x82, 0x6f, 0x00, 0x6c, 0x7b, 0x14, 0xb9, 0xa2, 0xce, 0x4d, 0x24, 0x46, 0xf5, 0xb6, - 0x54, 0xef, 0xca, 0x58, 0x6f, 0x9f, 0xd0, 0x88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x02, - 0xef, 0x73, 0xa6, 0x26, 0x27, 0xaa, 0xfd, 0xc8, 0x81, 0x65, 0x21, 0x00, 0x7e, 0xd3, 0xc0, 0xad, - 0x89, 0x35, 0x80, 0x0f, 0x67, 0xc6, 0x73, 0xe9, 0x62, 0xea, 0xbb, 0xd7, 0xc2, 0xca, 0x5b, 0x99, - 0xf7, 0xbf, 0xfc, 0xfc, 0x73, 0x9c, 0x35, 0xe0, 0xf6, 0xc8, 0x35, 0xf9, 0x10, 0xa8, 0x0d, 0x90, - 0x73, 0xa6, 0xf0, 0x23, 0xb8, 0x31, 0x4a, 0x28, 0x7c, 0x30, 0x9f, 0x7e, 0x2a, 0xda, 0x7a, 0xe5, - 0x2a, 0x98, 0x12, 0x50, 0x12, 0x02, 0x36, 0xe1, 0xbd, 0x49, 0x01, 0x5e, 0x18, 0xba, 0x32, 0xd5, - 0xc7, 0x1a, 0x58, 0x9b, 0xb4, 0x04, 0x5e, 0x72, 0xc3, 0xb9, 0xd9, 0xd5, 0x1f, 0x5d, 0x0f, 0xac, - 0xe4, 0x54, 0x84, 0x9c, 0x32, 0x34, 0x26, 0xe5, 0x8c, 0x85, 0x4e, 0x18, 0xd7, 0x78, 0x7e, 0x32, - 0x30, 0xb4, 0xd3, 0x81, 0xa1, 0xfd, 0x1e, 0x18, 0xda, 0xf7, 0xa1, 0x91, 0x39, 0x1d, 0x1a, 0x99, - 0x5f, 0x43, 0x23, 0x73, 0xb0, 0x7b, 0xd5, 0x56, 0x48, 0x46, 0x11, 0x85, 0xf6, 0x8a, 0x78, 0x68, - 0x9f, 0xfc, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x5d, 0x0b, 0x78, 0x83, 0xdb, 0x05, 0x00, 0x00, + proto.RegisterType((*QueryReserveAssetsRequest)(nil), "nibiru.perp.amm.v1.QueryReserveAssetsRequest") + proto.RegisterType((*QueryReserveAssetsResponse)(nil), "nibiru.perp.amm.v1.QueryReserveAssetsResponse") + proto.RegisterType((*QueryAllPoolsRequest)(nil), "nibiru.perp.amm.v1.QueryAllPoolsRequest") + proto.RegisterType((*QueryAllPoolsResponse)(nil), "nibiru.perp.amm.v1.QueryAllPoolsResponse") + proto.RegisterType((*QueryBaseAssetPriceRequest)(nil), "nibiru.perp.amm.v1.QueryBaseAssetPriceRequest") + proto.RegisterType((*QueryBaseAssetPriceResponse)(nil), "nibiru.perp.amm.v1.QueryBaseAssetPriceResponse") +} + +func init() { proto.RegisterFile("perp/amm/v1/query.proto", fileDescriptor_be29a9ea93e41df1) } + +var fileDescriptor_be29a9ea93e41df1 = []byte{ + // 614 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0xbf, 0x6f, 0xd3, 0x40, + 0x18, 0x8d, 0xd3, 0x1f, 0xa2, 0x87, 0x28, 0xf4, 0x28, 0x90, 0x9a, 0xe2, 0xb4, 0x46, 0x82, 0x74, + 0xe8, 0x9d, 0x12, 0xc4, 0x80, 0x60, 0x49, 0xc8, 0x00, 0x03, 0x28, 0xf5, 0xc0, 0x50, 0x21, 0xac, + 0x8b, 0x73, 0x4a, 0x0d, 0xb6, 0xcf, 0xf1, 0xd9, 0x11, 0x5d, 0x18, 0x80, 0x91, 0x01, 0x89, 0x81, + 0x85, 0xbf, 0x07, 0x75, 0xac, 0xc4, 0x82, 0x3a, 0x54, 0x28, 0xe1, 0x0f, 0x41, 0x77, 0xbe, 0x84, + 0xfc, 0x70, 0x44, 0x14, 0x89, 0x29, 0x91, 0xbf, 0xf7, 0xbd, 0xf7, 0xee, 0xfb, 0xde, 0x1d, 0xb8, + 0x11, 0xd2, 0x28, 0xc4, 0xc4, 0xf7, 0x71, 0xb7, 0x8c, 0x3b, 0x09, 0x8d, 0x8e, 0x51, 0x18, 0xb1, + 0x98, 0x41, 0x18, 0xb8, 0x4d, 0x37, 0x4a, 0x90, 0xa8, 0x23, 0xe2, 0xfb, 0xa8, 0x5b, 0xd6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x7f, 0xc9, 0xef, 0xc2, 0xe2, 0x60, + 0x7d, 0xc3, 0xa7, 0x41, 0xdd, 0x89, 0x74, 0xe0, 0x1c, 0x7e, 0xd0, 0xc0, 0x85, 0x41, 0x68, 0x61, + 0x69, 0xa6, 0xca, 0x44, 0xe0, 0xf5, 0xbd, 0x39, 0x90, 0xca, 0x8a, 0x29, 0xad, 0x6c, 0x43, 0x7d, + 0xca, 0x0a, 0xf1, 0x3c, 0x3b, 0x8d, 0xfb, 0x37, 0x0d, 0xac, 0x8f, 0x6f, 0x09, 0xce, 0x3e, 0x71, + 0x66, 0xa8, 0x75, 0x3c, 0x37, 0x5e, 0xf9, 0xda, 0x93, 0xbe, 0x6e, 0xc3, 0xdd, 0x29, 0x5f, 0x23, + 0x81, 0x94, 0x4b, 0xad, 0x3d, 0x39, 0xe9, 0x19, 0xda, 0x69, 0xcf, 0xd0, 0x7e, 0xf5, 0x0c, 0xed, + 0x73, 0xdf, 0xc8, 0x9d, 0xf6, 0x8d, 0xdc, 0xcf, 0xbe, 0x91, 0x3b, 0x44, 0xff, 0xba, 0x34, 0x43, + 0x52, 0x99, 0x94, 0xe6, 0xaa, 0x7c, 0x90, 0xef, 0xfd, 0x09, 0x00, 0x00, 0xff, 0xff, 0xbb, 0x26, + 0xb4, 0x4d, 0x0c, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -364,7 +365,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) ReserveAssets(ctx context.Context, in *QueryReserveAssetsRequest, opts ...grpc.CallOption) (*QueryReserveAssetsResponse, error) { out := new(QueryReserveAssetsResponse) - err := c.cc.Invoke(ctx, "/nibiru.vpool.v1.Query/ReserveAssets", in, out, opts...) + err := c.cc.Invoke(ctx, "/nibiru.perp.amm.v1.Query/ReserveAssets", in, out, opts...) if err != nil { return nil, err } @@ -373,7 +374,7 @@ func (c *queryClient) ReserveAssets(ctx context.Context, in *QueryReserveAssetsR func (c *queryClient) AllPools(ctx context.Context, in *QueryAllPoolsRequest, opts ...grpc.CallOption) (*QueryAllPoolsResponse, error) { out := new(QueryAllPoolsResponse) - err := c.cc.Invoke(ctx, "/nibiru.vpool.v1.Query/AllPools", in, out, opts...) + err := c.cc.Invoke(ctx, "/nibiru.perp.amm.v1.Query/AllPools", in, out, opts...) if err != nil { return nil, err } @@ -382,7 +383,7 @@ func (c *queryClient) AllPools(ctx context.Context, in *QueryAllPoolsRequest, op func (c *queryClient) BaseAssetPrice(ctx context.Context, in *QueryBaseAssetPriceRequest, opts ...grpc.CallOption) (*QueryBaseAssetPriceResponse, error) { out := new(QueryBaseAssetPriceResponse) - err := c.cc.Invoke(ctx, "/nibiru.vpool.v1.Query/BaseAssetPrice", in, out, opts...) + err := c.cc.Invoke(ctx, "/nibiru.perp.amm.v1.Query/BaseAssetPrice", in, out, opts...) if err != nil { return nil, err } @@ -427,7 +428,7 @@ func _Query_ReserveAssets_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/nibiru.vpool.v1.Query/ReserveAssets", + FullMethod: "/nibiru.perp.amm.v1.Query/ReserveAssets", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).ReserveAssets(ctx, req.(*QueryReserveAssetsRequest)) @@ -445,7 +446,7 @@ func _Query_AllPools_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/nibiru.vpool.v1.Query/AllPools", + FullMethod: "/nibiru.perp.amm.v1.Query/AllPools", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).AllPools(ctx, req.(*QueryAllPoolsRequest)) @@ -463,7 +464,7 @@ func _Query_BaseAssetPrice_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/nibiru.vpool.v1.Query/BaseAssetPrice", + FullMethod: "/nibiru.perp.amm.v1.Query/BaseAssetPrice", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).BaseAssetPrice(ctx, req.(*QueryBaseAssetPriceRequest)) @@ -472,7 +473,7 @@ func _Query_BaseAssetPrice_Handler(srv interface{}, ctx context.Context, dec fun } var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "nibiru.vpool.v1.Query", + ServiceName: "nibiru.perp.amm.v1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { @@ -489,7 +490,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "vpool/v1/query.proto", + Metadata: "perp/amm/v1/query.proto", } func (m *QueryReserveAssetsRequest) Marshal() (dAtA []byte, err error) { diff --git a/x/vpool/types/query.pb.gw.go b/x/perp/amm/types/query.pb.gw.go similarity index 96% rename from x/vpool/types/query.pb.gw.go rename to x/perp/amm/types/query.pb.gw.go index 3359d2748..84507f38d 100644 --- a/x/vpool/types/query.pb.gw.go +++ b/x/perp/amm/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: vpool/v1/query.proto +// source: perp/amm/v1/query.proto /* Package types is a reverse proxy. @@ -292,11 +292,11 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_ReserveAssets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"nibiru", "vpool", "reserve_assets"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ReserveAssets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"nibiru", "perp", "amm", "reserve_assets"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_AllPools_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"nibiru", "vpool", "all_pools"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_AllPools_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"nibiru", "perp", "amm", "all_pools"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_BaseAssetPrice_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"nibiru", "vpool", "base_asset_price"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_BaseAssetPrice_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"nibiru", "perp", "amm", "base_asset_price"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( diff --git a/x/vpool/types/snapshot.go b/x/perp/amm/types/snapshot.go similarity index 100% rename from x/vpool/types/snapshot.go rename to x/perp/amm/types/snapshot.go diff --git a/x/vpool/types/snapshot_test.go b/x/perp/amm/types/snapshot_test.go similarity index 100% rename from x/vpool/types/snapshot_test.go rename to x/perp/amm/types/snapshot_test.go diff --git a/x/vpool/types/state.pb.go b/x/perp/amm/types/state.pb.go similarity index 88% rename from x/vpool/types/state.pb.go rename to x/perp/amm/types/state.pb.go index 99d671edc..5b7d1fac0 100644 --- a/x/vpool/types/state.pb.go +++ b/x/perp/amm/types/state.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: vpool/v1/state.proto +// source: perp/amm/v1/state.proto package types @@ -51,7 +51,7 @@ func (x Direction) String() string { } func (Direction) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_e9da3afd19017067, []int{0} + return fileDescriptor_ccae3672192ecda2, []int{0} } // Enumerates different options of calculating twap. @@ -86,7 +86,7 @@ func (x TwapCalcOption) String() string { } func (TwapCalcOption) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_e9da3afd19017067, []int{1} + return fileDescriptor_ccae3672192ecda2, []int{1} } // A virtual pool used only for price discovery of perpetual futures contracts. @@ -112,7 +112,7 @@ type Vpool struct { func (m *Vpool) Reset() { *m = Vpool{} } func (*Vpool) ProtoMessage() {} func (*Vpool) Descriptor() ([]byte, []int) { - return fileDescriptor_e9da3afd19017067, []int{0} + return fileDescriptor_ccae3672192ecda2, []int{0} } func (m *Vpool) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -165,7 +165,7 @@ func (m *VpoolConfig) Reset() { *m = VpoolConfig{} } func (m *VpoolConfig) String() string { return proto.CompactTextString(m) } func (*VpoolConfig) ProtoMessage() {} func (*VpoolConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_e9da3afd19017067, []int{1} + return fileDescriptor_ccae3672192ecda2, []int{1} } func (m *VpoolConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -206,7 +206,7 @@ func (m *CurrentTWAP) Reset() { *m = CurrentTWAP{} } func (m *CurrentTWAP) String() string { return proto.CompactTextString(m) } func (*CurrentTWAP) ProtoMessage() {} func (*CurrentTWAP) Descriptor() ([]byte, []int) { - return fileDescriptor_e9da3afd19017067, []int{2} + return fileDescriptor_ccae3672192ecda2, []int{2} } func (m *CurrentTWAP) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -242,7 +242,7 @@ func (m *CurrentTWAP) GetPairID() string { return "" } -// a snapshot of the vpool's reserves at a given point in time +// a snapshot of the perp.amm's reserves at a given point in time type ReserveSnapshot struct { Pair github_com_NibiruChain_nibiru_x_common_asset.Pair `protobuf:"bytes,5,opt,name=pair,proto3,customtype=github.com/NibiruChain/nibiru/x/common/asset.Pair" json:"pair"` BaseAssetReserve github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=base_asset_reserve,json=baseAssetReserve,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"base_asset_reserve"` @@ -256,7 +256,7 @@ func (m *ReserveSnapshot) Reset() { *m = ReserveSnapshot{} } func (m *ReserveSnapshot) String() string { return proto.CompactTextString(m) } func (*ReserveSnapshot) ProtoMessage() {} func (*ReserveSnapshot) Descriptor() ([]byte, []int) { - return fileDescriptor_e9da3afd19017067, []int{3} + return fileDescriptor_ccae3672192ecda2, []int{3} } func (m *ReserveSnapshot) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -315,7 +315,7 @@ func (m *PoolPrices) Reset() { *m = PoolPrices{} } func (m *PoolPrices) String() string { return proto.CompactTextString(m) } func (*PoolPrices) ProtoMessage() {} func (*PoolPrices) Descriptor() ([]byte, []int) { - return fileDescriptor_e9da3afd19017067, []int{4} + return fileDescriptor_ccae3672192ecda2, []int{4} } func (m *PoolPrices) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -366,76 +366,76 @@ func (m *PoolPrices) GetBlockNumber() int64 { } func init() { - proto.RegisterEnum("nibiru.vpool.v1.Direction", Direction_name, Direction_value) - proto.RegisterEnum("nibiru.vpool.v1.TwapCalcOption", TwapCalcOption_name, TwapCalcOption_value) - proto.RegisterType((*Vpool)(nil), "nibiru.vpool.v1.Vpool") - proto.RegisterType((*VpoolConfig)(nil), "nibiru.vpool.v1.VpoolConfig") - proto.RegisterType((*CurrentTWAP)(nil), "nibiru.vpool.v1.CurrentTWAP") - proto.RegisterType((*ReserveSnapshot)(nil), "nibiru.vpool.v1.ReserveSnapshot") - proto.RegisterType((*PoolPrices)(nil), "nibiru.vpool.v1.PoolPrices") -} - -func init() { proto.RegisterFile("vpool/v1/state.proto", fileDescriptor_e9da3afd19017067) } - -var fileDescriptor_e9da3afd19017067 = []byte{ - // 904 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x96, 0xcf, 0x6f, 0xdb, 0x36, - 0x14, 0xc7, 0x6d, 0xc7, 0x49, 0xeb, 0xe7, 0x26, 0x76, 0xd9, 0x64, 0x55, 0xbb, 0xc2, 0xce, 0x3c, - 0x60, 0x28, 0x3a, 0xcc, 0x46, 0xb6, 0xd3, 0x72, 0xf3, 0xaf, 0x0e, 0x06, 0xac, 0x48, 0x95, 0x9d, - 0x16, 0x28, 0x86, 0x11, 0xb4, 0xcc, 0xd8, 0x84, 0x25, 0x52, 0xa5, 0x68, 0xd7, 0xfd, 0x2f, 0x76, - 0xec, 0x71, 0x7f, 0xca, 0x76, 0xeb, 0xb1, 0xc7, 0x61, 0x87, 0x60, 0x48, 0xfe, 0x83, 0x01, 0x3b, - 0xed, 0x32, 0x90, 0xd2, 0x32, 0xa7, 0x18, 0x30, 0x54, 0x68, 0x4f, 0x36, 0xdf, 0x23, 0x3f, 0x5f, - 0xea, 0xfb, 0x9e, 0x1e, 0x04, 0xfb, 0xab, 0x48, 0x88, 0xa0, 0xb5, 0x3a, 0x6a, 0xc5, 0x8a, 0x28, - 0xda, 0x8c, 0xa4, 0x50, 0x02, 0x55, 0x38, 0x9b, 0x30, 0xb9, 0x6c, 0x9a, 0x64, 0x73, 0x75, 0x74, - 0xff, 0x9e, 0x2f, 0xe2, 0x50, 0xc4, 0xd8, 0xa4, 0x5b, 0xc9, 0x22, 0xd9, 0x7b, 0x7f, 0x7f, 0x26, - 0x66, 0x22, 0x89, 0xeb, 0x7f, 0x49, 0xb4, 0xf1, 0x73, 0x11, 0xb6, 0x9f, 0xea, 0xd3, 0xc8, 0x86, - 0x62, 0x44, 0x98, 0xb4, 0xf2, 0x87, 0xf9, 0x87, 0xa5, 0xce, 0xb7, 0x6f, 0xce, 0xeb, 0xb9, 0xdf, - 0xce, 0xeb, 0x47, 0x33, 0xa6, 0xe6, 0xcb, 0x49, 0xd3, 0x17, 0x61, 0xeb, 0xc4, 0x88, 0x75, 0xe7, - 0x84, 0xf1, 0x56, 0x22, 0xdc, 0x5a, 0xb7, 0x7c, 0x11, 0x86, 0x82, 0xb7, 0x48, 0x1c, 0x53, 0xd5, - 0x74, 0x09, 0x93, 0x9e, 0xc1, 0xa0, 0xef, 0x01, 0x4d, 0x48, 0x4c, 0xb1, 0x49, 0x60, 0x49, 0x63, - 0x2a, 0x57, 0xd4, 0x2a, 0x18, 0x78, 0x33, 0x85, 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, 0xa3, 0x7d, 0xa8, 0x7a, 0x7d, 0xdb, 0x79, 0xda, - 0xc7, 0x8f, 0x3d, 0xc7, 0x4e, 0xa2, 0x85, 0x47, 0x33, 0xd8, 0x1b, 0xbf, 0x24, 0x51, 0x97, 0x04, - 0xbe, 0x13, 0x19, 0xe6, 0x21, 0x3c, 0xd0, 0x53, 0x03, 0x77, 0xdb, 0xc3, 0x2e, 0x76, 0xdc, 0xff, - 0x40, 0xdf, 0x84, 0xe2, 0xc8, 0x75, 0xc6, 0x09, 0xf3, 0xc9, 0xa9, 0x33, 0xee, 0xe3, 0xf6, 0x68, - 0xd4, 0x1f, 0xe3, 0xd1, 0xb3, 0xb6, 0x5b, 0x2d, 0xa0, 0x3b, 0x50, 0xe9, 0xb4, 0x47, 0xd7, 0x82, - 0x5b, 0x9d, 0xfe, 0x9b, 0x8b, 0x5a, 0xfe, 0xed, 0x45, 0x2d, 0xff, 0xfb, 0x45, 0x2d, 0xff, 0xe3, - 0x65, 0x2d, 0xf7, 0xf6, 0xb2, 0x96, 0xfb, 0xf5, 0xb2, 0x96, 0x7b, 0xfe, 0xe5, 0xff, 0xb5, 0x4a, - 0xf2, 0x85, 0x65, 0xdc, 0x9c, 0xec, 0x98, 0xaf, 0xa3, 0x6f, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, - 0xb0, 0xb8, 0x6d, 0xd5, 0x77, 0x09, 0x00, 0x00, + proto.RegisterEnum("nibiru.perp.amm.v1.Direction", Direction_name, Direction_value) + proto.RegisterEnum("nibiru.perp.amm.v1.TwapCalcOption", TwapCalcOption_name, TwapCalcOption_value) + proto.RegisterType((*Vpool)(nil), "nibiru.perp.amm.v1.Vpool") + proto.RegisterType((*VpoolConfig)(nil), "nibiru.perp.amm.v1.VpoolConfig") + proto.RegisterType((*CurrentTWAP)(nil), "nibiru.perp.amm.v1.CurrentTWAP") + proto.RegisterType((*ReserveSnapshot)(nil), "nibiru.perp.amm.v1.ReserveSnapshot") + proto.RegisterType((*PoolPrices)(nil), "nibiru.perp.amm.v1.PoolPrices") +} + +func init() { proto.RegisterFile("perp/amm/v1/state.proto", fileDescriptor_ccae3672192ecda2) } + +var fileDescriptor_ccae3672192ecda2 = []byte{ + // 912 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x96, 0x4f, 0x6f, 0xdb, 0x36, + 0x18, 0xc6, 0x6d, 0xc7, 0x49, 0xeb, 0xd7, 0xcd, 0x9f, 0xb2, 0xc9, 0xa2, 0x76, 0x83, 0x9d, 0x79, + 0xc0, 0x50, 0x14, 0x98, 0x84, 0x6c, 0xa7, 0x15, 0xd8, 0xc1, 0xb1, 0xdd, 0xcd, 0x40, 0x14, 0xa9, + 0xb2, 0xd3, 0x02, 0xc5, 0x30, 0x82, 0x96, 0x19, 0x87, 0x88, 0x48, 0xaa, 0x14, 0x9d, 0xa6, 0xdf, + 0x62, 0xc7, 0x1e, 0xf7, 0x55, 0x86, 0x5d, 0x7a, 0xec, 0x71, 0xd8, 0x21, 0x18, 0x92, 0x6f, 0x30, + 0x60, 0xa7, 0x5d, 0x06, 0x52, 0x5a, 0xe6, 0x6c, 0x03, 0x86, 0x0a, 0xed, 0xc9, 0xe6, 0x43, 0xf2, + 0xf7, 0x50, 0x0f, 0x5f, 0xbd, 0x10, 0x6c, 0xa7, 0x54, 0xa5, 0x1e, 0xe1, 0xdc, 0x3b, 0xdd, 0xf5, + 0x32, 0x4d, 0x34, 0x75, 0x53, 0x25, 0xb5, 0x44, 0x48, 0xb0, 0x09, 0x53, 0x73, 0xd7, 0xcc, 0xbb, + 0x84, 0x73, 0xf7, 0x74, 0xf7, 0xde, 0xdd, 0x58, 0x66, 0x5c, 0x66, 0xd8, 0xae, 0xf0, 0xf2, 0x41, + 0xbe, 0xfc, 0xde, 0xe6, 0x4c, 0xce, 0x64, 0xae, 0x9b, 0x7f, 0xb9, 0xda, 0xf9, 0xa9, 0x0e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xdc, 0xff, 0x2b, 0x95, 0xab, 0x4f, 0x2d, 0x1b, 0xe8, 0x64, 0xc5, 0x7e, 0x23, + 0x7d, 0xf1, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0xec, 0x10, 0x15, 0x0b, 0x83, 0x09, 0x00, 0x00, } func (m *Vpool) Marshal() (dAtA []byte, err error) { diff --git a/x/perp/client/cli/cli_test.go b/x/perp/client/cli/cli_test.go index bd102fa10..167aaa987 100644 --- a/x/perp/client/cli/cli_test.go +++ b/x/perp/client/cli/cli_test.go @@ -19,9 +19,9 @@ import ( testutilcli "github.com/NibiruChain/nibiru/x/common/testutil/cli" "github.com/NibiruChain/nibiru/x/common/testutil/genesis" oracletypes "github.com/NibiruChain/nibiru/x/oracle/types" + vpooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" "github.com/NibiruChain/nibiru/x/perp/client/cli" perptypes "github.com/NibiruChain/nibiru/x/perp/types" - vpooltypes "github.com/NibiruChain/nibiru/x/vpool/types" ) type IntegrationTestSuite struct { diff --git a/x/perp/integration/action/vpool.go b/x/perp/integration/action/vpool.go index 7efce0e8b..112bba399 100644 --- a/x/perp/integration/action/vpool.go +++ b/x/perp/integration/action/vpool.go @@ -10,7 +10,7 @@ import ( "github.com/NibiruChain/nibiru/app" "github.com/NibiruChain/nibiru/x/common/asset" - vpooltypes "github.com/NibiruChain/nibiru/x/vpool/types" + vpooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" ) // CreateVPoolAction creates a vpool diff --git a/x/perp/keeper/calc.go b/x/perp/keeper/calc.go index 591e25d29..c561aeb41 100644 --- a/x/perp/keeper/calc.go +++ b/x/perp/keeper/calc.go @@ -3,7 +3,7 @@ package keeper import ( "fmt" - vpooltypes "github.com/NibiruChain/nibiru/x/vpool/types" + vpooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/perp/keeper/calc_test.go b/x/perp/keeper/calc_test.go index fbcb86264..48496a6b1 100644 --- a/x/perp/keeper/calc_test.go +++ b/x/perp/keeper/calc_test.go @@ -13,9 +13,9 @@ import ( "github.com/NibiruChain/nibiru/x/common/denoms" "github.com/NibiruChain/nibiru/x/common/testutil" "github.com/NibiruChain/nibiru/x/common/testutil/testapp" + vpooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" "github.com/NibiruChain/nibiru/x/perp/keeper" "github.com/NibiruChain/nibiru/x/perp/types" - vpooltypes "github.com/NibiruChain/nibiru/x/vpool/types" ) func TestCalcRemainMarginWithFundingPayment(t *testing.T) { diff --git a/x/perp/keeper/calc_unit_test.go b/x/perp/keeper/calc_unit_test.go index 8d72c69a0..61f53a200 100644 --- a/x/perp/keeper/calc_unit_test.go +++ b/x/perp/keeper/calc_unit_test.go @@ -11,8 +11,8 @@ import ( "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/common/denoms" "github.com/NibiruChain/nibiru/x/common/testutil" + vpooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" "github.com/NibiruChain/nibiru/x/perp/types" - vpooltypes "github.com/NibiruChain/nibiru/x/vpool/types" ) func TestCalcFreeCollateralSuccess(t *testing.T) { diff --git a/x/perp/keeper/clearing_house.go b/x/perp/keeper/clearing_house.go index 011a3299f..4fc4ccc4b 100644 --- a/x/perp/keeper/clearing_house.go +++ b/x/perp/keeper/clearing_house.go @@ -8,8 +8,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/NibiruChain/nibiru/x/common/asset" + vpooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" "github.com/NibiruChain/nibiru/x/perp/types" - vpooltypes "github.com/NibiruChain/nibiru/x/vpool/types" ) /* diff --git a/x/perp/keeper/clearing_house_integration_test.go b/x/perp/keeper/clearing_house_integration_test.go index 653c3104d..75941d57f 100644 --- a/x/perp/keeper/clearing_house_integration_test.go +++ b/x/perp/keeper/clearing_house_integration_test.go @@ -23,8 +23,8 @@ import ( . "github.com/NibiruChain/nibiru/x/perp/integration/assertion" "github.com/NibiruChain/nibiru/x/perp/keeper" + vpooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" perptypes "github.com/NibiruChain/nibiru/x/perp/types" - vpooltypes "github.com/NibiruChain/nibiru/x/vpool/types" ) func createInitVPool() Action { diff --git a/x/perp/keeper/clearing_house_unit_test.go b/x/perp/keeper/clearing_house_unit_test.go index d79d88cb6..493ea88c5 100644 --- a/x/perp/keeper/clearing_house_unit_test.go +++ b/x/perp/keeper/clearing_house_unit_test.go @@ -23,8 +23,8 @@ import ( "github.com/NibiruChain/nibiru/x/common/denoms" testutilevents "github.com/NibiruChain/nibiru/x/common/testutil" "github.com/NibiruChain/nibiru/x/common/testutil/mock" + vpooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" "github.com/NibiruChain/nibiru/x/perp/types" - vpooltypes "github.com/NibiruChain/nibiru/x/vpool/types" ) type mockedDependencies struct { diff --git a/x/perp/keeper/grpc_query_test.go b/x/perp/keeper/grpc_query_test.go index d8e150917..e9559024b 100644 --- a/x/perp/keeper/grpc_query_test.go +++ b/x/perp/keeper/grpc_query_test.go @@ -14,9 +14,9 @@ import ( "github.com/NibiruChain/nibiru/x/common/denoms" "github.com/NibiruChain/nibiru/x/common/testutil" "github.com/NibiruChain/nibiru/x/common/testutil/testapp" + vpooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" "github.com/NibiruChain/nibiru/x/perp/keeper" "github.com/NibiruChain/nibiru/x/perp/types" - vpooltypes "github.com/NibiruChain/nibiru/x/vpool/types" ) func initAppVpools( diff --git a/x/perp/keeper/liquidate.go b/x/perp/keeper/liquidate.go index 9a3d1dea5..94f6c562e 100644 --- a/x/perp/keeper/liquidate.go +++ b/x/perp/keeper/liquidate.go @@ -6,8 +6,8 @@ import ( "github.com/NibiruChain/collections" "github.com/NibiruChain/nibiru/x/common/asset" + vpooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" "github.com/NibiruChain/nibiru/x/perp/types" - vpooltypes "github.com/NibiruChain/nibiru/x/vpool/types" ) /* diff --git a/x/perp/keeper/liquidate_test.go b/x/perp/keeper/liquidate_test.go index a00a9478a..183f359e4 100644 --- a/x/perp/keeper/liquidate_test.go +++ b/x/perp/keeper/liquidate_test.go @@ -16,9 +16,9 @@ import ( "github.com/NibiruChain/nibiru/x/common/testutil" testutilevents "github.com/NibiruChain/nibiru/x/common/testutil" "github.com/NibiruChain/nibiru/x/common/testutil/testapp" + vpooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" "github.com/NibiruChain/nibiru/x/perp/keeper" "github.com/NibiruChain/nibiru/x/perp/types" - vpooltypes "github.com/NibiruChain/nibiru/x/vpool/types" ) func TestExecuteFullLiquidation(t *testing.T) { diff --git a/x/perp/keeper/liquidate_unit_test.go b/x/perp/keeper/liquidate_unit_test.go index 6c052f15c..aaf4aae56 100644 --- a/x/perp/keeper/liquidate_unit_test.go +++ b/x/perp/keeper/liquidate_unit_test.go @@ -16,8 +16,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + vpooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" "github.com/NibiruChain/nibiru/x/perp/types" - vpooltypes "github.com/NibiruChain/nibiru/x/vpool/types" ) func TestLiquidateIntoPartialLiquidation(t *testing.T) { diff --git a/x/perp/keeper/margin.go b/x/perp/keeper/margin.go index 06df3af66..0fe548b1c 100644 --- a/x/perp/keeper/margin.go +++ b/x/perp/keeper/margin.go @@ -8,8 +8,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/NibiruChain/nibiru/x/common/asset" + vpooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" "github.com/NibiruChain/nibiru/x/perp/types" - vpooltypes "github.com/NibiruChain/nibiru/x/vpool/types" ) /* diff --git a/x/perp/keeper/margin_test.go b/x/perp/keeper/margin_test.go index 9a5984117..53e67d3da 100644 --- a/x/perp/keeper/margin_test.go +++ b/x/perp/keeper/margin_test.go @@ -15,9 +15,9 @@ import ( "github.com/NibiruChain/nibiru/x/common/denoms" testutilevents "github.com/NibiruChain/nibiru/x/common/testutil" "github.com/NibiruChain/nibiru/x/common/testutil/testapp" + vpooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" "github.com/NibiruChain/nibiru/x/perp/keeper" "github.com/NibiruChain/nibiru/x/perp/types" - vpooltypes "github.com/NibiruChain/nibiru/x/vpool/types" ) func TestAddMarginSuccess(t *testing.T) { diff --git a/x/perp/keeper/margin_unit_test.go b/x/perp/keeper/margin_unit_test.go index c845f6d8f..f23798133 100644 --- a/x/perp/keeper/margin_unit_test.go +++ b/x/perp/keeper/margin_unit_test.go @@ -15,8 +15,8 @@ import ( "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/common/denoms" testutilevents "github.com/NibiruChain/nibiru/x/common/testutil" + vpooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" "github.com/NibiruChain/nibiru/x/perp/types" - vpooltypes "github.com/NibiruChain/nibiru/x/vpool/types" ) func TestRequireMoreMarginRatio(t *testing.T) { diff --git a/x/perp/keeper/migrations_test.go b/x/perp/keeper/migrations_test.go index b73fd002c..ff09b0699 100644 --- a/x/perp/keeper/migrations_test.go +++ b/x/perp/keeper/migrations_test.go @@ -11,9 +11,9 @@ import ( "github.com/NibiruChain/nibiru/x/common/denoms" "github.com/NibiruChain/nibiru/x/common/testutil" "github.com/NibiruChain/nibiru/x/common/testutil/testapp" + "github.com/NibiruChain/nibiru/x/perp/amm/types" "github.com/NibiruChain/nibiru/x/perp/keeper" perptypes "github.com/NibiruChain/nibiru/x/perp/types" - "github.com/NibiruChain/nibiru/x/vpool/types" ) func TestFrom2To3(t *testing.T) { diff --git a/x/perp/keeper/msg_server_test.go b/x/perp/keeper/msg_server_test.go index e481e7fe0..e10250f1e 100644 --- a/x/perp/keeper/msg_server_test.go +++ b/x/perp/keeper/msg_server_test.go @@ -18,9 +18,9 @@ import ( "github.com/NibiruChain/nibiru/x/common/denoms" "github.com/NibiruChain/nibiru/x/common/testutil" "github.com/NibiruChain/nibiru/x/common/testutil/testapp" + vpooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" "github.com/NibiruChain/nibiru/x/perp/keeper" "github.com/NibiruChain/nibiru/x/perp/types" - vpooltypes "github.com/NibiruChain/nibiru/x/vpool/types" ) func TestMsgServerAddMargin(t *testing.T) { diff --git a/x/perp/keeper/perp_test.go b/x/perp/keeper/perp_test.go index d8726f7d0..3f9f83cdf 100644 --- a/x/perp/keeper/perp_test.go +++ b/x/perp/keeper/perp_test.go @@ -14,9 +14,9 @@ import ( "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/common/testutil" "github.com/NibiruChain/nibiru/x/common/testutil/testapp" + vpooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" "github.com/NibiruChain/nibiru/x/perp/keeper" "github.com/NibiruChain/nibiru/x/perp/types" - vpooltypes "github.com/NibiruChain/nibiru/x/vpool/types" ) func TestKeeperClosePosition(t *testing.T) { diff --git a/x/perp/simulation/operations.go b/x/perp/simulation/operations.go index 745e33d0e..584c1a47e 100644 --- a/x/perp/simulation/operations.go +++ b/x/perp/simulation/operations.go @@ -15,9 +15,9 @@ import ( "github.com/NibiruChain/nibiru/x/common" "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/common/denoms" + pooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" "github.com/NibiruChain/nibiru/x/perp/keeper" "github.com/NibiruChain/nibiru/x/perp/types" - pooltypes "github.com/NibiruChain/nibiru/x/vpool/types" ) const defaultWeight = 100 diff --git a/x/perp/types/event.pb.go b/x/perp/types/event.pb.go index ea4f8087a..a6107ad7d 100644 --- a/x/perp/types/event.pb.go +++ b/x/perp/types/event.pb.go @@ -190,7 +190,7 @@ type PositionLiquidatedEvent struct { Pair github_com_NibiruChain_nibiru_x_common_asset.Pair `protobuf:"bytes,1,opt,name=pair,proto3,customtype=github.com/NibiruChain/nibiru/x/common/asset.Pair" json:"pair"` // owner of the position. TraderAddress string `protobuf:"bytes,2,opt,name=trader_address,json=traderAddress,proto3" json:"trader_address,omitempty"` - // margin * leverage * vPrice. 'notional' is the virtual size times the virtual price on 'vpool'. + // margin * leverage * vPrice. 'notional' is the virtual size times the virtual price on 'perp.amm'. ExchangedQuoteAmount github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=exchanged_quote_amount,json=exchangedQuoteAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exchanged_quote_amount"` // virtual amount of base assets for the position, which would be margin * leverage * priceBasePerQuote. ExchangedPositionSize github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=exchanged_position_size,json=exchangedPositionSize,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exchanged_position_size"` @@ -313,7 +313,7 @@ type PositionSettledEvent struct { Pair github_com_NibiruChain_nibiru_x_common_asset.Pair `protobuf:"bytes,1,opt,name=pair,proto3,customtype=github.com/NibiruChain/nibiru/x/common/asset.Pair" json:"pair"` // Owner of the position. TraderAddress string `protobuf:"bytes,2,opt,name=trader_address,json=traderAddress,proto3" json:"trader_address,omitempty"` - // Settled coin as dictated by the settlement price of the vpool. + // Settled coin as dictated by the settlement price of the perp.amm. SettledCoins github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=settled_coins,json=settledCoins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"settled_coins" yaml:"settled_coins"` } diff --git a/x/perp/types/expected_keepers.go b/x/perp/types/expected_keepers.go index 067f9296f..aa167b933 100644 --- a/x/perp/types/expected_keepers.go +++ b/x/perp/types/expected_keepers.go @@ -12,7 +12,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - vpooltypes "github.com/NibiruChain/nibiru/x/vpool/types" + vpooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" ) // ---------------------------------------------------------- diff --git a/x/util/types/query.pb.go b/x/util/types/query.pb.go index 2b91abfb5..68e8c3617 100644 --- a/x/util/types/query.pb.go +++ b/x/util/types/query.pb.go @@ -6,7 +6,7 @@ package types import ( context "context" fmt "fmt" - _ "github.com/NibiruChain/nibiru/x/vpool/types" + _ "github.com/NibiruChain/nibiru/x/perp/amm/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" @@ -181,34 +181,34 @@ func init() { func init() { proto.RegisterFile("util/v1/query.proto", fileDescriptor_ea08d750598e4157) } var fileDescriptor_ea08d750598e4157 = []byte{ - // 417 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xbf, 0x6e, 0xd5, 0x30, - 0x14, 0xc6, 0xaf, 0xdb, 0x42, 0xc1, 0x48, 0x1d, 0x4c, 0x87, 0x10, 0xae, 0xdc, 0x2a, 0x62, 0xb8, - 0x2a, 0xc2, 0x26, 0xe5, 0x09, 0x48, 0xbb, 0x82, 0x44, 0x16, 0x24, 0x16, 0xe4, 0x24, 0x56, 0xae, - 0x45, 0xe2, 0x93, 0xc6, 0x4e, 0x44, 0x57, 0x5e, 0x00, 0x24, 0x26, 0x1e, 0x01, 0x9e, 0xa4, 0x63, - 0x25, 0x16, 0x26, 0x40, 0xf7, 0xf2, 0x20, 0x28, 0x76, 0x82, 0xb8, 0xfc, 0x91, 0x3a, 0xc5, 0x39, - 0xdf, 0xf9, 0x8e, 0xcf, 0xf7, 0x93, 0xf1, 0xed, 0xce, 0xaa, 0x8a, 0xf7, 0x31, 0x3f, 0xeb, 0x64, - 0x7b, 0xce, 0x9a, 0x16, 0x2c, 0x90, 0x3d, 0xad, 0x32, 0xd5, 0x76, 0x6c, 0xd0, 0x58, 0x1f, 0x87, - 0xfb, 0x25, 0x94, 0xe0, 0x24, 0x3e, 0x9c, 0x7c, 0x57,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0x2b, 0x6e, 0xcf, 0x1b, 0x69, 0x9c, 0xc1, 0xa4, 0xd3, 0xec, 0xe3, 0x0f, 0x08, 0x5f, 0x73, 0x44, - 0xc8, 0x5b, 0x84, 0xf7, 0x36, 0xb1, 0x90, 0xa3, 0x3f, 0xc3, 0xff, 0x9f, 0x6c, 0x78, 0xff, 0x4a, - 0xbd, 0x9e, 0x73, 0x74, 0xef, 0xcd, 0xe7, 0x1f, 0xef, 0xb7, 0x28, 0x99, 0x73, 0x6f, 0xe2, 0xee, - 0x0d, 0xd5, 0xae, 0xf9, 0xe5, 0xc4, 0x31, 0x39, 0xbd, 0x58, 0x51, 0x74, 0xb9, 0xa2, 0xe8, 0xfb, - 0x8a, 0xa2, 0x77, 0x6b, 0x3a, 0xbb, 0x5c, 0xd3, 0xd9, 0x97, 0x35, 0x9d, 0xbd, 0x38, 0xfa, 0x2d, - 0xe8, 0x53, 0x37, 0xe1, 0x64, 0x29, 0x94, 0x9e, 0xa6, 0xbd, 0xf6, 0xf3, 0x5c, 0xe0, 0xec, 0xba, - 0x7b, 0x17, 0x8f, 0x7e, 0x06, 0x00, 0x00, 0xff, 0xff, 0x9a, 0x61, 0x46, 0xb2, 0xa8, 0x02, 0x00, - 0x00, + // 420 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xcf, 0x6e, 0xd4, 0x30, + 0x10, 0xc6, 0xe3, 0xb6, 0x50, 0x30, 0x52, 0x0f, 0x06, 0x89, 0x10, 0x56, 0x6e, 0x15, 0x71, 0x58, + 0x15, 0x61, 0x93, 0xf2, 0x04, 0xa4, 0xbd, 0x82, 0x44, 0x2e, 0x48, 0x5c, 0x90, 0x93, 0x58, 0x59, + 0x8b, 0xc4, 0x93, 0xc6, 0xce, 0x8a, 0x5e, 0x79, 0x01, 0x90, 0x38, 0xf1, 0x08, 0xf0, 0x24, 0x3d, + 0x56, 0xe2, 0xc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xfc, 0x7a, 0xe6, 0x62, 0x12, 0xe2, 0x5d, + 0x51, 0x96, 0x9d, 0x34, 0x26, 0xdc, 0x72, 0xe9, 0xe9, 0x97, 0x48, 0xbc, 0x9b, 0x7b, 0x61, 0xb8, + 0xed, 0x36, 0xb9, 0xc3, 0x3c, 0x46, 0x36, 0x60, 0x64, 0x23, 0x46, 0x76, 0x0c, 0x4a, 0xa7, 0x0f, + 0x87, 0x05, 0x3e, 0x7d, 0xdb, 0x9f, 0x57, 0xca, 0x2e, 0xfa, 0x9c, 0x15, 0xd0, 0xf0, 0x91, 0xb9, + 0xff, 0x3c, 0x30, 0xe5, 0x2b, 0x6e, 0xcf, 0x5a, 0x69, 0x9c, 0xc0, 0x64, 0xd3, 0xec, 0xa3, 0x0f, + 0x08, 0x5f, 0x71, 0x44, 0xc8, 0x5b, 0x84, 0xf7, 0x36, 0xb1, 0x90, 0xc3, 0x3f, 0xcd, 0xff, 0x9f, + 0x6c, 0x74, 0xff, 0x52, 0xbd, 0x9e, 0x73, 0x7c, 0xef, 0xcd, 0xe7, 0x1f, 0xef, 0xb7, 0x28, 0x99, + 0x71, 0x2f, 0xe2, 0xee, 0x8c, 0x1a, 0xd7, 0xfc, 0x72, 0xe2, 0x98, 0x9e, 0x9c, 0xaf, 0x28, 0xba, + 0x58, 0x51, 0xf4, 0x7d, 0x45, 0xd1, 0xbb, 0x35, 0x0d, 0x2e, 0xd6, 0x34, 0xf8, 0xb2, 0xa6, 0xc1, + 0x8b, 0xc3, 0xdf, 0x8c, 0x3e, 0x75, 0x13, 0x8e, 0x17, 0x42, 0xe9, 0x69, 0xda, 0x6b, 0x3f, 0xcf, + 0x19, 0xce, 0xaf, 0xba, 0xbb, 0x78, 0xf4, 0x33, 0x00, 0x00, 0xff, 0xff, 0x11, 0xdf, 0x79, 0xf6, + 0xab, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/vpool/abci.go b/x/vpool/abci.go index f242ac9bd..71f83c625 100644 --- a/x/vpool/abci.go +++ b/x/vpool/abci.go @@ -7,8 +7,8 @@ import ( "github.com/NibiruChain/collections" "github.com/NibiruChain/nibiru/x/common/asset" + "github.com/NibiruChain/nibiru/x/perp/amm/types" "github.com/NibiruChain/nibiru/x/vpool/keeper" - "github.com/NibiruChain/nibiru/x/vpool/types" ) // EndBlocker Called every block to store a snapshot of the vpool. diff --git a/x/vpool/abci_test.go b/x/vpool/abci_test.go index 1251bc487..bfa23c755 100644 --- a/x/vpool/abci_test.go +++ b/x/vpool/abci_test.go @@ -13,8 +13,8 @@ import ( "github.com/NibiruChain/nibiru/x/common/denoms" "github.com/NibiruChain/nibiru/x/common/testutil" "github.com/NibiruChain/nibiru/x/common/testutil/testapp" + "github.com/NibiruChain/nibiru/x/perp/amm/types" "github.com/NibiruChain/nibiru/x/vpool" - "github.com/NibiruChain/nibiru/x/vpool/types" ) func TestSnapshotUpdates(t *testing.T) { diff --git a/x/vpool/client/cli/cli_test.go b/x/vpool/client/cli/cli_test.go index 212a8278d..606a143fc 100644 --- a/x/vpool/client/cli/cli_test.go +++ b/x/vpool/client/cli/cli_test.go @@ -19,8 +19,8 @@ import ( testutilcli "github.com/NibiruChain/nibiru/x/common/testutil/cli" "github.com/NibiruChain/nibiru/x/common/testutil/genesis" oracletypes "github.com/NibiruChain/nibiru/x/oracle/types" + vpooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" "github.com/NibiruChain/nibiru/x/vpool/client/cli" - vpooltypes "github.com/NibiruChain/nibiru/x/vpool/types" ) type IntegrationTestSuite struct { diff --git a/x/vpool/client/cli/genvpool.go b/x/vpool/client/cli/genvpool.go index 34d78b686..75f491a7b 100644 --- a/x/vpool/client/cli/genvpool.go +++ b/x/vpool/client/cli/genvpool.go @@ -16,7 +16,7 @@ import ( "github.com/spf13/cobra" "github.com/NibiruChain/nibiru/x/common/asset" - "github.com/NibiruChain/nibiru/x/vpool/types" + "github.com/NibiruChain/nibiru/x/perp/amm/types" ) const ( diff --git a/x/vpool/client/cli/gov_client.go b/x/vpool/client/cli/gov_client.go index 58bfe6bbb..beefd6d19 100644 --- a/x/vpool/client/cli/gov_client.go +++ b/x/vpool/client/cli/gov_client.go @@ -16,7 +16,7 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/spf13/cobra" - "github.com/NibiruChain/nibiru/x/vpool/types" + "github.com/NibiruChain/nibiru/x/perp/amm/types" ) func NewProposalHandler(cliHandler govclient.CLIHandlerFn) govclient.ProposalHandler { diff --git a/x/vpool/client/cli/query.go b/x/vpool/client/cli/query.go index d20f39844..859f440b4 100644 --- a/x/vpool/client/cli/query.go +++ b/x/vpool/client/cli/query.go @@ -12,7 +12,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/NibiruChain/nibiru/x/common/asset" - "github.com/NibiruChain/nibiru/x/vpool/types" + "github.com/NibiruChain/nibiru/x/perp/amm/types" ) var _ = strconv.Itoa(0) diff --git a/x/vpool/genesis.go b/x/vpool/genesis.go index 4998453d3..62b201755 100644 --- a/x/vpool/genesis.go +++ b/x/vpool/genesis.go @@ -6,8 +6,8 @@ import ( "github.com/NibiruChain/collections" "github.com/NibiruChain/nibiru/x/common/asset" + "github.com/NibiruChain/nibiru/x/perp/amm/types" "github.com/NibiruChain/nibiru/x/vpool/keeper" - "github.com/NibiruChain/nibiru/x/vpool/types" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/vpool/genesis_test.go b/x/vpool/genesis_test.go index 238a890a2..846cf8539 100644 --- a/x/vpool/genesis_test.go +++ b/x/vpool/genesis_test.go @@ -11,8 +11,8 @@ import ( "github.com/NibiruChain/nibiru/x/common" "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/common/testutil/testapp" + "github.com/NibiruChain/nibiru/x/perp/amm/types" "github.com/NibiruChain/nibiru/x/vpool" - "github.com/NibiruChain/nibiru/x/vpool/types" ) func TestGenesis(t *testing.T) { diff --git a/x/vpool/handler.go b/x/vpool/handler.go index f3f38824d..f7c66569b 100644 --- a/x/vpool/handler.go +++ b/x/vpool/handler.go @@ -8,8 +8,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/NibiruChain/nibiru/x/perp/amm/types" "github.com/NibiruChain/nibiru/x/vpool/keeper" - "github.com/NibiruChain/nibiru/x/vpool/types" ) // NewHandler ... diff --git a/x/vpool/integration/assertion/vpool.go b/x/vpool/integration/assertion/vpool.go index 5052ed852..27fc7b4e0 100644 --- a/x/vpool/integration/assertion/vpool.go +++ b/x/vpool/integration/assertion/vpool.go @@ -8,7 +8,7 @@ import ( "github.com/NibiruChain/nibiru/app" "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/common/testutil/action" - "github.com/NibiruChain/nibiru/x/vpool/types" + "github.com/NibiruChain/nibiru/x/perp/amm/types" ) type VpoolChecker func(resp types.Vpool) error diff --git a/x/vpool/keeper/bias_test.go b/x/vpool/keeper/bias_test.go index 41ca66f0e..7f3957586 100644 --- a/x/vpool/keeper/bias_test.go +++ b/x/vpool/keeper/bias_test.go @@ -16,9 +16,9 @@ import ( "github.com/NibiruChain/nibiru/x/common/testutil" . "github.com/NibiruChain/nibiru/x/common/testutil/action" . "github.com/NibiruChain/nibiru/x/oracle/integration_test/action" + "github.com/NibiruChain/nibiru/x/perp/amm/types" . "github.com/NibiruChain/nibiru/x/perp/integration/action" perptypes "github.com/NibiruChain/nibiru/x/perp/types" - "github.com/NibiruChain/nibiru/x/vpool/types" ) func createInitVPool() Action { diff --git a/x/vpool/keeper/keeper.go b/x/vpool/keeper/keeper.go index 04628929b..2eb889243 100644 --- a/x/vpool/keeper/keeper.go +++ b/x/vpool/keeper/keeper.go @@ -11,7 +11,7 @@ import ( "github.com/NibiruChain/collections" "github.com/NibiruChain/nibiru/x/common/asset" - "github.com/NibiruChain/nibiru/x/vpool/types" + "github.com/NibiruChain/nibiru/x/perp/amm/types" ) func NewKeeper( diff --git a/x/vpool/keeper/keeper_test.go b/x/vpool/keeper/keeper_test.go index 972ed1e47..7831caea4 100644 --- a/x/vpool/keeper/keeper_test.go +++ b/x/vpool/keeper/keeper_test.go @@ -15,7 +15,7 @@ import ( "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/common/denoms" "github.com/NibiruChain/nibiru/x/common/testutil/mock" - "github.com/NibiruChain/nibiru/x/vpool/types" + "github.com/NibiruChain/nibiru/x/perp/amm/types" ) func TestSwapQuoteForBase(t *testing.T) { diff --git a/x/vpool/keeper/pool_state.go b/x/vpool/keeper/pool_state.go index 2201d1bce..f7ec75fe2 100644 --- a/x/vpool/keeper/pool_state.go +++ b/x/vpool/keeper/pool_state.go @@ -9,7 +9,7 @@ import ( "github.com/NibiruChain/nibiru/x/common" "github.com/NibiruChain/nibiru/x/common/asset" - "github.com/NibiruChain/nibiru/x/vpool/types" + "github.com/NibiruChain/nibiru/x/perp/amm/types" ) // CreatePool creates a pool for a specific pair. diff --git a/x/vpool/keeper/pool_state_test.go b/x/vpool/keeper/pool_state_test.go index 308bfd046..bacd47d82 100644 --- a/x/vpool/keeper/pool_state_test.go +++ b/x/vpool/keeper/pool_state_test.go @@ -12,7 +12,7 @@ import ( "github.com/NibiruChain/nibiru/x/common" "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/common/denoms" - "github.com/NibiruChain/nibiru/x/vpool/types" + "github.com/NibiruChain/nibiru/x/perp/amm/types" ) func TestCreatePool(t *testing.T) { diff --git a/x/vpool/keeper/prices.go b/x/vpool/keeper/prices.go index acf9c50f2..f0e809bc7 100644 --- a/x/vpool/keeper/prices.go +++ b/x/vpool/keeper/prices.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/NibiruChain/nibiru/x/common/asset" - "github.com/NibiruChain/nibiru/x/vpool/types" + "github.com/NibiruChain/nibiru/x/perp/amm/types" ) /* diff --git a/x/vpool/keeper/prices_test.go b/x/vpool/keeper/prices_test.go index 8bd341215..ec044bb18 100644 --- a/x/vpool/keeper/prices_test.go +++ b/x/vpool/keeper/prices_test.go @@ -14,7 +14,7 @@ import ( "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/common/denoms" "github.com/NibiruChain/nibiru/x/common/testutil/mock" - "github.com/NibiruChain/nibiru/x/vpool/types" + "github.com/NibiruChain/nibiru/x/perp/amm/types" ) func TestGetMarkPrice(t *testing.T) { diff --git a/x/vpool/keeper/query_server.go b/x/vpool/keeper/query_server.go index 04246c0bb..feca50ba2 100644 --- a/x/vpool/keeper/query_server.go +++ b/x/vpool/keeper/query_server.go @@ -10,7 +10,7 @@ import ( "google.golang.org/grpc/status" "github.com/NibiruChain/nibiru/x/common/asset" - "github.com/NibiruChain/nibiru/x/vpool/types" + "github.com/NibiruChain/nibiru/x/perp/amm/types" ) type queryServer struct { diff --git a/x/vpool/keeper/query_server_test.go b/x/vpool/keeper/query_server_test.go index 10ad1bb44..acb00bffa 100644 --- a/x/vpool/keeper/query_server_test.go +++ b/x/vpool/keeper/query_server_test.go @@ -13,7 +13,7 @@ import ( "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/common/denoms" "github.com/NibiruChain/nibiru/x/common/testutil/mock" - "github.com/NibiruChain/nibiru/x/vpool/types" + "github.com/NibiruChain/nibiru/x/perp/amm/types" ) func TestQueryReserveAssets(t *testing.T) { diff --git a/x/vpool/keeper/snapshot.go b/x/vpool/keeper/snapshot.go index 64e23e8aa..e6dc05a8d 100644 --- a/x/vpool/keeper/snapshot.go +++ b/x/vpool/keeper/snapshot.go @@ -5,7 +5,7 @@ import ( "github.com/NibiruChain/nibiru/x/common" "github.com/NibiruChain/nibiru/x/common/asset" - "github.com/NibiruChain/nibiru/x/vpool/types" + "github.com/NibiruChain/nibiru/x/perp/amm/types" ) /* diff --git a/x/vpool/keeper/snapshot_test.go b/x/vpool/keeper/snapshot_test.go index 0a7b10ba9..9f81c38d7 100644 --- a/x/vpool/keeper/snapshot_test.go +++ b/x/vpool/keeper/snapshot_test.go @@ -9,7 +9,7 @@ import ( "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/common/denoms" - "github.com/NibiruChain/nibiru/x/vpool/types" + "github.com/NibiruChain/nibiru/x/perp/amm/types" ) func TestGetSnapshotPrice(t *testing.T) { diff --git a/x/vpool/keeper/util_test.go b/x/vpool/keeper/util_test.go index adb4bf6b8..16f646082 100644 --- a/x/vpool/keeper/util_test.go +++ b/x/vpool/keeper/util_test.go @@ -16,7 +16,7 @@ import ( tmdb "github.com/tendermint/tm-db" "github.com/NibiruChain/nibiru/x/common/testutil/mock" - "github.com/NibiruChain/nibiru/x/vpool/types" + "github.com/NibiruChain/nibiru/x/perp/amm/types" ) func VpoolKeeper(t *testing.T, oracleKeeper types.OracleKeeper) ( @@ -38,7 +38,7 @@ func VpoolKeeper(t *testing.T, oracleKeeper types.OracleKeeper) ( return vpoolKeeper, ctx } -// holds mocks for interfaces defined in vpool/types/expected_keepers.go +// holds mocks for interfaces defined in perp/amm/types/expected_keepers.go type mockedDependencies struct { mockOracleKeeper *mock.MockOracleKeeper mockAccountKeeper *mock.MockAccountKeeper diff --git a/x/vpool/module.go b/x/vpool/module.go index 38ac31d29..569a44185 100644 --- a/x/vpool/module.go +++ b/x/vpool/module.go @@ -16,10 +16,10 @@ import ( "github.com/spf13/cobra" abci "github.com/tendermint/tendermint/abci/types" + "github.com/NibiruChain/nibiru/x/perp/amm/types" "github.com/NibiruChain/nibiru/x/vpool/client/cli" "github.com/NibiruChain/nibiru/x/vpool/keeper" "github.com/NibiruChain/nibiru/x/vpool/simulation" - "github.com/NibiruChain/nibiru/x/vpool/types" ) var ( diff --git a/x/vpool/simulation/decoder.go b/x/vpool/simulation/decoder.go index 7a38a305e..76899d3a1 100644 --- a/x/vpool/simulation/decoder.go +++ b/x/vpool/simulation/decoder.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types/kv" - "github.com/NibiruChain/nibiru/x/vpool/types" + "github.com/NibiruChain/nibiru/x/perp/amm/types" ) // NewDecodeStore returns a decoder function closure that unmarshals the KVPair's diff --git a/x/vpool/simulation/genesis.go b/x/vpool/simulation/genesis.go index 2bb5170e2..9988ffb35 100644 --- a/x/vpool/simulation/genesis.go +++ b/x/vpool/simulation/genesis.go @@ -11,7 +11,7 @@ import ( "github.com/NibiruChain/nibiru/x/common" "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/common/denoms" - "github.com/NibiruChain/nibiru/x/vpool/types" + "github.com/NibiruChain/nibiru/x/perp/amm/types" ) // RandomizedGenState generates a random GenesisState for the perp module diff --git a/x/wasm/cli/cli_test.go b/x/wasm/cli/cli_test.go index b7cd08ecd..9c61418e5 100644 --- a/x/wasm/cli/cli_test.go +++ b/x/wasm/cli/cli_test.go @@ -19,7 +19,7 @@ import ( "github.com/NibiruChain/nibiru/x/common/denoms" testutilcli "github.com/NibiruChain/nibiru/x/common/testutil/cli" "github.com/NibiruChain/nibiru/x/common/testutil/genesis" - vpooltypes "github.com/NibiruChain/nibiru/x/vpool/types" + vpooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" ) // commonArgs is args for CLI test commands. From 2c43de4c1fdbbe0aa02cb5da598b632c07527539 Mon Sep 17 00:00:00 2001 From: Unique-Divine Date: Fri, 7 Apr 2023 16:06:42 -0500 Subject: [PATCH 2/4] refactor: #wip convert vpool to perp/amm | move keeper --- app/app.go | 2 +- x/{vpool => perp/amm}/keeper/bias_test.go | 0 x/{vpool => perp/amm}/keeper/get_settlement_price.go | 0 x/{vpool => perp/amm}/keeper/keeper.go | 0 x/{vpool => perp/amm}/keeper/keeper_test.go | 0 x/{vpool => perp/amm}/keeper/pool_state.go | 0 x/{vpool => perp/amm}/keeper/pool_state_test.go | 0 x/{vpool => perp/amm}/keeper/prices.go | 0 x/{vpool => perp/amm}/keeper/prices_test.go | 0 x/{vpool => perp/amm}/keeper/query_server.go | 0 x/{vpool => perp/amm}/keeper/query_server_test.go | 0 x/{vpool => perp/amm}/keeper/snapshot.go | 0 x/{vpool => perp/amm}/keeper/snapshot_test.go | 0 x/{vpool => perp/amm}/keeper/util_test.go | 0 x/perp/keeper/migrations.go | 2 +- x/vpool/abci.go | 2 +- x/vpool/genesis.go | 2 +- x/vpool/handler.go | 2 +- x/vpool/module.go | 2 +- 19 files changed, 6 insertions(+), 6 deletions(-) rename x/{vpool => perp/amm}/keeper/bias_test.go (100%) rename x/{vpool => perp/amm}/keeper/get_settlement_price.go (100%) rename x/{vpool => perp/amm}/keeper/keeper.go (100%) rename x/{vpool => perp/amm}/keeper/keeper_test.go (100%) rename x/{vpool => perp/amm}/keeper/pool_state.go (100%) rename x/{vpool => perp/amm}/keeper/pool_state_test.go (100%) rename x/{vpool => perp/amm}/keeper/prices.go (100%) rename x/{vpool => perp/amm}/keeper/prices_test.go (100%) rename x/{vpool => perp/amm}/keeper/query_server.go (100%) rename x/{vpool => perp/amm}/keeper/query_server_test.go (100%) rename x/{vpool => perp/amm}/keeper/snapshot.go (100%) rename x/{vpool => perp/amm}/keeper/snapshot_test.go (100%) rename x/{vpool => perp/amm}/keeper/util_test.go (100%) diff --git a/app/app.go b/app/app.go index 6ca01e20f..e7f44fbcd 100644 --- a/app/app.go +++ b/app/app.go @@ -114,6 +114,7 @@ import ( oraclekeeper "github.com/NibiruChain/nibiru/x/oracle/keeper" oracletypes "github.com/NibiruChain/nibiru/x/oracle/types" "github.com/NibiruChain/nibiru/x/perp" + vpoolkeeper "github.com/NibiruChain/nibiru/x/perp/amm/keeper" vpooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" perpkeeper "github.com/NibiruChain/nibiru/x/perp/keeper" perptypes "github.com/NibiruChain/nibiru/x/perp/types" @@ -127,7 +128,6 @@ import ( utiltypes "github.com/NibiruChain/nibiru/x/util/types" "github.com/NibiruChain/nibiru/x/vpool" vpoolcli "github.com/NibiruChain/nibiru/x/vpool/client/cli" - vpoolkeeper "github.com/NibiruChain/nibiru/x/vpool/keeper" ) const ( diff --git a/x/vpool/keeper/bias_test.go b/x/perp/amm/keeper/bias_test.go similarity index 100% rename from x/vpool/keeper/bias_test.go rename to x/perp/amm/keeper/bias_test.go diff --git a/x/vpool/keeper/get_settlement_price.go b/x/perp/amm/keeper/get_settlement_price.go similarity index 100% rename from x/vpool/keeper/get_settlement_price.go rename to x/perp/amm/keeper/get_settlement_price.go diff --git a/x/vpool/keeper/keeper.go b/x/perp/amm/keeper/keeper.go similarity index 100% rename from x/vpool/keeper/keeper.go rename to x/perp/amm/keeper/keeper.go diff --git a/x/vpool/keeper/keeper_test.go b/x/perp/amm/keeper/keeper_test.go similarity index 100% rename from x/vpool/keeper/keeper_test.go rename to x/perp/amm/keeper/keeper_test.go diff --git a/x/vpool/keeper/pool_state.go b/x/perp/amm/keeper/pool_state.go similarity index 100% rename from x/vpool/keeper/pool_state.go rename to x/perp/amm/keeper/pool_state.go diff --git a/x/vpool/keeper/pool_state_test.go b/x/perp/amm/keeper/pool_state_test.go similarity index 100% rename from x/vpool/keeper/pool_state_test.go rename to x/perp/amm/keeper/pool_state_test.go diff --git a/x/vpool/keeper/prices.go b/x/perp/amm/keeper/prices.go similarity index 100% rename from x/vpool/keeper/prices.go rename to x/perp/amm/keeper/prices.go diff --git a/x/vpool/keeper/prices_test.go b/x/perp/amm/keeper/prices_test.go similarity index 100% rename from x/vpool/keeper/prices_test.go rename to x/perp/amm/keeper/prices_test.go diff --git a/x/vpool/keeper/query_server.go b/x/perp/amm/keeper/query_server.go similarity index 100% rename from x/vpool/keeper/query_server.go rename to x/perp/amm/keeper/query_server.go diff --git a/x/vpool/keeper/query_server_test.go b/x/perp/amm/keeper/query_server_test.go similarity index 100% rename from x/vpool/keeper/query_server_test.go rename to x/perp/amm/keeper/query_server_test.go diff --git a/x/vpool/keeper/snapshot.go b/x/perp/amm/keeper/snapshot.go similarity index 100% rename from x/vpool/keeper/snapshot.go rename to x/perp/amm/keeper/snapshot.go diff --git a/x/vpool/keeper/snapshot_test.go b/x/perp/amm/keeper/snapshot_test.go similarity index 100% rename from x/vpool/keeper/snapshot_test.go rename to x/perp/amm/keeper/snapshot_test.go diff --git a/x/vpool/keeper/util_test.go b/x/perp/amm/keeper/util_test.go similarity index 100% rename from x/vpool/keeper/util_test.go rename to x/perp/amm/keeper/util_test.go diff --git a/x/perp/keeper/migrations.go b/x/perp/keeper/migrations.go index 2f6f43b07..63b2c9922 100644 --- a/x/perp/keeper/migrations.go +++ b/x/perp/keeper/migrations.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" "github.com/NibiruChain/nibiru/x/common/asset" + vpoolkeeper "github.com/NibiruChain/nibiru/x/perp/amm/keeper" "github.com/NibiruChain/nibiru/x/perp/types" - vpoolkeeper "github.com/NibiruChain/nibiru/x/vpool/keeper" ) func From2To3(perpKeeper Keeper, vpoolKeeper types.VpoolKeeper) module.MigrationHandler { diff --git a/x/vpool/abci.go b/x/vpool/abci.go index 71f83c625..af357a779 100644 --- a/x/vpool/abci.go +++ b/x/vpool/abci.go @@ -7,8 +7,8 @@ import ( "github.com/NibiruChain/collections" "github.com/NibiruChain/nibiru/x/common/asset" + "github.com/NibiruChain/nibiru/x/perp/amm/keeper" "github.com/NibiruChain/nibiru/x/perp/amm/types" - "github.com/NibiruChain/nibiru/x/vpool/keeper" ) // EndBlocker Called every block to store a snapshot of the vpool. diff --git a/x/vpool/genesis.go b/x/vpool/genesis.go index 62b201755..3f6ed26d8 100644 --- a/x/vpool/genesis.go +++ b/x/vpool/genesis.go @@ -6,8 +6,8 @@ import ( "github.com/NibiruChain/collections" "github.com/NibiruChain/nibiru/x/common/asset" + "github.com/NibiruChain/nibiru/x/perp/amm/keeper" "github.com/NibiruChain/nibiru/x/perp/amm/types" - "github.com/NibiruChain/nibiru/x/vpool/keeper" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/vpool/handler.go b/x/vpool/handler.go index f7c66569b..5c7617c45 100644 --- a/x/vpool/handler.go +++ b/x/vpool/handler.go @@ -8,8 +8,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/NibiruChain/nibiru/x/perp/amm/keeper" "github.com/NibiruChain/nibiru/x/perp/amm/types" - "github.com/NibiruChain/nibiru/x/vpool/keeper" ) // NewHandler ... diff --git a/x/vpool/module.go b/x/vpool/module.go index 569a44185..00c5be2a3 100644 --- a/x/vpool/module.go +++ b/x/vpool/module.go @@ -16,9 +16,9 @@ import ( "github.com/spf13/cobra" abci "github.com/tendermint/tendermint/abci/types" + "github.com/NibiruChain/nibiru/x/perp/amm/keeper" "github.com/NibiruChain/nibiru/x/perp/amm/types" "github.com/NibiruChain/nibiru/x/vpool/client/cli" - "github.com/NibiruChain/nibiru/x/vpool/keeper" "github.com/NibiruChain/nibiru/x/vpool/simulation" ) From e2a14083e03ef23be57f0e7488e24bd771ebd366 Mon Sep 17 00:00:00 2001 From: Unique-Divine Date: Fri, 7 Apr 2023 16:39:57 -0500 Subject: [PATCH 3/4] refactor: convert vpool to perp/amm | move vpool cli to perp cli --- app/app.go | 6 +-- cmd/nibid/cmd/root.go | 4 +- x/common/testutil/cli/query.go | 6 +-- x/{vpool/client => perp/amm}/cli/cli_test.go | 50 +++++++++---------- x/{vpool/client => perp/amm}/cli/genvpool.go | 0 .../client => perp/amm}/cli/genvpool_test.go | 2 +- .../client => perp/amm}/cli/gov_client.go | 0 x/{vpool/client => perp/amm}/cli/query.go | 0 x/perp/amm/keeper/bias_test.go | 40 ++++++++------- x/perp/client/cli/query.go | 10 ++-- x/vpool/module.go | 2 +- 11 files changed, 63 insertions(+), 57 deletions(-) rename x/{vpool/client => perp/amm}/cli/cli_test.go (90%) rename x/{vpool/client => perp/amm}/cli/genvpool.go (100%) rename x/{vpool/client => perp/amm}/cli/genvpool_test.go (98%) rename x/{vpool/client => perp/amm}/cli/gov_client.go (100%) rename x/{vpool/client => perp/amm}/cli/query.go (100%) diff --git a/app/app.go b/app/app.go index e7f44fbcd..cadf13fd8 100644 --- a/app/app.go +++ b/app/app.go @@ -114,6 +114,7 @@ import ( oraclekeeper "github.com/NibiruChain/nibiru/x/oracle/keeper" oracletypes "github.com/NibiruChain/nibiru/x/oracle/types" "github.com/NibiruChain/nibiru/x/perp" + perpammcli "github.com/NibiruChain/nibiru/x/perp/amm/cli" vpoolkeeper "github.com/NibiruChain/nibiru/x/perp/amm/keeper" vpooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" perpkeeper "github.com/NibiruChain/nibiru/x/perp/keeper" @@ -127,7 +128,6 @@ import ( "github.com/NibiruChain/nibiru/x/util" utiltypes "github.com/NibiruChain/nibiru/x/util/types" "github.com/NibiruChain/nibiru/x/vpool" - vpoolcli "github.com/NibiruChain/nibiru/x/vpool/client/cli" ) const ( @@ -162,8 +162,8 @@ var ( distrclient.ProposalHandler, upgradeclient.ProposalHandler, upgradeclient.CancelProposalHandler, - vpoolcli.CreatePoolProposalHandler, - vpoolcli.EditPoolConfigProposalHandler, + perpammcli.CreatePoolProposalHandler, + perpammcli.EditPoolConfigProposalHandler, ibcclientclient.UpdateClientProposalHandler, ibcclientclient.UpgradeProposalHandler, ), diff --git a/cmd/nibid/cmd/root.go b/cmd/nibid/cmd/root.go index 205569ffc..eff4650f6 100644 --- a/cmd/nibid/cmd/root.go +++ b/cmd/nibid/cmd/root.go @@ -32,7 +32,7 @@ import ( dbm "github.com/tendermint/tm-db" "github.com/NibiruChain/nibiru/app" - vpoolcli "github.com/NibiruChain/nibiru/x/vpool/client/cli" + perpammcli "github.com/NibiruChain/nibiru/x/perp/amm/cli" ) // NewRootCmd creates a new root command for nibid. It is called once in the @@ -144,7 +144,7 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { genutilcli.GenTxCmd(app.ModuleBasics, encodingConfig.TxConfig, banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome), genutilcli.ValidateGenesisCmd(app.ModuleBasics), AddGenesisAccountCmd(app.DefaultNodeHome), - vpoolcli.AddVpoolGenesisCmd(app.DefaultNodeHome), + perpammcli.AddVpoolGenesisCmd(app.DefaultNodeHome), tmcli.NewCompletionCmd(rootCmd, true), testnetCmd(app.ModuleBasics, banktypes.GenesisBalancesIterator{}), AddGenesisWasmMsgCmd(app.DefaultNodeHome), diff --git a/x/common/testutil/cli/query.go b/x/common/testutil/cli/query.go index 6476cbd28..3bd64ac56 100644 --- a/x/common/testutil/cli/query.go +++ b/x/common/testutil/cli/query.go @@ -13,10 +13,10 @@ import ( "github.com/NibiruChain/nibiru/x/common/asset" oraclecli "github.com/NibiruChain/nibiru/x/oracle/client/cli" oracletypes "github.com/NibiruChain/nibiru/x/oracle/types" + perpammcli "github.com/NibiruChain/nibiru/x/perp/amm/cli" vpooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" perpcli "github.com/NibiruChain/nibiru/x/perp/client/cli" perptypes "github.com/NibiruChain/nibiru/x/perp/types" - vpoolcli "github.com/NibiruChain/nibiru/x/vpool/client/cli" ) // ExecQueryOption defines a type which customizes a CLI query operation. @@ -77,7 +77,7 @@ func ExecQuery(clientCtx client.Context, cmd *cobra.Command, args []string, resu func QueryVpoolReserveAssets(clientCtx client.Context, pair asset.Pair, ) (*vpooltypes.QueryReserveAssetsResponse, error) { var queryResp vpooltypes.QueryReserveAssetsResponse - if err := ExecQuery(clientCtx, vpoolcli.CmdGetVpoolReserveAssets(), []string{pair.String()}, &queryResp); err != nil { + if err := ExecQuery(clientCtx, perpammcli.CmdGetVpoolReserveAssets(), []string{pair.String()}, &queryResp); err != nil { return nil, err } return &queryResp, nil @@ -93,7 +93,7 @@ func QueryOracleExchangeRate(clientCtx client.Context, pair asset.Pair) (*oracle func QueryBaseAssetPrice(clientCtx client.Context, pair asset.Pair, direction string, amount string) (*vpooltypes.QueryBaseAssetPriceResponse, error) { var queryResp vpooltypes.QueryBaseAssetPriceResponse - if err := ExecQuery(clientCtx, vpoolcli.CmdGetBaseAssetPrice(), []string{pair.String(), direction, amount}, &queryResp); err != nil { + if err := ExecQuery(clientCtx, perpammcli.CmdGetBaseAssetPrice(), []string{pair.String(), direction, amount}, &queryResp); err != nil { return nil, err } return &queryResp, nil diff --git a/x/vpool/client/cli/cli_test.go b/x/perp/amm/cli/cli_test.go similarity index 90% rename from x/vpool/client/cli/cli_test.go rename to x/perp/amm/cli/cli_test.go index 606a143fc..cbbd10c2a 100644 --- a/x/vpool/client/cli/cli_test.go +++ b/x/perp/amm/cli/cli_test.go @@ -19,8 +19,8 @@ import ( testutilcli "github.com/NibiruChain/nibiru/x/common/testutil/cli" "github.com/NibiruChain/nibiru/x/common/testutil/genesis" oracletypes "github.com/NibiruChain/nibiru/x/oracle/types" - vpooltypes "github.com/NibiruChain/nibiru/x/perp/amm/types" - "github.com/NibiruChain/nibiru/x/vpool/client/cli" + "github.com/NibiruChain/nibiru/x/perp/amm/cli" + perpammtypes "github.com/NibiruChain/nibiru/x/perp/amm/types" ) type IntegrationTestSuite struct { @@ -34,13 +34,13 @@ func TestIntegrationTestSuite(t *testing.T) { suite.Run(t, new(IntegrationTestSuite)) } -var START_VPOOLS = map[asset.Pair]vpooltypes.Vpool{ +var START_VPOOLS = map[asset.Pair]perpammtypes.Vpool{ asset.Registry.Pair(denoms.ETH, denoms.NUSD): { Pair: asset.Registry.Pair(denoms.ETH, denoms.NUSD), BaseAssetReserve: sdk.NewDec(10 * common.TO_MICRO), QuoteAssetReserve: sdk.NewDec(60_000 * common.TO_MICRO), SqrtDepth: common.MustSqrtDec(sdk.NewDec(600_000 * common.TO_MICRO * common.TO_MICRO)), - Config: vpooltypes.VpoolConfig{ + Config: perpammtypes.VpoolConfig{ TradeLimitRatio: sdk.MustNewDecFromStr("0.8"), FluctuationLimitRatio: sdk.MustNewDecFromStr("0.2"), MaxOracleSpreadRatio: sdk.MustNewDecFromStr("0.2"), @@ -53,7 +53,7 @@ var START_VPOOLS = map[asset.Pair]vpooltypes.Vpool{ BaseAssetReserve: sdk.NewDec(500_000), QuoteAssetReserve: sdk.NewDec(5 * common.TO_MICRO), SqrtDepth: common.MustSqrtDec(sdk.NewDec(5 * 500_000 * common.TO_MICRO)), - Config: vpooltypes.VpoolConfig{ + Config: perpammtypes.VpoolConfig{ TradeLimitRatio: sdk.MustNewDecFromStr("0.8"), FluctuationLimitRatio: sdk.MustNewDecFromStr("0.2"), MaxOracleSpreadRatio: sdk.MustNewDecFromStr("0.2"), @@ -74,8 +74,8 @@ func (s *IntegrationTestSuite) SetupSuite() { encodingConfig := app.MakeTestEncodingConfig() genesisState := genesis.NewTestGenesisState() - vpoolGenesis := vpooltypes.DefaultGenesis() - vpoolGenesis.Vpools = []vpooltypes.Vpool{ + vpoolGenesis := perpammtypes.DefaultGenesis() + vpoolGenesis.Vpools = []perpammtypes.Vpool{ START_VPOOLS[asset.Registry.Pair(denoms.ETH, denoms.NUSD)], START_VPOOLS[asset.Registry.Pair(denoms.NIBI, denoms.NUSD)], } @@ -87,7 +87,7 @@ func (s *IntegrationTestSuite) SetupSuite() { } oracleGenesis.Params.VotePeriod = 1_000 - genesisState[vpooltypes.ModuleName] = encodingConfig.Marshaler. + genesisState[perpammtypes.ModuleName] = encodingConfig.Marshaler. MustMarshalJSON(vpoolGenesis) s.cfg = testutilcli.BuildNetworkConfig(genesisState) @@ -106,13 +106,13 @@ func (s *IntegrationTestSuite) TestCmdCreatePoolProposal() { // ---------------------------------------------------------------------- s.T().Log("load example proposal json as bytes") // ---------------------------------------------------------------------- - proposal := &vpooltypes.CreatePoolProposal{ + proposal := &perpammtypes.CreatePoolProposal{ Title: "Create ETH:USD pool", Description: "Creates an ETH:USD pool", Pair: "ETH:USD", QuoteAssetReserve: sdk.NewDec(1 * common.TO_MICRO), BaseAssetReserve: sdk.NewDec(1 * common.TO_MICRO), - Config: vpooltypes.VpoolConfig{ + Config: perpammtypes.VpoolConfig{ TradeLimitRatio: sdk.MustNewDecFromStr("0.10"), FluctuationLimitRatio: sdk.MustNewDecFromStr("0.05"), MaxOracleSpreadRatio: sdk.MustNewDecFromStr("0.05"), @@ -125,7 +125,7 @@ func (s *IntegrationTestSuite) TestCmdCreatePoolProposal() { s.Require().NoError(err) s.T().Log("Unmarshal json bytes into proposal object; check validity") - proposal = &vpooltypes.CreatePoolProposal{} + proposal = &perpammtypes.CreatePoolProposal{} val.ClientCtx.Codec.MustUnmarshalJSON(contents, proposal) s.Require().NoError(proposal.ValidateBasic()) @@ -149,13 +149,13 @@ func (s *IntegrationTestSuite) TestCmdCreatePoolProposal() { // ---------------------------------------------------------------------- s.Require().NoError(s.network.WaitForNextBlock()) - vpoolsQueryResp := &vpooltypes.QueryAllPoolsResponse{} + vpoolsQueryResp := &perpammtypes.QueryAllPoolsResponse{} s.Require().NoError(testutilcli.ExecQuery(s.network.Validators[0].ClientCtx, cli.CmdGetVpools(), nil, vpoolsQueryResp)) found := false for _, pool := range vpoolsQueryResp.Pools { if pool.Pair.Equal(proposal.Pair) { - s.EqualValues(vpooltypes.Vpool{ + s.EqualValues(perpammtypes.Vpool{ Pair: proposal.Pair, BaseAssetReserve: proposal.BaseAssetReserve, QuoteAssetReserve: proposal.QuoteAssetReserve, @@ -193,11 +193,11 @@ func (s *IntegrationTestSuite) TestCmdEditPoolConfigProposal() { s.T().Log("load example proposal json as bytes") // ---------------------------------------------------------------------- startVpool := START_VPOOLS[asset.Registry.Pair(denoms.ETH, denoms.NUSD)] - proposal := &vpooltypes.EditPoolConfigProposal{ + proposal := &perpammtypes.EditPoolConfigProposal{ Title: "NIP-3: Edit config of the ueth:unusd vpool", Description: "enables higher max leverage on ueth:unusd", Pair: startVpool.Pair, - Config: vpooltypes.VpoolConfig{ + Config: perpammtypes.VpoolConfig{ TradeLimitRatio: sdk.MustNewDecFromStr("0.8"), FluctuationLimitRatio: sdk.MustNewDecFromStr("0.2"), MaxOracleSpreadRatio: sdk.MustNewDecFromStr("0.2"), @@ -210,7 +210,7 @@ func (s *IntegrationTestSuite) TestCmdEditPoolConfigProposal() { s.Require().NoError(err) s.T().Log("Unmarshal json bytes into proposal object; check validity") - proposal = &vpooltypes.EditPoolConfigProposal{} + proposal = &perpammtypes.EditPoolConfigProposal{} val.ClientCtx.Codec.MustUnmarshalJSON(contents, proposal) s.Require().NoError(proposal.ValidateBasic()) @@ -234,13 +234,13 @@ func (s *IntegrationTestSuite) TestCmdEditPoolConfigProposal() { // ---------------------------------------------------------------------- s.Require().NoError(s.network.WaitForNextBlock()) - vpoolsQueryResp := &vpooltypes.QueryAllPoolsResponse{} + vpoolsQueryResp := &perpammtypes.QueryAllPoolsResponse{} s.Require().NoError(testutilcli.ExecQuery(s.network.Validators[0].ClientCtx, cli.CmdGetVpools(), nil, vpoolsQueryResp)) found := false for _, vpool := range vpoolsQueryResp.Pools { if vpool.Pair.Equal(proposal.Pair) { - s.EqualValues(vpooltypes.Vpool{ + s.EqualValues(perpammtypes.Vpool{ Pair: proposal.Pair, BaseAssetReserve: startVpool.BaseAssetReserve, QuoteAssetReserve: startVpool.QuoteAssetReserve, @@ -262,10 +262,10 @@ func (s *IntegrationTestSuite) TestCmdEditSwapInvariantsProposal() { s.T().Log("load example proposal json as bytes") // ---------------------------------------------------------------------- startVpool := START_VPOOLS[asset.Registry.Pair(denoms.NIBI, denoms.NUSD)] - proposal := &vpooltypes.EditSwapInvariantsProposal{ + proposal := &perpammtypes.EditSwapInvariantsProposal{ Title: "NIP-4: Change the swap invariant for NIBI.", Description: "increase swap invariant for many virtual pools", - SwapInvariantMaps: []vpooltypes.EditSwapInvariantsProposal_SwapInvariantMultiple{ + SwapInvariantMaps: []perpammtypes.EditSwapInvariantsProposal_SwapInvariantMultiple{ {Pair: startVpool.Pair, Multiplier: sdk.NewDec(100)}, }, } @@ -276,15 +276,15 @@ func (s *IntegrationTestSuite) TestCmdEditSwapInvariantsProposal() { s.Require().NoError(err) s.T().Log("Unmarshal json bytes into proposal object; check validity") - proposal = &vpooltypes.EditSwapInvariantsProposal{} + proposal = &perpammtypes.EditSwapInvariantsProposal{} val.ClientCtx.Codec.MustUnmarshalJSON(contents, proposal) s.Require().NoError(proposal.ValidateBasic()) - vpoolsQueryResp := new(vpooltypes.QueryAllPoolsResponse) + vpoolsQueryResp := new(perpammtypes.QueryAllPoolsResponse) s.Require().NoError(testutilcli.ExecQuery( s.network.Validators[0].ClientCtx, cli.CmdGetVpools(), nil, vpoolsQueryResp)) - var vpoolBefore vpooltypes.Vpool + var vpoolBefore perpammtypes.Vpool for _, vpool := range vpoolsQueryResp.Pools { if vpool.Pair.Equal(proposal.SwapInvariantMaps[0].Pair) { vpoolBefore = vpool @@ -312,7 +312,7 @@ func (s *IntegrationTestSuite) TestCmdEditSwapInvariantsProposal() { // ---------------------------------------------------------------------- s.Require().NoError(s.network.WaitForNextBlock()) - vpoolsQueryResp = new(vpooltypes.QueryAllPoolsResponse) + vpoolsQueryResp = new(perpammtypes.QueryAllPoolsResponse) s.Require().NoError(testutilcli.ExecQuery( s.network.Validators[0].ClientCtx, cli.CmdGetVpools(), nil, vpoolsQueryResp, )) @@ -327,7 +327,7 @@ func (s *IntegrationTestSuite) TestCmdEditSwapInvariantsProposal() { s.Assert().EqualValues(sdk.NewDec(10).String(), multiplierToSqrtDepth.String()) // get vpool after proposal - vpoolAfter := vpooltypes.Vpool{ + vpoolAfter := perpammtypes.Vpool{ Pair: proposalPair, BaseAssetReserve: vpoolBefore.BaseAssetReserve.Mul(multiplierToSqrtDepth), QuoteAssetReserve: vpoolBefore.QuoteAssetReserve.Mul(multiplierToSqrtDepth), diff --git a/x/vpool/client/cli/genvpool.go b/x/perp/amm/cli/genvpool.go similarity index 100% rename from x/vpool/client/cli/genvpool.go rename to x/perp/amm/cli/genvpool.go diff --git a/x/vpool/client/cli/genvpool_test.go b/x/perp/amm/cli/genvpool_test.go similarity index 98% rename from x/vpool/client/cli/genvpool_test.go rename to x/perp/amm/cli/genvpool_test.go index 84ce33b3e..3b6d44f9c 100644 --- a/x/vpool/client/cli/genvpool_test.go +++ b/x/perp/amm/cli/genvpool_test.go @@ -16,7 +16,7 @@ import ( "github.com/stretchr/testify/require" "github.com/tendermint/tendermint/libs/log" - "github.com/NibiruChain/nibiru/x/vpool/client/cli" + "github.com/NibiruChain/nibiru/x/perp/amm/cli" ) var testModuleBasicManager = module.NewBasicManager(genutil.AppModuleBasic{}) diff --git a/x/vpool/client/cli/gov_client.go b/x/perp/amm/cli/gov_client.go similarity index 100% rename from x/vpool/client/cli/gov_client.go rename to x/perp/amm/cli/gov_client.go diff --git a/x/vpool/client/cli/query.go b/x/perp/amm/cli/query.go similarity index 100% rename from x/vpool/client/cli/query.go rename to x/perp/amm/cli/query.go diff --git a/x/perp/amm/keeper/bias_test.go b/x/perp/amm/keeper/bias_test.go index 7f3957586..4abd3bf0a 100644 --- a/x/perp/amm/keeper/bias_test.go +++ b/x/perp/amm/keeper/bias_test.go @@ -5,8 +5,8 @@ import ( "time" . "github.com/NibiruChain/nibiru/x/perp/integration/assertion" - . "github.com/NibiruChain/nibiru/x/vpool/integration/action" - . "github.com/NibiruChain/nibiru/x/vpool/integration/assertion" + integrationaction "github.com/NibiruChain/nibiru/x/vpool/integration/action" + vpoolassertion "github.com/NibiruChain/nibiru/x/vpool/integration/assertion" sdk "github.com/cosmos/cosmos-sdk/types" @@ -55,8 +55,8 @@ func TestBiasChangeOnVpool(t *testing.T) { OpenPosition(alice, pairBtcUsdc, perptypes.Side_BUY, sdk.NewInt(1000), sdk.NewDec(10), sdk.ZeroDec()), ). Then( - VpoolShouldBeEqual(pairBtcUsdc, - VPool_BiasShouldBeEqualTo(sdk.MustNewDecFromStr("9999.999900000001000000")), // Bias equal to PositionSize + vpoolassertion.VpoolShouldBeEqual(pairBtcUsdc, + vpoolassertion.VPool_BiasShouldBeEqualTo(sdk.MustNewDecFromStr("9999.999900000001000000")), // Bias equal to PositionSize ), PositionShouldBeEqual(alice, pairBtcUsdc, Position_PositionSizeShouldBeEqualTo(sdk.MustNewDecFromStr("9999.999900000001000000"))), ), @@ -75,8 +75,8 @@ func TestBiasChangeOnVpool(t *testing.T) { OpenPosition(alice, pairBtcUsdc, perptypes.Side_BUY, sdk.NewInt(1000), sdk.NewDec(10), sdk.ZeroDec()), ). Then( - VpoolShouldBeEqual(pairBtcUsdc, - VPool_BiasShouldBeEqualTo(sdk.MustNewDecFromStr("19999.999600000008000000")), // Bias equal to PositionSize + vpoolassertion.VpoolShouldBeEqual(pairBtcUsdc, + vpoolassertion.VPool_BiasShouldBeEqualTo(sdk.MustNewDecFromStr("19999.999600000008000000")), // Bias equal to PositionSize ), PositionShouldBeEqual(alice, pairBtcUsdc, Position_PositionSizeShouldBeEqualTo(sdk.MustNewDecFromStr("19999.999600000008000000"))), ), @@ -92,8 +92,8 @@ func TestBiasChangeOnVpool(t *testing.T) { OpenPosition(alice, pairBtcUsdc, perptypes.Side_SELL, sdk.NewInt(1000), sdk.NewDec(10), sdk.ZeroDec()), ). Then( - VpoolShouldBeEqual(pairBtcUsdc, - VPool_BiasShouldBeEqualTo(sdk.MustNewDecFromStr("-10000.000100000001000000")), // Bias equal to PositionSize + vpoolassertion.VpoolShouldBeEqual(pairBtcUsdc, + vpoolassertion.VPool_BiasShouldBeEqualTo(sdk.MustNewDecFromStr("-10000.000100000001000000")), // Bias equal to PositionSize ), PositionShouldBeEqual(alice, pairBtcUsdc, Position_PositionSizeShouldBeEqualTo(sdk.MustNewDecFromStr("-10000.000100000001000000"))), ), @@ -112,8 +112,8 @@ func TestBiasChangeOnVpool(t *testing.T) { OpenPosition(alice, pairBtcUsdc, perptypes.Side_SELL, sdk.NewInt(1000), sdk.NewDec(10), sdk.ZeroDec()), ). Then( - VpoolShouldBeEqual(pairBtcUsdc, - VPool_BiasShouldBeEqualTo(sdk.MustNewDecFromStr("-20000.000400000008000000")), // Bias equal to PositionSize + vpoolassertion.VpoolShouldBeEqual(pairBtcUsdc, + vpoolassertion.VPool_BiasShouldBeEqualTo(sdk.MustNewDecFromStr("-20000.000400000008000000")), // Bias equal to PositionSize ), PositionShouldBeEqual(alice, pairBtcUsdc, Position_PositionSizeShouldBeEqualTo(sdk.MustNewDecFromStr("-20000.000400000008000000"))), ), @@ -131,8 +131,8 @@ func TestBiasChangeOnVpool(t *testing.T) { ClosePosition(alice, pairBtcUsdc), ). Then( - VpoolShouldBeEqual(pairBtcUsdc, - VPool_BiasShouldBeEqualTo(sdk.ZeroDec()), // Bias equal to PositionSize + vpoolassertion.VpoolShouldBeEqual(pairBtcUsdc, + vpoolassertion.VPool_BiasShouldBeEqualTo(sdk.ZeroDec()), // Bias equal to PositionSize ), PositionShouldNotExist(alice, pairBtcUsdc), ), @@ -150,11 +150,12 @@ func TestBiasChangeOnVpool(t *testing.T) { OpenPosition(alice, pairBtcUsdc, perptypes.Side_SELL, sdk.NewInt(100), sdk.NewDec(10), sdk.ZeroDec()), ). Then( - VpoolShouldBeEqual(pairBtcUsdc, - VPool_BiasShouldBeEqualTo(sdk.MustNewDecFromStr("8999.999919000000729000")), // Bias equal to PositionSize + vpoolassertion.VpoolShouldBeEqual(pairBtcUsdc, + vpoolassertion.VPool_BiasShouldBeEqualTo(sdk.MustNewDecFromStr("8999.999919000000729000")), // Bias equal to PositionSize ), PositionShouldBeEqual(alice, pairBtcUsdc, Position_PositionSizeShouldBeEqualTo(sdk.MustNewDecFromStr("8999.999919000000729000"))), ), + TC("2 positions, one long, one short with same amount should set Bias to 0"). Given( createInitVPool(), @@ -169,12 +170,13 @@ func TestBiasChangeOnVpool(t *testing.T) { OpenPosition(bob, pairBtcUsdc, perptypes.Side_SELL, sdk.NewInt(1000), sdk.NewDec(10), sdk.ZeroDec()), ). Then( - VpoolShouldBeEqual(pairBtcUsdc, - VPool_BiasShouldBeEqualTo(sdk.ZeroDec()), // Bias equal to PositionSize + vpoolassertion.VpoolShouldBeEqual(pairBtcUsdc, + vpoolassertion.VPool_BiasShouldBeEqualTo(sdk.ZeroDec()), // Bias equal to PositionSize ), PositionShouldBeEqual(alice, pairBtcUsdc, Position_PositionSizeShouldBeEqualTo(sdk.MustNewDecFromStr("9999.999900000001000000"))), PositionShouldBeEqual(bob, pairBtcUsdc, Position_PositionSizeShouldBeEqualTo(sdk.MustNewDecFromStr("-9999.999900000001000000"))), ), + TC("Open long position and liquidate"). Given( createInitVPool(), @@ -186,14 +188,14 @@ func TestBiasChangeOnVpool(t *testing.T) { FundAccount(bob, sdk.NewCoins(sdk.NewCoin(denoms.USDC, sdk.NewInt(1020)))), OpenPosition(alice, pairBtcUsdc, perptypes.Side_BUY, sdk.NewInt(1000), sdk.NewDec(10), sdk.ZeroDec()), MoveToNextBlock(), - ChangeMaintenanceMarginRatio(pairBtcUsdc, sdk.MustNewDecFromStr("0.2")), + integrationaction.ChangeMaintenanceMarginRatio(pairBtcUsdc, sdk.MustNewDecFromStr("0.2")), ChangeLiquidationFeeRatio(sdk.MustNewDecFromStr("0.2")), ). When( LiquidatePosition(bob, alice, pairBtcUsdc), ).Then( - VpoolShouldBeEqual(pairBtcUsdc, - VPool_BiasShouldBeEqualTo(sdk.ZeroDec()), // Bias equal to PositionSize + vpoolassertion.VpoolShouldBeEqual(pairBtcUsdc, + vpoolassertion.VPool_BiasShouldBeEqualTo(sdk.ZeroDec()), // Bias equal to PositionSize ), PositionShouldNotExist(alice, pairBtcUsdc), ), diff --git a/x/perp/client/cli/query.go b/x/perp/client/cli/query.go index 8914cd19d..e287e1ad3 100644 --- a/x/perp/client/cli/query.go +++ b/x/perp/client/cli/query.go @@ -9,13 +9,14 @@ import ( "github.com/spf13/cobra" "github.com/NibiruChain/nibiru/x/common/asset" + perpammcli "github.com/NibiruChain/nibiru/x/perp/amm/cli" "github.com/NibiruChain/nibiru/x/perp/types" ) // GetQueryCmd returns the cli query commands for this module func GetQueryCmd() *cobra.Command { // Group stablecoin queries under a subcommand - perpQueryCmd := &cobra.Command{ + moduleQueryCmd := &cobra.Command{ Use: types.ModuleName, Short: fmt.Sprintf( "Querying commands for the %s module", types.ModuleName), @@ -30,12 +31,15 @@ func GetQueryCmd() *cobra.Command { CmdQueryPositions(), CmdQueryCumulativePremiumFraction(), CmdQueryMetrics(), + perpammcli.CmdGetVpoolReserveAssets(), + perpammcli.CmdGetVpools(), + perpammcli.CmdGetBaseAssetPrice(), } for _, cmd := range cmds { - perpQueryCmd.AddCommand(cmd) + moduleQueryCmd.AddCommand(cmd) } - return perpQueryCmd + return moduleQueryCmd } func CmdQueryParams() *cobra.Command { diff --git a/x/vpool/module.go b/x/vpool/module.go index 00c5be2a3..9df2006a8 100644 --- a/x/vpool/module.go +++ b/x/vpool/module.go @@ -16,9 +16,9 @@ import ( "github.com/spf13/cobra" abci "github.com/tendermint/tendermint/abci/types" + "github.com/NibiruChain/nibiru/x/perp/amm/cli" "github.com/NibiruChain/nibiru/x/perp/amm/keeper" "github.com/NibiruChain/nibiru/x/perp/amm/types" - "github.com/NibiruChain/nibiru/x/vpool/client/cli" "github.com/NibiruChain/nibiru/x/vpool/simulation" ) From d5d21a9d808fef6870a4fd5be2617c86a4d850f7 Mon Sep 17 00:00:00 2001 From: Unique-Divine Date: Fri, 7 Apr 2023 16:42:52 -0500 Subject: [PATCH 4/4] chore: CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cea9f8d87..22aa65c48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,7 +42,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Breaking -* [#xxx](https://github.com/NibiruChain/nibiru/pull/xxx) - refactor(perp)!: xxx +* [#1267](https://github.com/NibiruChain/nibiru/pull/1267) - refactor(perp)!: (1/2) Moves types, keeper, and cli from vpool to perp/amm * [#1243](https://github.com/NibiruChain/nibiru/pull/1243) - feat(vpool): sqrt of liquidity depth tracked on pool * [#1220](https://github.com/NibiruChain/nibiru/pull/1220) - feat: reduce gas fees when posting price * [#1229](https://github.com/NibiruChain/nibiru/pull/1229) - feat: upgrade ibc to v4.2.0 and wasm v0.30.0