From f3f0af1351b84e33b33579da1fe0c9397278d462 Mon Sep 17 00:00:00 2001 From: zakir <80246097+zakir-code@users.noreply.github.com> Date: Wed, 11 Oct 2023 17:07:21 +0800 Subject: [PATCH] fix query oracle prices return type --- fxsdk/client/marginx.py | 9 ++- fxsdk/msg/{dex.py => marginx.py} | 0 fxsdk/x/fx/dex/v1/genesis_pb2.py | 73 ------------------------- fxsdk/x/fx/dex/v1/genesis_pb2.pyi | 59 -------------------- fxsdk/x/fx/dex/v1/genesis_pb2_grpc.py | 4 -- fxsdk/x/fx/dex/v1/match_pb2.py | 72 +++++++----------------- fxsdk/x/fx/dex/v1/match_pb2.pyi | 60 -------------------- fxsdk/x/marginx/oracle/v1/query_pb2.py | 32 ++++++----- fxsdk/x/marginx/oracle/v1/query_pb2.pyi | 12 +++- proto/fx/dex/v1/genesis.proto | 39 ------------- proto/fx/dex/v1/match.proto | 59 -------------------- proto/marginx/oracle/v1/query.proto | 9 ++- 12 files changed, 60 insertions(+), 368 deletions(-) rename fxsdk/msg/{dex.py => marginx.py} (100%) delete mode 100644 fxsdk/x/fx/dex/v1/genesis_pb2.py delete mode 100644 fxsdk/x/fx/dex/v1/genesis_pb2.pyi delete mode 100644 fxsdk/x/fx/dex/v1/genesis_pb2_grpc.py delete mode 100644 proto/fx/dex/v1/genesis.proto diff --git a/fxsdk/client/marginx.py b/fxsdk/client/marginx.py index db7061d..5a23325 100644 --- a/fxsdk/client/marginx.py +++ b/fxsdk/client/marginx.py @@ -2,7 +2,7 @@ from fxsdk.client.grpc import Client from fxsdk.dec import dec_from_str -from fxsdk.msg.dex import new_position_from_proto, new_order_from_proto, Order, Position, \ +from fxsdk.msg.marginx import new_position_from_proto, new_order_from_proto, Order, Position, \ new_pair_funding_rate_from_proto, PairFundingRate, OrderDepths, PairPrice, new_order_depths_from_proto from fxsdk.x.marginx.oracle.v1.query_pb2 import QueryPriceRequest, QueryMarketRequest @@ -24,9 +24,12 @@ def query_oracle_price(self, pair_id: str) -> Decimal: response = OracleClient(self.channel).Price(QueryPriceRequest(pair_id=pair_id)) return dec_from_str(response.price) - def query_oracle_prices(self): # TODO: need fix return type + def query_oracle_prices(self) -> [PairPrice]: response = OracleClient(self.channel).Prices(QueryPriceRequest()) - return response.prices + pair_prices = [] + for price in response.prices: + pair_prices.append(PairPrice(price.pair_id, dec_from_str(price.price))) + return pair_prices def query_oracle_market(self, pair_id: str) -> Market: response = OracleClient(self.channel).Market(QueryMarketRequest(pair_id=pair_id)) diff --git a/fxsdk/msg/dex.py b/fxsdk/msg/marginx.py similarity index 100% rename from fxsdk/msg/dex.py rename to fxsdk/msg/marginx.py diff --git a/fxsdk/x/fx/dex/v1/genesis_pb2.py b/fxsdk/x/fx/dex/v1/genesis_pb2.py deleted file mode 100644 index 5daedc3..0000000 --- a/fxsdk/x/fx/dex/v1/genesis_pb2.py +++ /dev/null @@ -1,73 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: fx/dex/v1/genesis.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from fxsdk.x.fx.dex.v1 import funding_pb2 as fx_dot_dex_dot_v1_dot_funding__pb2 -from fxsdk.x.fx.dex.v1 import margin_pb2 as fx_dot_dex_dot_v1_dot_margin__pb2 -from fxsdk.x.fx.dex.v1 import match_pb2 as fx_dot_dex_dot_v1_dot_match__pb2 -from fxsdk.x.fx.dex.v1 import order_pb2 as fx_dot_dex_dot_v1_dot_order__pb2 -from fxsdk.x.fx.dex.v1 import params_pb2 as fx_dot_dex_dot_v1_dot_params__pb2 -from fxsdk.x.fx.dex.v1 import position_pb2 as fx_dot_dex_dot_v1_dot_position__pb2 -from fxsdk.x.gogoproto import gogo_pb2 as gogoproto_dot_gogo__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17\x66x/dex/v1/genesis.proto\x12\tfx.dex.v1\x1a\x17\x66x/dex/v1/funding.proto\x1a\x16\x66x/dex/v1/margin.proto\x1a\x15\x66x/dex/v1/match.proto\x1a\x15\x66x/dex/v1/order.proto\x1a\x16\x66x/dex/v1/params.proto\x1a\x18\x66x/dex/v1/position.proto\x1a\x14gogoproto/gogo.proto\"\x85\x07\n\x0cGenesisState\x12<\n\x12pair_funding_rates\x18\x01 \x03(\x0b\x32\x1a.fx.dex.v1.PairFundingRateB\x04\xc8\xde\x1f\x00\x12.\n\x0c\x66unding_info\x18\x02 \x01(\x0b\x32\x12.fx.dex.v1.FundingB\x04\xc8\xde\x1f\x00\x12\x32\n\x0c\x66unding_time\x18\x03 \x01(\x0b\x32\x16.fx.dex.v1.FundingTimeB\x04\xc8\xde\x1f\x00\x12?\n\x14premium_index_config\x18\x04 \x01(\x0b\x32\x1b.fx.dex.v1.PremiumIndexConfB\x04\xc8\xde\x1f\x00\x12\x34\n\rpremium_index\x18\x05 \x03(\x0b\x32\x17.fx.dex.v1.PremiumIndexB\x04\xc8\xde\x1f\x00\x12<\n\x12margin_rate_tables\x18\x06 \x03(\x0b\x32\x1a.fx.dex.v1.MarginRateTableB\x04\xc8\xde\x1f\x00\x12.\n\ndeal_price\x18\x07 \x03(\x0b\x32\x14.fx.dex.v1.DealPriceB\x04\xc8\xde\x1f\x00\x12&\n\x06orders\x18\x08 \x03(\x0b\x32\x10.fx.dex.v1.OrderB\x04\xc8\xde\x1f\x00\x12\'\n\x06params\x18\t \x01(\x0b\x32\x11.fx.dex.v1.ParamsB\x04\xc8\xde\x1f\x00\x12,\n\tpositions\x18\n \x03(\x0b\x32\x13.fx.dex.v1.PositionB\x04\xc8\xde\x1f\x00\x12\x30\n\x0bposition_id\x18\x0b \x01(\x0b\x32\x15.fx.dex.v1.PositionIDB\x04\xc8\xde\x1f\x00\x12\x37\n\tma_params\x18\x0c \x01(\x0b\x32\x1e.fx.dex.v1.MovingAverageParamsB\x04\xc8\xde\x1f\x00\x12\x1b\n\rbook_pair_ids\x18\r \x03(\tB\x04\xc8\xde\x1f\x00\x12\x32\n\x08\x61sk_book\x18\x0e \x03(\x0b\x32\x1a.fx.dex.v1.OrderDepthArrayB\x04\xc8\xde\x1f\x00\x12\x32\n\x08\x62id_book\x18\x0f \x03(\x0b\x32\x1a.fx.dex.v1.OrderDepthArrayB\x04\xc8\xde\x1f\x00\x12!\n\x13order_book_ids_keys\x18\x10 \x03(\tB\x04\xc8\xde\x1f\x00\x12\x31\n\x0eorder_book_ids\x18\x11 \x03(\x0b\x32\x13.fx.dex.v1.OrderIDsB\x04\xc8\xde\x1f\x00\x12)\n\x07reserve\x18\x12 \x01(\x0b\x32\x12.fx.dex.v1.ReserveB\x04\xc8\xde\x1f\x00\">\n\x0fOrderDepthArray\x12+\n\x06values\x18\x01 \x03(\x0b\x32\x15.fx.dex.v1.OrderDepthB\x04\xc8\xde\x1f\x00\x42-Z+github.com/marginxio/marginx/x/dex/v1/typesb\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'fx.dex.v1.genesis_pb2', _globals) -if _descriptor._USE_C_DESCRIPTORS == False: - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z+github.com/marginxio/marginx/x/dex/v1/types' - _GENESISSTATE.fields_by_name['pair_funding_rates']._options = None - _GENESISSTATE.fields_by_name['pair_funding_rates']._serialized_options = b'\310\336\037\000' - _GENESISSTATE.fields_by_name['funding_info']._options = None - _GENESISSTATE.fields_by_name['funding_info']._serialized_options = b'\310\336\037\000' - _GENESISSTATE.fields_by_name['funding_time']._options = None - _GENESISSTATE.fields_by_name['funding_time']._serialized_options = b'\310\336\037\000' - _GENESISSTATE.fields_by_name['premium_index_config']._options = None - _GENESISSTATE.fields_by_name['premium_index_config']._serialized_options = b'\310\336\037\000' - _GENESISSTATE.fields_by_name['premium_index']._options = None - _GENESISSTATE.fields_by_name['premium_index']._serialized_options = b'\310\336\037\000' - _GENESISSTATE.fields_by_name['margin_rate_tables']._options = None - _GENESISSTATE.fields_by_name['margin_rate_tables']._serialized_options = b'\310\336\037\000' - _GENESISSTATE.fields_by_name['deal_price']._options = None - _GENESISSTATE.fields_by_name['deal_price']._serialized_options = b'\310\336\037\000' - _GENESISSTATE.fields_by_name['orders']._options = None - _GENESISSTATE.fields_by_name['orders']._serialized_options = b'\310\336\037\000' - _GENESISSTATE.fields_by_name['params']._options = None - _GENESISSTATE.fields_by_name['params']._serialized_options = b'\310\336\037\000' - _GENESISSTATE.fields_by_name['positions']._options = None - _GENESISSTATE.fields_by_name['positions']._serialized_options = b'\310\336\037\000' - _GENESISSTATE.fields_by_name['position_id']._options = None - _GENESISSTATE.fields_by_name['position_id']._serialized_options = b'\310\336\037\000' - _GENESISSTATE.fields_by_name['ma_params']._options = None - _GENESISSTATE.fields_by_name['ma_params']._serialized_options = b'\310\336\037\000' - _GENESISSTATE.fields_by_name['book_pair_ids']._options = None - _GENESISSTATE.fields_by_name['book_pair_ids']._serialized_options = b'\310\336\037\000' - _GENESISSTATE.fields_by_name['ask_book']._options = None - _GENESISSTATE.fields_by_name['ask_book']._serialized_options = b'\310\336\037\000' - _GENESISSTATE.fields_by_name['bid_book']._options = None - _GENESISSTATE.fields_by_name['bid_book']._serialized_options = b'\310\336\037\000' - _GENESISSTATE.fields_by_name['order_book_ids_keys']._options = None - _GENESISSTATE.fields_by_name['order_book_ids_keys']._serialized_options = b'\310\336\037\000' - _GENESISSTATE.fields_by_name['order_book_ids']._options = None - _GENESISSTATE.fields_by_name['order_book_ids']._serialized_options = b'\310\336\037\000' - _GENESISSTATE.fields_by_name['reserve']._options = None - _GENESISSTATE.fields_by_name['reserve']._serialized_options = b'\310\336\037\000' - _ORDERDEPTHARRAY.fields_by_name['values']._options = None - _ORDERDEPTHARRAY.fields_by_name['values']._serialized_options = b'\310\336\037\000' - _globals['_GENESISSTATE']._serialized_start=206 - _globals['_GENESISSTATE']._serialized_end=1107 - _globals['_ORDERDEPTHARRAY']._serialized_start=1109 - _globals['_ORDERDEPTHARRAY']._serialized_end=1171 -# @@protoc_insertion_point(module_scope) diff --git a/fxsdk/x/fx/dex/v1/genesis_pb2.pyi b/fxsdk/x/fx/dex/v1/genesis_pb2.pyi deleted file mode 100644 index 8134b9f..0000000 --- a/fxsdk/x/fx/dex/v1/genesis_pb2.pyi +++ /dev/null @@ -1,59 +0,0 @@ -from fx.dex.v1 import funding_pb2 as _funding_pb2 -from fx.dex.v1 import margin_pb2 as _margin_pb2 -from fx.dex.v1 import match_pb2 as _match_pb2 -from fx.dex.v1 import order_pb2 as _order_pb2 -from fx.dex.v1 import params_pb2 as _params_pb2 -from fx.dex.v1 import position_pb2 as _position_pb2 -from gogoproto import gogo_pb2 as _gogo_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class GenesisState(_message.Message): - __slots__ = ["pair_funding_rates", "funding_info", "funding_time", "premium_index_config", "premium_index", "margin_rate_tables", "deal_price", "orders", "params", "positions", "position_id", "ma_params", "book_pair_ids", "ask_book", "bid_book", "order_book_ids_keys", "order_book_ids", "reserve"] - PAIR_FUNDING_RATES_FIELD_NUMBER: _ClassVar[int] - FUNDING_INFO_FIELD_NUMBER: _ClassVar[int] - FUNDING_TIME_FIELD_NUMBER: _ClassVar[int] - PREMIUM_INDEX_CONFIG_FIELD_NUMBER: _ClassVar[int] - PREMIUM_INDEX_FIELD_NUMBER: _ClassVar[int] - MARGIN_RATE_TABLES_FIELD_NUMBER: _ClassVar[int] - DEAL_PRICE_FIELD_NUMBER: _ClassVar[int] - ORDERS_FIELD_NUMBER: _ClassVar[int] - PARAMS_FIELD_NUMBER: _ClassVar[int] - POSITIONS_FIELD_NUMBER: _ClassVar[int] - POSITION_ID_FIELD_NUMBER: _ClassVar[int] - MA_PARAMS_FIELD_NUMBER: _ClassVar[int] - BOOK_PAIR_IDS_FIELD_NUMBER: _ClassVar[int] - ASK_BOOK_FIELD_NUMBER: _ClassVar[int] - BID_BOOK_FIELD_NUMBER: _ClassVar[int] - ORDER_BOOK_IDS_KEYS_FIELD_NUMBER: _ClassVar[int] - ORDER_BOOK_IDS_FIELD_NUMBER: _ClassVar[int] - RESERVE_FIELD_NUMBER: _ClassVar[int] - pair_funding_rates: _containers.RepeatedCompositeFieldContainer[_funding_pb2.PairFundingRate] - funding_info: _funding_pb2.Funding - funding_time: _funding_pb2.FundingTime - premium_index_config: _funding_pb2.PremiumIndexConf - premium_index: _containers.RepeatedCompositeFieldContainer[_funding_pb2.PremiumIndex] - margin_rate_tables: _containers.RepeatedCompositeFieldContainer[_margin_pb2.MarginRateTable] - deal_price: _containers.RepeatedCompositeFieldContainer[_match_pb2.DealPrice] - orders: _containers.RepeatedCompositeFieldContainer[_order_pb2.Order] - params: _params_pb2.Params - positions: _containers.RepeatedCompositeFieldContainer[_position_pb2.Position] - position_id: _position_pb2.PositionID - ma_params: _funding_pb2.MovingAverageParams - book_pair_ids: _containers.RepeatedScalarFieldContainer[str] - ask_book: _containers.RepeatedCompositeFieldContainer[OrderDepthArray] - bid_book: _containers.RepeatedCompositeFieldContainer[OrderDepthArray] - order_book_ids_keys: _containers.RepeatedScalarFieldContainer[str] - order_book_ids: _containers.RepeatedCompositeFieldContainer[_order_pb2.OrderIDs] - reserve: _params_pb2.Reserve - def __init__(self, pair_funding_rates: _Optional[_Iterable[_Union[_funding_pb2.PairFundingRate, _Mapping]]] = ..., funding_info: _Optional[_Union[_funding_pb2.Funding, _Mapping]] = ..., funding_time: _Optional[_Union[_funding_pb2.FundingTime, _Mapping]] = ..., premium_index_config: _Optional[_Union[_funding_pb2.PremiumIndexConf, _Mapping]] = ..., premium_index: _Optional[_Iterable[_Union[_funding_pb2.PremiumIndex, _Mapping]]] = ..., margin_rate_tables: _Optional[_Iterable[_Union[_margin_pb2.MarginRateTable, _Mapping]]] = ..., deal_price: _Optional[_Iterable[_Union[_match_pb2.DealPrice, _Mapping]]] = ..., orders: _Optional[_Iterable[_Union[_order_pb2.Order, _Mapping]]] = ..., params: _Optional[_Union[_params_pb2.Params, _Mapping]] = ..., positions: _Optional[_Iterable[_Union[_position_pb2.Position, _Mapping]]] = ..., position_id: _Optional[_Union[_position_pb2.PositionID, _Mapping]] = ..., ma_params: _Optional[_Union[_funding_pb2.MovingAverageParams, _Mapping]] = ..., book_pair_ids: _Optional[_Iterable[str]] = ..., ask_book: _Optional[_Iterable[_Union[OrderDepthArray, _Mapping]]] = ..., bid_book: _Optional[_Iterable[_Union[OrderDepthArray, _Mapping]]] = ..., order_book_ids_keys: _Optional[_Iterable[str]] = ..., order_book_ids: _Optional[_Iterable[_Union[_order_pb2.OrderIDs, _Mapping]]] = ..., reserve: _Optional[_Union[_params_pb2.Reserve, _Mapping]] = ...) -> None: ... - -class OrderDepthArray(_message.Message): - __slots__ = ["values"] - VALUES_FIELD_NUMBER: _ClassVar[int] - values: _containers.RepeatedCompositeFieldContainer[_match_pb2.OrderDepth] - def __init__(self, values: _Optional[_Iterable[_Union[_match_pb2.OrderDepth, _Mapping]]] = ...) -> None: ... diff --git a/fxsdk/x/fx/dex/v1/genesis_pb2_grpc.py b/fxsdk/x/fx/dex/v1/genesis_pb2_grpc.py deleted file mode 100644 index 2daafff..0000000 --- a/fxsdk/x/fx/dex/v1/genesis_pb2_grpc.py +++ /dev/null @@ -1,4 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - diff --git a/fxsdk/x/fx/dex/v1/match_pb2.py b/fxsdk/x/fx/dex/v1/match_pb2.py index b389ddd..1e53eb6 100644 --- a/fxsdk/x/fx/dex/v1/match_pb2.py +++ b/fxsdk/x/fx/dex/v1/match_pb2.py @@ -15,7 +15,7 @@ from fxsdk.x.fx.dex.v1 import order_pb2 as fx_dot_dex_dot_v1_dot_order__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15\x66x/dex/v1/match.proto\x12\tfx.dex.v1\x1a\x14gogoproto/gogo.proto\x1a\x15\x66x/dex/v1/order.proto\"\xe9\x01\n\tOrderFill\x12%\n\x05order\x18\x01 \x01(\x0b\x32\x10.fx.dex.v1.OrderB\x04\xc8\xde\x1f\x00\x12\x37\n\ndeal_price\x18\x02 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12<\n\x0fquantity_filled\x18\x03 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12>\n\x11quantity_unfilled\x18\x04 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\"<\n\nOrderFills\x12.\n\norder_fill\x18\x01 \x03(\x0b\x32\x14.fx.dex.v1.OrderFillB\x04\xc8\xde\x1f\x00\";\n\x05Price\x12\x32\n\x05price\x18\x01 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\"w\n\nOrderDepth\x12\x32\n\x05price\x18\x01 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12\x35\n\x08quantity\x18\x02 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\"@\n\x0bOrderDepths\x12\x31\n\x0corder_depths\x18\x01 \x03(\x0b\x32\x15.fx.dex.v1.OrderDepthB\x04\xc8\xde\x1f\x00\"W\n\tOrderBook\x12$\n\x03\x62id\x18\x01 \x01(\x0b\x32\x11.fx.dex.v1.OrdersB\x04\xc8\xde\x1f\x00\x12$\n\x03\x61sk\x18\x02 \x01(\x0b\x32\x11.fx.dex.v1.OrdersB\x04\xc8\xde\x1f\x00\"\xba\x01\n\rDepthBookItem\x12\x32\n\x05price\x18\x01 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12\x39\n\x0c\x62uy_quantity\x18\x02 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12:\n\rsell_quantity\x18\x03 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\":\n\tDepthBook\x12-\n\x05items\x18\x01 \x03(\x0b\x32\x18.fx.dex.v1.DepthBookItemB\x04\xc8\xde\x1f\x00\"\xbc\x01\n\x07Matcher\x12\x0f\n\x07pair_id\x18\x01 \x01(\t\x12.\n\norder_book\x18\x02 \x01(\x0b\x32\x14.fx.dex.v1.OrderBookB\x04\xc8\xde\x1f\x00\x12<\n\x0flast_deal_price\x18\x03 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12\x32\n\x0c\x64\x65pth_curves\x18\x04 \x01(\x0b\x32\x16.fx.dex.v1.DepthCurvesB\x04\xc8\xde\x1f\x00\"\xab\x03\n\x0bMatchResult\x12\x0f\n\x07pair_id\x18\x01 \x01(\t\x12\x11\n\tbid_count\x18\x02 \x01(\x03\x12\x11\n\task_count\x18\x03 \x01(\x03\x12\x37\n\ndeal_price\x18\x04 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12?\n\x12matched_bid_volume\x18\x05 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12?\n\x12matched_ask_volume\x18\x06 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12;\n\x0emax_bid_volume\x18\x07 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12;\n\x0emax_ask_volume\x18\x08 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12\x30\n\x0border_fills\x18\t \x01(\x0b\x32\x15.fx.dex.v1.OrderFillsB\x04\xc8\xde\x1f\x00\"B\n\x0cMatchResults\x12\x32\n\x0cmatch_result\x18\x01 \x03(\x0b\x32\x16.fx.dex.v1.MatchResultB\x04\xc8\xde\x1f\x00\"U\n\tDealPrice\x12\x0f\n\x07pair_id\x18\x01 \x01(\t\x12\x37\n\ndeal_price\x18\x02 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\"\xbb\x01\n\x0e\x44\x65pthCurveItem\x12\x32\n\x05price\x18\x01 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12:\n\rsell_quantity\x18\x02 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12\x39\n\x0c\x62uy_quantity\x18\x03 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\"=\n\x0b\x44\x65pthCurves\x12.\n\x05items\x18\x01 \x03(\x0b\x32\x19.fx.dex.v1.DepthCurveItemB\x04\xc8\xde\x1f\x00\"\xe9\x01\n\x04\x44\x65\x61l\x12\x10\n\x08order_id\x18\x01 \x01(\t\x12\x11\n\tdirection\x18\x02 \x01(\t\x12\x35\n\x08quantity\x18\x03 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12\x32\n\x05price\x18\x04 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12<\n\x03\x66\x65\x65\x18\x05 \x01(\tB/\xc8\xde\x1f\x00\xda\xde\x1f\'github.com/cosmos/cosmos-sdk/types.Coin\x12\x13\n\x0bposition_id\x18\x06 \x01(\t\"\xb1\x01\n\x08MatchRes\x12\x14\n\x0c\x62lock_height\x18\x01 \x01(\x03\x12\x32\n\x05price\x18\x02 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12\x35\n\x08quantity\x18\x03 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12$\n\x05\x64\x65\x61ls\x18\x04 \x03(\x0b\x32\x0f.fx.dex.v1.DealB\x04\xc8\xde\x1f\x00\"\x85\x02\n\x0bProductLock\x12\x14\n\x0c\x62lock_height\x18\x01 \x01(\x03\x12\x32\n\x05price\x18\x02 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12\x35\n\x08quantity\x18\x03 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12\x39\n\x0c\x62uy_executed\x18\x04 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12:\n\rsell_executed\x18\x05 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\"\x18\n\x07IntList\x12\r\n\x05items\x18\x01 \x03(\x03\"\x14\n\x03Int\x12\r\n\x05items\x18\x01 \x01(\x03\x42-Z+github.com/marginxio/marginx/x/dex/v1/typesb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15\x66x/dex/v1/match.proto\x12\tfx.dex.v1\x1a\x14gogoproto/gogo.proto\x1a\x15\x66x/dex/v1/order.proto\"\xe9\x01\n\tOrderFill\x12%\n\x05order\x18\x01 \x01(\x0b\x32\x10.fx.dex.v1.OrderB\x04\xc8\xde\x1f\x00\x12\x37\n\ndeal_price\x18\x02 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12<\n\x0fquantity_filled\x18\x03 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12>\n\x11quantity_unfilled\x18\x04 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\"<\n\nOrderFills\x12.\n\norder_fill\x18\x01 \x03(\x0b\x32\x14.fx.dex.v1.OrderFillB\x04\xc8\xde\x1f\x00\";\n\x05Price\x12\x32\n\x05price\x18\x01 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\"w\n\nOrderDepth\x12\x32\n\x05price\x18\x01 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12\x35\n\x08quantity\x18\x02 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\"W\n\tOrderBook\x12$\n\x03\x62id\x18\x01 \x01(\x0b\x32\x11.fx.dex.v1.OrdersB\x04\xc8\xde\x1f\x00\x12$\n\x03\x61sk\x18\x02 \x01(\x0b\x32\x11.fx.dex.v1.OrdersB\x04\xc8\xde\x1f\x00\"\xba\x01\n\rDepthBookItem\x12\x32\n\x05price\x18\x01 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12\x39\n\x0c\x62uy_quantity\x18\x02 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12:\n\rsell_quantity\x18\x03 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\":\n\tDepthBook\x12-\n\x05items\x18\x01 \x03(\x0b\x32\x18.fx.dex.v1.DepthBookItemB\x04\xc8\xde\x1f\x00\"\xbc\x01\n\x07Matcher\x12\x0f\n\x07pair_id\x18\x01 \x01(\t\x12.\n\norder_book\x18\x02 \x01(\x0b\x32\x14.fx.dex.v1.OrderBookB\x04\xc8\xde\x1f\x00\x12<\n\x0flast_deal_price\x18\x03 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12\x32\n\x0c\x64\x65pth_curves\x18\x04 \x01(\x0b\x32\x16.fx.dex.v1.DepthCurvesB\x04\xc8\xde\x1f\x00\"\xab\x03\n\x0bMatchResult\x12\x0f\n\x07pair_id\x18\x01 \x01(\t\x12\x11\n\tbid_count\x18\x02 \x01(\x03\x12\x11\n\task_count\x18\x03 \x01(\x03\x12\x37\n\ndeal_price\x18\x04 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12?\n\x12matched_bid_volume\x18\x05 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12?\n\x12matched_ask_volume\x18\x06 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12;\n\x0emax_bid_volume\x18\x07 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12;\n\x0emax_ask_volume\x18\x08 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12\x30\n\x0border_fills\x18\t \x01(\x0b\x32\x15.fx.dex.v1.OrderFillsB\x04\xc8\xde\x1f\x00\"B\n\x0cMatchResults\x12\x32\n\x0cmatch_result\x18\x01 \x03(\x0b\x32\x16.fx.dex.v1.MatchResultB\x04\xc8\xde\x1f\x00\"U\n\tDealPrice\x12\x0f\n\x07pair_id\x18\x01 \x01(\t\x12\x37\n\ndeal_price\x18\x02 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\"\xbb\x01\n\x0e\x44\x65pthCurveItem\x12\x32\n\x05price\x18\x01 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12:\n\rsell_quantity\x18\x02 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\x12\x39\n\x0c\x62uy_quantity\x18\x03 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\"=\n\x0b\x44\x65pthCurves\x12.\n\x05items\x18\x01 \x03(\x0b\x32\x19.fx.dex.v1.DepthCurveItemB\x04\xc8\xde\x1f\x00\x42-Z+github.com/marginxio/marginx/x/dex/v1/typesb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -39,8 +39,6 @@ _ORDERDEPTH.fields_by_name['price']._serialized_options = b'\310\336\037\000\332\336\037\033cosmossdk.io/math.LegacyDec' _ORDERDEPTH.fields_by_name['quantity']._options = None _ORDERDEPTH.fields_by_name['quantity']._serialized_options = b'\310\336\037\000\332\336\037\033cosmossdk.io/math.LegacyDec' - _ORDERDEPTHS.fields_by_name['order_depths']._options = None - _ORDERDEPTHS.fields_by_name['order_depths']._serialized_options = b'\310\336\037\000' _ORDERBOOK.fields_by_name['bid']._options = None _ORDERBOOK.fields_by_name['bid']._serialized_options = b'\310\336\037\000' _ORDERBOOK.fields_by_name['ask']._options = None @@ -83,26 +81,6 @@ _DEPTHCURVEITEM.fields_by_name['buy_quantity']._serialized_options = b'\310\336\037\000\332\336\037\033cosmossdk.io/math.LegacyDec' _DEPTHCURVES.fields_by_name['items']._options = None _DEPTHCURVES.fields_by_name['items']._serialized_options = b'\310\336\037\000' - _DEAL.fields_by_name['quantity']._options = None - _DEAL.fields_by_name['quantity']._serialized_options = b'\310\336\037\000\332\336\037\033cosmossdk.io/math.LegacyDec' - _DEAL.fields_by_name['price']._options = None - _DEAL.fields_by_name['price']._serialized_options = b'\310\336\037\000\332\336\037\033cosmossdk.io/math.LegacyDec' - _DEAL.fields_by_name['fee']._options = None - _DEAL.fields_by_name['fee']._serialized_options = b'\310\336\037\000\332\336\037\'github.com/cosmos/cosmos-sdk/types.Coin' - _MATCHRES.fields_by_name['price']._options = None - _MATCHRES.fields_by_name['price']._serialized_options = b'\310\336\037\000\332\336\037\033cosmossdk.io/math.LegacyDec' - _MATCHRES.fields_by_name['quantity']._options = None - _MATCHRES.fields_by_name['quantity']._serialized_options = b'\310\336\037\000\332\336\037\033cosmossdk.io/math.LegacyDec' - _MATCHRES.fields_by_name['deals']._options = None - _MATCHRES.fields_by_name['deals']._serialized_options = b'\310\336\037\000' - _PRODUCTLOCK.fields_by_name['price']._options = None - _PRODUCTLOCK.fields_by_name['price']._serialized_options = b'\310\336\037\000\332\336\037\033cosmossdk.io/math.LegacyDec' - _PRODUCTLOCK.fields_by_name['quantity']._options = None - _PRODUCTLOCK.fields_by_name['quantity']._serialized_options = b'\310\336\037\000\332\336\037\033cosmossdk.io/math.LegacyDec' - _PRODUCTLOCK.fields_by_name['buy_executed']._options = None - _PRODUCTLOCK.fields_by_name['buy_executed']._serialized_options = b'\310\336\037\000\332\336\037\033cosmossdk.io/math.LegacyDec' - _PRODUCTLOCK.fields_by_name['sell_executed']._options = None - _PRODUCTLOCK.fields_by_name['sell_executed']._serialized_options = b'\310\336\037\000\332\336\037\033cosmossdk.io/math.LegacyDec' _globals['_ORDERFILL']._serialized_start=82 _globals['_ORDERFILL']._serialized_end=315 _globals['_ORDERFILLS']._serialized_start=317 @@ -111,34 +89,22 @@ _globals['_PRICE']._serialized_end=438 _globals['_ORDERDEPTH']._serialized_start=440 _globals['_ORDERDEPTH']._serialized_end=559 - _globals['_ORDERDEPTHS']._serialized_start=561 - _globals['_ORDERDEPTHS']._serialized_end=625 - _globals['_ORDERBOOK']._serialized_start=627 - _globals['_ORDERBOOK']._serialized_end=714 - _globals['_DEPTHBOOKITEM']._serialized_start=717 - _globals['_DEPTHBOOKITEM']._serialized_end=903 - _globals['_DEPTHBOOK']._serialized_start=905 - _globals['_DEPTHBOOK']._serialized_end=963 - _globals['_MATCHER']._serialized_start=966 - _globals['_MATCHER']._serialized_end=1154 - _globals['_MATCHRESULT']._serialized_start=1157 - _globals['_MATCHRESULT']._serialized_end=1584 - _globals['_MATCHRESULTS']._serialized_start=1586 - _globals['_MATCHRESULTS']._serialized_end=1652 - _globals['_DEALPRICE']._serialized_start=1654 - _globals['_DEALPRICE']._serialized_end=1739 - _globals['_DEPTHCURVEITEM']._serialized_start=1742 - _globals['_DEPTHCURVEITEM']._serialized_end=1929 - _globals['_DEPTHCURVES']._serialized_start=1931 - _globals['_DEPTHCURVES']._serialized_end=1992 - _globals['_DEAL']._serialized_start=1995 - _globals['_DEAL']._serialized_end=2228 - _globals['_MATCHRES']._serialized_start=2231 - _globals['_MATCHRES']._serialized_end=2408 - _globals['_PRODUCTLOCK']._serialized_start=2411 - _globals['_PRODUCTLOCK']._serialized_end=2672 - _globals['_INTLIST']._serialized_start=2674 - _globals['_INTLIST']._serialized_end=2698 - _globals['_INT']._serialized_start=2700 - _globals['_INT']._serialized_end=2720 + _globals['_ORDERBOOK']._serialized_start=561 + _globals['_ORDERBOOK']._serialized_end=648 + _globals['_DEPTHBOOKITEM']._serialized_start=651 + _globals['_DEPTHBOOKITEM']._serialized_end=837 + _globals['_DEPTHBOOK']._serialized_start=839 + _globals['_DEPTHBOOK']._serialized_end=897 + _globals['_MATCHER']._serialized_start=900 + _globals['_MATCHER']._serialized_end=1088 + _globals['_MATCHRESULT']._serialized_start=1091 + _globals['_MATCHRESULT']._serialized_end=1518 + _globals['_MATCHRESULTS']._serialized_start=1520 + _globals['_MATCHRESULTS']._serialized_end=1586 + _globals['_DEALPRICE']._serialized_start=1588 + _globals['_DEALPRICE']._serialized_end=1673 + _globals['_DEPTHCURVEITEM']._serialized_start=1676 + _globals['_DEPTHCURVEITEM']._serialized_end=1863 + _globals['_DEPTHCURVES']._serialized_start=1865 + _globals['_DEPTHCURVES']._serialized_end=1926 # @@protoc_insertion_point(module_scope) diff --git a/fxsdk/x/fx/dex/v1/match_pb2.pyi b/fxsdk/x/fx/dex/v1/match_pb2.pyi index dcf63f7..d75bb63 100644 --- a/fxsdk/x/fx/dex/v1/match_pb2.pyi +++ b/fxsdk/x/fx/dex/v1/match_pb2.pyi @@ -39,12 +39,6 @@ class OrderDepth(_message.Message): quantity: str def __init__(self, price: _Optional[str] = ..., quantity: _Optional[str] = ...) -> None: ... -class OrderDepths(_message.Message): - __slots__ = ["order_depths"] - ORDER_DEPTHS_FIELD_NUMBER: _ClassVar[int] - order_depths: _containers.RepeatedCompositeFieldContainer[OrderDepth] - def __init__(self, order_depths: _Optional[_Iterable[_Union[OrderDepth, _Mapping]]] = ...) -> None: ... - class OrderBook(_message.Message): __slots__ = ["bid", "ask"] BID_FIELD_NUMBER: _ClassVar[int] @@ -132,57 +126,3 @@ class DepthCurves(_message.Message): ITEMS_FIELD_NUMBER: _ClassVar[int] items: _containers.RepeatedCompositeFieldContainer[DepthCurveItem] def __init__(self, items: _Optional[_Iterable[_Union[DepthCurveItem, _Mapping]]] = ...) -> None: ... - -class Deal(_message.Message): - __slots__ = ["order_id", "direction", "quantity", "price", "fee", "position_id"] - ORDER_ID_FIELD_NUMBER: _ClassVar[int] - DIRECTION_FIELD_NUMBER: _ClassVar[int] - QUANTITY_FIELD_NUMBER: _ClassVar[int] - PRICE_FIELD_NUMBER: _ClassVar[int] - FEE_FIELD_NUMBER: _ClassVar[int] - POSITION_ID_FIELD_NUMBER: _ClassVar[int] - order_id: str - direction: str - quantity: str - price: str - fee: str - position_id: str - def __init__(self, order_id: _Optional[str] = ..., direction: _Optional[str] = ..., quantity: _Optional[str] = ..., price: _Optional[str] = ..., fee: _Optional[str] = ..., position_id: _Optional[str] = ...) -> None: ... - -class MatchRes(_message.Message): - __slots__ = ["block_height", "price", "quantity", "deals"] - BLOCK_HEIGHT_FIELD_NUMBER: _ClassVar[int] - PRICE_FIELD_NUMBER: _ClassVar[int] - QUANTITY_FIELD_NUMBER: _ClassVar[int] - DEALS_FIELD_NUMBER: _ClassVar[int] - block_height: int - price: str - quantity: str - deals: _containers.RepeatedCompositeFieldContainer[Deal] - def __init__(self, block_height: _Optional[int] = ..., price: _Optional[str] = ..., quantity: _Optional[str] = ..., deals: _Optional[_Iterable[_Union[Deal, _Mapping]]] = ...) -> None: ... - -class ProductLock(_message.Message): - __slots__ = ["block_height", "price", "quantity", "buy_executed", "sell_executed"] - BLOCK_HEIGHT_FIELD_NUMBER: _ClassVar[int] - PRICE_FIELD_NUMBER: _ClassVar[int] - QUANTITY_FIELD_NUMBER: _ClassVar[int] - BUY_EXECUTED_FIELD_NUMBER: _ClassVar[int] - SELL_EXECUTED_FIELD_NUMBER: _ClassVar[int] - block_height: int - price: str - quantity: str - buy_executed: str - sell_executed: str - def __init__(self, block_height: _Optional[int] = ..., price: _Optional[str] = ..., quantity: _Optional[str] = ..., buy_executed: _Optional[str] = ..., sell_executed: _Optional[str] = ...) -> None: ... - -class IntList(_message.Message): - __slots__ = ["items"] - ITEMS_FIELD_NUMBER: _ClassVar[int] - items: _containers.RepeatedScalarFieldContainer[int] - def __init__(self, items: _Optional[_Iterable[int]] = ...) -> None: ... - -class Int(_message.Message): - __slots__ = ["items"] - ITEMS_FIELD_NUMBER: _ClassVar[int] - items: int - def __init__(self, items: _Optional[int] = ...) -> None: ... diff --git a/fxsdk/x/marginx/oracle/v1/query_pb2.py b/fxsdk/x/marginx/oracle/v1/query_pb2.py index 31aa978..298293b 100644 --- a/fxsdk/x/marginx/oracle/v1/query_pb2.py +++ b/fxsdk/x/marginx/oracle/v1/query_pb2.py @@ -17,7 +17,7 @@ from fxsdk.x.cosmos_proto import cosmos_pb2 as cosmos__proto_dot_cosmos__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dmarginx/oracle/v1/query.proto\x12\x11marginx.oracle.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x14gogoproto/gogo.proto\x1a\x1dmarginx/oracle/v1/types.proto\x1a\x19\x63osmos_proto/cosmos.proto\"%\n\x12QueryMarketRequest\x12\x0f\n\x07pair_id\x18\x01 \x01(\t\"F\n\x13QueryMarketResponse\x12/\n\x06market\x18\x01 \x01(\x0b\x32\x19.marginx.oracle.v1.MarketB\x04\xc8\xde\x1f\x00\"\x15\n\x13QueryMarketsRequest\"H\n\x14QueryMarketsResponse\x12\x30\n\x07markets\x18\x01 \x03(\x0b\x32\x19.marginx.oracle.v1.MarketB\x04\xc8\xde\x1f\x00\"$\n\x11QueryPriceRequest\x12\x0f\n\x07pair_id\x18\x01 \x01(\t\"V\n\x12QueryPriceResponse\x12@\n\x05price\x18\x01 \x01(\tB1\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\xd2\xb4-\ncosmos.Dec\"\x14\n\x12QueryPricesRequest\"X\n\x13QueryPricesResponse\x12\x41\n\x06prices\x18\x01 \x03(\tB1\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\xd2\xb4-\ncosmos.Dec\"\x14\n\x12QueryParamsRequest\"F\n\x13QueryParamsResponse\x12/\n\x06params\x18\x01 \x01(\x0b\x32\x19.marginx.oracle.v1.ParamsB\x04\xc8\xde\x1f\x00\"\x19\n\x17QueryAggregatorsRequest\"T\n\x18QueryAggregatorsResponse\x12\x38\n\x0b\x61ggregators\x18\x01 \x03(\x0b\x32\x1d.marginx.oracle.v1.AggregatorB\x04\xc8\xde\x1f\x00\x32\x95\x06\n\x05Query\x12~\n\x07Markets\x12&.marginx.oracle.v1.QueryMarketsRequest\x1a\'.marginx.oracle.v1.QueryMarketsResponse\"\"\x82\xd3\xe4\x93\x02\x1c\x12\x1a/marginx/oracle/v1/markets\x12z\n\x06Market\x12%.marginx.oracle.v1.QueryMarketRequest\x1a&.marginx.oracle.v1.QueryMarketResponse\"!\x82\xd3\xe4\x93\x02\x1b\x12\x19/marginx/oracle/v1/market\x12~\n\x05Price\x12$.marginx.oracle.v1.QueryPriceRequest\x1a%.marginx.oracle.v1.QueryPriceResponse\"(\x82\xd3\xe4\x93\x02\"\x12 /marginx/oracle/v1/current_price\x12\x82\x01\n\x06Prices\x12%.marginx.oracle.v1.QueryPricesRequest\x1a&.marginx.oracle.v1.QueryPricesResponse\")\x82\xd3\xe4\x93\x02#\x12!/marginx/oracle/v1/current_prices\x12z\n\x06Params\x12%.marginx.oracle.v1.QueryParamsRequest\x1a&.marginx.oracle.v1.QueryParamsResponse\"!\x82\xd3\xe4\x93\x02\x1b\x12\x19/marginx/oracle/v1/params\x12\x8e\x01\n\x0b\x41ggregators\x12*.marginx.oracle.v1.QueryAggregatorsRequest\x1a+.marginx.oracle.v1.QueryAggregatorsResponse\"&\x82\xd3\xe4\x93\x02 \x12\x1e/marginx/oracle/v1/aggregatorsB-Z+github.com/marginxio/marginx/x/oracle/typesb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dmarginx/oracle/v1/query.proto\x12\x11marginx.oracle.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x14gogoproto/gogo.proto\x1a\x1dmarginx/oracle/v1/types.proto\x1a\x19\x63osmos_proto/cosmos.proto\"%\n\x12QueryMarketRequest\x12\x0f\n\x07pair_id\x18\x01 \x01(\t\"F\n\x13QueryMarketResponse\x12/\n\x06market\x18\x01 \x01(\x0b\x32\x19.marginx.oracle.v1.MarketB\x04\xc8\xde\x1f\x00\"\x15\n\x13QueryMarketsRequest\"H\n\x14QueryMarketsResponse\x12\x30\n\x07markets\x18\x01 \x03(\x0b\x32\x19.marginx.oracle.v1.MarketB\x04\xc8\xde\x1f\x00\"$\n\x11QueryPriceRequest\x12\x0f\n\x07pair_id\x18\x01 \x01(\t\"V\n\x12QueryPriceResponse\x12@\n\x05price\x18\x01 \x01(\tB1\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\xd2\xb4-\ncosmos.Dec\"\x14\n\x12QueryPricesRequest\"^\n\tPairPrice\x12\x0f\n\x07pair_id\x18\x01 \x01(\t\x12@\n\x05price\x18\x02 \x01(\tB1\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDec\xd2\xb4-\ncosmos.Dec\"I\n\x13QueryPricesResponse\x12\x32\n\x06prices\x18\x01 \x03(\x0b\x32\x1c.marginx.oracle.v1.PairPriceB\x04\xc8\xde\x1f\x00\"\x14\n\x12QueryParamsRequest\"F\n\x13QueryParamsResponse\x12/\n\x06params\x18\x01 \x01(\x0b\x32\x19.marginx.oracle.v1.ParamsB\x04\xc8\xde\x1f\x00\"\x19\n\x17QueryAggregatorsRequest\"T\n\x18QueryAggregatorsResponse\x12\x38\n\x0b\x61ggregators\x18\x01 \x03(\x0b\x32\x1d.marginx.oracle.v1.AggregatorB\x04\xc8\xde\x1f\x00\x32\x95\x06\n\x05Query\x12~\n\x07Markets\x12&.marginx.oracle.v1.QueryMarketsRequest\x1a\'.marginx.oracle.v1.QueryMarketsResponse\"\"\x82\xd3\xe4\x93\x02\x1c\x12\x1a/marginx/oracle/v1/markets\x12z\n\x06Market\x12%.marginx.oracle.v1.QueryMarketRequest\x1a&.marginx.oracle.v1.QueryMarketResponse\"!\x82\xd3\xe4\x93\x02\x1b\x12\x19/marginx/oracle/v1/market\x12~\n\x05Price\x12$.marginx.oracle.v1.QueryPriceRequest\x1a%.marginx.oracle.v1.QueryPriceResponse\"(\x82\xd3\xe4\x93\x02\"\x12 /marginx/oracle/v1/current_price\x12\x82\x01\n\x06Prices\x12%.marginx.oracle.v1.QueryPricesRequest\x1a&.marginx.oracle.v1.QueryPricesResponse\")\x82\xd3\xe4\x93\x02#\x12!/marginx/oracle/v1/current_prices\x12z\n\x06Params\x12%.marginx.oracle.v1.QueryParamsRequest\x1a&.marginx.oracle.v1.QueryParamsResponse\"!\x82\xd3\xe4\x93\x02\x1b\x12\x19/marginx/oracle/v1/params\x12\x8e\x01\n\x0b\x41ggregators\x12*.marginx.oracle.v1.QueryAggregatorsRequest\x1a+.marginx.oracle.v1.QueryAggregatorsResponse\"&\x82\xd3\xe4\x93\x02 \x12\x1e/marginx/oracle/v1/aggregatorsB-Z+github.com/marginxio/marginx/x/oracle/typesb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -31,8 +31,10 @@ _QUERYMARKETSRESPONSE.fields_by_name['markets']._serialized_options = b'\310\336\037\000' _QUERYPRICERESPONSE.fields_by_name['price']._options = None _QUERYPRICERESPONSE.fields_by_name['price']._serialized_options = b'\310\336\037\000\332\336\037\033cosmossdk.io/math.LegacyDec\322\264-\ncosmos.Dec' + _PAIRPRICE.fields_by_name['price']._options = None + _PAIRPRICE.fields_by_name['price']._serialized_options = b'\310\336\037\000\332\336\037\033cosmossdk.io/math.LegacyDec\322\264-\ncosmos.Dec' _QUERYPRICESRESPONSE.fields_by_name['prices']._options = None - _QUERYPRICESRESPONSE.fields_by_name['prices']._serialized_options = b'\310\336\037\000\332\336\037\033cosmossdk.io/math.LegacyDec\322\264-\ncosmos.Dec' + _QUERYPRICESRESPONSE.fields_by_name['prices']._serialized_options = b'\310\336\037\000' _QUERYPARAMSRESPONSE.fields_by_name['params']._options = None _QUERYPARAMSRESPONSE.fields_by_name['params']._serialized_options = b'\310\336\037\000' _QUERYAGGREGATORSRESPONSE.fields_by_name['aggregators']._options = None @@ -63,16 +65,18 @@ _globals['_QUERYPRICERESPONSE']._serialized_end=494 _globals['_QUERYPRICESREQUEST']._serialized_start=496 _globals['_QUERYPRICESREQUEST']._serialized_end=516 - _globals['_QUERYPRICESRESPONSE']._serialized_start=518 - _globals['_QUERYPRICESRESPONSE']._serialized_end=606 - _globals['_QUERYPARAMSREQUEST']._serialized_start=608 - _globals['_QUERYPARAMSREQUEST']._serialized_end=628 - _globals['_QUERYPARAMSRESPONSE']._serialized_start=630 - _globals['_QUERYPARAMSRESPONSE']._serialized_end=700 - _globals['_QUERYAGGREGATORSREQUEST']._serialized_start=702 - _globals['_QUERYAGGREGATORSREQUEST']._serialized_end=727 - _globals['_QUERYAGGREGATORSRESPONSE']._serialized_start=729 - _globals['_QUERYAGGREGATORSRESPONSE']._serialized_end=813 - _globals['_QUERY']._serialized_start=816 - _globals['_QUERY']._serialized_end=1605 + _globals['_PAIRPRICE']._serialized_start=518 + _globals['_PAIRPRICE']._serialized_end=612 + _globals['_QUERYPRICESRESPONSE']._serialized_start=614 + _globals['_QUERYPRICESRESPONSE']._serialized_end=687 + _globals['_QUERYPARAMSREQUEST']._serialized_start=689 + _globals['_QUERYPARAMSREQUEST']._serialized_end=709 + _globals['_QUERYPARAMSRESPONSE']._serialized_start=711 + _globals['_QUERYPARAMSRESPONSE']._serialized_end=781 + _globals['_QUERYAGGREGATORSREQUEST']._serialized_start=783 + _globals['_QUERYAGGREGATORSREQUEST']._serialized_end=808 + _globals['_QUERYAGGREGATORSRESPONSE']._serialized_start=810 + _globals['_QUERYAGGREGATORSRESPONSE']._serialized_end=894 + _globals['_QUERY']._serialized_start=897 + _globals['_QUERY']._serialized_end=1686 # @@protoc_insertion_point(module_scope) diff --git a/fxsdk/x/marginx/oracle/v1/query_pb2.pyi b/fxsdk/x/marginx/oracle/v1/query_pb2.pyi index fbf4cdc..e9dedbf 100644 --- a/fxsdk/x/marginx/oracle/v1/query_pb2.pyi +++ b/fxsdk/x/marginx/oracle/v1/query_pb2.pyi @@ -47,11 +47,19 @@ class QueryPricesRequest(_message.Message): __slots__ = [] def __init__(self) -> None: ... +class PairPrice(_message.Message): + __slots__ = ["pair_id", "price"] + PAIR_ID_FIELD_NUMBER: _ClassVar[int] + PRICE_FIELD_NUMBER: _ClassVar[int] + pair_id: str + price: str + def __init__(self, pair_id: _Optional[str] = ..., price: _Optional[str] = ...) -> None: ... + class QueryPricesResponse(_message.Message): __slots__ = ["prices"] PRICES_FIELD_NUMBER: _ClassVar[int] - prices: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, prices: _Optional[_Iterable[str]] = ...) -> None: ... + prices: _containers.RepeatedCompositeFieldContainer[PairPrice] + def __init__(self, prices: _Optional[_Iterable[_Union[PairPrice, _Mapping]]] = ...) -> None: ... class QueryParamsRequest(_message.Message): __slots__ = [] diff --git a/proto/fx/dex/v1/genesis.proto b/proto/fx/dex/v1/genesis.proto deleted file mode 100644 index ce88f23..0000000 --- a/proto/fx/dex/v1/genesis.proto +++ /dev/null @@ -1,39 +0,0 @@ -syntax = "proto3"; -package fx.dex.v1; - -import "fx/dex/v1/funding.proto"; -import "fx/dex/v1/margin.proto"; -import "fx/dex/v1/match.proto"; -import "fx/dex/v1/order.proto"; -import "fx/dex/v1/params.proto"; -import "fx/dex/v1/position.proto"; -import "gogoproto/gogo.proto"; - -option go_package = "github.com/marginxio/marginx/x/dex/v1/types"; - -message GenesisState { - repeated PairFundingRate pair_funding_rates = 1 - [ (gogoproto.nullable) = false ]; - Funding funding_info = 2 [ (gogoproto.nullable) = false ]; - FundingTime funding_time = 3 [ (gogoproto.nullable) = false ]; - PremiumIndexConf premium_index_config = 4 [ (gogoproto.nullable) = false ]; - repeated PremiumIndex premium_index = 5 [ (gogoproto.nullable) = false ]; - repeated MarginRateTable margin_rate_tables = 6 - [ (gogoproto.nullable) = false ]; - repeated DealPrice deal_price = 7 [ (gogoproto.nullable) = false ]; - repeated Order orders = 8 [ (gogoproto.nullable) = false ]; - Params params = 9 [ (gogoproto.nullable) = false ]; - repeated Position positions = 10 [ (gogoproto.nullable) = false ]; - PositionID position_id = 11 [ (gogoproto.nullable) = false ]; - MovingAverageParams ma_params = 12 [ (gogoproto.nullable) = false ]; - repeated string book_pair_ids = 13 [ (gogoproto.nullable) = false ]; - repeated OrderDepthArray ask_book = 14 [ (gogoproto.nullable) = false ]; - repeated OrderDepthArray bid_book = 15 [ (gogoproto.nullable) = false ]; - repeated string order_book_ids_keys = 16 [ (gogoproto.nullable) = false ]; - repeated OrderIDs order_book_ids = 17 [ (gogoproto.nullable) = false ]; - Reserve reserve = 18 [ (gogoproto.nullable) = false ]; -} - -message OrderDepthArray { - repeated OrderDepth values = 1 [ (gogoproto.nullable) = false ]; -} diff --git a/proto/fx/dex/v1/match.proto b/proto/fx/dex/v1/match.proto index 8106777..ffe6b3b 100644 --- a/proto/fx/dex/v1/match.proto +++ b/proto/fx/dex/v1/match.proto @@ -44,10 +44,6 @@ message OrderDepth { ]; } -message OrderDepths { - repeated OrderDepth order_depths = 1 [ (gogoproto.nullable) = false ]; -} - message OrderBook { Orders bid = 1 [ (gogoproto.nullable) = false ]; Orders ask = 2 [ (gogoproto.nullable) = false ]; @@ -139,58 +135,3 @@ message DepthCurveItem { message DepthCurves { repeated DepthCurveItem items = 1 [ (gogoproto.nullable) = false ]; } - -message Deal { - string order_id = 1; - string direction = 2; - string quantity = 3 [ - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string price = 4 [ - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string fee = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", - (gogoproto.nullable) = false - ]; - string position_id = 6; -} - -message MatchRes { - int64 block_height = 1; - string price = 2 [ - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string quantity = 3 [ - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - repeated Deal deals = 4 [ (gogoproto.nullable) = false ]; -} - -message ProductLock { - int64 block_height = 1; - string price = 2 [ - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string quantity = 3 [ - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string buy_executed = 4 [ - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string sell_executed = 5 [ - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; -} - -message IntList { repeated int64 items = 1; } - -message Int { int64 items = 1; } \ No newline at end of file diff --git a/proto/marginx/oracle/v1/query.proto b/proto/marginx/oracle/v1/query.proto index 08088c0..cc051e9 100644 --- a/proto/marginx/oracle/v1/query.proto +++ b/proto/marginx/oracle/v1/query.proto @@ -53,14 +53,19 @@ message QueryPriceResponse { message QueryPricesRequest {} -message QueryPricesResponse { - repeated string prices = 1 [ +message PairPrice { + string pair_id = 1; + string price = 2 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; } +message QueryPricesResponse { + repeated PairPrice prices = 1 [ (gogoproto.nullable) = false ]; +} + message QueryParamsRequest {} message QueryParamsResponse {