From b4f421504c4647cec499b02bb119a4110fc58a0c Mon Sep 17 00:00:00 2001 From: Unique-Divine Date: Mon, 10 Oct 2022 14:04:38 -0500 Subject: [PATCH] feat: v0.15.0-alpha.1 nibiru_proto code gen --- nibiru_proto/proto/epochs/genesis_pb2.py | 23 +-- nibiru_proto/proto/epochs/genesis_pb2.pyi | 54 +------ nibiru_proto/proto/epochs/query_pb2.py | 24 +-- nibiru_proto/proto/epochs/query_pb2.pyi | 6 +- nibiru_proto/proto/epochs/state_pb2.py | 44 +++++ nibiru_proto/proto/epochs/state_pb2.pyi | 60 +++++++ .../state_pb2_grpc.py} | 0 .../state_pb2_grpc.pyi} | 0 .../proto/oracle/v1beta1/genesis_pb2.py | 14 +- .../proto/oracle/v1beta1/genesis_pb2.pyi | 6 +- .../proto/oracle/v1beta1/oracle_pb2.py | 34 ++-- .../proto/oracle/v1beta1/oracle_pb2.pyi | 38 ++++- nibiru_proto/proto/perp/v1/event_pb2.py | 16 +- nibiru_proto/proto/perp/v1/event_pb2.pyi | 29 ++-- nibiru_proto/proto/perp/v1/genesis_pb2.py | 48 ++++++ nibiru_proto/proto/perp/v1/genesis_pb2.pyi | 39 +++++ .../v1/genesis_pb2_grpc.py} | 0 .../v1/genesis_pb2_grpc.pyi} | 0 nibiru_proto/proto/perp/v1/query_pb2.py | 100 ++++++++---- nibiru_proto/proto/perp/v1/query_pb2.pyi | 84 ++++++++-- nibiru_proto/proto/perp/v1/query_pb2_grpc.py | 92 +++++++++-- nibiru_proto/proto/perp/v1/query_pb2_grpc.pyi | 32 +++- nibiru_proto/proto/perp/v1/state_pb2.py | 106 +++++------- nibiru_proto/proto/perp/v1/state_pb2.pyi | 152 ++++++++---------- nibiru_proto/proto/perp/v1/tx_pb2.py | 66 ++++++-- nibiru_proto/proto/perp/v1/tx_pb2.pyi | 57 +++++++ nibiru_proto/proto/perp/v1/tx_pb2_grpc.py | 33 ++++ nibiru_proto/proto/perp/v1/tx_pb2_grpc.pyi | 10 ++ nibiru_proto/proto/pricefeed/genesis_pb2.py | 8 +- nibiru_proto/proto/pricefeed/genesis_pb2.pyi | 10 +- nibiru_proto/proto/pricefeed/query_pb2.py | 68 ++++---- nibiru_proto/proto/pricefeed/query_pb2.pyi | 6 +- nibiru_proto/proto/pricefeed/snapshot_pb2.py | 40 ----- nibiru_proto/proto/pricefeed/snapshot_pb2.pyi | 35 ---- .../pricefeed/{params_pb2.py => state_pb2.py} | 60 ++++--- .../{params_pb2.pyi => state_pb2.pyi} | 30 +++- .../state_pb2_grpc.py} | 0 .../state_pb2_grpc.pyi} | 0 nibiru_proto/proto/vpool/v1/event_pb2.py | 24 +-- nibiru_proto/proto/vpool/v1/event_pb2.pyi | 4 +- nibiru_proto/proto/vpool/v1/genesis_pb2.py | 15 +- nibiru_proto/proto/vpool/v1/genesis_pb2.pyi | 16 +- nibiru_proto/proto/vpool/v1/params_pb2.py | 58 ------- nibiru_proto/proto/vpool/v1/params_pb2.pyi | 39 ----- nibiru_proto/proto/vpool/v1/query_pb2.py | 20 +-- nibiru_proto/proto/vpool/v1/query_pb2.pyi | 14 +- nibiru_proto/proto/vpool/v1/state_pb2.py | 118 ++++++++++++++ .../vpool/v1/{vpool_pb2.pyi => state_pb2.pyi} | 77 +++++---- .../{vpool_pb2_grpc.py => state_pb2_grpc.py} | 0 ...{vpool_pb2_grpc.pyi => state_pb2_grpc.pyi} | 0 nibiru_proto/proto/vpool/v1/vpool_pb2.py | 98 ----------- pyproject.toml | 2 +- 52 files changed, 1146 insertions(+), 763 deletions(-) create mode 100644 nibiru_proto/proto/epochs/state_pb2.py create mode 100644 nibiru_proto/proto/epochs/state_pb2.pyi rename nibiru_proto/proto/{pricefeed/params_pb2_grpc.py => epochs/state_pb2_grpc.py} (100%) rename nibiru_proto/proto/{pricefeed/params_pb2_grpc.pyi => epochs/state_pb2_grpc.pyi} (100%) create mode 100644 nibiru_proto/proto/perp/v1/genesis_pb2.py create mode 100644 nibiru_proto/proto/perp/v1/genesis_pb2.pyi rename nibiru_proto/proto/{pricefeed/snapshot_pb2_grpc.py => perp/v1/genesis_pb2_grpc.py} (100%) rename nibiru_proto/proto/{pricefeed/snapshot_pb2_grpc.pyi => perp/v1/genesis_pb2_grpc.pyi} (100%) delete mode 100644 nibiru_proto/proto/pricefeed/snapshot_pb2.py delete mode 100644 nibiru_proto/proto/pricefeed/snapshot_pb2.pyi rename nibiru_proto/proto/pricefeed/{params_pb2.py => state_pb2.py} (59%) rename nibiru_proto/proto/pricefeed/{params_pb2.pyi => state_pb2.pyi} (85%) rename nibiru_proto/proto/{vpool/v1/params_pb2_grpc.py => pricefeed/state_pb2_grpc.py} (100%) rename nibiru_proto/proto/{vpool/v1/params_pb2_grpc.pyi => pricefeed/state_pb2_grpc.pyi} (100%) delete mode 100644 nibiru_proto/proto/vpool/v1/params_pb2.py delete mode 100644 nibiru_proto/proto/vpool/v1/params_pb2.pyi create mode 100644 nibiru_proto/proto/vpool/v1/state_pb2.py rename nibiru_proto/proto/vpool/v1/{vpool_pb2.pyi => state_pb2.pyi} (84%) rename nibiru_proto/proto/vpool/v1/{vpool_pb2_grpc.py => state_pb2_grpc.py} (100%) rename nibiru_proto/proto/vpool/v1/{vpool_pb2_grpc.pyi => state_pb2_grpc.pyi} (100%) delete mode 100644 nibiru_proto/proto/vpool/v1/vpool_pb2.py diff --git a/nibiru_proto/proto/epochs/genesis_pb2.py b/nibiru_proto/proto/epochs/genesis_pb2.py index f2e0534..3582a47 100644 --- a/nibiru_proto/proto/epochs/genesis_pb2.py +++ b/nibiru_proto/proto/epochs/genesis_pb2.py @@ -15,21 +15,14 @@ from gogoproto import gogo_pb2 as gogoproto_dot_gogo__pb2 from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from epochs import state_pb2 as epochs_dot_state__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14\x65pochs/genesis.proto\x12\x15nibiru.epochs.v1beta1\x1a\x14gogoproto/gogo.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x94\x03\n\tEpochInfo\x12\x12\n\nidentifier\x18\x01 \x01(\t\x12M\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x1d\x90\xdf\x1f\x01\xc8\xde\x1f\x00\xf2\xde\x1f\x11yaml:\"start_time\"\x12^\n\x08\x64uration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB1\xc8\xde\x1f\x00\x98\xdf\x1f\x01\xea\xde\x1f\x12\x64uration,omitempty\xf2\xde\x1f\x0fyaml:\"duration\"\x12\x15\n\rcurrent_epoch\x18\x04 \x01(\x03\x12i\n\x18\x63urrent_epoch_start_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB+\x90\xdf\x1f\x01\xc8\xde\x1f\x00\xf2\xde\x1f\x1fyaml:\"current_epoch_start_time\"\x12\x1e\n\x16\x65poch_counting_started\x18\x06 \x01(\x08\x12\"\n\x1a\x63urrent_epoch_start_height\x18\x07 \x01(\x03\"F\n\x0cGenesisState\x12\x36\n\x06\x65pochs\x18\x01 \x03(\x0b\x32 .nibiru.epochs.v1beta1.EpochInfoB\x04\xc8\xde\x1f\x00\x42.Z,github.com/NibiruChain/nibiru/x/epochs/typesb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14\x65pochs/genesis.proto\x12\x15nibiru.epochs.v1beta1\x1a\x14gogoproto/gogo.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x12\x65pochs/state.proto\"F\n\x0cGenesisState\x12\x36\n\x06\x65pochs\x18\x01 \x03(\x0b\x32 .nibiru.epochs.v1beta1.EpochInfoB\x04\xc8\xde\x1f\x00\x42.Z,github.com/NibiruChain/nibiru/x/epochs/typesb\x06proto3') -_EPOCHINFO = DESCRIPTOR.message_types_by_name['EpochInfo'] _GENESISSTATE = DESCRIPTOR.message_types_by_name['GenesisState'] -EpochInfo = _reflection.GeneratedProtocolMessageType('EpochInfo', (_message.Message,), { - 'DESCRIPTOR' : _EPOCHINFO, - '__module__' : 'epochs.genesis_pb2' - # @@protoc_insertion_point(class_scope:nibiru.epochs.v1beta1.EpochInfo) - }) -_sym_db.RegisterMessage(EpochInfo) - GenesisState = _reflection.GeneratedProtocolMessageType('GenesisState', (_message.Message,), { 'DESCRIPTOR' : _GENESISSTATE, '__module__' : 'epochs.genesis_pb2' @@ -41,16 +34,8 @@ DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'Z,github.com/NibiruChain/nibiru/x/epochs/types' - _EPOCHINFO.fields_by_name['start_time']._options = None - _EPOCHINFO.fields_by_name['start_time']._serialized_options = b'\220\337\037\001\310\336\037\000\362\336\037\021yaml:\"start_time\"' - _EPOCHINFO.fields_by_name['duration']._options = None - _EPOCHINFO.fields_by_name['duration']._serialized_options = b'\310\336\037\000\230\337\037\001\352\336\037\022duration,omitempty\362\336\037\017yaml:\"duration\"' - _EPOCHINFO.fields_by_name['current_epoch_start_time']._options = None - _EPOCHINFO.fields_by_name['current_epoch_start_time']._serialized_options = b'\220\337\037\001\310\336\037\000\362\336\037\037yaml:\"current_epoch_start_time\"' _GENESISSTATE.fields_by_name['epochs']._options = None _GENESISSTATE.fields_by_name['epochs']._serialized_options = b'\310\336\037\000' - _EPOCHINFO._serialized_start=135 - _EPOCHINFO._serialized_end=539 - _GENESISSTATE._serialized_start=541 - _GENESISSTATE._serialized_end=611 + _GENESISSTATE._serialized_start=154 + _GENESISSTATE._serialized_end=224 # @@protoc_insertion_point(module_scope) diff --git a/nibiru_proto/proto/epochs/genesis_pb2.pyi b/nibiru_proto/proto/epochs/genesis_pb2.pyi index 48c848b..be92cdb 100644 --- a/nibiru_proto/proto/epochs/genesis_pb2.pyi +++ b/nibiru_proto/proto/epochs/genesis_pb2.pyi @@ -3,72 +3,24 @@ isort:skip_file """ import builtins +import epochs.state_pb2 import google.protobuf.descriptor -import google.protobuf.duration_pb2 import google.protobuf.internal.containers import google.protobuf.message -import google.protobuf.timestamp_pb2 import typing import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor -class EpochInfo(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - IDENTIFIER_FIELD_NUMBER: builtins.int - START_TIME_FIELD_NUMBER: builtins.int - DURATION_FIELD_NUMBER: builtins.int - CURRENT_EPOCH_FIELD_NUMBER: builtins.int - CURRENT_EPOCH_START_TIME_FIELD_NUMBER: builtins.int - EPOCH_COUNTING_STARTED_FIELD_NUMBER: builtins.int - CURRENT_EPOCH_START_HEIGHT_FIELD_NUMBER: builtins.int - identifier: typing.Text - """A string identifier for the epoch. e.g. "15min" or "1hour" """ - - @property - def start_time(self) -> google.protobuf.timestamp_pb2.Timestamp: - """When the epoch repetitino should start.""" - pass - @property - def duration(self) -> google.protobuf.duration_pb2.Duration: - """How long each epoch lasts for.""" - pass - current_epoch: builtins.int - """The current epoch number, starting from 1.""" - - @property - def current_epoch_start_time(self) -> google.protobuf.timestamp_pb2.Timestamp: - """The start timestamp of the current epoch.""" - pass - epoch_counting_started: builtins.bool - """Whether or not this epoch has started. Set to true if current blocktime >= start_time.""" - - current_epoch_start_height: builtins.int - """The block height at which the current epoch started at.""" - - def __init__(self, - *, - identifier: typing.Text = ..., - start_time: typing.Optional[google.protobuf.timestamp_pb2.Timestamp] = ..., - duration: typing.Optional[google.protobuf.duration_pb2.Duration] = ..., - current_epoch: builtins.int = ..., - current_epoch_start_time: typing.Optional[google.protobuf.timestamp_pb2.Timestamp] = ..., - epoch_counting_started: builtins.bool = ..., - current_epoch_start_height: builtins.int = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["current_epoch_start_time",b"current_epoch_start_time","duration",b"duration","start_time",b"start_time"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["current_epoch",b"current_epoch","current_epoch_start_height",b"current_epoch_start_height","current_epoch_start_time",b"current_epoch_start_time","duration",b"duration","epoch_counting_started",b"epoch_counting_started","identifier",b"identifier","start_time",b"start_time"]) -> None: ... -global___EpochInfo = EpochInfo - class GenesisState(google.protobuf.message.Message): """GenesisState defines the epochs module's genesis state.""" DESCRIPTOR: google.protobuf.descriptor.Descriptor EPOCHS_FIELD_NUMBER: builtins.int @property - def epochs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___EpochInfo]: ... + def epochs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[epochs.state_pb2.EpochInfo]: ... def __init__(self, *, - epochs: typing.Optional[typing.Iterable[global___EpochInfo]] = ..., + epochs: typing.Optional[typing.Iterable[epochs.state_pb2.EpochInfo]] = ..., ) -> None: ... def ClearField(self, field_name: typing_extensions.Literal["epochs",b"epochs"]) -> None: ... global___GenesisState = GenesisState diff --git a/nibiru_proto/proto/epochs/query_pb2.py b/nibiru_proto/proto/epochs/query_pb2.py index 1c3e779..d7eb305 100644 --- a/nibiru_proto/proto/epochs/query_pb2.py +++ b/nibiru_proto/proto/epochs/query_pb2.py @@ -15,10 +15,10 @@ from gogoproto import gogo_pb2 as gogoproto_dot_gogo__pb2 from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 from cosmos.base.query.v1beta1 import pagination_pb2 as cosmos_dot_base_dot_query_dot_v1beta1_dot_pagination__pb2 -from epochs import genesis_pb2 as epochs_dot_genesis__pb2 +from epochs import state_pb2 as epochs_dot_state__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x12\x65pochs/query.proto\x12\x15nibiru.epochs.v1beta1\x1a\x14gogoproto/gogo.proto\x1a\x1cgoogle/api/annotations.proto\x1a*cosmos/base/query/v1beta1/pagination.proto\x1a\x14\x65pochs/genesis.proto\"\x18\n\x16QueryEpochsInfoRequest\"Q\n\x17QueryEpochsInfoResponse\x12\x36\n\x06\x65pochs\x18\x01 \x03(\x0b\x32 .nibiru.epochs.v1beta1.EpochInfoB\x04\xc8\xde\x1f\x00\".\n\x18QueryCurrentEpochRequest\x12\x12\n\nidentifier\x18\x01 \x01(\t\"2\n\x19QueryCurrentEpochResponse\x12\x15\n\rcurrent_epoch\x18\x01 \x01(\x03\x32\xbe\x02\n\x05Query\x12\x92\x01\n\nEpochInfos\x12-.nibiru.epochs.v1beta1.QueryEpochsInfoRequest\x1a..nibiru.epochs.v1beta1.QueryEpochsInfoResponse\"%\x82\xd3\xe4\x93\x02\x1f\x12\x1d/nibiru/epochs/v1beta1/epochs\x12\x9f\x01\n\x0c\x43urrentEpoch\x12/.nibiru.epochs.v1beta1.QueryCurrentEpochRequest\x1a\x30.nibiru.epochs.v1beta1.QueryCurrentEpochResponse\",\x82\xd3\xe4\x93\x02&\x12$/nibiru/epochs/v1beta1/current_epochB.Z,github.com/NibiruChain/nibiru/x/epochs/typesb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x12\x65pochs/query.proto\x12\x15nibiru.epochs.v1beta1\x1a\x14gogoproto/gogo.proto\x1a\x1cgoogle/api/annotations.proto\x1a*cosmos/base/query/v1beta1/pagination.proto\x1a\x12\x65pochs/state.proto\"\x18\n\x16QueryEpochsInfoRequest\"Q\n\x17QueryEpochsInfoResponse\x12\x36\n\x06\x65pochs\x18\x01 \x03(\x0b\x32 .nibiru.epochs.v1beta1.EpochInfoB\x04\xc8\xde\x1f\x00\".\n\x18QueryCurrentEpochRequest\x12\x12\n\nidentifier\x18\x01 \x01(\t\"2\n\x19QueryCurrentEpochResponse\x12\x15\n\rcurrent_epoch\x18\x01 \x01(\x04\x32\xbe\x02\n\x05Query\x12\x92\x01\n\nEpochInfos\x12-.nibiru.epochs.v1beta1.QueryEpochsInfoRequest\x1a..nibiru.epochs.v1beta1.QueryEpochsInfoResponse\"%\x82\xd3\xe4\x93\x02\x1f\x12\x1d/nibiru/epochs/v1beta1/epochs\x12\x9f\x01\n\x0c\x43urrentEpoch\x12/.nibiru.epochs.v1beta1.QueryCurrentEpochRequest\x1a\x30.nibiru.epochs.v1beta1.QueryCurrentEpochResponse\",\x82\xd3\xe4\x93\x02&\x12$/nibiru/epochs/v1beta1/current_epochB.Z,github.com/NibiruChain/nibiru/x/epochs/typesb\x06proto3') @@ -65,14 +65,14 @@ _QUERY.methods_by_name['EpochInfos']._serialized_options = b'\202\323\344\223\002\037\022\035/nibiru/epochs/v1beta1/epochs' _QUERY.methods_by_name['CurrentEpoch']._options = None _QUERY.methods_by_name['CurrentEpoch']._serialized_options = b'\202\323\344\223\002&\022$/nibiru/epochs/v1beta1/current_epoch' - _QUERYEPOCHSINFOREQUEST._serialized_start=163 - _QUERYEPOCHSINFOREQUEST._serialized_end=187 - _QUERYEPOCHSINFORESPONSE._serialized_start=189 - _QUERYEPOCHSINFORESPONSE._serialized_end=270 - _QUERYCURRENTEPOCHREQUEST._serialized_start=272 - _QUERYCURRENTEPOCHREQUEST._serialized_end=318 - _QUERYCURRENTEPOCHRESPONSE._serialized_start=320 - _QUERYCURRENTEPOCHRESPONSE._serialized_end=370 - _QUERY._serialized_start=373 - _QUERY._serialized_end=691 + _QUERYEPOCHSINFOREQUEST._serialized_start=161 + _QUERYEPOCHSINFOREQUEST._serialized_end=185 + _QUERYEPOCHSINFORESPONSE._serialized_start=187 + _QUERYEPOCHSINFORESPONSE._serialized_end=268 + _QUERYCURRENTEPOCHREQUEST._serialized_start=270 + _QUERYCURRENTEPOCHREQUEST._serialized_end=316 + _QUERYCURRENTEPOCHRESPONSE._serialized_start=318 + _QUERYCURRENTEPOCHRESPONSE._serialized_end=368 + _QUERY._serialized_start=371 + _QUERY._serialized_end=689 # @@protoc_insertion_point(module_scope) diff --git a/nibiru_proto/proto/epochs/query_pb2.pyi b/nibiru_proto/proto/epochs/query_pb2.pyi index 542319b..4507c6d 100644 --- a/nibiru_proto/proto/epochs/query_pb2.pyi +++ b/nibiru_proto/proto/epochs/query_pb2.pyi @@ -3,7 +3,7 @@ isort:skip_file """ import builtins -import epochs.genesis_pb2 +import epochs.state_pb2 import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message @@ -22,10 +22,10 @@ class QueryEpochsInfoResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor EPOCHS_FIELD_NUMBER: builtins.int @property - def epochs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[epochs.genesis_pb2.EpochInfo]: ... + def epochs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[epochs.state_pb2.EpochInfo]: ... def __init__(self, *, - epochs: typing.Optional[typing.Iterable[epochs.genesis_pb2.EpochInfo]] = ..., + epochs: typing.Optional[typing.Iterable[epochs.state_pb2.EpochInfo]] = ..., ) -> None: ... def ClearField(self, field_name: typing_extensions.Literal["epochs",b"epochs"]) -> None: ... global___QueryEpochsInfoResponse = QueryEpochsInfoResponse diff --git a/nibiru_proto/proto/epochs/state_pb2.py b/nibiru_proto/proto/epochs/state_pb2.py new file mode 100644 index 0000000..3832837 --- /dev/null +++ b/nibiru_proto/proto/epochs/state_pb2.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: epochs/state.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 message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from gogoproto import gogo_pb2 as gogoproto_dot_gogo__pb2 +from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x12\x65pochs/state.proto\x12\x15nibiru.epochs.v1beta1\x1a\x14gogoproto/gogo.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x94\x03\n\tEpochInfo\x12\x12\n\nidentifier\x18\x01 \x01(\t\x12M\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x1d\x90\xdf\x1f\x01\xc8\xde\x1f\x00\xf2\xde\x1f\x11yaml:\"start_time\"\x12^\n\x08\x64uration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB1\xc8\xde\x1f\x00\x98\xdf\x1f\x01\xea\xde\x1f\x12\x64uration,omitempty\xf2\xde\x1f\x0fyaml:\"duration\"\x12\x15\n\rcurrent_epoch\x18\x04 \x01(\x04\x12i\n\x18\x63urrent_epoch_start_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB+\x90\xdf\x1f\x01\xc8\xde\x1f\x00\xf2\xde\x1f\x1fyaml:\"current_epoch_start_time\"\x12\x1e\n\x16\x65poch_counting_started\x18\x06 \x01(\x08\x12\"\n\x1a\x63urrent_epoch_start_height\x18\x07 \x01(\x03\x42.Z,github.com/NibiruChain/nibiru/x/epochs/typesb\x06proto3') + + + +_EPOCHINFO = DESCRIPTOR.message_types_by_name['EpochInfo'] +EpochInfo = _reflection.GeneratedProtocolMessageType('EpochInfo', (_message.Message,), { + 'DESCRIPTOR' : _EPOCHINFO, + '__module__' : 'epochs.state_pb2' + # @@protoc_insertion_point(class_scope:nibiru.epochs.v1beta1.EpochInfo) + }) +_sym_db.RegisterMessage(EpochInfo) + +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'Z,github.com/NibiruChain/nibiru/x/epochs/types' + _EPOCHINFO.fields_by_name['start_time']._options = None + _EPOCHINFO.fields_by_name['start_time']._serialized_options = b'\220\337\037\001\310\336\037\000\362\336\037\021yaml:\"start_time\"' + _EPOCHINFO.fields_by_name['duration']._options = None + _EPOCHINFO.fields_by_name['duration']._serialized_options = b'\310\336\037\000\230\337\037\001\352\336\037\022duration,omitempty\362\336\037\017yaml:\"duration\"' + _EPOCHINFO.fields_by_name['current_epoch_start_time']._options = None + _EPOCHINFO.fields_by_name['current_epoch_start_time']._serialized_options = b'\220\337\037\001\310\336\037\000\362\336\037\037yaml:\"current_epoch_start_time\"' + _EPOCHINFO._serialized_start=133 + _EPOCHINFO._serialized_end=537 +# @@protoc_insertion_point(module_scope) diff --git a/nibiru_proto/proto/epochs/state_pb2.pyi b/nibiru_proto/proto/epochs/state_pb2.pyi new file mode 100644 index 0000000..cf76a44 --- /dev/null +++ b/nibiru_proto/proto/epochs/state_pb2.pyi @@ -0,0 +1,60 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +""" +import builtins +import google.protobuf.descriptor +import google.protobuf.duration_pb2 +import google.protobuf.message +import google.protobuf.timestamp_pb2 +import typing +import typing_extensions + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +class EpochInfo(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + IDENTIFIER_FIELD_NUMBER: builtins.int + START_TIME_FIELD_NUMBER: builtins.int + DURATION_FIELD_NUMBER: builtins.int + CURRENT_EPOCH_FIELD_NUMBER: builtins.int + CURRENT_EPOCH_START_TIME_FIELD_NUMBER: builtins.int + EPOCH_COUNTING_STARTED_FIELD_NUMBER: builtins.int + CURRENT_EPOCH_START_HEIGHT_FIELD_NUMBER: builtins.int + identifier: typing.Text + """A string identifier for the epoch. e.g. "15min" or "1hour" """ + + @property + def start_time(self) -> google.protobuf.timestamp_pb2.Timestamp: + """When the epoch repetitino should start.""" + pass + @property + def duration(self) -> google.protobuf.duration_pb2.Duration: + """How long each epoch lasts for.""" + pass + current_epoch: builtins.int + """The current epoch number, starting from 1.""" + + @property + def current_epoch_start_time(self) -> google.protobuf.timestamp_pb2.Timestamp: + """The start timestamp of the current epoch.""" + pass + epoch_counting_started: builtins.bool + """Whether or not this epoch has started. Set to true if current blocktime >= start_time.""" + + current_epoch_start_height: builtins.int + """The block height at which the current epoch started at.""" + + def __init__(self, + *, + identifier: typing.Text = ..., + start_time: typing.Optional[google.protobuf.timestamp_pb2.Timestamp] = ..., + duration: typing.Optional[google.protobuf.duration_pb2.Duration] = ..., + current_epoch: builtins.int = ..., + current_epoch_start_time: typing.Optional[google.protobuf.timestamp_pb2.Timestamp] = ..., + epoch_counting_started: builtins.bool = ..., + current_epoch_start_height: builtins.int = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["current_epoch_start_time",b"current_epoch_start_time","duration",b"duration","start_time",b"start_time"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["current_epoch",b"current_epoch","current_epoch_start_height",b"current_epoch_start_height","current_epoch_start_time",b"current_epoch_start_time","duration",b"duration","epoch_counting_started",b"epoch_counting_started","identifier",b"identifier","start_time",b"start_time"]) -> None: ... +global___EpochInfo = EpochInfo diff --git a/nibiru_proto/proto/pricefeed/params_pb2_grpc.py b/nibiru_proto/proto/epochs/state_pb2_grpc.py similarity index 100% rename from nibiru_proto/proto/pricefeed/params_pb2_grpc.py rename to nibiru_proto/proto/epochs/state_pb2_grpc.py diff --git a/nibiru_proto/proto/pricefeed/params_pb2_grpc.pyi b/nibiru_proto/proto/epochs/state_pb2_grpc.pyi similarity index 100% rename from nibiru_proto/proto/pricefeed/params_pb2_grpc.pyi rename to nibiru_proto/proto/epochs/state_pb2_grpc.pyi diff --git a/nibiru_proto/proto/oracle/v1beta1/genesis_pb2.py b/nibiru_proto/proto/oracle/v1beta1/genesis_pb2.py index 3b1a4e1..ea03479 100644 --- a/nibiru_proto/proto/oracle/v1beta1/genesis_pb2.py +++ b/nibiru_proto/proto/oracle/v1beta1/genesis_pb2.py @@ -17,7 +17,7 @@ from cosmos.base.v1beta1 import coin_pb2 as cosmos_dot_base_dot_v1beta1_dot_coin__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1coracle/v1beta1/genesis.proto\x12\x15nibiru.oracle.v1beta1\x1a\x14gogoproto/gogo.proto\x1a\x1boracle/v1beta1/oracle.proto\x1a\x1e\x63osmos/base/v1beta1/coin.proto\"\xa3\x04\n\x0cGenesisState\x12\x33\n\x06params\x18\x01 \x01(\x0b\x32\x1d.nibiru.oracle.v1beta1.ParamsB\x04\xc8\xde\x1f\x00\x12I\n\x12\x66\x65\x65\x64\x65r_delegations\x18\x02 \x03(\x0b\x32\'.nibiru.oracle.v1beta1.FeederDelegationB\x04\xc8\xde\x1f\x00\x12\\\n\x0e\x65xchange_rates\x18\x03 \x03(\x0b\x32(.nibiru.oracle.v1beta1.ExchangeRateTupleB\x1a\xaa\xdf\x1f\x12\x45xchangeRateTuples\xc8\xde\x1f\x00\x12?\n\rmiss_counters\x18\x04 \x03(\x0b\x32\".nibiru.oracle.v1beta1.MissCounterB\x04\xc8\xde\x1f\x00\x12\x63\n aggregate_exchange_rate_prevotes\x18\x05 \x03(\x0b\x32\x33.nibiru.oracle.v1beta1.AggregateExchangeRatePrevoteB\x04\xc8\xde\x1f\x00\x12]\n\x1d\x61ggregate_exchange_rate_votes\x18\x06 \x03(\x0b\x32\x30.nibiru.oracle.v1beta1.AggregateExchangeRateVoteB\x04\xc8\xde\x1f\x00\x12\x30\n\x05pairs\x18\x07 \x03(\x0b\x32\x1b.nibiru.oracle.v1beta1.PairB\x04\xc8\xde\x1f\x00\"E\n\x10\x46\x65\x65\x64\x65rDelegation\x12\x16\n\x0e\x66\x65\x65\x64\x65r_address\x18\x01 \x01(\t\x12\x19\n\x11validator_address\x18\x02 \x01(\t\">\n\x0bMissCounter\x12\x19\n\x11validator_address\x18\x01 \x01(\t\x12\x14\n\x0cmiss_counter\x18\x02 \x01(\x04\x42.Z,github.com/NibiruChain/nibiru/x/oracle/typesb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1coracle/v1beta1/genesis.proto\x12\x15nibiru.oracle.v1beta1\x1a\x14gogoproto/gogo.proto\x1a\x1boracle/v1beta1/oracle.proto\x1a\x1e\x63osmos/base/v1beta1/coin.proto\"\xe2\x04\n\x0cGenesisState\x12\x33\n\x06params\x18\x01 \x01(\x0b\x32\x1d.nibiru.oracle.v1beta1.ParamsB\x04\xc8\xde\x1f\x00\x12I\n\x12\x66\x65\x65\x64\x65r_delegations\x18\x02 \x03(\x0b\x32\'.nibiru.oracle.v1beta1.FeederDelegationB\x04\xc8\xde\x1f\x00\x12\\\n\x0e\x65xchange_rates\x18\x03 \x03(\x0b\x32(.nibiru.oracle.v1beta1.ExchangeRateTupleB\x1a\xaa\xdf\x1f\x12\x45xchangeRateTuples\xc8\xde\x1f\x00\x12?\n\rmiss_counters\x18\x04 \x03(\x0b\x32\".nibiru.oracle.v1beta1.MissCounterB\x04\xc8\xde\x1f\x00\x12\x63\n aggregate_exchange_rate_prevotes\x18\x05 \x03(\x0b\x32\x33.nibiru.oracle.v1beta1.AggregateExchangeRatePrevoteB\x04\xc8\xde\x1f\x00\x12]\n\x1d\x61ggregate_exchange_rate_votes\x18\x06 \x03(\x0b\x32\x30.nibiru.oracle.v1beta1.AggregateExchangeRateVoteB\x04\xc8\xde\x1f\x00\x12\x30\n\x05pairs\x18\x07 \x03(\x0b\x32\x1b.nibiru.oracle.v1beta1.PairB\x04\xc8\xde\x1f\x00\x12=\n\x0cpair_rewards\x18\x08 \x03(\x0b\x32!.nibiru.oracle.v1beta1.PairRewardB\x04\xc8\xde\x1f\x00\"E\n\x10\x46\x65\x65\x64\x65rDelegation\x12\x16\n\x0e\x66\x65\x65\x64\x65r_address\x18\x01 \x01(\t\x12\x19\n\x11validator_address\x18\x02 \x01(\t\">\n\x0bMissCounter\x12\x19\n\x11validator_address\x18\x01 \x01(\t\x12\x14\n\x0cmiss_counter\x18\x02 \x01(\x04\x42.Z,github.com/NibiruChain/nibiru/x/oracle/typesb\x06proto3') @@ -63,10 +63,12 @@ _GENESISSTATE.fields_by_name['aggregate_exchange_rate_votes']._serialized_options = b'\310\336\037\000' _GENESISSTATE.fields_by_name['pairs']._options = None _GENESISSTATE.fields_by_name['pairs']._serialized_options = b'\310\336\037\000' + _GENESISSTATE.fields_by_name['pair_rewards']._options = None + _GENESISSTATE.fields_by_name['pair_rewards']._serialized_options = b'\310\336\037\000' _GENESISSTATE._serialized_start=139 - _GENESISSTATE._serialized_end=686 - _FEEDERDELEGATION._serialized_start=688 - _FEEDERDELEGATION._serialized_end=757 - _MISSCOUNTER._serialized_start=759 - _MISSCOUNTER._serialized_end=821 + _GENESISSTATE._serialized_end=749 + _FEEDERDELEGATION._serialized_start=751 + _FEEDERDELEGATION._serialized_end=820 + _MISSCOUNTER._serialized_start=822 + _MISSCOUNTER._serialized_end=884 # @@protoc_insertion_point(module_scope) diff --git a/nibiru_proto/proto/oracle/v1beta1/genesis_pb2.pyi b/nibiru_proto/proto/oracle/v1beta1/genesis_pb2.pyi index b6ea1b0..20eab3f 100644 --- a/nibiru_proto/proto/oracle/v1beta1/genesis_pb2.pyi +++ b/nibiru_proto/proto/oracle/v1beta1/genesis_pb2.pyi @@ -22,6 +22,7 @@ class GenesisState(google.protobuf.message.Message): AGGREGATE_EXCHANGE_RATE_PREVOTES_FIELD_NUMBER: builtins.int AGGREGATE_EXCHANGE_RATE_VOTES_FIELD_NUMBER: builtins.int PAIRS_FIELD_NUMBER: builtins.int + PAIR_REWARDS_FIELD_NUMBER: builtins.int @property def params(self) -> oracle.v1beta1.oracle_pb2.Params: ... @property @@ -36,6 +37,8 @@ class GenesisState(google.protobuf.message.Message): def aggregate_exchange_rate_votes(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[oracle.v1beta1.oracle_pb2.AggregateExchangeRateVote]: ... @property def pairs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[oracle.v1beta1.oracle_pb2.Pair]: ... + @property + def pair_rewards(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[oracle.v1beta1.oracle_pb2.PairReward]: ... def __init__(self, *, params: typing.Optional[oracle.v1beta1.oracle_pb2.Params] = ..., @@ -45,9 +48,10 @@ class GenesisState(google.protobuf.message.Message): aggregate_exchange_rate_prevotes: typing.Optional[typing.Iterable[oracle.v1beta1.oracle_pb2.AggregateExchangeRatePrevote]] = ..., aggregate_exchange_rate_votes: typing.Optional[typing.Iterable[oracle.v1beta1.oracle_pb2.AggregateExchangeRateVote]] = ..., pairs: typing.Optional[typing.Iterable[oracle.v1beta1.oracle_pb2.Pair]] = ..., + pair_rewards: typing.Optional[typing.Iterable[oracle.v1beta1.oracle_pb2.PairReward]] = ..., ) -> None: ... def HasField(self, field_name: typing_extensions.Literal["params",b"params"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["aggregate_exchange_rate_prevotes",b"aggregate_exchange_rate_prevotes","aggregate_exchange_rate_votes",b"aggregate_exchange_rate_votes","exchange_rates",b"exchange_rates","feeder_delegations",b"feeder_delegations","miss_counters",b"miss_counters","pairs",b"pairs","params",b"params"]) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["aggregate_exchange_rate_prevotes",b"aggregate_exchange_rate_prevotes","aggregate_exchange_rate_votes",b"aggregate_exchange_rate_votes","exchange_rates",b"exchange_rates","feeder_delegations",b"feeder_delegations","miss_counters",b"miss_counters","pair_rewards",b"pair_rewards","pairs",b"pairs","params",b"params"]) -> None: ... global___GenesisState = GenesisState class FeederDelegation(google.protobuf.message.Message): diff --git a/nibiru_proto/proto/oracle/v1beta1/oracle_pb2.py b/nibiru_proto/proto/oracle/v1beta1/oracle_pb2.py index e67fccf..5c121c9 100644 --- a/nibiru_proto/proto/oracle/v1beta1/oracle_pb2.py +++ b/nibiru_proto/proto/oracle/v1beta1/oracle_pb2.py @@ -16,7 +16,7 @@ from cosmos.base.v1beta1 import coin_pb2 as cosmos_dot_base_dot_v1beta1_dot_coin__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1boracle/v1beta1/oracle.proto\x12\x15nibiru.oracle.v1beta1\x1a\x14gogoproto/gogo.proto\x1a\x1e\x63osmos/base/v1beta1/coin.proto\"\x99\x05\n\x06Params\x12+\n\x0bvote_period\x18\x01 \x01(\x04\x42\x16\xf2\xde\x1f\x12yaml:\"vote_period\"\x12_\n\x0evote_threshold\x18\x02 \x01(\tBG\xf2\xde\x1f\x15yaml:\"vote_threshold\"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12Y\n\x0breward_band\x18\x03 \x01(\tBD\xf2\xde\x1f\x12yaml:\"reward_band\"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12I\n\x1areward_distribution_window\x18\x04 \x01(\x04\x42%\xf2\xde\x1f!yaml:\"reward_distribution_window\"\x12T\n\twhitelist\x18\x05 \x03(\x0b\x32\x1b.nibiru.oracle.v1beta1.PairB$\xf2\xde\x1f\x10yaml:\"whitelist\"\xaa\xdf\x1f\x08PairList\xc8\xde\x1f\x00\x12_\n\x0eslash_fraction\x18\x06 \x01(\tBG\xf2\xde\x1f\x15yaml:\"slash_fraction\"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12-\n\x0cslash_window\x18\x07 \x01(\x04\x42\x17\xf2\xde\x1f\x13yaml:\"slash_window\"\x12k\n\x14min_valid_per_window\x18\x08 \x01(\tBM\xf2\xde\x1f\x1byaml:\"min_valid_per_window\"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00:\x08\xe8\xa0\x1f\x01\x98\xa0\x1f\x00\"3\n\x04Pair\x12\x1d\n\x04name\x18\x01 \x01(\tB\x0f\xf2\xde\x1f\x0byaml:\"name\":\x0c\xe8\xa0\x1f\x00\x88\xa0\x1f\x00\x98\xa0\x1f\x00\"\x9b\x01\n\x1c\x41ggregateExchangeRatePrevote\x12\x1d\n\x04hash\x18\x01 \x01(\tB\x0f\xf2\xde\x1f\x0byaml:\"hash\"\x12\x1f\n\x05voter\x18\x02 \x01(\tB\x10\xf2\xde\x1f\x0cyaml:\"voter\"\x12-\n\x0csubmit_block\x18\x03 \x01(\x04\x42\x17\xf2\xde\x1f\x13yaml:\"submit_block\":\x0c\xe8\xa0\x1f\x00\x88\xa0\x1f\x00\x98\xa0\x1f\x00\"\xce\x01\n\x19\x41ggregateExchangeRateVote\x12\x81\x01\n\x14\x65xchange_rate_tuples\x18\x01 \x03(\x0b\x32(.nibiru.oracle.v1beta1.ExchangeRateTupleB9\xf2\xde\x1f\x1byaml:\"exchange_rate_tuples\"\xaa\xdf\x1f\x12\x45xchangeRateTuples\xc8\xde\x1f\x00\x12\x1f\n\x05voter\x18\x02 \x01(\tB\x10\xf2\xde\x1f\x0cyaml:\"voter\":\x0c\xe8\xa0\x1f\x00\x88\xa0\x1f\x00\x98\xa0\x1f\x00\"\x9f\x01\n\x11\x45xchangeRateTuple\x12\x1d\n\x04pair\x18\x01 \x01(\tB\x0f\xf2\xde\x1f\x0byaml:\"pair\"\x12]\n\rexchange_rate\x18\x02 \x01(\tBF\xf2\xde\x1f\x14yaml:\"exchange_rate\"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00:\x0c\xe8\xa0\x1f\x00\x88\xa0\x1f\x00\x98\xa0\x1f\x00\x42.Z,github.com/NibiruChain/nibiru/x/oracle/typesb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1boracle/v1beta1/oracle.proto\x12\x15nibiru.oracle.v1beta1\x1a\x14gogoproto/gogo.proto\x1a\x1e\x63osmos/base/v1beta1/coin.proto\"\xce\x04\n\x06Params\x12+\n\x0bvote_period\x18\x01 \x01(\x04\x42\x16\xf2\xde\x1f\x12yaml:\"vote_period\"\x12_\n\x0evote_threshold\x18\x02 \x01(\tBG\xf2\xde\x1f\x15yaml:\"vote_threshold\"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12Y\n\x0breward_band\x18\x03 \x01(\tBD\xf2\xde\x1f\x12yaml:\"reward_band\"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12T\n\twhitelist\x18\x04 \x03(\x0b\x32\x1b.nibiru.oracle.v1beta1.PairB$\xf2\xde\x1f\x10yaml:\"whitelist\"\xaa\xdf\x1f\x08PairList\xc8\xde\x1f\x00\x12_\n\x0eslash_fraction\x18\x05 \x01(\tBG\xf2\xde\x1f\x15yaml:\"slash_fraction\"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12-\n\x0cslash_window\x18\x06 \x01(\x04\x42\x17\xf2\xde\x1f\x13yaml:\"slash_window\"\x12k\n\x14min_valid_per_window\x18\x07 \x01(\tBM\xf2\xde\x1f\x1byaml:\"min_valid_per_window\"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00:\x08\xe8\xa0\x1f\x01\x98\xa0\x1f\x00\"3\n\x04Pair\x12\x1d\n\x04name\x18\x01 \x01(\tB\x0f\xf2\xde\x1f\x0byaml:\"name\":\x0c\xe8\xa0\x1f\x00\x88\xa0\x1f\x00\x98\xa0\x1f\x00\"\x9b\x01\n\x1c\x41ggregateExchangeRatePrevote\x12\x1d\n\x04hash\x18\x01 \x01(\tB\x0f\xf2\xde\x1f\x0byaml:\"hash\"\x12\x1f\n\x05voter\x18\x02 \x01(\tB\x10\xf2\xde\x1f\x0cyaml:\"voter\"\x12-\n\x0csubmit_block\x18\x03 \x01(\x04\x42\x17\xf2\xde\x1f\x13yaml:\"submit_block\":\x0c\xe8\xa0\x1f\x00\x88\xa0\x1f\x00\x98\xa0\x1f\x00\"\xce\x01\n\x19\x41ggregateExchangeRateVote\x12\x81\x01\n\x14\x65xchange_rate_tuples\x18\x01 \x03(\x0b\x32(.nibiru.oracle.v1beta1.ExchangeRateTupleB9\xf2\xde\x1f\x1byaml:\"exchange_rate_tuples\"\xaa\xdf\x1f\x12\x45xchangeRateTuples\xc8\xde\x1f\x00\x12\x1f\n\x05voter\x18\x02 \x01(\tB\x10\xf2\xde\x1f\x0cyaml:\"voter\":\x0c\xe8\xa0\x1f\x00\x88\xa0\x1f\x00\x98\xa0\x1f\x00\"\x9f\x01\n\x11\x45xchangeRateTuple\x12\x1d\n\x04pair\x18\x01 \x01(\tB\x0f\xf2\xde\x1f\x0byaml:\"pair\"\x12]\n\rexchange_rate\x18\x02 \x01(\tBF\xf2\xde\x1f\x14yaml:\"exchange_rate\"\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00:\x0c\xe8\xa0\x1f\x00\x88\xa0\x1f\x00\x98\xa0\x1f\x00\"l\n\nPairReward\x12\x0c\n\x04pair\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\x04\x12\x14\n\x0cvote_periods\x18\x03 \x01(\x04\x12.\n\x05\x63oins\x18\x04 \x03(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x04\xc8\xde\x1f\x00\x42.Z,github.com/NibiruChain/nibiru/x/oracle/typesb\x06proto3') @@ -25,6 +25,7 @@ _AGGREGATEEXCHANGERATEPREVOTE = DESCRIPTOR.message_types_by_name['AggregateExchangeRatePrevote'] _AGGREGATEEXCHANGERATEVOTE = DESCRIPTOR.message_types_by_name['AggregateExchangeRateVote'] _EXCHANGERATETUPLE = DESCRIPTOR.message_types_by_name['ExchangeRateTuple'] +_PAIRREWARD = DESCRIPTOR.message_types_by_name['PairReward'] Params = _reflection.GeneratedProtocolMessageType('Params', (_message.Message,), { 'DESCRIPTOR' : _PARAMS, '__module__' : 'oracle.v1beta1.oracle_pb2' @@ -60,6 +61,13 @@ }) _sym_db.RegisterMessage(ExchangeRateTuple) +PairReward = _reflection.GeneratedProtocolMessageType('PairReward', (_message.Message,), { + 'DESCRIPTOR' : _PAIRREWARD, + '__module__' : 'oracle.v1beta1.oracle_pb2' + # @@protoc_insertion_point(class_scope:nibiru.oracle.v1beta1.PairReward) + }) +_sym_db.RegisterMessage(PairReward) + if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None @@ -70,8 +78,6 @@ _PARAMS.fields_by_name['vote_threshold']._serialized_options = b'\362\336\037\025yaml:\"vote_threshold\"\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' _PARAMS.fields_by_name['reward_band']._options = None _PARAMS.fields_by_name['reward_band']._serialized_options = b'\362\336\037\022yaml:\"reward_band\"\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' - _PARAMS.fields_by_name['reward_distribution_window']._options = None - _PARAMS.fields_by_name['reward_distribution_window']._serialized_options = b'\362\336\037!yaml:\"reward_distribution_window\"' _PARAMS.fields_by_name['whitelist']._options = None _PARAMS.fields_by_name['whitelist']._serialized_options = b'\362\336\037\020yaml:\"whitelist\"\252\337\037\010PairList\310\336\037\000' _PARAMS.fields_by_name['slash_fraction']._options = None @@ -106,14 +112,18 @@ _EXCHANGERATETUPLE.fields_by_name['exchange_rate']._serialized_options = b'\362\336\037\024yaml:\"exchange_rate\"\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' _EXCHANGERATETUPLE._options = None _EXCHANGERATETUPLE._serialized_options = b'\350\240\037\000\210\240\037\000\230\240\037\000' + _PAIRREWARD.fields_by_name['coins']._options = None + _PAIRREWARD.fields_by_name['coins']._serialized_options = b'\310\336\037\000' _PARAMS._serialized_start=109 - _PARAMS._serialized_end=774 - _PAIR._serialized_start=776 - _PAIR._serialized_end=827 - _AGGREGATEEXCHANGERATEPREVOTE._serialized_start=830 - _AGGREGATEEXCHANGERATEPREVOTE._serialized_end=985 - _AGGREGATEEXCHANGERATEVOTE._serialized_start=988 - _AGGREGATEEXCHANGERATEVOTE._serialized_end=1194 - _EXCHANGERATETUPLE._serialized_start=1197 - _EXCHANGERATETUPLE._serialized_end=1356 + _PARAMS._serialized_end=699 + _PAIR._serialized_start=701 + _PAIR._serialized_end=752 + _AGGREGATEEXCHANGERATEPREVOTE._serialized_start=755 + _AGGREGATEEXCHANGERATEPREVOTE._serialized_end=910 + _AGGREGATEEXCHANGERATEVOTE._serialized_start=913 + _AGGREGATEEXCHANGERATEVOTE._serialized_end=1119 + _EXCHANGERATETUPLE._serialized_start=1122 + _EXCHANGERATETUPLE._serialized_end=1281 + _PAIRREWARD._serialized_start=1283 + _PAIRREWARD._serialized_end=1391 # @@protoc_insertion_point(module_scope) diff --git a/nibiru_proto/proto/oracle/v1beta1/oracle_pb2.pyi b/nibiru_proto/proto/oracle/v1beta1/oracle_pb2.pyi index 3d04452..6eb0015 100644 --- a/nibiru_proto/proto/oracle/v1beta1/oracle_pb2.pyi +++ b/nibiru_proto/proto/oracle/v1beta1/oracle_pb2.pyi @@ -3,6 +3,7 @@ isort:skip_file """ import builtins +import cosmos.base.v1beta1.coin_pb2 import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message @@ -17,7 +18,6 @@ class Params(google.protobuf.message.Message): VOTE_PERIOD_FIELD_NUMBER: builtins.int VOTE_THRESHOLD_FIELD_NUMBER: builtins.int REWARD_BAND_FIELD_NUMBER: builtins.int - REWARD_DISTRIBUTION_WINDOW_FIELD_NUMBER: builtins.int WHITELIST_FIELD_NUMBER: builtins.int SLASH_FRACTION_FIELD_NUMBER: builtins.int SLASH_WINDOW_FIELD_NUMBER: builtins.int @@ -25,7 +25,6 @@ class Params(google.protobuf.message.Message): vote_period: builtins.int vote_threshold: typing.Text reward_band: typing.Text - reward_distribution_window: builtins.int @property def whitelist(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Pair]: ... slash_fraction: typing.Text @@ -36,13 +35,12 @@ class Params(google.protobuf.message.Message): vote_period: builtins.int = ..., vote_threshold: typing.Text = ..., reward_band: typing.Text = ..., - reward_distribution_window: builtins.int = ..., whitelist: typing.Optional[typing.Iterable[global___Pair]] = ..., slash_fraction: typing.Text = ..., slash_window: builtins.int = ..., min_valid_per_window: typing.Text = ..., ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["min_valid_per_window",b"min_valid_per_window","reward_band",b"reward_band","reward_distribution_window",b"reward_distribution_window","slash_fraction",b"slash_fraction","slash_window",b"slash_window","vote_period",b"vote_period","vote_threshold",b"vote_threshold","whitelist",b"whitelist"]) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["min_valid_per_window",b"min_valid_per_window","reward_band",b"reward_band","slash_fraction",b"slash_fraction","slash_window",b"slash_window","vote_period",b"vote_period","vote_threshold",b"vote_threshold","whitelist",b"whitelist"]) -> None: ... global___Params = Params class Pair(google.protobuf.message.Message): @@ -110,3 +108,35 @@ class ExchangeRateTuple(google.protobuf.message.Message): ) -> None: ... def ClearField(self, field_name: typing_extensions.Literal["exchange_rate",b"exchange_rate","pair",b"pair"]) -> None: ... global___ExchangeRateTuple = ExchangeRateTuple + +class PairReward(google.protobuf.message.Message): + """PairReward defines a credit object towards validators + which provide prices faithfully for different pairs. + """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PAIR_FIELD_NUMBER: builtins.int + ID_FIELD_NUMBER: builtins.int + VOTE_PERIODS_FIELD_NUMBER: builtins.int + COINS_FIELD_NUMBER: builtins.int + pair: typing.Text + """pair defines the pair for which we incentivize validator to provide prices for.""" + + id: builtins.int + """id uniquely identifies the rewards instance of the pair""" + + vote_periods: builtins.int + """vote_periods defines the vote periods left in which rewards will be distributed.""" + + @property + def coins(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[cosmos.base.v1beta1.coin_pb2.Coin]: + """coins defines the amount of coins to distribute in a single vote period.""" + pass + def __init__(self, + *, + pair: typing.Text = ..., + id: builtins.int = ..., + vote_periods: builtins.int = ..., + coins: typing.Optional[typing.Iterable[cosmos.base.v1beta1.coin_pb2.Coin]] = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["coins",b"coins","id",b"id","pair",b"pair","vote_periods",b"vote_periods"]) -> None: ... +global___PairReward = PairReward diff --git a/nibiru_proto/proto/perp/v1/event_pb2.py b/nibiru_proto/proto/perp/v1/event_pb2.py index 02fde3c..57ac761 100644 --- a/nibiru_proto/proto/perp/v1/event_pb2.py +++ b/nibiru_proto/proto/perp/v1/event_pb2.py @@ -14,12 +14,12 @@ from gogoproto import gogo_pb2 as gogoproto_dot_gogo__pb2 from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from perp.v1 import state_pb2 as perp_dot_v1_dot_state__pb2 from cosmos.base.v1beta1 import coin_pb2 as cosmos_dot_base_dot_v1beta1_dot_coin__pb2 from common import common_pb2 as common_dot_common__pb2 +from perp.v1 import state_pb2 as perp_dot_v1_dot_state__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13perp/v1/event.proto\x12\x0enibiru.perp.v1\x1a\x14gogoproto/gogo.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x13perp/v1/state.proto\x1a\x1e\x63osmos/base/v1beta1/coin.proto\x1a\x13\x63ommon/common.proto\"\x83\x07\n\x14PositionChangedEvent\x12\x0c\n\x04pair\x18\x01 \x01(\t\x12\x16\n\x0etrader_address\x18\x02 \x01(\t\x12@\n\x06margin\x18\x03 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x15\xf2\xde\x1f\ryaml:\"margin\"\xc8\xde\x1f\x00\x12I\n\x11position_notional\x18\x04 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12O\n\x17\x65xchanged_position_size\x18\x05 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12R\n\x0ftransaction_fee\x18\x06 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x1e\xf2\xde\x1f\x16yaml:\"transaction_fee\"\xc8\xde\x1f\x00\x12\x45\n\rposition_size\x18\x07 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x44\n\x0crealized_pnl\x18\x08 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12L\n\x14unrealized_pnl_after\x18\t \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x31\n\x08\x62\x61\x64_debt\x18\n \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x04\xc8\xde\x1f\x00\x12K\n\x13liquidation_penalty\x18\x0b \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x42\n\nspot_price\x18\x0c \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12G\n\x0f\x66unding_payment\x18\r \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x14\n\x0c\x62lock_height\x18\x0e \x01(\x03\x12\x15\n\rblock_time_ms\x18\x0f \x01(\x03\"\xf3\x06\n\x17PositionLiquidatedEvent\x12\x0c\n\x04pair\x18\x01 \x01(\t\x12\x16\n\x0etrader_address\x18\x02 \x01(\t\x12N\n\x16\x65xchanged_quote_amount\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12O\n\x17\x65xchanged_position_size\x18\x04 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x1a\n\x12liquidator_address\x18\x05 \x01(\t\x12V\n\x11\x66\x65\x65_to_liquidator\x18\x06 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB \xf2\xde\x1f\x18yaml:\"fee_to_liquidator\"\xc8\xde\x1f\x00\x12^\n\x15\x66\x65\x65_to_ecosystem_fund\x18\x07 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB$\xf2\xde\x1f\x1cyaml:\"fee_to_ecosystem_fund\"\xc8\xde\x1f\x00\x12\x31\n\x08\x62\x61\x64_debt\x18\x08 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x04\xc8\xde\x1f\x00\x12@\n\x06margin\x18\t \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x15\xf2\xde\x1f\ryaml:\"margin\"\xc8\xde\x1f\x00\x12I\n\x11position_notional\x18\n \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x45\n\rposition_size\x18\x0b \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x45\n\runrealizedPnl\x18\x0c \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x42\n\nmark_price\x18\r \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x14\n\x0c\x62lock_height\x18\x0e \x01(\x03\x12\x15\n\rblock_time_ms\x18\x0f \x01(\x03\"\xb8\x01\n\x14PositionSettledEvent\x12\x0c\n\x04pair\x18\x01 \x01(\t\x12\x16\n\x0etrader_address\x18\x02 \x01(\t\x12z\n\rsettled_coins\x18\x03 \x03(\x0b\x32\x19.cosmos.base.v1beta1.CoinBH\xaa\xdf\x1f(github.com/cosmos/cosmos-sdk/types.Coins\xf2\xde\x1f\x14yaml:\"settled_coins\"\xc8\xde\x1f\x00\"\xfb\x02\n\x17\x46undingRateChangedEvent\x12\x0c\n\x04pair\x18\x01 \x01(\t\x12\x42\n\nmark_price\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x43\n\x0bindex_price\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12K\n\x13latest_funding_rate\x18\x04 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12O\n\x17\x63umulative_funding_rate\x18\x05 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x14\n\x0c\x62lock_height\x18\x06 \x01(\x03\x12\x15\n\rblock_time_ms\x18\x07 \x01(\x03\x42,Z*github.com/NibiruChain/nibiru/x/perp/typesb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13perp/v1/event.proto\x12\x0enibiru.perp.v1\x1a\x14gogoproto/gogo.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1e\x63osmos/base/v1beta1/coin.proto\x1a\x13\x63ommon/common.proto\x1a\x13perp/v1/state.proto\"\x83\x07\n\x14PositionChangedEvent\x12\x0c\n\x04pair\x18\x01 \x01(\t\x12\x16\n\x0etrader_address\x18\x02 \x01(\t\x12@\n\x06margin\x18\x03 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x15\xf2\xde\x1f\ryaml:\"margin\"\xc8\xde\x1f\x00\x12I\n\x11position_notional\x18\x04 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12O\n\x17\x65xchanged_position_size\x18\x05 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12R\n\x0ftransaction_fee\x18\x06 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x1e\xf2\xde\x1f\x16yaml:\"transaction_fee\"\xc8\xde\x1f\x00\x12\x45\n\rposition_size\x18\x07 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x44\n\x0crealized_pnl\x18\x08 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12L\n\x14unrealized_pnl_after\x18\t \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x31\n\x08\x62\x61\x64_debt\x18\n \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x04\xc8\xde\x1f\x00\x12K\n\x13liquidation_penalty\x18\x0b \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x42\n\nmark_price\x18\x0c \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12G\n\x0f\x66unding_payment\x18\r \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x14\n\x0c\x62lock_height\x18\x0e \x01(\x03\x12\x15\n\rblock_time_ms\x18\x0f \x01(\x03\"\xf3\x06\n\x17PositionLiquidatedEvent\x12\x0c\n\x04pair\x18\x01 \x01(\t\x12\x16\n\x0etrader_address\x18\x02 \x01(\t\x12N\n\x16\x65xchanged_quote_amount\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12O\n\x17\x65xchanged_position_size\x18\x04 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x1a\n\x12liquidator_address\x18\x05 \x01(\t\x12V\n\x11\x66\x65\x65_to_liquidator\x18\x06 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB \xf2\xde\x1f\x18yaml:\"fee_to_liquidator\"\xc8\xde\x1f\x00\x12^\n\x15\x66\x65\x65_to_ecosystem_fund\x18\x07 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB$\xf2\xde\x1f\x1cyaml:\"fee_to_ecosystem_fund\"\xc8\xde\x1f\x00\x12\x31\n\x08\x62\x61\x64_debt\x18\x08 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x04\xc8\xde\x1f\x00\x12@\n\x06margin\x18\t \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x15\xf2\xde\x1f\ryaml:\"margin\"\xc8\xde\x1f\x00\x12I\n\x11position_notional\x18\n \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x45\n\rposition_size\x18\x0b \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x45\n\runrealizedPnl\x18\x0c \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x42\n\nmark_price\x18\r \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x14\n\x0c\x62lock_height\x18\x0e \x01(\x03\x12\x15\n\rblock_time_ms\x18\x0f \x01(\x03\"\xb8\x01\n\x14PositionSettledEvent\x12\x0c\n\x04pair\x18\x01 \x01(\t\x12\x16\n\x0etrader_address\x18\x02 \x01(\t\x12z\n\rsettled_coins\x18\x03 \x03(\x0b\x32\x19.cosmos.base.v1beta1.CoinBH\xaa\xdf\x1f(github.com/cosmos/cosmos-sdk/types.Coins\xf2\xde\x1f\x14yaml:\"settled_coins\"\xc8\xde\x1f\x00\"\xd0\x03\n\x17\x46undingRateChangedEvent\x12\x0c\n\x04pair\x18\x01 \x01(\t\x12\x42\n\nmark_price\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x43\n\x0bindex_price\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12K\n\x13latest_funding_rate\x18\x04 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12O\n\x17latest_premium_fraction\x18\x05 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12S\n\x1b\x63umulative_premium_fraction\x18\x06 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x14\n\x0c\x62lock_height\x18\x07 \x01(\x03\x12\x15\n\rblock_time_ms\x18\x08 \x01(\x03\x42,Z*github.com/NibiruChain/nibiru/x/perp/typesb\x06proto3') @@ -77,8 +77,8 @@ _POSITIONCHANGEDEVENT.fields_by_name['bad_debt']._serialized_options = b'\310\336\037\000' _POSITIONCHANGEDEVENT.fields_by_name['liquidation_penalty']._options = None _POSITIONCHANGEDEVENT.fields_by_name['liquidation_penalty']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' - _POSITIONCHANGEDEVENT.fields_by_name['spot_price']._options = None - _POSITIONCHANGEDEVENT.fields_by_name['spot_price']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' + _POSITIONCHANGEDEVENT.fields_by_name['mark_price']._options = None + _POSITIONCHANGEDEVENT.fields_by_name['mark_price']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' _POSITIONCHANGEDEVENT.fields_by_name['funding_payment']._options = None _POSITIONCHANGEDEVENT.fields_by_name['funding_payment']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' _POSITIONLIQUIDATEDEVENT.fields_by_name['exchanged_quote_amount']._options = None @@ -109,8 +109,10 @@ _FUNDINGRATECHANGEDEVENT.fields_by_name['index_price']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' _FUNDINGRATECHANGEDEVENT.fields_by_name['latest_funding_rate']._options = None _FUNDINGRATECHANGEDEVENT.fields_by_name['latest_funding_rate']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' - _FUNDINGRATECHANGEDEVENT.fields_by_name['cumulative_funding_rate']._options = None - _FUNDINGRATECHANGEDEVENT.fields_by_name['cumulative_funding_rate']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' + _FUNDINGRATECHANGEDEVENT.fields_by_name['latest_premium_fraction']._options = None + _FUNDINGRATECHANGEDEVENT.fields_by_name['latest_premium_fraction']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' + _FUNDINGRATECHANGEDEVENT.fields_by_name['cumulative_premium_fraction']._options = None + _FUNDINGRATECHANGEDEVENT.fields_by_name['cumulative_premium_fraction']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' _POSITIONCHANGEDEVENT._serialized_start=166 _POSITIONCHANGEDEVENT._serialized_end=1065 _POSITIONLIQUIDATEDEVENT._serialized_start=1068 @@ -118,5 +120,5 @@ _POSITIONSETTLEDEVENT._serialized_start=1954 _POSITIONSETTLEDEVENT._serialized_end=2138 _FUNDINGRATECHANGEDEVENT._serialized_start=2141 - _FUNDINGRATECHANGEDEVENT._serialized_end=2520 + _FUNDINGRATECHANGEDEVENT._serialized_end=2605 # @@protoc_insertion_point(module_scope) diff --git a/nibiru_proto/proto/perp/v1/event_pb2.pyi b/nibiru_proto/proto/perp/v1/event_pb2.pyi index 02ce113..f2596dc 100644 --- a/nibiru_proto/proto/perp/v1/event_pb2.pyi +++ b/nibiru_proto/proto/perp/v1/event_pb2.pyi @@ -28,7 +28,7 @@ class PositionChangedEvent(google.protobuf.message.Message): UNREALIZED_PNL_AFTER_FIELD_NUMBER: builtins.int BAD_DEBT_FIELD_NUMBER: builtins.int LIQUIDATION_PENALTY_FIELD_NUMBER: builtins.int - SPOT_PRICE_FIELD_NUMBER: builtins.int + MARK_PRICE_FIELD_NUMBER: builtins.int FUNDING_PAYMENT_FIELD_NUMBER: builtins.int BLOCK_HEIGHT_FIELD_NUMBER: builtins.int BLOCK_TIME_MS_FIELD_NUMBER: builtins.int @@ -70,8 +70,8 @@ class PositionChangedEvent(google.protobuf.message.Message): liquidation_penalty: typing.Text """amt of margin (y) lost due to liquidation""" - spot_price: typing.Text - """Spot price, synonymous with mark price in this context, is the quotient of + mark_price: typing.Text + """Mark price, synonymous with mark price in this context, is the quotient of the quote reserves and base reserves """ @@ -102,13 +102,13 @@ class PositionChangedEvent(google.protobuf.message.Message): unrealized_pnl_after: typing.Text = ..., bad_debt: typing.Optional[cosmos.base.v1beta1.coin_pb2.Coin] = ..., liquidation_penalty: typing.Text = ..., - spot_price: typing.Text = ..., + mark_price: typing.Text = ..., funding_payment: typing.Text = ..., block_height: builtins.int = ..., block_time_ms: builtins.int = ..., ) -> None: ... def HasField(self, field_name: typing_extensions.Literal["bad_debt",b"bad_debt","margin",b"margin","transaction_fee",b"transaction_fee"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["bad_debt",b"bad_debt","block_height",b"block_height","block_time_ms",b"block_time_ms","exchanged_position_size",b"exchanged_position_size","funding_payment",b"funding_payment","liquidation_penalty",b"liquidation_penalty","margin",b"margin","pair",b"pair","position_notional",b"position_notional","position_size",b"position_size","realized_pnl",b"realized_pnl","spot_price",b"spot_price","trader_address",b"trader_address","transaction_fee",b"transaction_fee","unrealized_pnl_after",b"unrealized_pnl_after"]) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["bad_debt",b"bad_debt","block_height",b"block_height","block_time_ms",b"block_time_ms","exchanged_position_size",b"exchanged_position_size","funding_payment",b"funding_payment","liquidation_penalty",b"liquidation_penalty","margin",b"margin","mark_price",b"mark_price","pair",b"pair","position_notional",b"position_notional","position_size",b"position_size","realized_pnl",b"realized_pnl","trader_address",b"trader_address","transaction_fee",b"transaction_fee","unrealized_pnl_after",b"unrealized_pnl_after"]) -> None: ... global___PositionChangedEvent = PositionChangedEvent class PositionLiquidatedEvent(google.protobuf.message.Message): @@ -232,7 +232,8 @@ class FundingRateChangedEvent(google.protobuf.message.Message): MARK_PRICE_FIELD_NUMBER: builtins.int INDEX_PRICE_FIELD_NUMBER: builtins.int LATEST_FUNDING_RATE_FIELD_NUMBER: builtins.int - CUMULATIVE_FUNDING_RATE_FIELD_NUMBER: builtins.int + LATEST_PREMIUM_FRACTION_FIELD_NUMBER: builtins.int + CUMULATIVE_PREMIUM_FRACTION_FIELD_NUMBER: builtins.int BLOCK_HEIGHT_FIELD_NUMBER: builtins.int BLOCK_TIME_MS_FIELD_NUMBER: builtins.int pair: typing.Text @@ -247,10 +248,13 @@ class FundingRateChangedEvent(google.protobuf.message.Message): latest_funding_rate: typing.Text """The latest funding rate.""" - cumulative_funding_rate: typing.Text - """The latest cumulative funding rate. - The funding rate a position will pay is the difference between this value - and the latest cumulative funding rate on the position. + latest_premium_fraction: typing.Text + """The latest premium fraction just calculated.""" + + cumulative_premium_fraction: typing.Text + """The latest cumulative premium fraction. + The funding payment a position will pay is the difference between this value + and the latest cumulative premium fraction on the position, multiplied by the position size. """ block_height: builtins.int @@ -265,9 +269,10 @@ class FundingRateChangedEvent(google.protobuf.message.Message): mark_price: typing.Text = ..., index_price: typing.Text = ..., latest_funding_rate: typing.Text = ..., - cumulative_funding_rate: typing.Text = ..., + latest_premium_fraction: typing.Text = ..., + cumulative_premium_fraction: typing.Text = ..., block_height: builtins.int = ..., block_time_ms: builtins.int = ..., ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["block_height",b"block_height","block_time_ms",b"block_time_ms","cumulative_funding_rate",b"cumulative_funding_rate","index_price",b"index_price","latest_funding_rate",b"latest_funding_rate","mark_price",b"mark_price","pair",b"pair"]) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["block_height",b"block_height","block_time_ms",b"block_time_ms","cumulative_premium_fraction",b"cumulative_premium_fraction","index_price",b"index_price","latest_funding_rate",b"latest_funding_rate","latest_premium_fraction",b"latest_premium_fraction","mark_price",b"mark_price","pair",b"pair"]) -> None: ... global___FundingRateChangedEvent = FundingRateChangedEvent diff --git a/nibiru_proto/proto/perp/v1/genesis_pb2.py b/nibiru_proto/proto/perp/v1/genesis_pb2.py new file mode 100644 index 0000000..e802b78 --- /dev/null +++ b/nibiru_proto/proto/perp/v1/genesis_pb2.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: perp/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 message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from gogoproto import gogo_pb2 as gogoproto_dot_gogo__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from cosmos.base.v1beta1 import coin_pb2 as cosmos_dot_base_dot_v1beta1_dot_coin__pb2 +from common import common_pb2 as common_dot_common__pb2 +from perp.v1 import state_pb2 as perp_dot_v1_dot_state__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15perp/v1/genesis.proto\x12\x0enibiru.perp.v1\x1a\x14gogoproto/gogo.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1e\x63osmos/base/v1beta1/coin.proto\x1a\x13\x63ommon/common.proto\x1a\x13perp/v1/state.proto\"\xeb\x01\n\x0cGenesisState\x12,\n\x06params\x18\x01 \x01(\x0b\x32\x16.nibiru.perp.v1.ParamsB\x04\xc8\xde\x1f\x00\x12\x39\n\rpair_metadata\x18\x02 \x03(\x0b\x32\x1c.nibiru.perp.v1.PairMetadataB\x04\xc8\xde\x1f\x00\x12\x31\n\tpositions\x18\x03 \x03(\x0b\x32\x18.nibiru.perp.v1.PositionB\x04\xc8\xde\x1f\x00\x12?\n\x11prepaid_bad_debts\x18\x04 \x03(\x0b\x32\x1e.nibiru.perp.v1.PrepaidBadDebtB\x04\xc8\xde\x1f\x00\x42,Z*github.com/NibiruChain/nibiru/x/perp/typesb\x06proto3') + + + +_GENESISSTATE = DESCRIPTOR.message_types_by_name['GenesisState'] +GenesisState = _reflection.GeneratedProtocolMessageType('GenesisState', (_message.Message,), { + 'DESCRIPTOR' : _GENESISSTATE, + '__module__' : 'perp.v1.genesis_pb2' + # @@protoc_insertion_point(class_scope:nibiru.perp.v1.GenesisState) + }) +_sym_db.RegisterMessage(GenesisState) + +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'Z*github.com/NibiruChain/nibiru/x/perp/types' + _GENESISSTATE.fields_by_name['params']._options = None + _GENESISSTATE.fields_by_name['params']._serialized_options = b'\310\336\037\000' + _GENESISSTATE.fields_by_name['pair_metadata']._options = None + _GENESISSTATE.fields_by_name['pair_metadata']._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['prepaid_bad_debts']._options = None + _GENESISSTATE.fields_by_name['prepaid_bad_debts']._serialized_options = b'\310\336\037\000' + _GENESISSTATE._serialized_start=168 + _GENESISSTATE._serialized_end=403 +# @@protoc_insertion_point(module_scope) diff --git a/nibiru_proto/proto/perp/v1/genesis_pb2.pyi b/nibiru_proto/proto/perp/v1/genesis_pb2.pyi new file mode 100644 index 0000000..3ed3bec --- /dev/null +++ b/nibiru_proto/proto/perp/v1/genesis_pb2.pyi @@ -0,0 +1,39 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +""" +import builtins +import google.protobuf.descriptor +import google.protobuf.internal.containers +import google.protobuf.message +import perp.v1.state_pb2 +import typing +import typing_extensions + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +class GenesisState(google.protobuf.message.Message): + """GenesisState defines the perp module's genesis state.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PARAMS_FIELD_NUMBER: builtins.int + PAIR_METADATA_FIELD_NUMBER: builtins.int + POSITIONS_FIELD_NUMBER: builtins.int + PREPAID_BAD_DEBTS_FIELD_NUMBER: builtins.int + @property + def params(self) -> perp.v1.state_pb2.Params: ... + @property + def pair_metadata(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[perp.v1.state_pb2.PairMetadata]: ... + @property + def positions(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[perp.v1.state_pb2.Position]: ... + @property + def prepaid_bad_debts(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[perp.v1.state_pb2.PrepaidBadDebt]: ... + def __init__(self, + *, + params: typing.Optional[perp.v1.state_pb2.Params] = ..., + pair_metadata: typing.Optional[typing.Iterable[perp.v1.state_pb2.PairMetadata]] = ..., + positions: typing.Optional[typing.Iterable[perp.v1.state_pb2.Position]] = ..., + prepaid_bad_debts: typing.Optional[typing.Iterable[perp.v1.state_pb2.PrepaidBadDebt]] = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["params",b"params"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["pair_metadata",b"pair_metadata","params",b"params","positions",b"positions","prepaid_bad_debts",b"prepaid_bad_debts"]) -> None: ... +global___GenesisState = GenesisState diff --git a/nibiru_proto/proto/pricefeed/snapshot_pb2_grpc.py b/nibiru_proto/proto/perp/v1/genesis_pb2_grpc.py similarity index 100% rename from nibiru_proto/proto/pricefeed/snapshot_pb2_grpc.py rename to nibiru_proto/proto/perp/v1/genesis_pb2_grpc.py diff --git a/nibiru_proto/proto/pricefeed/snapshot_pb2_grpc.pyi b/nibiru_proto/proto/perp/v1/genesis_pb2_grpc.pyi similarity index 100% rename from nibiru_proto/proto/pricefeed/snapshot_pb2_grpc.pyi rename to nibiru_proto/proto/perp/v1/genesis_pb2_grpc.pyi diff --git a/nibiru_proto/proto/perp/v1/query_pb2.py b/nibiru_proto/proto/perp/v1/query_pb2.py index c28beca..8517ab4 100644 --- a/nibiru_proto/proto/perp/v1/query_pb2.py +++ b/nibiru_proto/proto/perp/v1/query_pb2.py @@ -17,14 +17,18 @@ from perp.v1 import state_pb2 as perp_dot_v1_dot_state__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13perp/v1/query.proto\x12\x0enibiru.perp.v1\x1a\x14gogoproto/gogo.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x13perp/v1/state.proto\"\x14\n\x12QueryParamsRequest\"C\n\x13QueryParamsResponse\x12,\n\x06params\x18\x01 \x01(\x0b\x32\x16.nibiru.perp.v1.ParamsB\x04\xc8\xde\x1f\x00\"@\n\x1aQueryTraderPositionRequest\x12\x12\n\ntoken_pair\x18\x01 \x01(\t\x12\x0e\n\x06trader\x18\x02 \x01(\t\"\x89\x03\n\x1bQueryTraderPositionResponse\x12*\n\x08position\x18\x01 \x01(\x0b\x32\x18.nibiru.perp.v1.Position\x12I\n\x11position_notional\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x46\n\x0eunrealized_pnl\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12I\n\x11margin_ratio_mark\x18\x04 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12J\n\x12margin_ratio_index\x18\x05 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x14\n\x0c\x62lock_number\x18\x07 \x01(\x03\x32\x8e\x02\n\x05Query\x12n\n\x06Params\x12\".nibiru.perp.v1.QueryParamsRequest\x1a#.nibiru.perp.v1.QueryParamsResponse\"\x1b\x82\xd3\xe4\x93\x02\x15\x12\x13/nibiru/perp/params\x12\x94\x01\n\x13QueryTraderPosition\x12*.nibiru.perp.v1.QueryTraderPositionRequest\x1a+.nibiru.perp.v1.QueryTraderPositionResponse\"$\x82\xd3\xe4\x93\x02\x1e\x12\x1c/nibiru/perp/trader_positionB,Z*github.com/NibiruChain/nibiru/x/perp/typesb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13perp/v1/query.proto\x12\x0enibiru.perp.v1\x1a\x14gogoproto/gogo.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x13perp/v1/state.proto\"\x14\n\x12QueryParamsRequest\"C\n\x13QueryParamsResponse\x12,\n\x06params\x18\x01 \x01(\x0b\x32\x16.nibiru.perp.v1.ParamsB\x04\xc8\xde\x1f\x00\"\'\n\x15QueryPositionsRequest\x12\x0e\n\x06trader\x18\x01 \x01(\t\"R\n\x16QueryPositionsResponse\x12\x38\n\tpositions\x18\x01 \x03(\x0b\x32%.nibiru.perp.v1.QueryPositionResponse\":\n\x14QueryPositionRequest\x12\x12\n\ntoken_pair\x18\x01 \x01(\t\x12\x0e\n\x06trader\x18\x02 \x01(\t\"\x83\x03\n\x15QueryPositionResponse\x12*\n\x08position\x18\x01 \x01(\x0b\x32\x18.nibiru.perp.v1.Position\x12I\n\x11position_notional\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x46\n\x0eunrealized_pnl\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12I\n\x11margin_ratio_mark\x18\x04 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12J\n\x12margin_ratio_index\x18\x05 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x14\n\x0c\x62lock_number\x18\x07 \x01(\x03\"(\n\x18QueryFundingRatesRequest\x12\x0c\n\x04pair\x18\x01 \x01(\t\"m\n\x19QueryFundingRatesResponse\x12P\n\x18\x63umulative_funding_rates\x18\x01 \x03(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x32\xff\x03\n\x05Query\x12n\n\x06Params\x12\".nibiru.perp.v1.QueryParamsRequest\x1a#.nibiru.perp.v1.QueryParamsResponse\"\x1b\x82\xd3\xe4\x93\x02\x15\x12\x13/nibiru/perp/params\x12{\n\rQueryPosition\x12$.nibiru.perp.v1.QueryPositionRequest\x1a%.nibiru.perp.v1.QueryPositionResponse\"\x1d\x82\xd3\xe4\x93\x02\x17\x12\x15/nibiru/perp/position\x12\x7f\n\x0eQueryPositions\x12%.nibiru.perp.v1.QueryPositionsRequest\x1a&.nibiru.perp.v1.QueryPositionsResponse\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/nibiru/perp/positions\x12\x87\x01\n\x0c\x46undingRates\x12(.nibiru.perp.v1.QueryFundingRatesRequest\x1a).nibiru.perp.v1.QueryFundingRatesResponse\"\"\x82\xd3\xe4\x93\x02\x1c\x12\x1a/nibiru/perp/funding_ratesB,Z*github.com/NibiruChain/nibiru/x/perp/typesb\x06proto3') _QUERYPARAMSREQUEST = DESCRIPTOR.message_types_by_name['QueryParamsRequest'] _QUERYPARAMSRESPONSE = DESCRIPTOR.message_types_by_name['QueryParamsResponse'] -_QUERYTRADERPOSITIONREQUEST = DESCRIPTOR.message_types_by_name['QueryTraderPositionRequest'] -_QUERYTRADERPOSITIONRESPONSE = DESCRIPTOR.message_types_by_name['QueryTraderPositionResponse'] +_QUERYPOSITIONSREQUEST = DESCRIPTOR.message_types_by_name['QueryPositionsRequest'] +_QUERYPOSITIONSRESPONSE = DESCRIPTOR.message_types_by_name['QueryPositionsResponse'] +_QUERYPOSITIONREQUEST = DESCRIPTOR.message_types_by_name['QueryPositionRequest'] +_QUERYPOSITIONRESPONSE = DESCRIPTOR.message_types_by_name['QueryPositionResponse'] +_QUERYFUNDINGRATESREQUEST = DESCRIPTOR.message_types_by_name['QueryFundingRatesRequest'] +_QUERYFUNDINGRATESRESPONSE = DESCRIPTOR.message_types_by_name['QueryFundingRatesResponse'] QueryParamsRequest = _reflection.GeneratedProtocolMessageType('QueryParamsRequest', (_message.Message,), { 'DESCRIPTOR' : _QUERYPARAMSREQUEST, '__module__' : 'perp.v1.query_pb2' @@ -39,19 +43,47 @@ }) _sym_db.RegisterMessage(QueryParamsResponse) -QueryTraderPositionRequest = _reflection.GeneratedProtocolMessageType('QueryTraderPositionRequest', (_message.Message,), { - 'DESCRIPTOR' : _QUERYTRADERPOSITIONREQUEST, +QueryPositionsRequest = _reflection.GeneratedProtocolMessageType('QueryPositionsRequest', (_message.Message,), { + 'DESCRIPTOR' : _QUERYPOSITIONSREQUEST, '__module__' : 'perp.v1.query_pb2' - # @@protoc_insertion_point(class_scope:nibiru.perp.v1.QueryTraderPositionRequest) + # @@protoc_insertion_point(class_scope:nibiru.perp.v1.QueryPositionsRequest) }) -_sym_db.RegisterMessage(QueryTraderPositionRequest) +_sym_db.RegisterMessage(QueryPositionsRequest) -QueryTraderPositionResponse = _reflection.GeneratedProtocolMessageType('QueryTraderPositionResponse', (_message.Message,), { - 'DESCRIPTOR' : _QUERYTRADERPOSITIONRESPONSE, +QueryPositionsResponse = _reflection.GeneratedProtocolMessageType('QueryPositionsResponse', (_message.Message,), { + 'DESCRIPTOR' : _QUERYPOSITIONSRESPONSE, '__module__' : 'perp.v1.query_pb2' - # @@protoc_insertion_point(class_scope:nibiru.perp.v1.QueryTraderPositionResponse) + # @@protoc_insertion_point(class_scope:nibiru.perp.v1.QueryPositionsResponse) }) -_sym_db.RegisterMessage(QueryTraderPositionResponse) +_sym_db.RegisterMessage(QueryPositionsResponse) + +QueryPositionRequest = _reflection.GeneratedProtocolMessageType('QueryPositionRequest', (_message.Message,), { + 'DESCRIPTOR' : _QUERYPOSITIONREQUEST, + '__module__' : 'perp.v1.query_pb2' + # @@protoc_insertion_point(class_scope:nibiru.perp.v1.QueryPositionRequest) + }) +_sym_db.RegisterMessage(QueryPositionRequest) + +QueryPositionResponse = _reflection.GeneratedProtocolMessageType('QueryPositionResponse', (_message.Message,), { + 'DESCRIPTOR' : _QUERYPOSITIONRESPONSE, + '__module__' : 'perp.v1.query_pb2' + # @@protoc_insertion_point(class_scope:nibiru.perp.v1.QueryPositionResponse) + }) +_sym_db.RegisterMessage(QueryPositionResponse) + +QueryFundingRatesRequest = _reflection.GeneratedProtocolMessageType('QueryFundingRatesRequest', (_message.Message,), { + 'DESCRIPTOR' : _QUERYFUNDINGRATESREQUEST, + '__module__' : 'perp.v1.query_pb2' + # @@protoc_insertion_point(class_scope:nibiru.perp.v1.QueryFundingRatesRequest) + }) +_sym_db.RegisterMessage(QueryFundingRatesRequest) + +QueryFundingRatesResponse = _reflection.GeneratedProtocolMessageType('QueryFundingRatesResponse', (_message.Message,), { + 'DESCRIPTOR' : _QUERYFUNDINGRATESRESPONSE, + '__module__' : 'perp.v1.query_pb2' + # @@protoc_insertion_point(class_scope:nibiru.perp.v1.QueryFundingRatesResponse) + }) +_sym_db.RegisterMessage(QueryFundingRatesResponse) _QUERY = DESCRIPTOR.services_by_name['Query'] if _descriptor._USE_C_DESCRIPTORS == False: @@ -60,26 +92,40 @@ DESCRIPTOR._serialized_options = b'Z*github.com/NibiruChain/nibiru/x/perp/types' _QUERYPARAMSRESPONSE.fields_by_name['params']._options = None _QUERYPARAMSRESPONSE.fields_by_name['params']._serialized_options = b'\310\336\037\000' - _QUERYTRADERPOSITIONRESPONSE.fields_by_name['position_notional']._options = None - _QUERYTRADERPOSITIONRESPONSE.fields_by_name['position_notional']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' - _QUERYTRADERPOSITIONRESPONSE.fields_by_name['unrealized_pnl']._options = None - _QUERYTRADERPOSITIONRESPONSE.fields_by_name['unrealized_pnl']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' - _QUERYTRADERPOSITIONRESPONSE.fields_by_name['margin_ratio_mark']._options = None - _QUERYTRADERPOSITIONRESPONSE.fields_by_name['margin_ratio_mark']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' - _QUERYTRADERPOSITIONRESPONSE.fields_by_name['margin_ratio_index']._options = None - _QUERYTRADERPOSITIONRESPONSE.fields_by_name['margin_ratio_index']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' + _QUERYPOSITIONRESPONSE.fields_by_name['position_notional']._options = None + _QUERYPOSITIONRESPONSE.fields_by_name['position_notional']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' + _QUERYPOSITIONRESPONSE.fields_by_name['unrealized_pnl']._options = None + _QUERYPOSITIONRESPONSE.fields_by_name['unrealized_pnl']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' + _QUERYPOSITIONRESPONSE.fields_by_name['margin_ratio_mark']._options = None + _QUERYPOSITIONRESPONSE.fields_by_name['margin_ratio_mark']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' + _QUERYPOSITIONRESPONSE.fields_by_name['margin_ratio_index']._options = None + _QUERYPOSITIONRESPONSE.fields_by_name['margin_ratio_index']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' + _QUERYFUNDINGRATESRESPONSE.fields_by_name['cumulative_funding_rates']._options = None + _QUERYFUNDINGRATESRESPONSE.fields_by_name['cumulative_funding_rates']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' _QUERY.methods_by_name['Params']._options = None _QUERY.methods_by_name['Params']._serialized_options = b'\202\323\344\223\002\025\022\023/nibiru/perp/params' - _QUERY.methods_by_name['QueryTraderPosition']._options = None - _QUERY.methods_by_name['QueryTraderPosition']._serialized_options = b'\202\323\344\223\002\036\022\034/nibiru/perp/trader_position' + _QUERY.methods_by_name['QueryPosition']._options = None + _QUERY.methods_by_name['QueryPosition']._serialized_options = b'\202\323\344\223\002\027\022\025/nibiru/perp/position' + _QUERY.methods_by_name['QueryPositions']._options = None + _QUERY.methods_by_name['QueryPositions']._serialized_options = b'\202\323\344\223\002\030\022\026/nibiru/perp/positions' + _QUERY.methods_by_name['FundingRates']._options = None + _QUERY.methods_by_name['FundingRates']._serialized_options = b'\202\323\344\223\002\034\022\032/nibiru/perp/funding_rates' _QUERYPARAMSREQUEST._serialized_start=112 _QUERYPARAMSREQUEST._serialized_end=132 _QUERYPARAMSRESPONSE._serialized_start=134 _QUERYPARAMSRESPONSE._serialized_end=201 - _QUERYTRADERPOSITIONREQUEST._serialized_start=203 - _QUERYTRADERPOSITIONREQUEST._serialized_end=267 - _QUERYTRADERPOSITIONRESPONSE._serialized_start=270 - _QUERYTRADERPOSITIONRESPONSE._serialized_end=663 - _QUERY._serialized_start=666 - _QUERY._serialized_end=936 + _QUERYPOSITIONSREQUEST._serialized_start=203 + _QUERYPOSITIONSREQUEST._serialized_end=242 + _QUERYPOSITIONSRESPONSE._serialized_start=244 + _QUERYPOSITIONSRESPONSE._serialized_end=326 + _QUERYPOSITIONREQUEST._serialized_start=328 + _QUERYPOSITIONREQUEST._serialized_end=386 + _QUERYPOSITIONRESPONSE._serialized_start=389 + _QUERYPOSITIONRESPONSE._serialized_end=776 + _QUERYFUNDINGRATESREQUEST._serialized_start=778 + _QUERYFUNDINGRATESREQUEST._serialized_end=818 + _QUERYFUNDINGRATESRESPONSE._serialized_start=820 + _QUERYFUNDINGRATESRESPONSE._serialized_end=929 + _QUERY._serialized_start=932 + _QUERY._serialized_end=1443 # @@protoc_insertion_point(module_scope) diff --git a/nibiru_proto/proto/perp/v1/query_pb2.pyi b/nibiru_proto/proto/perp/v1/query_pb2.pyi index 1daef72..2ccf9e0 100644 --- a/nibiru_proto/proto/perp/v1/query_pb2.pyi +++ b/nibiru_proto/proto/perp/v1/query_pb2.pyi @@ -4,6 +4,7 @@ isort:skip_file """ import builtins import google.protobuf.descriptor +import google.protobuf.internal.containers import google.protobuf.message import perp.v1.state_pb2 import typing @@ -37,11 +38,35 @@ class QueryParamsResponse(google.protobuf.message.Message): def ClearField(self, field_name: typing_extensions.Literal["params",b"params"]) -> None: ... global___QueryParamsResponse = QueryParamsResponse -class QueryTraderPositionRequest(google.protobuf.message.Message): - """---------------------------------------- TraderPosition +class QueryPositionsRequest(google.protobuf.message.Message): + """---------------------------------------- Positions""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + TRADER_FIELD_NUMBER: builtins.int + trader: typing.Text + def __init__(self, + *, + trader: typing.Text = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["trader",b"trader"]) -> None: ... +global___QueryPositionsRequest = QueryPositionsRequest - QueryTraderPositionRequest is the request type for the position of the - x/perp module account. +class QueryPositionsResponse(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + POSITIONS_FIELD_NUMBER: builtins.int + @property + def positions(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___QueryPositionResponse]: ... + def __init__(self, + *, + positions: typing.Optional[typing.Iterable[global___QueryPositionResponse]] = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["positions",b"positions"]) -> None: ... +global___QueryPositionsResponse = QueryPositionsResponse + +class QueryPositionRequest(google.protobuf.message.Message): + """---------------------------------------- Position + + QueryPositionRequest is the request type for the position of the x/perp + module account. """ DESCRIPTOR: google.protobuf.descriptor.Descriptor TOKEN_PAIR_FIELD_NUMBER: builtins.int @@ -54,9 +79,9 @@ class QueryTraderPositionRequest(google.protobuf.message.Message): trader: typing.Text = ..., ) -> None: ... def ClearField(self, field_name: typing_extensions.Literal["token_pair",b"token_pair","trader",b"trader"]) -> None: ... -global___QueryTraderPositionRequest = QueryTraderPositionRequest +global___QueryPositionRequest = QueryPositionRequest -class QueryTraderPositionResponse(google.protobuf.message.Message): +class QueryPositionResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor POSITION_FIELD_NUMBER: builtins.int POSITION_NOTIONAL_FIELD_NUMBER: builtins.int @@ -69,20 +94,23 @@ class QueryTraderPositionResponse(google.protobuf.message.Message): """The position as it exists in the blockchain state""" pass position_notional: typing.Text - """The position's current notional value, if it were to be entirely closed (in margin units).""" + """The position's current notional value, if it were to be entirely closed (in + margin units). + """ unrealized_pnl: typing.Text """The position's unrealized PnL.""" margin_ratio_mark: typing.Text """margin ratio of the position based on the mark price, mark TWAP. The higher - value of the possible margin ratios (TWAP and instantaneous) is taken to be - 'marginRatioMark'. Calculated from margin, unrealized PnL, and position notional. + value of the possible margin ratios (TWAP and instantaneous) is taken to be + 'marginRatioMark'. Calculated from margin, unrealized PnL, and position + notional. """ margin_ratio_index: typing.Text - """margin ratio of the position based on the index price. Calculated from margin, - unrealized PnL, and position notional. + """margin ratio of the position based on the index price. Calculated from + margin, unrealized PnL, and position notional. """ block_number: builtins.int @@ -99,4 +127,36 @@ class QueryTraderPositionResponse(google.protobuf.message.Message): ) -> None: ... def HasField(self, field_name: typing_extensions.Literal["position",b"position"]) -> builtins.bool: ... def ClearField(self, field_name: typing_extensions.Literal["block_number",b"block_number","margin_ratio_index",b"margin_ratio_index","margin_ratio_mark",b"margin_ratio_mark","position",b"position","position_notional",b"position_notional","unrealized_pnl",b"unrealized_pnl"]) -> None: ... -global___QueryTraderPositionResponse = QueryTraderPositionResponse +global___QueryPositionResponse = QueryPositionResponse + +class QueryFundingRatesRequest(google.protobuf.message.Message): + """---------------------------------------- FundingPayments + + """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PAIR_FIELD_NUMBER: builtins.int + pair: typing.Text + """the pair to query for""" + + def __init__(self, + *, + pair: typing.Text = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["pair",b"pair"]) -> None: ... +global___QueryFundingRatesRequest = QueryFundingRatesRequest + +class QueryFundingRatesResponse(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + CUMULATIVE_FUNDING_RATES_FIELD_NUMBER: builtins.int + @property + def cumulative_funding_rates(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: + """a historical list of cumulative funding rates, with the most recent one + last + """ + pass + def __init__(self, + *, + cumulative_funding_rates: typing.Optional[typing.Iterable[typing.Text]] = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["cumulative_funding_rates",b"cumulative_funding_rates"]) -> None: ... +global___QueryFundingRatesResponse = QueryFundingRatesResponse diff --git a/nibiru_proto/proto/perp/v1/query_pb2_grpc.py b/nibiru_proto/proto/perp/v1/query_pb2_grpc.py index 5d6c92a..ef01554 100644 --- a/nibiru_proto/proto/perp/v1/query_pb2_grpc.py +++ b/nibiru_proto/proto/perp/v1/query_pb2_grpc.py @@ -20,10 +20,20 @@ def __init__(self, channel): request_serializer=perp_dot_v1_dot_query__pb2.QueryParamsRequest.SerializeToString, response_deserializer=perp_dot_v1_dot_query__pb2.QueryParamsResponse.FromString, ) - self.QueryTraderPosition = channel.unary_unary( - '/nibiru.perp.v1.Query/QueryTraderPosition', - request_serializer=perp_dot_v1_dot_query__pb2.QueryTraderPositionRequest.SerializeToString, - response_deserializer=perp_dot_v1_dot_query__pb2.QueryTraderPositionResponse.FromString, + self.QueryPosition = channel.unary_unary( + '/nibiru.perp.v1.Query/QueryPosition', + request_serializer=perp_dot_v1_dot_query__pb2.QueryPositionRequest.SerializeToString, + response_deserializer=perp_dot_v1_dot_query__pb2.QueryPositionResponse.FromString, + ) + self.QueryPositions = channel.unary_unary( + '/nibiru.perp.v1.Query/QueryPositions', + request_serializer=perp_dot_v1_dot_query__pb2.QueryPositionsRequest.SerializeToString, + response_deserializer=perp_dot_v1_dot_query__pb2.QueryPositionsResponse.FromString, + ) + self.FundingRates = channel.unary_unary( + '/nibiru.perp.v1.Query/FundingRates', + request_serializer=perp_dot_v1_dot_query__pb2.QueryFundingRatesRequest.SerializeToString, + response_deserializer=perp_dot_v1_dot_query__pb2.QueryFundingRatesResponse.FromString, ) @@ -38,7 +48,19 @@ def Params(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') - def QueryTraderPosition(self, request, context): + def QueryPosition(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def QueryPositions(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def FundingRates(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') @@ -52,10 +74,20 @@ def add_QueryServicer_to_server(servicer, server): request_deserializer=perp_dot_v1_dot_query__pb2.QueryParamsRequest.FromString, response_serializer=perp_dot_v1_dot_query__pb2.QueryParamsResponse.SerializeToString, ), - 'QueryTraderPosition': grpc.unary_unary_rpc_method_handler( - servicer.QueryTraderPosition, - request_deserializer=perp_dot_v1_dot_query__pb2.QueryTraderPositionRequest.FromString, - response_serializer=perp_dot_v1_dot_query__pb2.QueryTraderPositionResponse.SerializeToString, + 'QueryPosition': grpc.unary_unary_rpc_method_handler( + servicer.QueryPosition, + request_deserializer=perp_dot_v1_dot_query__pb2.QueryPositionRequest.FromString, + response_serializer=perp_dot_v1_dot_query__pb2.QueryPositionResponse.SerializeToString, + ), + 'QueryPositions': grpc.unary_unary_rpc_method_handler( + servicer.QueryPositions, + request_deserializer=perp_dot_v1_dot_query__pb2.QueryPositionsRequest.FromString, + response_serializer=perp_dot_v1_dot_query__pb2.QueryPositionsResponse.SerializeToString, + ), + 'FundingRates': grpc.unary_unary_rpc_method_handler( + servicer.FundingRates, + request_deserializer=perp_dot_v1_dot_query__pb2.QueryFundingRatesRequest.FromString, + response_serializer=perp_dot_v1_dot_query__pb2.QueryFundingRatesResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( @@ -86,7 +118,41 @@ def Params(request, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def QueryTraderPosition(request, + def QueryPosition(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/nibiru.perp.v1.Query/QueryPosition', + perp_dot_v1_dot_query__pb2.QueryPositionRequest.SerializeToString, + perp_dot_v1_dot_query__pb2.QueryPositionResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def QueryPositions(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/nibiru.perp.v1.Query/QueryPositions', + perp_dot_v1_dot_query__pb2.QueryPositionsRequest.SerializeToString, + perp_dot_v1_dot_query__pb2.QueryPositionsResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def FundingRates(request, target, options=(), channel_credentials=None, @@ -96,8 +162,8 @@ def QueryTraderPosition(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/nibiru.perp.v1.Query/QueryTraderPosition', - perp_dot_v1_dot_query__pb2.QueryTraderPositionRequest.SerializeToString, - perp_dot_v1_dot_query__pb2.QueryTraderPositionResponse.FromString, + return grpc.experimental.unary_unary(request, target, '/nibiru.perp.v1.Query/FundingRates', + perp_dot_v1_dot_query__pb2.QueryFundingRatesRequest.SerializeToString, + perp_dot_v1_dot_query__pb2.QueryFundingRatesResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/nibiru_proto/proto/perp/v1/query_pb2_grpc.pyi b/nibiru_proto/proto/perp/v1/query_pb2_grpc.pyi index c6faea5..01d5aa6 100644 --- a/nibiru_proto/proto/perp/v1/query_pb2_grpc.pyi +++ b/nibiru_proto/proto/perp/v1/query_pb2_grpc.pyi @@ -14,9 +14,17 @@ class QueryStub: perp.v1.query_pb2.QueryParamsResponse] """Parameters queries the parameters of the x/perp module.""" - QueryTraderPosition: grpc.UnaryUnaryMultiCallable[ - perp.v1.query_pb2.QueryTraderPositionRequest, - perp.v1.query_pb2.QueryTraderPositionResponse] + QueryPosition: grpc.UnaryUnaryMultiCallable[ + perp.v1.query_pb2.QueryPositionRequest, + perp.v1.query_pb2.QueryPositionResponse] + + QueryPositions: grpc.UnaryUnaryMultiCallable[ + perp.v1.query_pb2.QueryPositionsRequest, + perp.v1.query_pb2.QueryPositionsResponse] + + FundingRates: grpc.UnaryUnaryMultiCallable[ + perp.v1.query_pb2.QueryFundingRatesRequest, + perp.v1.query_pb2.QueryFundingRatesResponse] class QueryServicer(metaclass=abc.ABCMeta): @@ -30,10 +38,22 @@ class QueryServicer(metaclass=abc.ABCMeta): pass @abc.abstractmethod - def QueryTraderPosition(self, - request: perp.v1.query_pb2.QueryTraderPositionRequest, + def QueryPosition(self, + request: perp.v1.query_pb2.QueryPositionRequest, + context: grpc.ServicerContext, + ) -> perp.v1.query_pb2.QueryPositionResponse: ... + + @abc.abstractmethod + def QueryPositions(self, + request: perp.v1.query_pb2.QueryPositionsRequest, + context: grpc.ServicerContext, + ) -> perp.v1.query_pb2.QueryPositionsResponse: ... + + @abc.abstractmethod + def FundingRates(self, + request: perp.v1.query_pb2.QueryFundingRatesRequest, context: grpc.ServicerContext, - ) -> perp.v1.query_pb2.QueryTraderPositionResponse: ... + ) -> perp.v1.query_pb2.QueryFundingRatesResponse: ... def add_QueryServicer_to_server(servicer: QueryServicer, server: grpc.Server) -> None: ... diff --git a/nibiru_proto/proto/perp/v1/state_pb2.py b/nibiru_proto/proto/perp/v1/state_pb2.py index 9f9b17a..78b4a12 100644 --- a/nibiru_proto/proto/perp/v1/state_pb2.py +++ b/nibiru_proto/proto/perp/v1/state_pb2.py @@ -20,7 +20,7 @@ from common import common_pb2 as common_dot_common__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13perp/v1/state.proto\x12\x0enibiru.perp.v1\x1a\x14gogoproto/gogo.proto\x1a\x1e\x63osmos/base/v1beta1/coin.proto\x1a\x19\x63osmos_proto/cosmos.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x13\x63ommon/common.proto\"\xfd\x03\n\x06Params\x12\x0f\n\x07stopped\x18\x01 \x01(\x08\x12J\n\x12\x66\x65\x65_pool_fee_ratio\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12P\n\x18\x65\x63osystem_fund_fee_ratio\x18\x04 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12M\n\x15liquidation_fee_ratio\x18\x05 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12Q\n\x19partial_liquidation_ratio\x18\x06 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x1d\n\x15\x66unding_rate_interval\x18\x07 \x01(\t\x12\x82\x01\n\x14twap_lookback_window\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationBI\xc8\xde\x1f\x00\x98\xdf\x1f\x01\xea\xde\x1f\x1etwap_lookback_window,omitempty\xf2\xde\x1f\x1byaml:\"twap_lookback_window\"\"\x88\x04\n\x0cGenesisState\x12,\n\x06params\x18\x01 \x01(\x0b\x32\x16.nibiru.perp.v1.ParamsB\x04\xc8\xde\x1f\x00\x12W\n\rvault_balance\x18\x02 \x03(\x0b\x32\x19.cosmos.base.v1beta1.CoinB%\xf2\xde\x1f\x1dyaml:\"module_account_balance\"\xc8\xde\x1f\x00\x12Y\n\x0fperp_ef_balance\x18\x03 \x03(\x0b\x32\x19.cosmos.base.v1beta1.CoinB%\xf2\xde\x1f\x1dyaml:\"module_account_balance\"\xc8\xde\x1f\x00\x12Z\n\x10\x66\x65\x65_pool_balance\x18\x04 \x03(\x0b\x32\x19.cosmos.base.v1beta1.CoinB%\xf2\xde\x1f\x1dyaml:\"module_account_balance\"\xc8\xde\x1f\x00\x12\x33\n\rpair_metadata\x18\x05 \x03(\x0b\x32\x1c.nibiru.perp.v1.PairMetadata\x12+\n\tpositions\x18\x06 \x03(\x0b\x32\x18.nibiru.perp.v1.Position\x12\x39\n\x11prepaid_bad_debts\x18\x07 \x03(\x0b\x32\x1e.nibiru.perp.v1.PrepaidBadDebt\x12\x1d\n\x15whitelisted_addresses\x18\x08 \x03(\t\"\x8c\x03\n\x08Position\x12\x16\n\x0etrader_address\x18\x01 \x01(\t\x12,\n\x04pair\x18\x02 \x01(\x0b\x32\x18.nibiru.common.AssetPairB\x04\xc8\xde\x1f\x00\x12<\n\x04size\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12>\n\x06margin\x18\x04 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x45\n\ropen_notional\x18\x05 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12_\n\'last_update_cumulative_premium_fraction\x18\x06 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x14\n\x0c\x62lock_number\x18\x07 \x01(\x03\"\x90\x05\n\x0cPositionResp\x12*\n\x08position\x18\x01 \x01(\x0b\x32\x18.nibiru.perp.v1.Position\x12P\n\x18\x65xchanged_notional_value\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12O\n\x17\x65xchanged_position_size\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12@\n\x08\x62\x61\x64_debt\x18\x04 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12G\n\x0f\x66unding_payment\x18\x05 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x44\n\x0crealized_pnl\x18\x06 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12L\n\x14unrealized_pnl_after\x18\x07 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12G\n\x0fmargin_to_vault\x18\x08 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12I\n\x11position_notional\x18\t \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\"\xb9\x02\n\rLiquidateResp\x12@\n\x08\x62\x61\x64_debt\x18\x01 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\x00\x12I\n\x11\x66\x65\x65_to_liquidator\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\x00\x12R\n\x1a\x66\x65\x65_to_perp_ecosystem_fund\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\x00\x12\x12\n\nliquidator\x18\x04 \x01(\t\x12\x33\n\rposition_resp\x18\x05 \x01(\x0b\x32\x1c.nibiru.perp.v1.PositionResp\"\x92\x01\n\x0cPairMetadata\x12,\n\x04pair\x18\x01 \x01(\x0b\x32\x18.nibiru.common.AssetPairB\x04\xc8\xde\x1f\x00\x12T\n\x1c\x63umulative_premium_fractions\x18\x02 \x03(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\"_\n\x0ePrepaidBadDebt\x12\r\n\x05\x64\x65nom\x18\x01 \x01(\t\x12>\n\x06\x61mount\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\x00*/\n\x04Side\x12\x14\n\x10SIDE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x42UY\x10\x01\x12\x08\n\x04SELL\x10\x02*V\n\rPnLCalcOption\x12\x1f\n\x1bPNL_CALC_OPTION_UNSPECIFIED\x10\x00\x12\x0e\n\nSPOT_PRICE\x10\x01\x12\x08\n\x04TWAP\x10\x02\x12\n\n\x06ORACLE\x10\x03*G\n\x13PnLPreferenceOption\x12\x1e\n\x1aPNL_PREFERENCE_UNSPECIFIED\x10\x00\x12\x07\n\x03MAX\x10\x01\x12\x07\n\x03MIN\x10\x02*q\n\x1cMarginCalculationPriceOption\x12/\n+MARGIN_CALCULATION_PRICE_OPTION_UNSPECIFIED\x10\x00\x12\x08\n\x04SPOT\x10\x01\x12\t\n\x05INDEX\x10\x02\x12\x0b\n\x07MAX_PNL\x10\x03\x42,Z*github.com/NibiruChain/nibiru/x/perp/typesb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13perp/v1/state.proto\x12\x0enibiru.perp.v1\x1a\x14gogoproto/gogo.proto\x1a\x1e\x63osmos/base/v1beta1/coin.proto\x1a\x19\x63osmos_proto/cosmos.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x13\x63ommon/common.proto\"\x9e\x04\n\x06Params\x12\x0f\n\x07stopped\x18\x01 \x01(\x08\x12J\n\x12\x66\x65\x65_pool_fee_ratio\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12P\n\x18\x65\x63osystem_fund_fee_ratio\x18\x04 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12M\n\x15liquidation_fee_ratio\x18\x05 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12Q\n\x19partial_liquidation_ratio\x18\x06 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x1d\n\x15\x66unding_rate_interval\x18\x07 \x01(\t\x12\x82\x01\n\x14twap_lookback_window\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationBI\xc8\xde\x1f\x00\x98\xdf\x1f\x01\xea\xde\x1f\x1etwap_lookback_window,omitempty\xf2\xde\x1f\x1byaml:\"twap_lookback_window\"\x12\x1f\n\x17whitelisted_liquidators\x18\t \x03(\t\"\x87\x03\n\x08Position\x12\x16\n\x0etrader_address\x18\x01 \x01(\t\x12,\n\x04pair\x18\x02 \x01(\x0b\x32\x18.nibiru.common.AssetPairB\x04\xc8\xde\x1f\x00\x12<\n\x04size\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12>\n\x06margin\x18\x04 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x45\n\ropen_notional\x18\x05 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12Z\n\"latest_cumulative_premium_fraction\x18\x06 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x14\n\x0c\x62lock_number\x18\x07 \x01(\x03\"\x92\x01\n\x0cPairMetadata\x12,\n\x04pair\x18\x01 \x01(\x0b\x32\x18.nibiru.common.AssetPairB\x04\xc8\xde\x1f\x00\x12T\n\x1c\x63umulative_premium_fractions\x18\x02 \x03(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\"_\n\x0ePrepaidBadDebt\x12\r\n\x05\x64\x65nom\x18\x01 \x01(\t\x12>\n\x06\x61mount\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\x00\"\x90\x05\n\x0cPositionResp\x12*\n\x08position\x18\x01 \x01(\x0b\x32\x18.nibiru.perp.v1.Position\x12P\n\x18\x65xchanged_notional_value\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12O\n\x17\x65xchanged_position_size\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12@\n\x08\x62\x61\x64_debt\x18\x04 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12G\n\x0f\x66unding_payment\x18\x05 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x44\n\x0crealized_pnl\x18\x06 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12L\n\x14unrealized_pnl_after\x18\x07 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12G\n\x0fmargin_to_vault\x18\x08 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12I\n\x11position_notional\x18\t \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\"\xb9\x02\n\rLiquidateResp\x12@\n\x08\x62\x61\x64_debt\x18\x01 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\x00\x12I\n\x11\x66\x65\x65_to_liquidator\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\x00\x12R\n\x1a\x66\x65\x65_to_perp_ecosystem_fund\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\x00\x12\x12\n\nliquidator\x18\x04 \x01(\t\x12\x33\n\rposition_resp\x18\x05 \x01(\x0b\x32\x1c.nibiru.perp.v1.PositionResp*/\n\x04Side\x12\x14\n\x10SIDE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x42UY\x10\x01\x12\x08\n\x04SELL\x10\x02*V\n\rPnLCalcOption\x12\x1f\n\x1bPNL_CALC_OPTION_UNSPECIFIED\x10\x00\x12\x0e\n\nSPOT_PRICE\x10\x01\x12\x08\n\x04TWAP\x10\x02\x12\n\n\x06ORACLE\x10\x03*G\n\x13PnLPreferenceOption\x12\x1e\n\x1aPNL_PREFERENCE_UNSPECIFIED\x10\x00\x12\x07\n\x03MAX\x10\x01\x12\x07\n\x03MIN\x10\x02*q\n\x1cMarginCalculationPriceOption\x12/\n+MARGIN_CALCULATION_PRICE_OPTION_UNSPECIFIED\x10\x00\x12\x08\n\x04SPOT\x10\x01\x12\t\n\x05INDEX\x10\x02\x12\x0b\n\x07MAX_PNL\x10\x03\x42,Z*github.com/NibiruChain/nibiru/x/perp/typesb\x06proto3') _SIDE = DESCRIPTOR.enum_types_by_name['Side'] Side = enum_type_wrapper.EnumTypeWrapper(_SIDE) @@ -47,12 +47,11 @@ _PARAMS = DESCRIPTOR.message_types_by_name['Params'] -_GENESISSTATE = DESCRIPTOR.message_types_by_name['GenesisState'] _POSITION = DESCRIPTOR.message_types_by_name['Position'] -_POSITIONRESP = DESCRIPTOR.message_types_by_name['PositionResp'] -_LIQUIDATERESP = DESCRIPTOR.message_types_by_name['LiquidateResp'] _PAIRMETADATA = DESCRIPTOR.message_types_by_name['PairMetadata'] _PREPAIDBADDEBT = DESCRIPTOR.message_types_by_name['PrepaidBadDebt'] +_POSITIONRESP = DESCRIPTOR.message_types_by_name['PositionResp'] +_LIQUIDATERESP = DESCRIPTOR.message_types_by_name['LiquidateResp'] Params = _reflection.GeneratedProtocolMessageType('Params', (_message.Message,), { 'DESCRIPTOR' : _PARAMS, '__module__' : 'perp.v1.state_pb2' @@ -60,13 +59,6 @@ }) _sym_db.RegisterMessage(Params) -GenesisState = _reflection.GeneratedProtocolMessageType('GenesisState', (_message.Message,), { - 'DESCRIPTOR' : _GENESISSTATE, - '__module__' : 'perp.v1.state_pb2' - # @@protoc_insertion_point(class_scope:nibiru.perp.v1.GenesisState) - }) -_sym_db.RegisterMessage(GenesisState) - Position = _reflection.GeneratedProtocolMessageType('Position', (_message.Message,), { 'DESCRIPTOR' : _POSITION, '__module__' : 'perp.v1.state_pb2' @@ -74,20 +66,6 @@ }) _sym_db.RegisterMessage(Position) -PositionResp = _reflection.GeneratedProtocolMessageType('PositionResp', (_message.Message,), { - 'DESCRIPTOR' : _POSITIONRESP, - '__module__' : 'perp.v1.state_pb2' - # @@protoc_insertion_point(class_scope:nibiru.perp.v1.PositionResp) - }) -_sym_db.RegisterMessage(PositionResp) - -LiquidateResp = _reflection.GeneratedProtocolMessageType('LiquidateResp', (_message.Message,), { - 'DESCRIPTOR' : _LIQUIDATERESP, - '__module__' : 'perp.v1.state_pb2' - # @@protoc_insertion_point(class_scope:nibiru.perp.v1.LiquidateResp) - }) -_sym_db.RegisterMessage(LiquidateResp) - PairMetadata = _reflection.GeneratedProtocolMessageType('PairMetadata', (_message.Message,), { 'DESCRIPTOR' : _PAIRMETADATA, '__module__' : 'perp.v1.state_pb2' @@ -102,6 +80,20 @@ }) _sym_db.RegisterMessage(PrepaidBadDebt) +PositionResp = _reflection.GeneratedProtocolMessageType('PositionResp', (_message.Message,), { + 'DESCRIPTOR' : _POSITIONRESP, + '__module__' : 'perp.v1.state_pb2' + # @@protoc_insertion_point(class_scope:nibiru.perp.v1.PositionResp) + }) +_sym_db.RegisterMessage(PositionResp) + +LiquidateResp = _reflection.GeneratedProtocolMessageType('LiquidateResp', (_message.Message,), { + 'DESCRIPTOR' : _LIQUIDATERESP, + '__module__' : 'perp.v1.state_pb2' + # @@protoc_insertion_point(class_scope:nibiru.perp.v1.LiquidateResp) + }) +_sym_db.RegisterMessage(LiquidateResp) + if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None @@ -116,14 +108,6 @@ _PARAMS.fields_by_name['partial_liquidation_ratio']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' _PARAMS.fields_by_name['twap_lookback_window']._options = None _PARAMS.fields_by_name['twap_lookback_window']._serialized_options = b'\310\336\037\000\230\337\037\001\352\336\037\036twap_lookback_window,omitempty\362\336\037\033yaml:\"twap_lookback_window\"' - _GENESISSTATE.fields_by_name['params']._options = None - _GENESISSTATE.fields_by_name['params']._serialized_options = b'\310\336\037\000' - _GENESISSTATE.fields_by_name['vault_balance']._options = None - _GENESISSTATE.fields_by_name['vault_balance']._serialized_options = b'\362\336\037\035yaml:\"module_account_balance\"\310\336\037\000' - _GENESISSTATE.fields_by_name['perp_ef_balance']._options = None - _GENESISSTATE.fields_by_name['perp_ef_balance']._serialized_options = b'\362\336\037\035yaml:\"module_account_balance\"\310\336\037\000' - _GENESISSTATE.fields_by_name['fee_pool_balance']._options = None - _GENESISSTATE.fields_by_name['fee_pool_balance']._serialized_options = b'\362\336\037\035yaml:\"module_account_balance\"\310\336\037\000' _POSITION.fields_by_name['pair']._options = None _POSITION.fields_by_name['pair']._serialized_options = b'\310\336\037\000' _POSITION.fields_by_name['size']._options = None @@ -132,8 +116,14 @@ _POSITION.fields_by_name['margin']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' _POSITION.fields_by_name['open_notional']._options = None _POSITION.fields_by_name['open_notional']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' - _POSITION.fields_by_name['last_update_cumulative_premium_fraction']._options = None - _POSITION.fields_by_name['last_update_cumulative_premium_fraction']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' + _POSITION.fields_by_name['latest_cumulative_premium_fraction']._options = None + _POSITION.fields_by_name['latest_cumulative_premium_fraction']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' + _PAIRMETADATA.fields_by_name['pair']._options = None + _PAIRMETADATA.fields_by_name['pair']._serialized_options = b'\310\336\037\000' + _PAIRMETADATA.fields_by_name['cumulative_premium_fractions']._options = None + _PAIRMETADATA.fields_by_name['cumulative_premium_fractions']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' + _PREPAIDBADDEBT.fields_by_name['amount']._options = None + _PREPAIDBADDEBT.fields_by_name['amount']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Int\310\336\037\000' _POSITIONRESP.fields_by_name['exchanged_notional_value']._options = None _POSITIONRESP.fields_by_name['exchanged_notional_value']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' _POSITIONRESP.fields_by_name['exchanged_position_size']._options = None @@ -156,32 +146,24 @@ _LIQUIDATERESP.fields_by_name['fee_to_liquidator']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Int\310\336\037\000' _LIQUIDATERESP.fields_by_name['fee_to_perp_ecosystem_fund']._options = None _LIQUIDATERESP.fields_by_name['fee_to_perp_ecosystem_fund']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Int\310\336\037\000' - _PAIRMETADATA.fields_by_name['pair']._options = None - _PAIRMETADATA.fields_by_name['pair']._serialized_options = b'\310\336\037\000' - _PAIRMETADATA.fields_by_name['cumulative_premium_fractions']._options = None - _PAIRMETADATA.fields_by_name['cumulative_premium_fractions']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' - _PREPAIDBADDEBT.fields_by_name['amount']._options = None - _PREPAIDBADDEBT.fields_by_name['amount']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Int\310\336\037\000' - _SIDE._serialized_start=2828 - _SIDE._serialized_end=2875 - _PNLCALCOPTION._serialized_start=2877 - _PNLCALCOPTION._serialized_end=2963 - _PNLPREFERENCEOPTION._serialized_start=2965 - _PNLPREFERENCEOPTION._serialized_end=3036 - _MARGINCALCULATIONPRICEOPTION._serialized_start=3038 - _MARGINCALCULATIONPRICEOPTION._serialized_end=3151 + _SIDE._serialized_start=2333 + _SIDE._serialized_end=2380 + _PNLCALCOPTION._serialized_start=2382 + _PNLCALCOPTION._serialized_end=2468 + _PNLPREFERENCEOPTION._serialized_start=2470 + _PNLPREFERENCEOPTION._serialized_end=2541 + _MARGINCALCULATIONPRICEOPTION._serialized_start=2543 + _MARGINCALCULATIONPRICEOPTION._serialized_end=2656 _PARAMS._serialized_start=174 - _PARAMS._serialized_end=683 - _GENESISSTATE._serialized_start=686 - _GENESISSTATE._serialized_end=1206 - _POSITION._serialized_start=1209 - _POSITION._serialized_end=1605 - _POSITIONRESP._serialized_start=1608 - _POSITIONRESP._serialized_end=2264 - _LIQUIDATERESP._serialized_start=2267 - _LIQUIDATERESP._serialized_end=2580 - _PAIRMETADATA._serialized_start=2583 - _PAIRMETADATA._serialized_end=2729 - _PREPAIDBADDEBT._serialized_start=2731 - _PREPAIDBADDEBT._serialized_end=2826 + _PARAMS._serialized_end=716 + _POSITION._serialized_start=719 + _POSITION._serialized_end=1110 + _PAIRMETADATA._serialized_start=1113 + _PAIRMETADATA._serialized_end=1259 + _PREPAIDBADDEBT._serialized_start=1261 + _PREPAIDBADDEBT._serialized_end=1356 + _POSITIONRESP._serialized_start=1359 + _POSITIONRESP._serialized_end=2015 + _LIQUIDATERESP._serialized_start=2018 + _LIQUIDATERESP._serialized_end=2331 # @@protoc_insertion_point(module_scope) diff --git a/nibiru_proto/proto/perp/v1/state_pb2.pyi b/nibiru_proto/proto/perp/v1/state_pb2.pyi index 9c26294..27461e5 100644 --- a/nibiru_proto/proto/perp/v1/state_pb2.pyi +++ b/nibiru_proto/proto/perp/v1/state_pb2.pyi @@ -4,7 +4,6 @@ isort:skip_file """ import builtins import common.common_pb2 -import cosmos.base.v1beta1.coin_pb2 import google.protobuf.descriptor import google.protobuf.duration_pb2 import google.protobuf.internal.containers @@ -96,6 +95,7 @@ class Params(google.protobuf.message.Message): PARTIAL_LIQUIDATION_RATIO_FIELD_NUMBER: builtins.int FUNDING_RATE_INTERVAL_FIELD_NUMBER: builtins.int TWAP_LOOKBACK_WINDOW_FIELD_NUMBER: builtins.int + WHITELISTED_LIQUIDATORS_FIELD_NUMBER: builtins.int stopped: builtins.bool """stopped identifies if the perp exchange is stopped or not""" @@ -106,13 +106,15 @@ class Params(google.protobuf.message.Message): """EcosystemFundFeeRatio is the ratio transferred to the PerpEF.""" liquidation_fee_ratio: typing.Text - """LiquidationFeeRatio is the percentage of liquidated position that will be given - to out as a reward. Half of the liquidation fee is given to the liquidator, - and the other half is given to the ecosystem fund. + """LiquidationFeeRatio is the percentage of liquidated position that will be + given to out as a reward. Half of the liquidation fee is given to the + liquidator, and the other half is given to the ecosystem fund. """ partial_liquidation_ratio: typing.Text - """PartialLiquidationRatio is the share we try to liquidate if the margin is higher than liquidation fee""" + """PartialLiquidationRatio is the share we try to liquidate if the margin is + higher than liquidation fee + """ funding_rate_interval: typing.Text """specifies the interval on which the funding rate is updated""" @@ -121,6 +123,12 @@ class Params(google.protobuf.message.Message): def twap_lookback_window(self) -> google.protobuf.duration_pb2.Duration: """amount of time to look back for TWAP calculations""" pass + @property + def whitelisted_liquidators(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: + """whitelisted_liquidators defines the list of addresses + which are allowed to liquidate a position. + """ + pass def __init__(self, *, stopped: builtins.bool = ..., @@ -130,53 +138,12 @@ class Params(google.protobuf.message.Message): partial_liquidation_ratio: typing.Text = ..., funding_rate_interval: typing.Text = ..., twap_lookback_window: typing.Optional[google.protobuf.duration_pb2.Duration] = ..., + whitelisted_liquidators: typing.Optional[typing.Iterable[typing.Text]] = ..., ) -> None: ... def HasField(self, field_name: typing_extensions.Literal["twap_lookback_window",b"twap_lookback_window"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["ecosystem_fund_fee_ratio",b"ecosystem_fund_fee_ratio","fee_pool_fee_ratio",b"fee_pool_fee_ratio","funding_rate_interval",b"funding_rate_interval","liquidation_fee_ratio",b"liquidation_fee_ratio","partial_liquidation_ratio",b"partial_liquidation_ratio","stopped",b"stopped","twap_lookback_window",b"twap_lookback_window"]) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["ecosystem_fund_fee_ratio",b"ecosystem_fund_fee_ratio","fee_pool_fee_ratio",b"fee_pool_fee_ratio","funding_rate_interval",b"funding_rate_interval","liquidation_fee_ratio",b"liquidation_fee_ratio","partial_liquidation_ratio",b"partial_liquidation_ratio","stopped",b"stopped","twap_lookback_window",b"twap_lookback_window","whitelisted_liquidators",b"whitelisted_liquidators"]) -> None: ... global___Params = Params -class GenesisState(google.protobuf.message.Message): - """GenesisState defines the perp module's genesis state.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - PARAMS_FIELD_NUMBER: builtins.int - VAULT_BALANCE_FIELD_NUMBER: builtins.int - PERP_EF_BALANCE_FIELD_NUMBER: builtins.int - FEE_POOL_BALANCE_FIELD_NUMBER: builtins.int - PAIR_METADATA_FIELD_NUMBER: builtins.int - POSITIONS_FIELD_NUMBER: builtins.int - PREPAID_BAD_DEBTS_FIELD_NUMBER: builtins.int - WHITELISTED_ADDRESSES_FIELD_NUMBER: builtins.int - @property - def params(self) -> global___Params: ... - @property - def vault_balance(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[cosmos.base.v1beta1.coin_pb2.Coin]: ... - @property - def perp_ef_balance(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[cosmos.base.v1beta1.coin_pb2.Coin]: ... - @property - def fee_pool_balance(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[cosmos.base.v1beta1.coin_pb2.Coin]: ... - @property - def pair_metadata(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___PairMetadata]: ... - @property - def positions(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Position]: ... - @property - def prepaid_bad_debts(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___PrepaidBadDebt]: ... - @property - def whitelisted_addresses(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: ... - def __init__(self, - *, - params: typing.Optional[global___Params] = ..., - vault_balance: typing.Optional[typing.Iterable[cosmos.base.v1beta1.coin_pb2.Coin]] = ..., - perp_ef_balance: typing.Optional[typing.Iterable[cosmos.base.v1beta1.coin_pb2.Coin]] = ..., - fee_pool_balance: typing.Optional[typing.Iterable[cosmos.base.v1beta1.coin_pb2.Coin]] = ..., - pair_metadata: typing.Optional[typing.Iterable[global___PairMetadata]] = ..., - positions: typing.Optional[typing.Iterable[global___Position]] = ..., - prepaid_bad_debts: typing.Optional[typing.Iterable[global___PrepaidBadDebt]] = ..., - whitelisted_addresses: typing.Optional[typing.Iterable[typing.Text]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["params",b"params"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["fee_pool_balance",b"fee_pool_balance","pair_metadata",b"pair_metadata","params",b"params","perp_ef_balance",b"perp_ef_balance","positions",b"positions","prepaid_bad_debts",b"prepaid_bad_debts","vault_balance",b"vault_balance","whitelisted_addresses",b"whitelisted_addresses"]) -> None: ... -global___GenesisState = GenesisState - class Position(google.protobuf.message.Message): """Position identifies and records information on a user's position on one of the virtual liquidity pools. @@ -187,7 +154,7 @@ class Position(google.protobuf.message.Message): SIZE_FIELD_NUMBER: builtins.int MARGIN_FIELD_NUMBER: builtins.int OPEN_NOTIONAL_FIELD_NUMBER: builtins.int - LAST_UPDATE_CUMULATIVE_PREMIUM_FRACTION_FIELD_NUMBER: builtins.int + LATEST_CUMULATIVE_PREMIUM_FRACTION_FIELD_NUMBER: builtins.int BLOCK_NUMBER_FIELD_NUMBER: builtins.int trader_address: typing.Text """address identifies the address owner of this position""" @@ -209,14 +176,13 @@ class Position(google.protobuf.message.Message): Used to calculate PnL. """ - last_update_cumulative_premium_fraction: typing.Text - """The last cumulative funding payment this position has applied. + latest_cumulative_premium_fraction: typing.Text + """The most recent cumulative premium fraction this position has. Used to calculate the next funding payment. - int """ block_number: builtins.int - """BlockNumber is the last block number when this position changed.""" + """BlockNumber is the last block number when this position was updated.""" def __init__(self, *, @@ -225,13 +191,50 @@ class Position(google.protobuf.message.Message): size: typing.Text = ..., margin: typing.Text = ..., open_notional: typing.Text = ..., - last_update_cumulative_premium_fraction: typing.Text = ..., + latest_cumulative_premium_fraction: typing.Text = ..., block_number: builtins.int = ..., ) -> None: ... def HasField(self, field_name: typing_extensions.Literal["pair",b"pair"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["block_number",b"block_number","last_update_cumulative_premium_fraction",b"last_update_cumulative_premium_fraction","margin",b"margin","open_notional",b"open_notional","pair",b"pair","size",b"size","trader_address",b"trader_address"]) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["block_number",b"block_number","latest_cumulative_premium_fraction",b"latest_cumulative_premium_fraction","margin",b"margin","open_notional",b"open_notional","pair",b"pair","size",b"size","trader_address",b"trader_address"]) -> None: ... global___Position = Position +class PairMetadata(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PAIR_FIELD_NUMBER: builtins.int + CUMULATIVE_PREMIUM_FRACTIONS_FIELD_NUMBER: builtins.int + @property + def pair(self) -> common.common_pb2.AssetPair: ... + @property + def cumulative_premium_fractions(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: + """The historical list of cumulative premium fractions for a given pair. + Calculated once per epoch. + A premium fraction is the difference between mark and index, divided by the number of payments per day. + (mark - index) / # payments in a day + """ + pass + def __init__(self, + *, + pair: typing.Optional[common.common_pb2.AssetPair] = ..., + cumulative_premium_fractions: typing.Optional[typing.Iterable[typing.Text]] = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["pair",b"pair"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["cumulative_premium_fractions",b"cumulative_premium_fractions","pair",b"pair"]) -> None: ... +global___PairMetadata = PairMetadata + +class PrepaidBadDebt(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + DENOM_FIELD_NUMBER: builtins.int + AMOUNT_FIELD_NUMBER: builtins.int + denom: typing.Text + amount: typing.Text + def __init__(self, + *, + denom: typing.Text = ..., + amount: typing.Text = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["amount",b"amount","denom",b"denom"]) -> None: ... +global___PrepaidBadDebt = PrepaidBadDebt + class PositionResp(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor POSITION_FIELD_NUMBER: builtins.int @@ -261,7 +264,9 @@ class PositionResp(google.protobuf.message.Message): """The funding payment applied on this position change.""" realized_pnl: typing.Text - """The amount of PnL realized on this position changed, measured in quote units.""" + """The amount of PnL realized on this position changed, measured in quote + units. + """ unrealized_pnl_after: typing.Text """The unrealized PnL in the position after the position change.""" @@ -272,7 +277,9 @@ class PositionResp(google.protobuf.message.Message): """ position_notional: typing.Text - """The position's notional value after the position change, measured in quote units.""" + """The position's notional value after the position change, measured in quote + units. + """ def __init__(self, *, @@ -324,34 +331,3 @@ class LiquidateResp(google.protobuf.message.Message): def HasField(self, field_name: typing_extensions.Literal["position_resp",b"position_resp"]) -> builtins.bool: ... def ClearField(self, field_name: typing_extensions.Literal["bad_debt",b"bad_debt","fee_to_liquidator",b"fee_to_liquidator","fee_to_perp_ecosystem_fund",b"fee_to_perp_ecosystem_fund","liquidator",b"liquidator","position_resp",b"position_resp"]) -> None: ... global___LiquidateResp = LiquidateResp - -class PairMetadata(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - PAIR_FIELD_NUMBER: builtins.int - CUMULATIVE_PREMIUM_FRACTIONS_FIELD_NUMBER: builtins.int - @property - def pair(self) -> common.common_pb2.AssetPair: ... - @property - def cumulative_premium_fractions(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: ... - def __init__(self, - *, - pair: typing.Optional[common.common_pb2.AssetPair] = ..., - cumulative_premium_fractions: typing.Optional[typing.Iterable[typing.Text]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["pair",b"pair"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["cumulative_premium_fractions",b"cumulative_premium_fractions","pair",b"pair"]) -> None: ... -global___PairMetadata = PairMetadata - -class PrepaidBadDebt(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - DENOM_FIELD_NUMBER: builtins.int - AMOUNT_FIELD_NUMBER: builtins.int - denom: typing.Text - amount: typing.Text - def __init__(self, - *, - denom: typing.Text = ..., - amount: typing.Text = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["amount",b"amount","denom",b"denom"]) -> None: ... -global___PrepaidBadDebt = PrepaidBadDebt diff --git a/nibiru_proto/proto/perp/v1/tx_pb2.py b/nibiru_proto/proto/perp/v1/tx_pb2.py index 0bd8843..4061db0 100644 --- a/nibiru_proto/proto/perp/v1/tx_pb2.py +++ b/nibiru_proto/proto/perp/v1/tx_pb2.py @@ -18,7 +18,7 @@ from perp.v1 import state_pb2 as perp_dot_v1_dot_state__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10perp/v1/tx.proto\x12\x0enibiru.perp.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1e\x63osmos/base/v1beta1/coin.proto\x1a\x14gogoproto/gogo.proto\x1a\x13perp/v1/state.proto\"f\n\x0fMsgRemoveMargin\x12\x0e\n\x06sender\x18\x01 \x01(\t\x12\x12\n\ntoken_pair\x18\x02 \x01(\t\x12/\n\x06margin\x18\x03 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x04\xc8\xde\x1f\x00\"\xc3\x01\n\x17MsgRemoveMarginResponse\x12\x33\n\nmargin_out\x18\x01 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x04\xc8\xde\x1f\x00\x12G\n\x0f\x66unding_payment\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12*\n\x08position\x18\x03 \x01(\x0b\x32\x18.nibiru.perp.v1.Position\"c\n\x0cMsgAddMargin\x12\x0e\n\x06sender\x18\x01 \x01(\t\x12\x12\n\ntoken_pair\x18\x02 \x01(\t\x12/\n\x06margin\x18\x03 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x04\xc8\xde\x1f\x00\"\x8b\x01\n\x14MsgAddMarginResponse\x12G\n\x0f\x66unding_payment\x18\x01 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12*\n\x08position\x18\x02 \x01(\x0b\x32\x18.nibiru.perp.v1.Position\"B\n\x0cMsgLiquidate\x12\x0e\n\x06sender\x18\x01 \x01(\t\x12\x12\n\ntoken_pair\x18\x02 \x01(\t\x12\x0e\n\x06trader\x18\x03 \x01(\t\"\x97\x01\n\x14MsgLiquidateResponse\x12:\n\x11\x66\x65\x65_to_liquidator\x18\x01 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x04\xc8\xde\x1f\x00\x12\x43\n\x1a\x66\x65\x65_to_perp_ecosystem_fund\x18\x02 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x04\xc8\xde\x1f\x00\"\xb8\x02\n\x0fMsgOpenPosition\x12\x0e\n\x06sender\x18\x01 \x01(\t\x12\x12\n\ntoken_pair\x18\x02 \x01(\t\x12\"\n\x04side\x18\x03 \x01(\x0e\x32\x14.nibiru.perp.v1.Side\x12J\n\x12quote_asset_amount\x18\x04 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\x00\x12@\n\x08leverage\x18\x05 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12O\n\x17\x62\x61se_asset_amount_limit\x18\x06 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\x00\"\xd9\x04\n\x17MsgOpenPositionResponse\x12*\n\x08position\x18\x01 \x01(\x0b\x32\x18.nibiru.perp.v1.Position\x12P\n\x18\x65xchanged_notional_value\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12O\n\x17\x65xchanged_position_size\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12G\n\x0f\x66unding_payment\x18\x04 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x44\n\x0crealized_pnl\x18\x05 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12L\n\x14unrealized_pnl_after\x18\x06 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12G\n\x0fmargin_to_vault\x18\x07 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12I\n\x11position_notional\x18\x08 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\"6\n\x10MsgClosePosition\x12\x0e\n\x06sender\x18\x01 \x01(\t\x12\x12\n\ntoken_pair\x18\x02 \x01(\t\"\x96\x03\n\x18MsgClosePositionResponse\x12P\n\x18\x65xchanged_notional_value\x18\x01 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12O\n\x17\x65xchanged_position_size\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12G\n\x0f\x66unding_payment\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x44\n\x0crealized_pnl\x18\x04 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12H\n\x10margin_to_trader\x18\x07 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x32\xe7\x04\n\x03Msg\x12|\n\x0cRemoveMargin\x12\x1f.nibiru.perp.v1.MsgRemoveMargin\x1a\'.nibiru.perp.v1.MsgRemoveMarginResponse\"\"\x82\xd3\xe4\x93\x02\x1c\"\x1a/nibiru/perp/remove_margin\x12p\n\tAddMargin\x12\x1c.nibiru.perp.v1.MsgAddMargin\x1a$.nibiru.perp.v1.MsgAddMarginResponse\"\x1f\x82\xd3\xe4\x93\x02\x19\"\x17/nibiru/perp/add_margin\x12o\n\tLiquidate\x12\x1c.nibiru.perp.v1.MsgLiquidate\x1a$.nibiru.perp.v1.MsgLiquidateResponse\"\x1e\x82\xd3\xe4\x93\x02\x18\"\x16/nibiru/perp/liquidate\x12|\n\x0cOpenPosition\x12\x1f.nibiru.perp.v1.MsgOpenPosition\x1a\'.nibiru.perp.v1.MsgOpenPositionResponse\"\"\x82\xd3\xe4\x93\x02\x1c\"\x1a/nibiru/perp/open_position\x12\x80\x01\n\rClosePosition\x12 .nibiru.perp.v1.MsgClosePosition\x1a(.nibiru.perp.v1.MsgClosePositionResponse\"#\x82\xd3\xe4\x93\x02\x1d\"\x1b/nibiru/perp/close_positionB,Z*github.com/NibiruChain/nibiru/x/perp/typesb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10perp/v1/tx.proto\x12\x0enibiru.perp.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1e\x63osmos/base/v1beta1/coin.proto\x1a\x14gogoproto/gogo.proto\x1a\x13perp/v1/state.proto\"f\n\x0fMsgRemoveMargin\x12\x0e\n\x06sender\x18\x01 \x01(\t\x12\x12\n\ntoken_pair\x18\x02 \x01(\t\x12/\n\x06margin\x18\x03 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x04\xc8\xde\x1f\x00\"\xc3\x01\n\x17MsgRemoveMarginResponse\x12\x33\n\nmargin_out\x18\x01 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x04\xc8\xde\x1f\x00\x12G\n\x0f\x66unding_payment\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12*\n\x08position\x18\x03 \x01(\x0b\x32\x18.nibiru.perp.v1.Position\"c\n\x0cMsgAddMargin\x12\x0e\n\x06sender\x18\x01 \x01(\t\x12\x12\n\ntoken_pair\x18\x02 \x01(\t\x12/\n\x06margin\x18\x03 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x04\xc8\xde\x1f\x00\"\x8b\x01\n\x14MsgAddMarginResponse\x12G\n\x0f\x66unding_payment\x18\x01 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12*\n\x08position\x18\x02 \x01(\x0b\x32\x18.nibiru.perp.v1.Position\"B\n\x0cMsgLiquidate\x12\x0e\n\x06sender\x18\x01 \x01(\t\x12\x12\n\ntoken_pair\x18\x02 \x01(\t\x12\x0e\n\x06trader\x18\x03 \x01(\t\"\x97\x01\n\x14MsgLiquidateResponse\x12:\n\x11\x66\x65\x65_to_liquidator\x18\x01 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x04\xc8\xde\x1f\x00\x12\x43\n\x1a\x66\x65\x65_to_perp_ecosystem_fund\x18\x02 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x04\xc8\xde\x1f\x00\"\xa5\x01\n\x11MsgMultiLiquidate\x12\x0e\n\x06sender\x18\x01 \x01(\t\x12H\n\x0cliquidations\x18\x02 \x03(\x0b\x32\x32.nibiru.perp.v1.MsgMultiLiquidate.MultiLiquidation\x1a\x36\n\x10MultiLiquidation\x12\x12\n\ntoken_pair\x18\x02 \x01(\t\x12\x0e\n\x06trader\x18\x03 \x01(\t\"\xf0\x01\n\x19MsgMultiLiquidateResponse\x12_\n\x15liquidation_responses\x18\x01 \x03(\x0b\x32@.nibiru.perp.v1.MsgMultiLiquidateResponse.MultiLiquidateResponse\x1ar\n\x16MultiLiquidateResponse\x12\x0f\n\x05\x65rror\x18\x01 \x01(\tH\x00\x12;\n\x0bliquidation\x18\x02 \x01(\x0b\x32$.nibiru.perp.v1.MsgLiquidateResponseH\x00\x42\n\n\x08response\"\xb8\x02\n\x0fMsgOpenPosition\x12\x0e\n\x06sender\x18\x01 \x01(\t\x12\x12\n\ntoken_pair\x18\x02 \x01(\t\x12\"\n\x04side\x18\x03 \x01(\x0e\x32\x14.nibiru.perp.v1.Side\x12J\n\x12quote_asset_amount\x18\x04 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\x00\x12@\n\x08leverage\x18\x05 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12O\n\x17\x62\x61se_asset_amount_limit\x18\x06 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xc8\xde\x1f\x00\"\xd9\x04\n\x17MsgOpenPositionResponse\x12*\n\x08position\x18\x01 \x01(\x0b\x32\x18.nibiru.perp.v1.Position\x12P\n\x18\x65xchanged_notional_value\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12O\n\x17\x65xchanged_position_size\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12G\n\x0f\x66unding_payment\x18\x04 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x44\n\x0crealized_pnl\x18\x05 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12L\n\x14unrealized_pnl_after\x18\x06 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12G\n\x0fmargin_to_vault\x18\x07 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12I\n\x11position_notional\x18\x08 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\"6\n\x10MsgClosePosition\x12\x0e\n\x06sender\x18\x01 \x01(\t\x12\x12\n\ntoken_pair\x18\x02 \x01(\t\"\x96\x03\n\x18MsgClosePositionResponse\x12P\n\x18\x65xchanged_notional_value\x18\x01 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12O\n\x17\x65xchanged_position_size\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12G\n\x0f\x66unding_payment\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x44\n\x0crealized_pnl\x18\x04 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12H\n\x10margin_to_trader\x18\x07 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x32\xed\x05\n\x03Msg\x12|\n\x0cRemoveMargin\x12\x1f.nibiru.perp.v1.MsgRemoveMargin\x1a\'.nibiru.perp.v1.MsgRemoveMarginResponse\"\"\x82\xd3\xe4\x93\x02\x1c\"\x1a/nibiru/perp/remove_margin\x12p\n\tAddMargin\x12\x1c.nibiru.perp.v1.MsgAddMargin\x1a$.nibiru.perp.v1.MsgAddMarginResponse\"\x1f\x82\xd3\xe4\x93\x02\x19\"\x17/nibiru/perp/add_margin\x12o\n\tLiquidate\x12\x1c.nibiru.perp.v1.MsgLiquidate\x1a$.nibiru.perp.v1.MsgLiquidateResponse\"\x1e\x82\xd3\xe4\x93\x02\x18\"\x16/nibiru/perp/liquidate\x12\x83\x01\n\x0eMultiLiquidate\x12!.nibiru.perp.v1.MsgMultiLiquidate\x1a).nibiru.perp.v1.MsgMultiLiquidateResponse\"#\x82\xd3\xe4\x93\x02\x1d\"\x1b/nibiru/perp/multiliquidate\x12|\n\x0cOpenPosition\x12\x1f.nibiru.perp.v1.MsgOpenPosition\x1a\'.nibiru.perp.v1.MsgOpenPositionResponse\"\"\x82\xd3\xe4\x93\x02\x1c\"\x1a/nibiru/perp/open_position\x12\x80\x01\n\rClosePosition\x12 .nibiru.perp.v1.MsgClosePosition\x1a(.nibiru.perp.v1.MsgClosePositionResponse\"#\x82\xd3\xe4\x93\x02\x1d\"\x1b/nibiru/perp/close_positionB,Z*github.com/NibiruChain/nibiru/x/perp/typesb\x06proto3') @@ -28,6 +28,10 @@ _MSGADDMARGINRESPONSE = DESCRIPTOR.message_types_by_name['MsgAddMarginResponse'] _MSGLIQUIDATE = DESCRIPTOR.message_types_by_name['MsgLiquidate'] _MSGLIQUIDATERESPONSE = DESCRIPTOR.message_types_by_name['MsgLiquidateResponse'] +_MSGMULTILIQUIDATE = DESCRIPTOR.message_types_by_name['MsgMultiLiquidate'] +_MSGMULTILIQUIDATE_MULTILIQUIDATION = _MSGMULTILIQUIDATE.nested_types_by_name['MultiLiquidation'] +_MSGMULTILIQUIDATERESPONSE = DESCRIPTOR.message_types_by_name['MsgMultiLiquidateResponse'] +_MSGMULTILIQUIDATERESPONSE_MULTILIQUIDATERESPONSE = _MSGMULTILIQUIDATERESPONSE.nested_types_by_name['MultiLiquidateResponse'] _MSGOPENPOSITION = DESCRIPTOR.message_types_by_name['MsgOpenPosition'] _MSGOPENPOSITIONRESPONSE = DESCRIPTOR.message_types_by_name['MsgOpenPositionResponse'] _MSGCLOSEPOSITION = DESCRIPTOR.message_types_by_name['MsgClosePosition'] @@ -74,6 +78,36 @@ }) _sym_db.RegisterMessage(MsgLiquidateResponse) +MsgMultiLiquidate = _reflection.GeneratedProtocolMessageType('MsgMultiLiquidate', (_message.Message,), { + + 'MultiLiquidation' : _reflection.GeneratedProtocolMessageType('MultiLiquidation', (_message.Message,), { + 'DESCRIPTOR' : _MSGMULTILIQUIDATE_MULTILIQUIDATION, + '__module__' : 'perp.v1.tx_pb2' + # @@protoc_insertion_point(class_scope:nibiru.perp.v1.MsgMultiLiquidate.MultiLiquidation) + }) + , + 'DESCRIPTOR' : _MSGMULTILIQUIDATE, + '__module__' : 'perp.v1.tx_pb2' + # @@protoc_insertion_point(class_scope:nibiru.perp.v1.MsgMultiLiquidate) + }) +_sym_db.RegisterMessage(MsgMultiLiquidate) +_sym_db.RegisterMessage(MsgMultiLiquidate.MultiLiquidation) + +MsgMultiLiquidateResponse = _reflection.GeneratedProtocolMessageType('MsgMultiLiquidateResponse', (_message.Message,), { + + 'MultiLiquidateResponse' : _reflection.GeneratedProtocolMessageType('MultiLiquidateResponse', (_message.Message,), { + 'DESCRIPTOR' : _MSGMULTILIQUIDATERESPONSE_MULTILIQUIDATERESPONSE, + '__module__' : 'perp.v1.tx_pb2' + # @@protoc_insertion_point(class_scope:nibiru.perp.v1.MsgMultiLiquidateResponse.MultiLiquidateResponse) + }) + , + 'DESCRIPTOR' : _MSGMULTILIQUIDATERESPONSE, + '__module__' : 'perp.v1.tx_pb2' + # @@protoc_insertion_point(class_scope:nibiru.perp.v1.MsgMultiLiquidateResponse) + }) +_sym_db.RegisterMessage(MsgMultiLiquidateResponse) +_sym_db.RegisterMessage(MsgMultiLiquidateResponse.MultiLiquidateResponse) + MsgOpenPosition = _reflection.GeneratedProtocolMessageType('MsgOpenPosition', (_message.Message,), { 'DESCRIPTOR' : _MSGOPENPOSITION, '__module__' : 'perp.v1.tx_pb2' @@ -157,6 +191,8 @@ _MSG.methods_by_name['AddMargin']._serialized_options = b'\202\323\344\223\002\031\"\027/nibiru/perp/add_margin' _MSG.methods_by_name['Liquidate']._options = None _MSG.methods_by_name['Liquidate']._serialized_options = b'\202\323\344\223\002\030\"\026/nibiru/perp/liquidate' + _MSG.methods_by_name['MultiLiquidate']._options = None + _MSG.methods_by_name['MultiLiquidate']._serialized_options = b'\202\323\344\223\002\035\"\033/nibiru/perp/multiliquidate' _MSG.methods_by_name['OpenPosition']._options = None _MSG.methods_by_name['OpenPosition']._serialized_options = b'\202\323\344\223\002\034\"\032/nibiru/perp/open_position' _MSG.methods_by_name['ClosePosition']._options = None @@ -173,14 +209,22 @@ _MSGLIQUIDATE._serialized_end=752 _MSGLIQUIDATERESPONSE._serialized_start=755 _MSGLIQUIDATERESPONSE._serialized_end=906 - _MSGOPENPOSITION._serialized_start=909 - _MSGOPENPOSITION._serialized_end=1221 - _MSGOPENPOSITIONRESPONSE._serialized_start=1224 - _MSGOPENPOSITIONRESPONSE._serialized_end=1825 - _MSGCLOSEPOSITION._serialized_start=1827 - _MSGCLOSEPOSITION._serialized_end=1881 - _MSGCLOSEPOSITIONRESPONSE._serialized_start=1884 - _MSGCLOSEPOSITIONRESPONSE._serialized_end=2290 - _MSG._serialized_start=2293 - _MSG._serialized_end=2908 + _MSGMULTILIQUIDATE._serialized_start=909 + _MSGMULTILIQUIDATE._serialized_end=1074 + _MSGMULTILIQUIDATE_MULTILIQUIDATION._serialized_start=1020 + _MSGMULTILIQUIDATE_MULTILIQUIDATION._serialized_end=1074 + _MSGMULTILIQUIDATERESPONSE._serialized_start=1077 + _MSGMULTILIQUIDATERESPONSE._serialized_end=1317 + _MSGMULTILIQUIDATERESPONSE_MULTILIQUIDATERESPONSE._serialized_start=1203 + _MSGMULTILIQUIDATERESPONSE_MULTILIQUIDATERESPONSE._serialized_end=1317 + _MSGOPENPOSITION._serialized_start=1320 + _MSGOPENPOSITION._serialized_end=1632 + _MSGOPENPOSITIONRESPONSE._serialized_start=1635 + _MSGOPENPOSITIONRESPONSE._serialized_end=2236 + _MSGCLOSEPOSITION._serialized_start=2238 + _MSGCLOSEPOSITION._serialized_end=2292 + _MSGCLOSEPOSITIONRESPONSE._serialized_start=2295 + _MSGCLOSEPOSITIONRESPONSE._serialized_end=2701 + _MSG._serialized_start=2704 + _MSG._serialized_end=3453 # @@protoc_insertion_point(module_scope) diff --git a/nibiru_proto/proto/perp/v1/tx_pb2.pyi b/nibiru_proto/proto/perp/v1/tx_pb2.pyi index c2da69b..66415b9 100644 --- a/nibiru_proto/proto/perp/v1/tx_pb2.pyi +++ b/nibiru_proto/proto/perp/v1/tx_pb2.pyi @@ -5,6 +5,7 @@ isort:skip_file import builtins import cosmos.base.v1beta1.coin_pb2 import google.protobuf.descriptor +import google.protobuf.internal.containers import google.protobuf.message import perp.v1.state_pb2 import typing @@ -143,6 +144,62 @@ class MsgLiquidateResponse(google.protobuf.message.Message): def ClearField(self, field_name: typing_extensions.Literal["fee_to_liquidator",b"fee_to_liquidator","fee_to_perp_ecosystem_fund",b"fee_to_perp_ecosystem_fund"]) -> None: ... global___MsgLiquidateResponse = MsgLiquidateResponse +class MsgMultiLiquidate(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + class MultiLiquidation(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + TOKEN_PAIR_FIELD_NUMBER: builtins.int + TRADER_FIELD_NUMBER: builtins.int + token_pair: typing.Text + trader: typing.Text + def __init__(self, + *, + token_pair: typing.Text = ..., + trader: typing.Text = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["token_pair",b"token_pair","trader",b"trader"]) -> None: ... + + SENDER_FIELD_NUMBER: builtins.int + LIQUIDATIONS_FIELD_NUMBER: builtins.int + sender: typing.Text + @property + def liquidations(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___MsgMultiLiquidate.MultiLiquidation]: ... + def __init__(self, + *, + sender: typing.Text = ..., + liquidations: typing.Optional[typing.Iterable[global___MsgMultiLiquidate.MultiLiquidation]] = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["liquidations",b"liquidations","sender",b"sender"]) -> None: ... +global___MsgMultiLiquidate = MsgMultiLiquidate + +class MsgMultiLiquidateResponse(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + class MultiLiquidateResponse(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + ERROR_FIELD_NUMBER: builtins.int + LIQUIDATION_FIELD_NUMBER: builtins.int + error: typing.Text + @property + def liquidation(self) -> global___MsgLiquidateResponse: ... + def __init__(self, + *, + error: typing.Text = ..., + liquidation: typing.Optional[global___MsgLiquidateResponse] = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["error",b"error","liquidation",b"liquidation","response",b"response"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["error",b"error","liquidation",b"liquidation","response",b"response"]) -> None: ... + def WhichOneof(self, oneof_group: typing_extensions.Literal["response",b"response"]) -> typing.Optional[typing_extensions.Literal["error","liquidation"]]: ... + + LIQUIDATION_RESPONSES_FIELD_NUMBER: builtins.int + @property + def liquidation_responses(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___MsgMultiLiquidateResponse.MultiLiquidateResponse]: ... + def __init__(self, + *, + liquidation_responses: typing.Optional[typing.Iterable[global___MsgMultiLiquidateResponse.MultiLiquidateResponse]] = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["liquidation_responses",b"liquidation_responses"]) -> None: ... +global___MsgMultiLiquidateResponse = MsgMultiLiquidateResponse + class MsgOpenPosition(google.protobuf.message.Message): """-------------------------- OpenPosition -------------------------- diff --git a/nibiru_proto/proto/perp/v1/tx_pb2_grpc.py b/nibiru_proto/proto/perp/v1/tx_pb2_grpc.py index 4ea4d65..f9a7149 100644 --- a/nibiru_proto/proto/perp/v1/tx_pb2_grpc.py +++ b/nibiru_proto/proto/perp/v1/tx_pb2_grpc.py @@ -30,6 +30,11 @@ def __init__(self, channel): request_serializer=perp_dot_v1_dot_tx__pb2.MsgLiquidate.SerializeToString, response_deserializer=perp_dot_v1_dot_tx__pb2.MsgLiquidateResponse.FromString, ) + self.MultiLiquidate = channel.unary_unary( + '/nibiru.perp.v1.Msg/MultiLiquidate', + request_serializer=perp_dot_v1_dot_tx__pb2.MsgMultiLiquidate.SerializeToString, + response_deserializer=perp_dot_v1_dot_tx__pb2.MsgMultiLiquidateResponse.FromString, + ) self.OpenPosition = channel.unary_unary( '/nibiru.perp.v1.Msg/OpenPosition', request_serializer=perp_dot_v1_dot_tx__pb2.MsgOpenPosition.SerializeToString, @@ -66,6 +71,12 @@ def Liquidate(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def MultiLiquidate(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def OpenPosition(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -96,6 +107,11 @@ def add_MsgServicer_to_server(servicer, server): request_deserializer=perp_dot_v1_dot_tx__pb2.MsgLiquidate.FromString, response_serializer=perp_dot_v1_dot_tx__pb2.MsgLiquidateResponse.SerializeToString, ), + 'MultiLiquidate': grpc.unary_unary_rpc_method_handler( + servicer.MultiLiquidate, + request_deserializer=perp_dot_v1_dot_tx__pb2.MsgMultiLiquidate.FromString, + response_serializer=perp_dot_v1_dot_tx__pb2.MsgMultiLiquidateResponse.SerializeToString, + ), 'OpenPosition': grpc.unary_unary_rpc_method_handler( servicer.OpenPosition, request_deserializer=perp_dot_v1_dot_tx__pb2.MsgOpenPosition.FromString, @@ -168,6 +184,23 @@ def Liquidate(request, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod + def MultiLiquidate(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/nibiru.perp.v1.Msg/MultiLiquidate', + perp_dot_v1_dot_tx__pb2.MsgMultiLiquidate.SerializeToString, + perp_dot_v1_dot_tx__pb2.MsgMultiLiquidateResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod def OpenPosition(request, target, diff --git a/nibiru_proto/proto/perp/v1/tx_pb2_grpc.pyi b/nibiru_proto/proto/perp/v1/tx_pb2_grpc.pyi index f5be1b9..af3970e 100644 --- a/nibiru_proto/proto/perp/v1/tx_pb2_grpc.pyi +++ b/nibiru_proto/proto/perp/v1/tx_pb2_grpc.pyi @@ -24,6 +24,10 @@ class MsgStub: liquidate an existing position. """ + MultiLiquidate: grpc.UnaryUnaryMultiCallable[ + perp.v1.tx_pb2.MsgMultiLiquidate, + perp.v1.tx_pb2.MsgMultiLiquidateResponse] + OpenPosition: grpc.UnaryUnaryMultiCallable[ perp.v1.tx_pb2.MsgOpenPosition, perp.v1.tx_pb2.MsgOpenPositionResponse] @@ -57,6 +61,12 @@ class MsgServicer(metaclass=abc.ABCMeta): """ pass + @abc.abstractmethod + def MultiLiquidate(self, + request: perp.v1.tx_pb2.MsgMultiLiquidate, + context: grpc.ServicerContext, + ) -> perp.v1.tx_pb2.MsgMultiLiquidateResponse: ... + @abc.abstractmethod def OpenPosition(self, request: perp.v1.tx_pb2.MsgOpenPosition, diff --git a/nibiru_proto/proto/pricefeed/genesis_pb2.py b/nibiru_proto/proto/pricefeed/genesis_pb2.py index 1fac19c..3449699 100644 --- a/nibiru_proto/proto/pricefeed/genesis_pb2.py +++ b/nibiru_proto/proto/pricefeed/genesis_pb2.py @@ -13,10 +13,10 @@ from gogoproto import gogo_pb2 as gogoproto_dot_gogo__pb2 -from pricefeed import params_pb2 as pricefeed_dot_params__pb2 +from pricefeed import state_pb2 as pricefeed_dot_state__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17pricefeed/genesis.proto\x12\x13nibiru.pricefeed.v1\x1a\x14gogoproto/gogo.proto\x1a\x16pricefeed/params.proto\"\xa9\x01\n\x0cGenesisState\x12\x31\n\x06params\x18\x01 \x01(\x0b\x32\x1b.nibiru.pricefeed.v1.ParamsB\x04\xc8\xde\x1f\x00\x12M\n\rposted_prices\x18\x02 \x03(\x0b\x32 .nibiru.pricefeed.v1.PostedPriceB\x14\xaa\xdf\x1f\x0cPostedPrices\xc8\xde\x1f\x00\x12\x17\n\x0fgenesis_oracles\x18\x03 \x03(\tB1Z/github.com/NibiruChain/nibiru/x/pricefeed/typesb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17pricefeed/genesis.proto\x12\x13nibiru.pricefeed.v1\x1a\x14gogoproto/gogo.proto\x1a\x15pricefeed/state.proto\"\xa9\x01\n\x0cGenesisState\x12\x31\n\x06params\x18\x01 \x01(\x0b\x32\x1b.nibiru.pricefeed.v1.ParamsB\x04\xc8\xde\x1f\x00\x12M\n\rposted_prices\x18\x02 \x03(\x0b\x32 .nibiru.pricefeed.v1.PostedPriceB\x14\xaa\xdf\x1f\x0cPostedPrices\xc8\xde\x1f\x00\x12\x17\n\x0fgenesis_oracles\x18\x03 \x03(\tB1Z/github.com/NibiruChain/nibiru/x/pricefeed/typesb\x06proto3') @@ -36,6 +36,6 @@ _GENESISSTATE.fields_by_name['params']._serialized_options = b'\310\336\037\000' _GENESISSTATE.fields_by_name['posted_prices']._options = None _GENESISSTATE.fields_by_name['posted_prices']._serialized_options = b'\252\337\037\014PostedPrices\310\336\037\000' - _GENESISSTATE._serialized_start=95 - _GENESISSTATE._serialized_end=264 + _GENESISSTATE._serialized_start=94 + _GENESISSTATE._serialized_end=263 # @@protoc_insertion_point(module_scope) diff --git a/nibiru_proto/proto/pricefeed/genesis_pb2.pyi b/nibiru_proto/proto/pricefeed/genesis_pb2.pyi index 81fb0f6..f12fb11 100644 --- a/nibiru_proto/proto/pricefeed/genesis_pb2.pyi +++ b/nibiru_proto/proto/pricefeed/genesis_pb2.pyi @@ -6,7 +6,7 @@ import builtins import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message -import pricefeed.params_pb2 +import pricefeed.state_pb2 import typing import typing_extensions @@ -19,17 +19,17 @@ class GenesisState(google.protobuf.message.Message): POSTED_PRICES_FIELD_NUMBER: builtins.int GENESIS_ORACLES_FIELD_NUMBER: builtins.int @property - def params(self) -> pricefeed.params_pb2.Params: + def params(self) -> pricefeed.state_pb2.Params: """params defines all the paramaters of the module.""" pass @property - def posted_prices(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[pricefeed.params_pb2.PostedPrice]: ... + def posted_prices(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[pricefeed.state_pb2.PostedPrice]: ... @property def genesis_oracles(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: ... def __init__(self, *, - params: typing.Optional[pricefeed.params_pb2.Params] = ..., - posted_prices: typing.Optional[typing.Iterable[pricefeed.params_pb2.PostedPrice]] = ..., + params: typing.Optional[pricefeed.state_pb2.Params] = ..., + posted_prices: typing.Optional[typing.Iterable[pricefeed.state_pb2.PostedPrice]] = ..., genesis_oracles: typing.Optional[typing.Iterable[typing.Text]] = ..., ) -> None: ... def HasField(self, field_name: typing_extensions.Literal["params",b"params"]) -> builtins.bool: ... diff --git a/nibiru_proto/proto/pricefeed/query_pb2.py b/nibiru_proto/proto/pricefeed/query_pb2.py index 648c0a6..7407e45 100644 --- a/nibiru_proto/proto/pricefeed/query_pb2.py +++ b/nibiru_proto/proto/pricefeed/query_pb2.py @@ -15,10 +15,10 @@ from gogoproto import gogo_pb2 as gogoproto_dot_gogo__pb2 from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from pricefeed import params_pb2 as pricefeed_dot_params__pb2 +from pricefeed import state_pb2 as pricefeed_dot_state__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15pricefeed/query.proto\x12\x13nibiru.pricefeed.v1\x1a\x14gogoproto/gogo.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x16pricefeed/params.proto\"\x14\n\x12QueryParamsRequest\"N\n\x13QueryParamsResponse\x12\x31\n\x06params\x18\x01 \x01(\x0b\x32\x1b.nibiru.pricefeed.v1.ParamsB\x04\xc8\xde\x1f\x00:\x04\x88\xa0\x1f\x00\"*\n\x11QueryPriceRequest\x12\x0f\n\x07pair_id\x18\x01 \x01(\t:\x04\x88\xa0\x1f\x00\"Z\n\x12QueryPriceResponse\x12>\n\x05price\x18\x01 \x01(\x0b\x32).nibiru.pricefeed.v1.CurrentPriceResponseB\x04\xc8\xde\x1f\x00:\x04\x88\xa0\x1f\x00\"\x14\n\x12QueryPricesRequest\"u\n\x13QueryPricesResponse\x12X\n\x06prices\x18\x01 \x03(\x0b\x32).nibiru.pricefeed.v1.CurrentPriceResponseB\x1d\xaa\xdf\x1f\x15\x43urrentPriceResponses\xc8\xde\x1f\x00:\x04\x88\xa0\x1f\x00\".\n\x15QueryRawPricesRequest\x12\x0f\n\x07pair_id\x18\x01 \x01(\t:\x04\x88\xa0\x1f\x00\"z\n\x16QueryRawPricesResponse\x12Z\n\nraw_prices\x18\x01 \x03(\x0b\x32(.nibiru.pricefeed.v1.PostedPriceResponseB\x1c\xaa\xdf\x1f\x14PostedPriceResponses\xc8\xde\x1f\x00:\x04\x88\xa0\x1f\x00\",\n\x13QueryOraclesRequest\x12\x0f\n\x07pair_id\x18\x01 \x01(\t:\x04\x88\xa0\x1f\x00\"-\n\x14QueryOraclesResponse\x12\x0f\n\x07oracles\x18\x01 \x03(\t:\x04\x88\xa0\x1f\x00\"\x15\n\x13QueryMarketsRequest\"[\n\x14QueryMarketsResponse\x12=\n\x07markets\x18\x01 \x03(\x0b\x32\x1b.nibiru.pricefeed.v1.MarketB\x0f\xaa\xdf\x1f\x07Markets\xc8\xde\x1f\x00:\x04\x88\xa0\x1f\x00\"\xbf\x01\n\x13PostedPriceResponse\x12\x1b\n\x07pair_id\x18\x01 \x01(\tB\n\xe2\xde\x1f\x06PairID\x12\x16\n\x0eoracle_address\x18\x02 \x01(\t\x12=\n\x05price\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x34\n\x06\x65xpiry\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x08\x90\xdf\x1f\x01\xc8\xde\x1f\x00\"\xb0\x01\n\x14\x43urrentPriceResponse\x12\x1b\n\x07pair_id\x18\x01 \x01(\tB\n\xe2\xde\x1f\x06PairID\x12=\n\x05price\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12<\n\x04twap\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\"F\n\x06Market\x12\x1b\n\x07pair_id\x18\x01 \x01(\tB\n\xe2\xde\x1f\x06PairID\x12\x0f\n\x07oracles\x18\x02 \x03(\t\x12\x0e\n\x06\x61\x63tive\x18\x03 \x01(\x08\x32\x84\x07\n\x05Query\x12\x8a\x01\n\x0bQueryParams\x12\'.nibiru.pricefeed.v1.QueryParamsRequest\x1a(.nibiru.pricefeed.v1.QueryParamsResponse\"(\x82\xd3\xe4\x93\x02\"\x12 /nibiru/pricefeed/v1beta1/params\x12\x91\x01\n\nQueryPrice\x12&.nibiru.pricefeed.v1.QueryPriceRequest\x1a\'.nibiru.pricefeed.v1.QueryPriceResponse\"2\x82\xd3\xe4\x93\x02,\x12*/nibiru/pricefeed/v1beta1/prices/{pair_id}\x12\x8a\x01\n\x0bQueryPrices\x12\'.nibiru.pricefeed.v1.QueryPricesRequest\x1a(.nibiru.pricefeed.v1.QueryPricesResponse\"(\x82\xd3\xe4\x93\x02\"\x12 /nibiru/pricefeed/v1beta1/prices\x12\xa0\x01\n\x0eQueryRawPrices\x12*.nibiru.pricefeed.v1.QueryRawPricesRequest\x1a+.nibiru.pricefeed.v1.QueryRawPricesResponse\"5\x82\xd3\xe4\x93\x02/\x12-/nibiru/pricefeed/v1beta1/rawprices/{pair_id}\x12\x98\x01\n\x0cQueryOracles\x12(.nibiru.pricefeed.v1.QueryOraclesRequest\x1a).nibiru.pricefeed.v1.QueryOraclesResponse\"3\x82\xd3\xe4\x93\x02-\x12+/nibiru/pricefeed/v1beta1/oracles/{pair_id}\x12\x8e\x01\n\x0cQueryMarkets\x12(.nibiru.pricefeed.v1.QueryMarketsRequest\x1a).nibiru.pricefeed.v1.QueryMarketsResponse\")\x82\xd3\xe4\x93\x02#\x12!/nibiru/pricefeed/v1beta1/marketsB9Z/github.com/NibiruChain/nibiru/x/pricefeed/types\xa8\xe2\x1e\x01\xe0\xe1\x1e\x01\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15pricefeed/query.proto\x12\x13nibiru.pricefeed.v1\x1a\x14gogoproto/gogo.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x15pricefeed/state.proto\"\x14\n\x12QueryParamsRequest\"N\n\x13QueryParamsResponse\x12\x31\n\x06params\x18\x01 \x01(\x0b\x32\x1b.nibiru.pricefeed.v1.ParamsB\x04\xc8\xde\x1f\x00:\x04\x88\xa0\x1f\x00\"*\n\x11QueryPriceRequest\x12\x0f\n\x07pair_id\x18\x01 \x01(\t:\x04\x88\xa0\x1f\x00\"Z\n\x12QueryPriceResponse\x12>\n\x05price\x18\x01 \x01(\x0b\x32).nibiru.pricefeed.v1.CurrentPriceResponseB\x04\xc8\xde\x1f\x00:\x04\x88\xa0\x1f\x00\"\x14\n\x12QueryPricesRequest\"u\n\x13QueryPricesResponse\x12X\n\x06prices\x18\x01 \x03(\x0b\x32).nibiru.pricefeed.v1.CurrentPriceResponseB\x1d\xaa\xdf\x1f\x15\x43urrentPriceResponses\xc8\xde\x1f\x00:\x04\x88\xa0\x1f\x00\".\n\x15QueryRawPricesRequest\x12\x0f\n\x07pair_id\x18\x01 \x01(\t:\x04\x88\xa0\x1f\x00\"z\n\x16QueryRawPricesResponse\x12Z\n\nraw_prices\x18\x01 \x03(\x0b\x32(.nibiru.pricefeed.v1.PostedPriceResponseB\x1c\xaa\xdf\x1f\x14PostedPriceResponses\xc8\xde\x1f\x00:\x04\x88\xa0\x1f\x00\",\n\x13QueryOraclesRequest\x12\x0f\n\x07pair_id\x18\x01 \x01(\t:\x04\x88\xa0\x1f\x00\"-\n\x14QueryOraclesResponse\x12\x0f\n\x07oracles\x18\x01 \x03(\t:\x04\x88\xa0\x1f\x00\"\x15\n\x13QueryMarketsRequest\"[\n\x14QueryMarketsResponse\x12=\n\x07markets\x18\x01 \x03(\x0b\x32\x1b.nibiru.pricefeed.v1.MarketB\x0f\xaa\xdf\x1f\x07Markets\xc8\xde\x1f\x00:\x04\x88\xa0\x1f\x00\"\xbf\x01\n\x13PostedPriceResponse\x12\x1b\n\x07pair_id\x18\x01 \x01(\tB\n\xe2\xde\x1f\x06PairID\x12\x16\n\x0eoracle_address\x18\x02 \x01(\t\x12=\n\x05price\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x34\n\x06\x65xpiry\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x08\x90\xdf\x1f\x01\xc8\xde\x1f\x00\"\xb0\x01\n\x14\x43urrentPriceResponse\x12\x1b\n\x07pair_id\x18\x01 \x01(\tB\n\xe2\xde\x1f\x06PairID\x12=\n\x05price\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12<\n\x04twap\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\"F\n\x06Market\x12\x1b\n\x07pair_id\x18\x01 \x01(\tB\n\xe2\xde\x1f\x06PairID\x12\x0f\n\x07oracles\x18\x02 \x03(\t\x12\x0e\n\x06\x61\x63tive\x18\x03 \x01(\x08\x32\x84\x07\n\x05Query\x12\x8a\x01\n\x0bQueryParams\x12\'.nibiru.pricefeed.v1.QueryParamsRequest\x1a(.nibiru.pricefeed.v1.QueryParamsResponse\"(\x82\xd3\xe4\x93\x02\"\x12 /nibiru/pricefeed/v1beta1/params\x12\x91\x01\n\nQueryPrice\x12&.nibiru.pricefeed.v1.QueryPriceRequest\x1a\'.nibiru.pricefeed.v1.QueryPriceResponse\"2\x82\xd3\xe4\x93\x02,\x12*/nibiru/pricefeed/v1beta1/prices/{pair_id}\x12\x8a\x01\n\x0bQueryPrices\x12\'.nibiru.pricefeed.v1.QueryPricesRequest\x1a(.nibiru.pricefeed.v1.QueryPricesResponse\"(\x82\xd3\xe4\x93\x02\"\x12 /nibiru/pricefeed/v1beta1/prices\x12\xa0\x01\n\x0eQueryRawPrices\x12*.nibiru.pricefeed.v1.QueryRawPricesRequest\x1a+.nibiru.pricefeed.v1.QueryRawPricesResponse\"5\x82\xd3\xe4\x93\x02/\x12-/nibiru/pricefeed/v1beta1/rawprices/{pair_id}\x12\x98\x01\n\x0cQueryOracles\x12(.nibiru.pricefeed.v1.QueryOraclesRequest\x1a).nibiru.pricefeed.v1.QueryOraclesResponse\"3\x82\xd3\xe4\x93\x02-\x12+/nibiru/pricefeed/v1beta1/oracles/{pair_id}\x12\x8e\x01\n\x0cQueryMarkets\x12(.nibiru.pricefeed.v1.QueryMarketsRequest\x1a).nibiru.pricefeed.v1.QueryMarketsResponse\")\x82\xd3\xe4\x93\x02#\x12!/nibiru/pricefeed/v1beta1/marketsB9Z/github.com/NibiruChain/nibiru/x/pricefeed/types\xa8\xe2\x1e\x01\xe0\xe1\x1e\x01\x62\x06proto3') @@ -201,36 +201,36 @@ _QUERY.methods_by_name['QueryOracles']._serialized_options = b'\202\323\344\223\002-\022+/nibiru/pricefeed/v1beta1/oracles/{pair_id}' _QUERY.methods_by_name['QueryMarkets']._options = None _QUERY.methods_by_name['QueryMarkets']._serialized_options = b'\202\323\344\223\002#\022!/nibiru/pricefeed/v1beta1/markets' - _QUERYPARAMSREQUEST._serialized_start=155 - _QUERYPARAMSREQUEST._serialized_end=175 - _QUERYPARAMSRESPONSE._serialized_start=177 - _QUERYPARAMSRESPONSE._serialized_end=255 - _QUERYPRICEREQUEST._serialized_start=257 - _QUERYPRICEREQUEST._serialized_end=299 - _QUERYPRICERESPONSE._serialized_start=301 - _QUERYPRICERESPONSE._serialized_end=391 - _QUERYPRICESREQUEST._serialized_start=393 - _QUERYPRICESREQUEST._serialized_end=413 - _QUERYPRICESRESPONSE._serialized_start=415 - _QUERYPRICESRESPONSE._serialized_end=532 - _QUERYRAWPRICESREQUEST._serialized_start=534 - _QUERYRAWPRICESREQUEST._serialized_end=580 - _QUERYRAWPRICESRESPONSE._serialized_start=582 - _QUERYRAWPRICESRESPONSE._serialized_end=704 - _QUERYORACLESREQUEST._serialized_start=706 - _QUERYORACLESREQUEST._serialized_end=750 - _QUERYORACLESRESPONSE._serialized_start=752 - _QUERYORACLESRESPONSE._serialized_end=797 - _QUERYMARKETSREQUEST._serialized_start=799 - _QUERYMARKETSREQUEST._serialized_end=820 - _QUERYMARKETSRESPONSE._serialized_start=822 - _QUERYMARKETSRESPONSE._serialized_end=913 - _POSTEDPRICERESPONSE._serialized_start=916 - _POSTEDPRICERESPONSE._serialized_end=1107 - _CURRENTPRICERESPONSE._serialized_start=1110 - _CURRENTPRICERESPONSE._serialized_end=1286 - _MARKET._serialized_start=1288 - _MARKET._serialized_end=1358 - _QUERY._serialized_start=1361 - _QUERY._serialized_end=2261 + _QUERYPARAMSREQUEST._serialized_start=154 + _QUERYPARAMSREQUEST._serialized_end=174 + _QUERYPARAMSRESPONSE._serialized_start=176 + _QUERYPARAMSRESPONSE._serialized_end=254 + _QUERYPRICEREQUEST._serialized_start=256 + _QUERYPRICEREQUEST._serialized_end=298 + _QUERYPRICERESPONSE._serialized_start=300 + _QUERYPRICERESPONSE._serialized_end=390 + _QUERYPRICESREQUEST._serialized_start=392 + _QUERYPRICESREQUEST._serialized_end=412 + _QUERYPRICESRESPONSE._serialized_start=414 + _QUERYPRICESRESPONSE._serialized_end=531 + _QUERYRAWPRICESREQUEST._serialized_start=533 + _QUERYRAWPRICESREQUEST._serialized_end=579 + _QUERYRAWPRICESRESPONSE._serialized_start=581 + _QUERYRAWPRICESRESPONSE._serialized_end=703 + _QUERYORACLESREQUEST._serialized_start=705 + _QUERYORACLESREQUEST._serialized_end=749 + _QUERYORACLESRESPONSE._serialized_start=751 + _QUERYORACLESRESPONSE._serialized_end=796 + _QUERYMARKETSREQUEST._serialized_start=798 + _QUERYMARKETSREQUEST._serialized_end=819 + _QUERYMARKETSRESPONSE._serialized_start=821 + _QUERYMARKETSRESPONSE._serialized_end=912 + _POSTEDPRICERESPONSE._serialized_start=915 + _POSTEDPRICERESPONSE._serialized_end=1106 + _CURRENTPRICERESPONSE._serialized_start=1109 + _CURRENTPRICERESPONSE._serialized_end=1285 + _MARKET._serialized_start=1287 + _MARKET._serialized_end=1357 + _QUERY._serialized_start=1360 + _QUERY._serialized_end=2260 # @@protoc_insertion_point(module_scope) diff --git a/nibiru_proto/proto/pricefeed/query_pb2.pyi b/nibiru_proto/proto/pricefeed/query_pb2.pyi index 0cae662..ada32da 100644 --- a/nibiru_proto/proto/pricefeed/query_pb2.pyi +++ b/nibiru_proto/proto/pricefeed/query_pb2.pyi @@ -7,7 +7,7 @@ import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message import google.protobuf.timestamp_pb2 -import pricefeed.params_pb2 +import pricefeed.state_pb2 import typing import typing_extensions @@ -29,10 +29,10 @@ class QueryParamsResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor PARAMS_FIELD_NUMBER: builtins.int @property - def params(self) -> pricefeed.params_pb2.Params: ... + def params(self) -> pricefeed.state_pb2.Params: ... def __init__(self, *, - params: typing.Optional[pricefeed.params_pb2.Params] = ..., + params: typing.Optional[pricefeed.state_pb2.Params] = ..., ) -> None: ... def HasField(self, field_name: typing_extensions.Literal["params",b"params"]) -> builtins.bool: ... def ClearField(self, field_name: typing_extensions.Literal["params",b"params"]) -> None: ... diff --git a/nibiru_proto/proto/pricefeed/snapshot_pb2.py b/nibiru_proto/proto/pricefeed/snapshot_pb2.py deleted file mode 100644 index 22fd10c..0000000 --- a/nibiru_proto/proto/pricefeed/snapshot_pb2.py +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: pricefeed/snapshot.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 message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from gogoproto import gogo_pb2 as gogoproto_dot_gogo__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18pricefeed/snapshot.proto\x12\x13nibiru.pricefeed.v1\x1a\x14gogoproto/gogo.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/api/annotations.proto\"u\n\rPriceSnapshot\x12\x0f\n\x07pair_id\x18\x01 \x01(\t\x12=\n\x05price\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x14\n\x0ctimestamp_ms\x18\x03 \x01(\x03\x42\x39Z/github.com/NibiruChain/nibiru/x/pricefeed/types\xa8\xe2\x1e\x01\xe0\xe1\x1e\x01\x62\x06proto3') - - - -_PRICESNAPSHOT = DESCRIPTOR.message_types_by_name['PriceSnapshot'] -PriceSnapshot = _reflection.GeneratedProtocolMessageType('PriceSnapshot', (_message.Message,), { - 'DESCRIPTOR' : _PRICESNAPSHOT, - '__module__' : 'pricefeed.snapshot_pb2' - # @@protoc_insertion_point(class_scope:nibiru.pricefeed.v1.PriceSnapshot) - }) -_sym_db.RegisterMessage(PriceSnapshot) - -if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z/github.com/NibiruChain/nibiru/x/pricefeed/types\250\342\036\001\340\341\036\001' - _PRICESNAPSHOT.fields_by_name['price']._options = None - _PRICESNAPSHOT.fields_by_name['price']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' - _PRICESNAPSHOT._serialized_start=134 - _PRICESNAPSHOT._serialized_end=251 -# @@protoc_insertion_point(module_scope) diff --git a/nibiru_proto/proto/pricefeed/snapshot_pb2.pyi b/nibiru_proto/proto/pricefeed/snapshot_pb2.pyi deleted file mode 100644 index d64f097..0000000 --- a/nibiru_proto/proto/pricefeed/snapshot_pb2.pyi +++ /dev/null @@ -1,35 +0,0 @@ -""" -@generated by mypy-protobuf. Do not edit manually! -isort:skip_file -""" -import builtins -import google.protobuf.descriptor -import google.protobuf.message -import typing -import typing_extensions - -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor - -class PriceSnapshot(google.protobuf.message.Message): - """a snapshot of the pricefeed oracle's median price at a given point in time""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - PAIR_ID_FIELD_NUMBER: builtins.int - PRICE_FIELD_NUMBER: builtins.int - TIMESTAMP_MS_FIELD_NUMBER: builtins.int - pair_id: typing.Text - """the token pair""" - - price: typing.Text - """the median prices of all oracles""" - - timestamp_ms: builtins.int - """milliseconds since unix epoch""" - - def __init__(self, - *, - pair_id: typing.Text = ..., - price: typing.Text = ..., - timestamp_ms: builtins.int = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["pair_id",b"pair_id","price",b"price","timestamp_ms",b"timestamp_ms"]) -> None: ... -global___PriceSnapshot = PriceSnapshot diff --git a/nibiru_proto/proto/pricefeed/params_pb2.py b/nibiru_proto/proto/pricefeed/state_pb2.py similarity index 59% rename from nibiru_proto/proto/pricefeed/params_pb2.py rename to nibiru_proto/proto/pricefeed/state_pb2.py index 608223b..723dd32 100644 --- a/nibiru_proto/proto/pricefeed/params_pb2.py +++ b/nibiru_proto/proto/pricefeed/state_pb2.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! -# source: pricefeed/params.proto +# source: pricefeed/state.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -12,18 +12,19 @@ _sym_db = _symbol_database.Default() -from cosmos_proto import cosmos_pb2 as cosmos__proto_dot_cosmos__pb2 from gogoproto import gogo_pb2 as gogoproto_dot_gogo__pb2 -from common import common_pb2 as common_dot_common__pb2 -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from common import common_pb2 as common_dot_common__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16pricefeed/params.proto\x12\x13nibiru.pricefeed.v1\x1a\x19\x63osmos_proto/cosmos.proto\x1a\x14gogoproto/gogo.proto\x1a\x13\x63ommon/common.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xbc\x01\n\x06Params\x12-\n\x05pairs\x18\x01 \x03(\x0b\x32\x18.nibiru.common.AssetPairB\x04\xc8\xde\x1f\x00\x12\x82\x01\n\x14twap_lookback_window\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationBI\xc8\xde\x1f\x00\x98\xdf\x1f\x01\xea\xde\x1f\x1etwap_lookback_window,omitempty\xf2\xde\x1f\x1byaml:\"twap_lookback_window\"\"V\n\x10OraclesMarshaler\x12\x42\n\x07oracles\x18\x01 \x03(\x0c\x42\x31\xfa\xde\x1f-jackfan.us.kg/cosmos/cosmos-sdk/types.AccAddress\"(\n\x13\x41\x63tivePairMarshaler\x12\x11\n\tis_active\x18\x01 \x01(\x08\"\xaf\x01\n\x0bPostedPrice\x12\x1b\n\x07pair_id\x18\x01 \x01(\tB\n\xe2\xde\x1f\x06PairID\x12\x0e\n\x06oracle\x18\x02 \x01(\t\x12=\n\x05price\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x34\n\x06\x65xpiry\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x08\x90\xdf\x1f\x01\xc8\xde\x1f\x00\"j\n\x0c\x43urrentPrice\x12\x1b\n\x07pair_id\x18\x01 \x01(\tB\n\xe2\xde\x1f\x06PairID\x12=\n\x05price\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\"\xf1\x01\n\x0b\x43urrentTWAP\x12\x1b\n\x07pair_id\x18\x01 \x01(\tB\n\xe2\xde\x1f\x06PairID\x12\x41\n\tnumerator\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x43\n\x0b\x64\x65nominator\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12=\n\x05price\x18\x04 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x42\x35Z/github.com/NibiruChain/nibiru/x/pricefeed/types\xa8\xe2\x1e\x01\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15pricefeed/state.proto\x12\x13nibiru.pricefeed.v1\x1a\x14gogoproto/gogo.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x13\x63ommon/common.proto\"\xbc\x01\n\x06Params\x12-\n\x05pairs\x18\x01 \x03(\x0b\x32\x18.nibiru.common.AssetPairB\x04\xc8\xde\x1f\x00\x12\x82\x01\n\x14twap_lookback_window\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationBI\xc8\xde\x1f\x00\x98\xdf\x1f\x01\xea\xde\x1f\x1etwap_lookback_window,omitempty\xf2\xde\x1f\x1byaml:\"twap_lookback_window\"\"u\n\rPriceSnapshot\x12\x0f\n\x07pair_id\x18\x01 \x01(\t\x12=\n\x05price\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x14\n\x0ctimestamp_ms\x18\x03 \x01(\x03\"V\n\x10OraclesMarshaler\x12\x42\n\x07oracles\x18\x01 \x03(\x0c\x42\x31\xfa\xde\x1f-jackfan.us.kg/cosmos/cosmos-sdk/types.AccAddress\"(\n\x13\x41\x63tivePairMarshaler\x12\x11\n\tis_active\x18\x01 \x01(\x08\"\xaf\x01\n\x0bPostedPrice\x12\x1b\n\x07pair_id\x18\x01 \x01(\tB\n\xe2\xde\x1f\x06PairID\x12\x0e\n\x06oracle\x18\x02 \x01(\t\x12=\n\x05price\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x34\n\x06\x65xpiry\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x08\x90\xdf\x1f\x01\xc8\xde\x1f\x00\"j\n\x0c\x43urrentPrice\x12\x1b\n\x07pair_id\x18\x01 \x01(\tB\n\xe2\xde\x1f\x06PairID\x12=\n\x05price\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\"\xf1\x01\n\x0b\x43urrentTWAP\x12\x1b\n\x07pair_id\x18\x01 \x01(\tB\n\xe2\xde\x1f\x06PairID\x12\x41\n\tnumerator\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x43\n\x0b\x64\x65nominator\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12=\n\x05price\x18\x04 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x42\x39Z/github.com/NibiruChain/nibiru/x/pricefeed/types\xa8\xe2\x1e\x01\xe0\xe1\x1e\x01\x62\x06proto3') _PARAMS = DESCRIPTOR.message_types_by_name['Params'] +_PRICESNAPSHOT = DESCRIPTOR.message_types_by_name['PriceSnapshot'] _ORACLESMARSHALER = DESCRIPTOR.message_types_by_name['OraclesMarshaler'] _ACTIVEPAIRMARSHALER = DESCRIPTOR.message_types_by_name['ActivePairMarshaler'] _POSTEDPRICE = DESCRIPTOR.message_types_by_name['PostedPrice'] @@ -31,42 +32,49 @@ _CURRENTTWAP = DESCRIPTOR.message_types_by_name['CurrentTWAP'] Params = _reflection.GeneratedProtocolMessageType('Params', (_message.Message,), { 'DESCRIPTOR' : _PARAMS, - '__module__' : 'pricefeed.params_pb2' + '__module__' : 'pricefeed.state_pb2' # @@protoc_insertion_point(class_scope:nibiru.pricefeed.v1.Params) }) _sym_db.RegisterMessage(Params) +PriceSnapshot = _reflection.GeneratedProtocolMessageType('PriceSnapshot', (_message.Message,), { + 'DESCRIPTOR' : _PRICESNAPSHOT, + '__module__' : 'pricefeed.state_pb2' + # @@protoc_insertion_point(class_scope:nibiru.pricefeed.v1.PriceSnapshot) + }) +_sym_db.RegisterMessage(PriceSnapshot) + OraclesMarshaler = _reflection.GeneratedProtocolMessageType('OraclesMarshaler', (_message.Message,), { 'DESCRIPTOR' : _ORACLESMARSHALER, - '__module__' : 'pricefeed.params_pb2' + '__module__' : 'pricefeed.state_pb2' # @@protoc_insertion_point(class_scope:nibiru.pricefeed.v1.OraclesMarshaler) }) _sym_db.RegisterMessage(OraclesMarshaler) ActivePairMarshaler = _reflection.GeneratedProtocolMessageType('ActivePairMarshaler', (_message.Message,), { 'DESCRIPTOR' : _ACTIVEPAIRMARSHALER, - '__module__' : 'pricefeed.params_pb2' + '__module__' : 'pricefeed.state_pb2' # @@protoc_insertion_point(class_scope:nibiru.pricefeed.v1.ActivePairMarshaler) }) _sym_db.RegisterMessage(ActivePairMarshaler) PostedPrice = _reflection.GeneratedProtocolMessageType('PostedPrice', (_message.Message,), { 'DESCRIPTOR' : _POSTEDPRICE, - '__module__' : 'pricefeed.params_pb2' + '__module__' : 'pricefeed.state_pb2' # @@protoc_insertion_point(class_scope:nibiru.pricefeed.v1.PostedPrice) }) _sym_db.RegisterMessage(PostedPrice) CurrentPrice = _reflection.GeneratedProtocolMessageType('CurrentPrice', (_message.Message,), { 'DESCRIPTOR' : _CURRENTPRICE, - '__module__' : 'pricefeed.params_pb2' + '__module__' : 'pricefeed.state_pb2' # @@protoc_insertion_point(class_scope:nibiru.pricefeed.v1.CurrentPrice) }) _sym_db.RegisterMessage(CurrentPrice) CurrentTWAP = _reflection.GeneratedProtocolMessageType('CurrentTWAP', (_message.Message,), { 'DESCRIPTOR' : _CURRENTTWAP, - '__module__' : 'pricefeed.params_pb2' + '__module__' : 'pricefeed.state_pb2' # @@protoc_insertion_point(class_scope:nibiru.pricefeed.v1.CurrentTWAP) }) _sym_db.RegisterMessage(CurrentTWAP) @@ -74,11 +82,13 @@ if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z/github.com/NibiruChain/nibiru/x/pricefeed/types\250\342\036\001' + DESCRIPTOR._serialized_options = b'Z/github.com/NibiruChain/nibiru/x/pricefeed/types\250\342\036\001\340\341\036\001' _PARAMS.fields_by_name['pairs']._options = None _PARAMS.fields_by_name['pairs']._serialized_options = b'\310\336\037\000' _PARAMS.fields_by_name['twap_lookback_window']._options = None _PARAMS.fields_by_name['twap_lookback_window']._serialized_options = b'\310\336\037\000\230\337\037\001\352\336\037\036twap_lookback_window,omitempty\362\336\037\033yaml:\"twap_lookback_window\"' + _PRICESNAPSHOT.fields_by_name['price']._options = None + _PRICESNAPSHOT.fields_by_name['price']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' _ORACLESMARSHALER.fields_by_name['oracles']._options = None _ORACLESMARSHALER.fields_by_name['oracles']._serialized_options = b'\372\336\037-jackfan.us.kg/cosmos/cosmos-sdk/types.AccAddress' _POSTEDPRICE.fields_by_name['pair_id']._options = None @@ -99,16 +109,18 @@ _CURRENTTWAP.fields_by_name['denominator']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' _CURRENTTWAP.fields_by_name['price']._options = None _CURRENTTWAP.fields_by_name['price']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' - _PARAMS._serialized_start=183 - _PARAMS._serialized_end=371 - _ORACLESMARSHALER._serialized_start=373 - _ORACLESMARSHALER._serialized_end=459 - _ACTIVEPAIRMARSHALER._serialized_start=461 - _ACTIVEPAIRMARSHALER._serialized_end=501 - _POSTEDPRICE._serialized_start=504 - _POSTEDPRICE._serialized_end=679 - _CURRENTPRICE._serialized_start=681 - _CURRENTPRICE._serialized_end=787 - _CURRENTTWAP._serialized_start=790 - _CURRENTTWAP._serialized_end=1031 + _PARAMS._serialized_start=185 + _PARAMS._serialized_end=373 + _PRICESNAPSHOT._serialized_start=375 + _PRICESNAPSHOT._serialized_end=492 + _ORACLESMARSHALER._serialized_start=494 + _ORACLESMARSHALER._serialized_end=580 + _ACTIVEPAIRMARSHALER._serialized_start=582 + _ACTIVEPAIRMARSHALER._serialized_end=622 + _POSTEDPRICE._serialized_start=625 + _POSTEDPRICE._serialized_end=800 + _CURRENTPRICE._serialized_start=802 + _CURRENTPRICE._serialized_end=908 + _CURRENTTWAP._serialized_start=911 + _CURRENTTWAP._serialized_end=1152 # @@protoc_insertion_point(module_scope) diff --git a/nibiru_proto/proto/pricefeed/params_pb2.pyi b/nibiru_proto/proto/pricefeed/state_pb2.pyi similarity index 85% rename from nibiru_proto/proto/pricefeed/params_pb2.pyi rename to nibiru_proto/proto/pricefeed/state_pb2.pyi index 29458b7..db2cd43 100644 --- a/nibiru_proto/proto/pricefeed/params_pb2.pyi +++ b/nibiru_proto/proto/pricefeed/state_pb2.pyi @@ -21,7 +21,7 @@ class Params(google.protobuf.message.Message): TWAP_LOOKBACK_WINDOW_FIELD_NUMBER: builtins.int @property def pairs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[common.common_pb2.AssetPair]: - """Pairs is the list of valid trading pairs for the module. + """Pairs is the list of valid trading pairs for the module. Add new trading pairs """ pass @@ -38,8 +38,32 @@ class Params(google.protobuf.message.Message): def ClearField(self, field_name: typing_extensions.Literal["pairs",b"pairs","twap_lookback_window",b"twap_lookback_window"]) -> None: ... global___Params = Params +class PriceSnapshot(google.protobuf.message.Message): + """a snapshot of the pricefeed oracle's median price at a given point in time""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PAIR_ID_FIELD_NUMBER: builtins.int + PRICE_FIELD_NUMBER: builtins.int + TIMESTAMP_MS_FIELD_NUMBER: builtins.int + pair_id: typing.Text + """the token pair""" + + price: typing.Text + """the median prices of all oracles""" + + timestamp_ms: builtins.int + """milliseconds since unix epoch""" + + def __init__(self, + *, + pair_id: typing.Text = ..., + price: typing.Text = ..., + timestamp_ms: builtins.int = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["pair_id",b"pair_id","price",b"price","timestamp_ms",b"timestamp_ms"]) -> None: ... +global___PriceSnapshot = PriceSnapshot + class OraclesMarshaler(google.protobuf.message.Message): - """OraclesMarshaler is a codec.ProtoMarshaler for an oracles array in the + """OraclesMarshaler is a codec.ProtoMarshaler for an oracles array in the OraclesState sdk.KVStore. """ DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -54,7 +78,7 @@ class OraclesMarshaler(google.protobuf.message.Message): global___OraclesMarshaler = OraclesMarshaler class ActivePairMarshaler(google.protobuf.message.Message): - """ActivePairMarshaler is a codec.ProtoMarshaler for the "IsActive" status of + """ActivePairMarshaler is a codec.ProtoMarshaler for the "IsActive" status of a pair in the ActivePairState sdk.KVStore. """ DESCRIPTOR: google.protobuf.descriptor.Descriptor diff --git a/nibiru_proto/proto/vpool/v1/params_pb2_grpc.py b/nibiru_proto/proto/pricefeed/state_pb2_grpc.py similarity index 100% rename from nibiru_proto/proto/vpool/v1/params_pb2_grpc.py rename to nibiru_proto/proto/pricefeed/state_pb2_grpc.py diff --git a/nibiru_proto/proto/vpool/v1/params_pb2_grpc.pyi b/nibiru_proto/proto/pricefeed/state_pb2_grpc.pyi similarity index 100% rename from nibiru_proto/proto/vpool/v1/params_pb2_grpc.pyi rename to nibiru_proto/proto/pricefeed/state_pb2_grpc.pyi diff --git a/nibiru_proto/proto/vpool/v1/event_pb2.py b/nibiru_proto/proto/vpool/v1/event_pb2.py index 6192621..2a5ba68 100644 --- a/nibiru_proto/proto/vpool/v1/event_pb2.py +++ b/nibiru_proto/proto/vpool/v1/event_pb2.py @@ -18,14 +18,14 @@ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14vpool/v1/event.proto\x12\x0fnibiru.vpool.v1\x1a\x14gogoproto/gogo.proto\x1a\x1e\x63osmos/base/v1beta1/coin.proto\x1a\x19\x63osmos_proto/cosmos.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb6\x01\n\x19ReserveSnapshotSavedEvent\x12\x0c\n\x04pair\x18\x01 \x01(\t\x12\x45\n\rquote_reserve\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x44\n\x0c\x62\x61se_reserve\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\"\xb0\x01\n\x15SwapQuoteForBaseEvent\x12\x0c\n\x04pair\x18\x01 \x01(\t\x12\x44\n\x0cquote_amount\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x43\n\x0b\x62\x61se_amount\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\"\xb0\x01\n\x15SwapBaseForQuoteEvent\x12\x0c\n\x04pair\x18\x01 \x01(\t\x12\x44\n\x0cquote_amount\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x43\n\x0b\x62\x61se_amount\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\"\x98\x01\n\x10MarkPriceChanged\x12\x0c\n\x04pair\x18\x01 \x01(\t\x12=\n\x05price\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x37\n\ttimestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x08\x90\xdf\x1f\x01\xc8\xde\x1f\x00\x42-Z+github.com/NibiruChain/nibiru/x/vpool/typesb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14vpool/v1/event.proto\x12\x0fnibiru.vpool.v1\x1a\x14gogoproto/gogo.proto\x1a\x1e\x63osmos/base/v1beta1/coin.proto\x1a\x19\x63osmos_proto/cosmos.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb6\x01\n\x19ReserveSnapshotSavedEvent\x12\x0c\n\x04pair\x18\x01 \x01(\t\x12\x45\n\rquote_reserve\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x44\n\x0c\x62\x61se_reserve\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\"\xb0\x01\n\x15SwapQuoteForBaseEvent\x12\x0c\n\x04pair\x18\x01 \x01(\t\x12\x44\n\x0cquote_amount\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x43\n\x0b\x62\x61se_amount\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\"\xb0\x01\n\x15SwapBaseForQuoteEvent\x12\x0c\n\x04pair\x18\x01 \x01(\t\x12\x44\n\x0cquote_amount\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x43\n\x0b\x62\x61se_amount\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\"\x9d\x01\n\x15MarkPriceChangedEvent\x12\x0c\n\x04pair\x18\x01 \x01(\t\x12=\n\x05price\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x37\n\ttimestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x08\x90\xdf\x1f\x01\xc8\xde\x1f\x00\x42-Z+github.com/NibiruChain/nibiru/x/vpool/typesb\x06proto3') _RESERVESNAPSHOTSAVEDEVENT = DESCRIPTOR.message_types_by_name['ReserveSnapshotSavedEvent'] _SWAPQUOTEFORBASEEVENT = DESCRIPTOR.message_types_by_name['SwapQuoteForBaseEvent'] _SWAPBASEFORQUOTEEVENT = DESCRIPTOR.message_types_by_name['SwapBaseForQuoteEvent'] -_MARKPRICECHANGED = DESCRIPTOR.message_types_by_name['MarkPriceChanged'] +_MARKPRICECHANGEDEVENT = DESCRIPTOR.message_types_by_name['MarkPriceChangedEvent'] ReserveSnapshotSavedEvent = _reflection.GeneratedProtocolMessageType('ReserveSnapshotSavedEvent', (_message.Message,), { 'DESCRIPTOR' : _RESERVESNAPSHOTSAVEDEVENT, '__module__' : 'vpool.v1.event_pb2' @@ -47,12 +47,12 @@ }) _sym_db.RegisterMessage(SwapBaseForQuoteEvent) -MarkPriceChanged = _reflection.GeneratedProtocolMessageType('MarkPriceChanged', (_message.Message,), { - 'DESCRIPTOR' : _MARKPRICECHANGED, +MarkPriceChangedEvent = _reflection.GeneratedProtocolMessageType('MarkPriceChangedEvent', (_message.Message,), { + 'DESCRIPTOR' : _MARKPRICECHANGEDEVENT, '__module__' : 'vpool.v1.event_pb2' - # @@protoc_insertion_point(class_scope:nibiru.vpool.v1.MarkPriceChanged) + # @@protoc_insertion_point(class_scope:nibiru.vpool.v1.MarkPriceChangedEvent) }) -_sym_db.RegisterMessage(MarkPriceChanged) +_sym_db.RegisterMessage(MarkPriceChangedEvent) if _descriptor._USE_C_DESCRIPTORS == False: @@ -70,16 +70,16 @@ _SWAPBASEFORQUOTEEVENT.fields_by_name['quote_amount']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' _SWAPBASEFORQUOTEEVENT.fields_by_name['base_amount']._options = None _SWAPBASEFORQUOTEEVENT.fields_by_name['base_amount']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' - _MARKPRICECHANGED.fields_by_name['price']._options = None - _MARKPRICECHANGED.fields_by_name['price']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' - _MARKPRICECHANGED.fields_by_name['timestamp']._options = None - _MARKPRICECHANGED.fields_by_name['timestamp']._serialized_options = b'\220\337\037\001\310\336\037\000' + _MARKPRICECHANGEDEVENT.fields_by_name['price']._options = None + _MARKPRICECHANGEDEVENT.fields_by_name['price']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' + _MARKPRICECHANGEDEVENT.fields_by_name['timestamp']._options = None + _MARKPRICECHANGEDEVENT.fields_by_name['timestamp']._serialized_options = b'\220\337\037\001\310\336\037\000' _RESERVESNAPSHOTSAVEDEVENT._serialized_start=156 _RESERVESNAPSHOTSAVEDEVENT._serialized_end=338 _SWAPQUOTEFORBASEEVENT._serialized_start=341 _SWAPQUOTEFORBASEEVENT._serialized_end=517 _SWAPBASEFORQUOTEEVENT._serialized_start=520 _SWAPBASEFORQUOTEEVENT._serialized_end=696 - _MARKPRICECHANGED._serialized_start=699 - _MARKPRICECHANGED._serialized_end=851 + _MARKPRICECHANGEDEVENT._serialized_start=699 + _MARKPRICECHANGEDEVENT._serialized_end=856 # @@protoc_insertion_point(module_scope) diff --git a/nibiru_proto/proto/vpool/v1/event_pb2.pyi b/nibiru_proto/proto/vpool/v1/event_pb2.pyi index 13ad014..679d8c1 100644 --- a/nibiru_proto/proto/vpool/v1/event_pb2.pyi +++ b/nibiru_proto/proto/vpool/v1/event_pb2.pyi @@ -62,7 +62,7 @@ class SwapBaseForQuoteEvent(google.protobuf.message.Message): def ClearField(self, field_name: typing_extensions.Literal["base_amount",b"base_amount","pair",b"pair","quote_amount",b"quote_amount"]) -> None: ... global___SwapBaseForQuoteEvent = SwapBaseForQuoteEvent -class MarkPriceChanged(google.protobuf.message.Message): +class MarkPriceChangedEvent(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor PAIR_FIELD_NUMBER: builtins.int PRICE_FIELD_NUMBER: builtins.int @@ -79,4 +79,4 @@ class MarkPriceChanged(google.protobuf.message.Message): ) -> None: ... def HasField(self, field_name: typing_extensions.Literal["timestamp",b"timestamp"]) -> builtins.bool: ... def ClearField(self, field_name: typing_extensions.Literal["pair",b"pair","price",b"price","timestamp",b"timestamp"]) -> None: ... -global___MarkPriceChanged = MarkPriceChanged +global___MarkPriceChangedEvent = MarkPriceChangedEvent diff --git a/nibiru_proto/proto/vpool/v1/genesis_pb2.py b/nibiru_proto/proto/vpool/v1/genesis_pb2.py index 5083290..a90118f 100644 --- a/nibiru_proto/proto/vpool/v1/genesis_pb2.py +++ b/nibiru_proto/proto/vpool/v1/genesis_pb2.py @@ -13,11 +13,10 @@ from gogoproto import gogo_pb2 as gogoproto_dot_gogo__pb2 -from vpool.v1 import vpool_pb2 as vpool_dot_v1_dot_vpool__pb2 -from vpool.v1 import params_pb2 as vpool_dot_v1_dot_params__pb2 +from vpool.v1 import state_pb2 as vpool_dot_v1_dot_state__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16vpool/v1/genesis.proto\x12\x0fnibiru.vpool.v1\x1a\x14gogoproto/gogo.proto\x1a\x14vpool/v1/vpool.proto\x1a\x15vpool/v1/params.proto\"d\n\x0cGenesisState\x12%\n\x06vpools\x18\x01 \x03(\x0b\x32\x15.nibiru.vpool.v1.Pool\x12-\n\x06params\x18\x02 \x01(\x0b\x32\x17.nibiru.vpool.v1.ParamsB\x04\xc8\xde\x1f\x00\x42-Z+github.com/NibiruChain/nibiru/x/vpool/typesb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16vpool/v1/genesis.proto\x12\x0fnibiru.vpool.v1\x1a\x14gogoproto/gogo.proto\x1a\x14vpool/v1/state.proto\"w\n\x0cGenesisState\x12,\n\x06vpools\x18\x01 \x03(\x0b\x32\x16.nibiru.vpool.v1.VPoolB\x04\xc8\xde\x1f\x00\x12\x39\n\tsnapshots\x18\x02 \x03(\x0b\x32 .nibiru.vpool.v1.ReserveSnapshotB\x04\xc8\xde\x1f\x00\x42-Z+github.com/NibiruChain/nibiru/x/vpool/typesb\x06proto3') @@ -33,8 +32,10 @@ DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'Z+github.com/NibiruChain/nibiru/x/vpool/types' - _GENESISSTATE.fields_by_name['params']._options = None - _GENESISSTATE.fields_by_name['params']._serialized_options = b'\310\336\037\000' - _GENESISSTATE._serialized_start=110 - _GENESISSTATE._serialized_end=210 + _GENESISSTATE.fields_by_name['vpools']._options = None + _GENESISSTATE.fields_by_name['vpools']._serialized_options = b'\310\336\037\000' + _GENESISSTATE.fields_by_name['snapshots']._options = None + _GENESISSTATE.fields_by_name['snapshots']._serialized_options = b'\310\336\037\000' + _GENESISSTATE._serialized_start=87 + _GENESISSTATE._serialized_end=206 # @@protoc_insertion_point(module_scope) diff --git a/nibiru_proto/proto/vpool/v1/genesis_pb2.pyi b/nibiru_proto/proto/vpool/v1/genesis_pb2.pyi index f64d8ba..52c1fc5 100644 --- a/nibiru_proto/proto/vpool/v1/genesis_pb2.pyi +++ b/nibiru_proto/proto/vpool/v1/genesis_pb2.pyi @@ -8,8 +8,7 @@ import google.protobuf.internal.containers import google.protobuf.message import typing import typing_extensions -import vpool.v1.params_pb2 -import vpool.v1.vpool_pb2 +import vpool.v1.state_pb2 DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @@ -17,16 +16,15 @@ class GenesisState(google.protobuf.message.Message): """GenesisState defines the vpool module's genesis state.""" DESCRIPTOR: google.protobuf.descriptor.Descriptor VPOOLS_FIELD_NUMBER: builtins.int - PARAMS_FIELD_NUMBER: builtins.int + SNAPSHOTS_FIELD_NUMBER: builtins.int @property - def vpools(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[vpool.v1.vpool_pb2.Pool]: ... + def vpools(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[vpool.v1.state_pb2.VPool]: ... @property - def params(self) -> vpool.v1.params_pb2.Params: ... + def snapshots(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[vpool.v1.state_pb2.ReserveSnapshot]: ... def __init__(self, *, - vpools: typing.Optional[typing.Iterable[vpool.v1.vpool_pb2.Pool]] = ..., - params: typing.Optional[vpool.v1.params_pb2.Params] = ..., + vpools: typing.Optional[typing.Iterable[vpool.v1.state_pb2.VPool]] = ..., + snapshots: typing.Optional[typing.Iterable[vpool.v1.state_pb2.ReserveSnapshot]] = ..., ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["params",b"params"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["params",b"params","vpools",b"vpools"]) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["snapshots",b"snapshots","vpools",b"vpools"]) -> None: ... global___GenesisState = GenesisState diff --git a/nibiru_proto/proto/vpool/v1/params_pb2.py b/nibiru_proto/proto/vpool/v1/params_pb2.py deleted file mode 100644 index 9e44a24..0000000 --- a/nibiru_proto/proto/vpool/v1/params_pb2.py +++ /dev/null @@ -1,58 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: vpool/v1/params.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 message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from gogoproto import gogo_pb2 as gogoproto_dot_gogo__pb2 -from cosmos.base.v1beta1 import coin_pb2 as cosmos_dot_base_dot_v1beta1_dot_coin__pb2 -from cosmos_proto import cosmos_pb2 as cosmos__proto_dot_cosmos__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15vpool/v1/params.proto\x12\x0fnibiru.vpool.v1\x1a\x14gogoproto/gogo.proto\x1a\x1e\x63osmos/base/v1beta1/coin.proto\x1a\x19\x63osmos_proto/cosmos.proto\"\x0e\n\x06Params:\x04\x98\xa0\x1f\x00\"\xf1\x01\n\x0b\x43urrentTWAP\x12\x1b\n\x07pair_id\x18\x01 \x01(\tB\n\xe2\xde\x1f\x06PairID\x12\x41\n\tnumerator\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x43\n\x0b\x64\x65nominator\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12=\n\x05price\x18\x04 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x42-Z+github.com/NibiruChain/nibiru/x/vpool/typesb\x06proto3') - - - -_PARAMS = DESCRIPTOR.message_types_by_name['Params'] -_CURRENTTWAP = DESCRIPTOR.message_types_by_name['CurrentTWAP'] -Params = _reflection.GeneratedProtocolMessageType('Params', (_message.Message,), { - 'DESCRIPTOR' : _PARAMS, - '__module__' : 'vpool.v1.params_pb2' - # @@protoc_insertion_point(class_scope:nibiru.vpool.v1.Params) - }) -_sym_db.RegisterMessage(Params) - -CurrentTWAP = _reflection.GeneratedProtocolMessageType('CurrentTWAP', (_message.Message,), { - 'DESCRIPTOR' : _CURRENTTWAP, - '__module__' : 'vpool.v1.params_pb2' - # @@protoc_insertion_point(class_scope:nibiru.vpool.v1.CurrentTWAP) - }) -_sym_db.RegisterMessage(CurrentTWAP) - -if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z+github.com/NibiruChain/nibiru/x/vpool/types' - _PARAMS._options = None - _PARAMS._serialized_options = b'\230\240\037\000' - _CURRENTTWAP.fields_by_name['pair_id']._options = None - _CURRENTTWAP.fields_by_name['pair_id']._serialized_options = b'\342\336\037\006PairID' - _CURRENTTWAP.fields_by_name['numerator']._options = None - _CURRENTTWAP.fields_by_name['numerator']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' - _CURRENTTWAP.fields_by_name['denominator']._options = None - _CURRENTTWAP.fields_by_name['denominator']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' - _CURRENTTWAP.fields_by_name['price']._options = None - _CURRENTTWAP.fields_by_name['price']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' - _PARAMS._serialized_start=123 - _PARAMS._serialized_end=137 - _CURRENTTWAP._serialized_start=140 - _CURRENTTWAP._serialized_end=381 -# @@protoc_insertion_point(module_scope) diff --git a/nibiru_proto/proto/vpool/v1/params_pb2.pyi b/nibiru_proto/proto/vpool/v1/params_pb2.pyi deleted file mode 100644 index 6c5181f..0000000 --- a/nibiru_proto/proto/vpool/v1/params_pb2.pyi +++ /dev/null @@ -1,39 +0,0 @@ -""" -@generated by mypy-protobuf. Do not edit manually! -isort:skip_file -""" -import builtins -import google.protobuf.descriptor -import google.protobuf.message -import typing -import typing_extensions - -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor - -class Params(google.protobuf.message.Message): - """Params defines the parameters for the module.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - def __init__(self, - ) -> None: ... -global___Params = Params - -class CurrentTWAP(google.protobuf.message.Message): - """CurrentTWAP states defines the numerator and denominator for the TWAP calculation""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - PAIR_ID_FIELD_NUMBER: builtins.int - NUMERATOR_FIELD_NUMBER: builtins.int - DENOMINATOR_FIELD_NUMBER: builtins.int - PRICE_FIELD_NUMBER: builtins.int - pair_id: typing.Text - numerator: typing.Text - denominator: typing.Text - price: typing.Text - def __init__(self, - *, - pair_id: typing.Text = ..., - numerator: typing.Text = ..., - denominator: typing.Text = ..., - price: typing.Text = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["denominator",b"denominator","numerator",b"numerator","pair_id",b"pair_id","price",b"price"]) -> None: ... -global___CurrentTWAP = CurrentTWAP diff --git a/nibiru_proto/proto/vpool/v1/query_pb2.py b/nibiru_proto/proto/vpool/v1/query_pb2.py index 785abff..da32380 100644 --- a/nibiru_proto/proto/vpool/v1/query_pb2.py +++ b/nibiru_proto/proto/vpool/v1/query_pb2.py @@ -14,10 +14,10 @@ from gogoproto import gogo_pb2 as gogoproto_dot_gogo__pb2 from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from vpool.v1 import vpool_pb2 as vpool_dot_v1_dot_vpool__pb2 +from vpool.v1 import state_pb2 as vpool_dot_v1_dot_state__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14vpool/v1/query.proto\x12\x0fnibiru.vpool.v1\x1a\x14gogoproto/gogo.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x14vpool/v1/vpool.proto\")\n\x19QueryReserveAssetsRequest\x12\x0c\n\x04pair\x18\x01 \x01(\t\"\xb5\x01\n\x1aQueryReserveAssetsResponse\x12J\n\x12\x62\x61se_asset_reserve\x18\x01 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12K\n\x13quote_asset_reserve\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\"\x16\n\x14QueryAllPoolsRequest\"p\n\x15QueryAllPoolsResponse\x12$\n\x05pools\x18\x01 \x03(\x0b\x32\x15.nibiru.vpool.v1.Pool\x12\x31\n\x06prices\x18\x02 \x03(\x0b\x32\x1b.nibiru.vpool.v1.PoolPricesB\x04\xc8\xde\x1f\x00\"\xa4\x01\n\x1aQueryBaseAssetPriceRequest\x12\x0c\n\x04pair\x18\x01 \x01(\t\x12-\n\tdirection\x18\x02 \x01(\x0e\x32\x1a.nibiru.vpool.v1.Direction\x12I\n\x11\x62\x61se_asset_amount\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\"k\n\x1bQueryBaseAssetPriceResponse\x12L\n\x14price_in_quote_denom\x18\x01 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x32\xaa\x03\n\x05Query\x12\x8e\x01\n\rReserveAssets\x12*.nibiru.vpool.v1.QueryReserveAssetsRequest\x1a+.nibiru.vpool.v1.QueryReserveAssetsResponse\"$\x82\xd3\xe4\x93\x02\x1e\x12\x1c/nibiru/vpool/reserve_assets\x12z\n\x08\x41llPools\x12%.nibiru.vpool.v1.QueryAllPoolsRequest\x1a&.nibiru.vpool.v1.QueryAllPoolsResponse\"\x1f\x82\xd3\xe4\x93\x02\x19\x12\x17/nibiru/vpool/all_pools\x12\x93\x01\n\x0e\x42\x61seAssetPrice\x12+.nibiru.vpool.v1.QueryBaseAssetPriceRequest\x1a,.nibiru.vpool.v1.QueryBaseAssetPriceResponse\"&\x82\xd3\xe4\x93\x02 \x12\x1e/nibiru/vpool/base_asset_priceB-Z+github.com/NibiruChain/nibiru/x/vpool/typesb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14vpool/v1/query.proto\x12\x0fnibiru.vpool.v1\x1a\x14gogoproto/gogo.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x14vpool/v1/state.proto\")\n\x19QueryReserveAssetsRequest\x12\x0c\n\x04pair\x18\x01 \x01(\t\"\xb5\x01\n\x1aQueryReserveAssetsResponse\x12J\n\x12\x62\x61se_asset_reserve\x18\x01 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12K\n\x13quote_asset_reserve\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\"\x16\n\x14QueryAllPoolsRequest\"w\n\x15QueryAllPoolsResponse\x12+\n\x05pools\x18\x01 \x03(\x0b\x32\x16.nibiru.vpool.v1.VPoolB\x04\xc8\xde\x1f\x00\x12\x31\n\x06prices\x18\x02 \x03(\x0b\x32\x1b.nibiru.vpool.v1.PoolPricesB\x04\xc8\xde\x1f\x00\"\xa4\x01\n\x1aQueryBaseAssetPriceRequest\x12\x0c\n\x04pair\x18\x01 \x01(\t\x12-\n\tdirection\x18\x02 \x01(\x0e\x32\x1a.nibiru.vpool.v1.Direction\x12I\n\x11\x62\x61se_asset_amount\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\"k\n\x1bQueryBaseAssetPriceResponse\x12L\n\x14price_in_quote_denom\x18\x01 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x32\xaa\x03\n\x05Query\x12\x8e\x01\n\rReserveAssets\x12*.nibiru.vpool.v1.QueryReserveAssetsRequest\x1a+.nibiru.vpool.v1.QueryReserveAssetsResponse\"$\x82\xd3\xe4\x93\x02\x1e\x12\x1c/nibiru/vpool/reserve_assets\x12z\n\x08\x41llPools\x12%.nibiru.vpool.v1.QueryAllPoolsRequest\x1a&.nibiru.vpool.v1.QueryAllPoolsResponse\"\x1f\x82\xd3\xe4\x93\x02\x19\x12\x17/nibiru/vpool/all_pools\x12\x93\x01\n\x0e\x42\x61seAssetPrice\x12+.nibiru.vpool.v1.QueryBaseAssetPriceRequest\x1a,.nibiru.vpool.v1.QueryBaseAssetPriceResponse\"&\x82\xd3\xe4\x93\x02 \x12\x1e/nibiru/vpool/base_asset_priceB-Z+github.com/NibiruChain/nibiru/x/vpool/typesb\x06proto3') @@ -78,6 +78,8 @@ _QUERYRESERVEASSETSRESPONSE.fields_by_name['base_asset_reserve']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' _QUERYRESERVEASSETSRESPONSE.fields_by_name['quote_asset_reserve']._options = None _QUERYRESERVEASSETSRESPONSE.fields_by_name['quote_asset_reserve']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' + _QUERYALLPOOLSRESPONSE.fields_by_name['pools']._options = None + _QUERYALLPOOLSRESPONSE.fields_by_name['pools']._serialized_options = b'\310\336\037\000' _QUERYALLPOOLSRESPONSE.fields_by_name['prices']._options = None _QUERYALLPOOLSRESPONSE.fields_by_name['prices']._serialized_options = b'\310\336\037\000' _QUERYBASEASSETPRICEREQUEST.fields_by_name['base_asset_amount']._options = None @@ -97,11 +99,11 @@ _QUERYALLPOOLSREQUEST._serialized_start=342 _QUERYALLPOOLSREQUEST._serialized_end=364 _QUERYALLPOOLSRESPONSE._serialized_start=366 - _QUERYALLPOOLSRESPONSE._serialized_end=478 - _QUERYBASEASSETPRICEREQUEST._serialized_start=481 - _QUERYBASEASSETPRICEREQUEST._serialized_end=645 - _QUERYBASEASSETPRICERESPONSE._serialized_start=647 - _QUERYBASEASSETPRICERESPONSE._serialized_end=754 - _QUERY._serialized_start=757 - _QUERY._serialized_end=1183 + _QUERYALLPOOLSRESPONSE._serialized_end=485 + _QUERYBASEASSETPRICEREQUEST._serialized_start=488 + _QUERYBASEASSETPRICEREQUEST._serialized_end=652 + _QUERYBASEASSETPRICERESPONSE._serialized_start=654 + _QUERYBASEASSETPRICERESPONSE._serialized_end=761 + _QUERY._serialized_start=764 + _QUERY._serialized_end=1190 # @@protoc_insertion_point(module_scope) diff --git a/nibiru_proto/proto/vpool/v1/query_pb2.pyi b/nibiru_proto/proto/vpool/v1/query_pb2.pyi index 51302ad..3a33027 100644 --- a/nibiru_proto/proto/vpool/v1/query_pb2.pyi +++ b/nibiru_proto/proto/vpool/v1/query_pb2.pyi @@ -8,7 +8,7 @@ import google.protobuf.internal.containers import google.protobuf.message import typing import typing_extensions -import vpool.v1.vpool_pb2 +import vpool.v1.state_pb2 DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @@ -60,13 +60,13 @@ class QueryAllPoolsResponse(google.protobuf.message.Message): POOLS_FIELD_NUMBER: builtins.int PRICES_FIELD_NUMBER: builtins.int @property - def pools(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[vpool.v1.vpool_pb2.Pool]: ... + def pools(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[vpool.v1.state_pb2.VPool]: ... @property - def prices(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[vpool.v1.vpool_pb2.PoolPrices]: ... + def prices(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[vpool.v1.state_pb2.PoolPrices]: ... def __init__(self, *, - pools: typing.Optional[typing.Iterable[vpool.v1.vpool_pb2.Pool]] = ..., - prices: typing.Optional[typing.Iterable[vpool.v1.vpool_pb2.PoolPrices]] = ..., + pools: typing.Optional[typing.Iterable[vpool.v1.state_pb2.VPool]] = ..., + prices: typing.Optional[typing.Iterable[vpool.v1.state_pb2.PoolPrices]] = ..., ) -> None: ... def ClearField(self, field_name: typing_extensions.Literal["pools",b"pools","prices",b"prices"]) -> None: ... global___QueryAllPoolsResponse = QueryAllPoolsResponse @@ -80,14 +80,14 @@ class QueryBaseAssetPriceRequest(google.protobuf.message.Message): DIRECTION_FIELD_NUMBER: builtins.int BASE_ASSET_AMOUNT_FIELD_NUMBER: builtins.int pair: typing.Text - direction: vpool.v1.vpool_pb2.Direction.ValueType + direction: vpool.v1.state_pb2.Direction.ValueType base_asset_amount: typing.Text """base asset is the crypto asset, e.g. BTC or ETH""" def __init__(self, *, pair: typing.Text = ..., - direction: vpool.v1.vpool_pb2.Direction.ValueType = ..., + direction: vpool.v1.state_pb2.Direction.ValueType = ..., base_asset_amount: typing.Text = ..., ) -> None: ... def ClearField(self, field_name: typing_extensions.Literal["base_asset_amount",b"base_asset_amount","direction",b"direction","pair",b"pair"]) -> None: ... diff --git a/nibiru_proto/proto/vpool/v1/state_pb2.py b/nibiru_proto/proto/vpool/v1/state_pb2.py new file mode 100644 index 0000000..4ec934a --- /dev/null +++ b/nibiru_proto/proto/vpool/v1/state_pb2.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: vpool/v1/state.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from cosmos_proto import cosmos_pb2 as cosmos__proto_dot_cosmos__pb2 +from gogoproto import gogo_pb2 as gogoproto_dot_gogo__pb2 +from common import common_pb2 as common_dot_common__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14vpool/v1/state.proto\x12\x0fnibiru.vpool.v1\x1a\x19\x63osmos_proto/cosmos.proto\x1a\x14gogoproto/gogo.proto\x1a\x13\x63ommon/common.proto\"\xd3\x04\n\x05VPool\x12,\n\x04pair\x18\x01 \x01(\x0b\x32\x18.nibiru.common.AssetPairB\x04\xc8\xde\x1f\x00\x12J\n\x12\x62\x61se_asset_reserve\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12K\n\x13quote_asset_reserve\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12I\n\x11trade_limit_ratio\x18\x04 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12O\n\x17\x66luctuation_limit_ratio\x18\x05 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12O\n\x17max_oracle_spread_ratio\x18\x06 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12P\n\x18maintenance_margin_ratio\x18\x07 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x44\n\x0cmax_leverage\x18\x08 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\"\xf1\x01\n\x0b\x43urrentTWAP\x12\x1b\n\x07pair_id\x18\x01 \x01(\tB\n\xe2\xde\x1f\x06PairID\x12\x41\n\tnumerator\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x43\n\x0b\x64\x65nominator\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12=\n\x05price\x18\x04 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\"\xee\x01\n\x0fReserveSnapshot\x12,\n\x04pair\x18\x05 \x01(\x0b\x32\x18.nibiru.common.AssetPairB\x04\xc8\xde\x1f\x00\x12J\n\x12\x62\x61se_asset_reserve\x18\x01 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12K\n\x13quote_asset_reserve\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x14\n\x0ctimestamp_ms\x18\x03 \x01(\x03\"\xfd\x01\n\nPoolPrices\x12\x0c\n\x04pair\x18\t \x01(\t\x12\x42\n\nmark_price\x18\n \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x13\n\x0bindex_price\x18\x0b \x01(\t\x12\x11\n\ttwap_mark\x18\x0c \x01(\t\x12_\n\x0eswap_invariant\x18\r \x01(\tBG\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xf2\xde\x1f\x15yaml:\"swap_invariant\"\xc8\xde\x1f\x00\x12\x14\n\x0c\x62lock_number\x18\x0e \x01(\x03*M\n\tDirection\x12\x19\n\x15\x44IRECTION_UNSPECIFIED\x10\x00\x12\x0f\n\x0b\x41\x44\x44_TO_POOL\x10\x01\x12\x14\n\x10REMOVE_FROM_POOL\x10\x02*g\n\x0eTwapCalcOption\x12 \n\x1cTWAP_CALC_OPTION_UNSPECIFIED\x10\x00\x12\x08\n\x04SPOT\x10\x01\x12\x14\n\x10QUOTE_ASSET_SWAP\x10\x02\x12\x13\n\x0f\x42\x41SE_ASSET_SWAP\x10\x03\x42-Z+github.com/NibiruChain/nibiru/x/vpool/typesb\x06proto3') + +_DIRECTION = DESCRIPTOR.enum_types_by_name['Direction'] +Direction = enum_type_wrapper.EnumTypeWrapper(_DIRECTION) +_TWAPCALCOPTION = DESCRIPTOR.enum_types_by_name['TwapCalcOption'] +TwapCalcOption = enum_type_wrapper.EnumTypeWrapper(_TWAPCALCOPTION) +DIRECTION_UNSPECIFIED = 0 +ADD_TO_POOL = 1 +REMOVE_FROM_POOL = 2 +TWAP_CALC_OPTION_UNSPECIFIED = 0 +SPOT = 1 +QUOTE_ASSET_SWAP = 2 +BASE_ASSET_SWAP = 3 + + +_VPOOL = DESCRIPTOR.message_types_by_name['VPool'] +_CURRENTTWAP = DESCRIPTOR.message_types_by_name['CurrentTWAP'] +_RESERVESNAPSHOT = DESCRIPTOR.message_types_by_name['ReserveSnapshot'] +_POOLPRICES = DESCRIPTOR.message_types_by_name['PoolPrices'] +VPool = _reflection.GeneratedProtocolMessageType('VPool', (_message.Message,), { + 'DESCRIPTOR' : _VPOOL, + '__module__' : 'vpool.v1.state_pb2' + # @@protoc_insertion_point(class_scope:nibiru.vpool.v1.VPool) + }) +_sym_db.RegisterMessage(VPool) + +CurrentTWAP = _reflection.GeneratedProtocolMessageType('CurrentTWAP', (_message.Message,), { + 'DESCRIPTOR' : _CURRENTTWAP, + '__module__' : 'vpool.v1.state_pb2' + # @@protoc_insertion_point(class_scope:nibiru.vpool.v1.CurrentTWAP) + }) +_sym_db.RegisterMessage(CurrentTWAP) + +ReserveSnapshot = _reflection.GeneratedProtocolMessageType('ReserveSnapshot', (_message.Message,), { + 'DESCRIPTOR' : _RESERVESNAPSHOT, + '__module__' : 'vpool.v1.state_pb2' + # @@protoc_insertion_point(class_scope:nibiru.vpool.v1.ReserveSnapshot) + }) +_sym_db.RegisterMessage(ReserveSnapshot) + +PoolPrices = _reflection.GeneratedProtocolMessageType('PoolPrices', (_message.Message,), { + 'DESCRIPTOR' : _POOLPRICES, + '__module__' : 'vpool.v1.state_pb2' + # @@protoc_insertion_point(class_scope:nibiru.vpool.v1.PoolPrices) + }) +_sym_db.RegisterMessage(PoolPrices) + +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'Z+github.com/NibiruChain/nibiru/x/vpool/types' + _VPOOL.fields_by_name['pair']._options = None + _VPOOL.fields_by_name['pair']._serialized_options = b'\310\336\037\000' + _VPOOL.fields_by_name['base_asset_reserve']._options = None + _VPOOL.fields_by_name['base_asset_reserve']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' + _VPOOL.fields_by_name['quote_asset_reserve']._options = None + _VPOOL.fields_by_name['quote_asset_reserve']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' + _VPOOL.fields_by_name['trade_limit_ratio']._options = None + _VPOOL.fields_by_name['trade_limit_ratio']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' + _VPOOL.fields_by_name['fluctuation_limit_ratio']._options = None + _VPOOL.fields_by_name['fluctuation_limit_ratio']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' + _VPOOL.fields_by_name['max_oracle_spread_ratio']._options = None + _VPOOL.fields_by_name['max_oracle_spread_ratio']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' + _VPOOL.fields_by_name['maintenance_margin_ratio']._options = None + _VPOOL.fields_by_name['maintenance_margin_ratio']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' + _VPOOL.fields_by_name['max_leverage']._options = None + _VPOOL.fields_by_name['max_leverage']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' + _CURRENTTWAP.fields_by_name['pair_id']._options = None + _CURRENTTWAP.fields_by_name['pair_id']._serialized_options = b'\342\336\037\006PairID' + _CURRENTTWAP.fields_by_name['numerator']._options = None + _CURRENTTWAP.fields_by_name['numerator']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' + _CURRENTTWAP.fields_by_name['denominator']._options = None + _CURRENTTWAP.fields_by_name['denominator']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' + _CURRENTTWAP.fields_by_name['price']._options = None + _CURRENTTWAP.fields_by_name['price']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' + _RESERVESNAPSHOT.fields_by_name['pair']._options = None + _RESERVESNAPSHOT.fields_by_name['pair']._serialized_options = b'\310\336\037\000' + _RESERVESNAPSHOT.fields_by_name['base_asset_reserve']._options = None + _RESERVESNAPSHOT.fields_by_name['base_asset_reserve']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' + _RESERVESNAPSHOT.fields_by_name['quote_asset_reserve']._options = None + _RESERVESNAPSHOT.fields_by_name['quote_asset_reserve']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' + _POOLPRICES.fields_by_name['mark_price']._options = None + _POOLPRICES.fields_by_name['mark_price']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' + _POOLPRICES.fields_by_name['swap_invariant']._options = None + _POOLPRICES.fields_by_name['swap_invariant']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Int\362\336\037\025yaml:\"swap_invariant\"\310\336\037\000' + _DIRECTION._serialized_start=1450 + _DIRECTION._serialized_end=1527 + _TWAPCALCOPTION._serialized_start=1529 + _TWAPCALCOPTION._serialized_end=1632 + _VPOOL._serialized_start=112 + _VPOOL._serialized_end=707 + _CURRENTTWAP._serialized_start=710 + _CURRENTTWAP._serialized_end=951 + _RESERVESNAPSHOT._serialized_start=954 + _RESERVESNAPSHOT._serialized_end=1192 + _POOLPRICES._serialized_start=1195 + _POOLPRICES._serialized_end=1448 +# @@protoc_insertion_point(module_scope) diff --git a/nibiru_proto/proto/vpool/v1/vpool_pb2.pyi b/nibiru_proto/proto/vpool/v1/state_pb2.pyi similarity index 84% rename from nibiru_proto/proto/vpool/v1/vpool_pb2.pyi rename to nibiru_proto/proto/vpool/v1/state_pb2.pyi index fc0809b..f1e32ad 100644 --- a/nibiru_proto/proto/vpool/v1/vpool_pb2.pyi +++ b/nibiru_proto/proto/vpool/v1/state_pb2.pyi @@ -61,32 +61,7 @@ BASE_ASSET_SWAP: TwapCalcOption.ValueType # 3 global___TwapCalcOption = TwapCalcOption -class ReserveSnapshot(google.protobuf.message.Message): - """a snapshot of the vpool's reserves at a given point in time""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - BASE_ASSET_RESERVE_FIELD_NUMBER: builtins.int - QUOTE_ASSET_RESERVE_FIELD_NUMBER: builtins.int - TIMESTAMP_MS_FIELD_NUMBER: builtins.int - BLOCK_NUMBER_FIELD_NUMBER: builtins.int - base_asset_reserve: typing.Text - quote_asset_reserve: typing.Text - """quote asset is usually the margin asset, e.g. NUSD""" - - timestamp_ms: builtins.int - """milliseconds since unix epoch""" - - block_number: builtins.int - def __init__(self, - *, - base_asset_reserve: typing.Text = ..., - quote_asset_reserve: typing.Text = ..., - timestamp_ms: builtins.int = ..., - block_number: builtins.int = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["base_asset_reserve",b"base_asset_reserve","block_number",b"block_number","quote_asset_reserve",b"quote_asset_reserve","timestamp_ms",b"timestamp_ms"]) -> None: ... -global___ReserveSnapshot = ReserveSnapshot - -class Pool(google.protobuf.message.Message): +class VPool(google.protobuf.message.Message): """A virtual pool used only for price discovery of perpetual futures contracts. No real liquidity exists in this pool. """ @@ -137,7 +112,55 @@ class Pool(google.protobuf.message.Message): ) -> None: ... def HasField(self, field_name: typing_extensions.Literal["pair",b"pair"]) -> builtins.bool: ... def ClearField(self, field_name: typing_extensions.Literal["base_asset_reserve",b"base_asset_reserve","fluctuation_limit_ratio",b"fluctuation_limit_ratio","maintenance_margin_ratio",b"maintenance_margin_ratio","max_leverage",b"max_leverage","max_oracle_spread_ratio",b"max_oracle_spread_ratio","pair",b"pair","quote_asset_reserve",b"quote_asset_reserve","trade_limit_ratio",b"trade_limit_ratio"]) -> None: ... -global___Pool = Pool +global___VPool = VPool + +class CurrentTWAP(google.protobuf.message.Message): + """CurrentTWAP states defines the numerator and denominator for the TWAP calculation""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PAIR_ID_FIELD_NUMBER: builtins.int + NUMERATOR_FIELD_NUMBER: builtins.int + DENOMINATOR_FIELD_NUMBER: builtins.int + PRICE_FIELD_NUMBER: builtins.int + pair_id: typing.Text + numerator: typing.Text + denominator: typing.Text + price: typing.Text + def __init__(self, + *, + pair_id: typing.Text = ..., + numerator: typing.Text = ..., + denominator: typing.Text = ..., + price: typing.Text = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["denominator",b"denominator","numerator",b"numerator","pair_id",b"pair_id","price",b"price"]) -> None: ... +global___CurrentTWAP = CurrentTWAP + +class ReserveSnapshot(google.protobuf.message.Message): + """a snapshot of the vpool's reserves at a given point in time""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PAIR_FIELD_NUMBER: builtins.int + BASE_ASSET_RESERVE_FIELD_NUMBER: builtins.int + QUOTE_ASSET_RESERVE_FIELD_NUMBER: builtins.int + TIMESTAMP_MS_FIELD_NUMBER: builtins.int + @property + def pair(self) -> common.common_pb2.AssetPair: ... + base_asset_reserve: typing.Text + quote_asset_reserve: typing.Text + """quote asset is usually the margin asset, e.g. NUSD""" + + timestamp_ms: builtins.int + """milliseconds since unix epoch""" + + def __init__(self, + *, + pair: typing.Optional[common.common_pb2.AssetPair] = ..., + base_asset_reserve: typing.Text = ..., + quote_asset_reserve: typing.Text = ..., + timestamp_ms: builtins.int = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["pair",b"pair"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["base_asset_reserve",b"base_asset_reserve","pair",b"pair","quote_asset_reserve",b"quote_asset_reserve","timestamp_ms",b"timestamp_ms"]) -> None: ... +global___ReserveSnapshot = ReserveSnapshot class PoolPrices(google.protobuf.message.Message): """PoolPrices is a simple structure that displays a snapshot of the mark and index diff --git a/nibiru_proto/proto/vpool/v1/vpool_pb2_grpc.py b/nibiru_proto/proto/vpool/v1/state_pb2_grpc.py similarity index 100% rename from nibiru_proto/proto/vpool/v1/vpool_pb2_grpc.py rename to nibiru_proto/proto/vpool/v1/state_pb2_grpc.py diff --git a/nibiru_proto/proto/vpool/v1/vpool_pb2_grpc.pyi b/nibiru_proto/proto/vpool/v1/state_pb2_grpc.pyi similarity index 100% rename from nibiru_proto/proto/vpool/v1/vpool_pb2_grpc.pyi rename to nibiru_proto/proto/vpool/v1/state_pb2_grpc.pyi diff --git a/nibiru_proto/proto/vpool/v1/vpool_pb2.py b/nibiru_proto/proto/vpool/v1/vpool_pb2.py deleted file mode 100644 index 98108c0..0000000 --- a/nibiru_proto/proto/vpool/v1/vpool_pb2.py +++ /dev/null @@ -1,98 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: vpool/v1/vpool.proto -"""Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from cosmos_proto import cosmos_pb2 as cosmos__proto_dot_cosmos__pb2 -from gogoproto import gogo_pb2 as gogoproto_dot_gogo__pb2 -from common import common_pb2 as common_dot_common__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14vpool/v1/vpool.proto\x12\x0fnibiru.vpool.v1\x1a\x19\x63osmos_proto/cosmos.proto\x1a\x14gogoproto/gogo.proto\x1a\x13\x63ommon/common.proto\"\xd6\x01\n\x0fReserveSnapshot\x12J\n\x12\x62\x61se_asset_reserve\x18\x01 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12K\n\x13quote_asset_reserve\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x14\n\x0ctimestamp_ms\x18\x03 \x01(\x03\x12\x14\n\x0c\x62lock_number\x18\x04 \x01(\x03\"\xd2\x04\n\x04Pool\x12,\n\x04pair\x18\x01 \x01(\x0b\x32\x18.nibiru.common.AssetPairB\x04\xc8\xde\x1f\x00\x12J\n\x12\x62\x61se_asset_reserve\x18\x02 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12K\n\x13quote_asset_reserve\x18\x03 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12I\n\x11trade_limit_ratio\x18\x04 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12O\n\x17\x66luctuation_limit_ratio\x18\x05 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12O\n\x17max_oracle_spread_ratio\x18\x06 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12P\n\x18maintenance_margin_ratio\x18\x07 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x44\n\x0cmax_leverage\x18\x08 \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\"\xfd\x01\n\nPoolPrices\x12\x0c\n\x04pair\x18\t \x01(\t\x12\x42\n\nmark_price\x18\n \x01(\tB.\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Dec\xc8\xde\x1f\x00\x12\x13\n\x0bindex_price\x18\x0b \x01(\t\x12\x11\n\ttwap_mark\x18\x0c \x01(\t\x12_\n\x0eswap_invariant\x18\r \x01(\tBG\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\xf2\xde\x1f\x15yaml:\"swap_invariant\"\xc8\xde\x1f\x00\x12\x14\n\x0c\x62lock_number\x18\x0e \x01(\x03*M\n\tDirection\x12\x19\n\x15\x44IRECTION_UNSPECIFIED\x10\x00\x12\x0f\n\x0b\x41\x44\x44_TO_POOL\x10\x01\x12\x14\n\x10REMOVE_FROM_POOL\x10\x02*g\n\x0eTwapCalcOption\x12 \n\x1cTWAP_CALC_OPTION_UNSPECIFIED\x10\x00\x12\x08\n\x04SPOT\x10\x01\x12\x14\n\x10QUOTE_ASSET_SWAP\x10\x02\x12\x13\n\x0f\x42\x41SE_ASSET_SWAP\x10\x03\x42-Z+github.com/NibiruChain/nibiru/x/vpool/typesb\x06proto3') - -_DIRECTION = DESCRIPTOR.enum_types_by_name['Direction'] -Direction = enum_type_wrapper.EnumTypeWrapper(_DIRECTION) -_TWAPCALCOPTION = DESCRIPTOR.enum_types_by_name['TwapCalcOption'] -TwapCalcOption = enum_type_wrapper.EnumTypeWrapper(_TWAPCALCOPTION) -DIRECTION_UNSPECIFIED = 0 -ADD_TO_POOL = 1 -REMOVE_FROM_POOL = 2 -TWAP_CALC_OPTION_UNSPECIFIED = 0 -SPOT = 1 -QUOTE_ASSET_SWAP = 2 -BASE_ASSET_SWAP = 3 - - -_RESERVESNAPSHOT = DESCRIPTOR.message_types_by_name['ReserveSnapshot'] -_POOL = DESCRIPTOR.message_types_by_name['Pool'] -_POOLPRICES = DESCRIPTOR.message_types_by_name['PoolPrices'] -ReserveSnapshot = _reflection.GeneratedProtocolMessageType('ReserveSnapshot', (_message.Message,), { - 'DESCRIPTOR' : _RESERVESNAPSHOT, - '__module__' : 'vpool.v1.vpool_pb2' - # @@protoc_insertion_point(class_scope:nibiru.vpool.v1.ReserveSnapshot) - }) -_sym_db.RegisterMessage(ReserveSnapshot) - -Pool = _reflection.GeneratedProtocolMessageType('Pool', (_message.Message,), { - 'DESCRIPTOR' : _POOL, - '__module__' : 'vpool.v1.vpool_pb2' - # @@protoc_insertion_point(class_scope:nibiru.vpool.v1.Pool) - }) -_sym_db.RegisterMessage(Pool) - -PoolPrices = _reflection.GeneratedProtocolMessageType('PoolPrices', (_message.Message,), { - 'DESCRIPTOR' : _POOLPRICES, - '__module__' : 'vpool.v1.vpool_pb2' - # @@protoc_insertion_point(class_scope:nibiru.vpool.v1.PoolPrices) - }) -_sym_db.RegisterMessage(PoolPrices) - -if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z+github.com/NibiruChain/nibiru/x/vpool/types' - _RESERVESNAPSHOT.fields_by_name['base_asset_reserve']._options = None - _RESERVESNAPSHOT.fields_by_name['base_asset_reserve']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' - _RESERVESNAPSHOT.fields_by_name['quote_asset_reserve']._options = None - _RESERVESNAPSHOT.fields_by_name['quote_asset_reserve']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' - _POOL.fields_by_name['pair']._options = None - _POOL.fields_by_name['pair']._serialized_options = b'\310\336\037\000' - _POOL.fields_by_name['base_asset_reserve']._options = None - _POOL.fields_by_name['base_asset_reserve']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' - _POOL.fields_by_name['quote_asset_reserve']._options = None - _POOL.fields_by_name['quote_asset_reserve']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' - _POOL.fields_by_name['trade_limit_ratio']._options = None - _POOL.fields_by_name['trade_limit_ratio']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' - _POOL.fields_by_name['fluctuation_limit_ratio']._options = None - _POOL.fields_by_name['fluctuation_limit_ratio']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' - _POOL.fields_by_name['max_oracle_spread_ratio']._options = None - _POOL.fields_by_name['max_oracle_spread_ratio']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' - _POOL.fields_by_name['maintenance_margin_ratio']._options = None - _POOL.fields_by_name['maintenance_margin_ratio']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' - _POOL.fields_by_name['max_leverage']._options = None - _POOL.fields_by_name['max_leverage']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' - _POOLPRICES.fields_by_name['mark_price']._options = None - _POOLPRICES.fields_by_name['mark_price']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Dec\310\336\037\000' - _POOLPRICES.fields_by_name['swap_invariant']._options = None - _POOLPRICES.fields_by_name['swap_invariant']._serialized_options = b'\332\336\037&github.com/cosmos/cosmos-sdk/types.Int\362\336\037\025yaml:\"swap_invariant\"\310\336\037\000' - _DIRECTION._serialized_start=1181 - _DIRECTION._serialized_end=1258 - _TWAPCALCOPTION._serialized_start=1260 - _TWAPCALCOPTION._serialized_end=1363 - _RESERVESNAPSHOT._serialized_start=112 - _RESERVESNAPSHOT._serialized_end=326 - _POOL._serialized_start=329 - _POOL._serialized_end=923 - _POOLPRICES._serialized_start=926 - _POOLPRICES._serialized_end=1179 -# @@protoc_insertion_point(module_scope) diff --git a/pyproject.toml b/pyproject.toml index 6e9ee10..4622974 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "nibiru-proto" -version = "0.14.1" +version = "0.15.0-alpha.1" description = "" authors = [ "Nibiru Chain "