From 087c83ba1d10baa59dd0e684048a9a8154397493 Mon Sep 17 00:00:00 2001 From: Cosmic Vagabond <121588426+cosmic-vagabond@users.noreply.github.com> Date: Tue, 7 Jan 2025 19:33:09 +0100 Subject: [PATCH 01/18] feat: add support to dec34 --- api/elys/tier/query.pulsar.go | 338 +++++++++--------- go.mod | 5 +- go.sum | 16 +- proto/elys/tier/query.proto | 12 +- types/dec34.go | 109 ++++++ types/dec34_test.go | 90 +++++ x/amm/keeper/estimate_price.go | 50 +-- x/amm/types/expected_keepers.go | 3 +- x/masterchef/types/expected_keepers.go | 3 +- x/oracle/keeper/price.go | 19 +- x/oracle/types/pow.go | 13 + x/perpetual/types/expected_keepers.go | 3 +- x/tier/keeper/query_get_consolidated_price.go | 10 +- x/tier/types/expected_keepers.go | 4 +- x/tier/types/query.pb.go | 265 +++++++------- 15 files changed, 573 insertions(+), 367 deletions(-) create mode 100644 types/dec34.go create mode 100644 types/dec34_test.go create mode 100644 x/oracle/types/pow.go diff --git a/api/elys/tier/query.pulsar.go b/api/elys/tier/query.pulsar.go index 09e624e1d..a85d6305b 100644 --- a/api/elys/tier/query.pulsar.go +++ b/api/elys/tier/query.pulsar.go @@ -16077,182 +16077,176 @@ var file_elys_tier_query_proto_rawDesc = []byte{ 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x22, 0xc3, 0x01, 0x0a, 0x05, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, - 0x6f, 0x6d, 0x12, 0x54, 0x0a, 0x0c, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5f, 0x70, 0x72, 0x69, - 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, - 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, - 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, - 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0b, 0x6f, 0x72, 0x61, - 0x63, 0x6c, 0x65, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x4e, 0x0a, 0x09, 0x61, 0x6d, 0x6d, 0x5f, - 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, - 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, - 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x08, - 0x61, 0x6d, 0x6d, 0x50, 0x72, 0x69, 0x63, 0x65, 0x22, 0x62, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x8e, 0x01, 0x0a, - 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x50, 0x72, 0x69, 0x63, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x06, 0x70, 0x72, - 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x65, 0x6c, 0x79, - 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x06, 0x70, 0x72, - 0x69, 0x63, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0xa3, 0x11, - 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x79, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x12, 0x1d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1e, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, - 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x65, 0x6d, - 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x70, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x12, 0x92, 0x01, 0x0a, 0x09, 0x50, 0x6f, 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, - 0x12, 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, - 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x72, 0x74, 0x66, 0x6f, - 0x6c, 0x69, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x34, 0x12, 0x32, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, - 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, - 0x69, 0x70, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x70, 0x6f, 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, - 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x7d, 0x12, 0x8e, 0x01, 0x0a, 0x0c, 0x50, 0x6f, 0x72, 0x74, - 0x66, 0x6f, 0x6c, 0x69, 0x6f, 0x41, 0x6c, 0x6c, 0x12, 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, - 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x50, 0x6f, 0x72, - 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, - 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, - 0x6c, 0x6c, 0x50, 0x6f, 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x65, 0x6c, - 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, - 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x70, - 0x6f, 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, 0x12, 0xad, 0x01, 0x0a, 0x11, 0x43, 0x61, 0x6c, - 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, + 0x6f, 0x6e, 0x22, 0x5d, 0x0a, 0x05, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x64, + 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, + 0x6d, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5f, 0x70, 0x72, 0x69, 0x63, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x50, + 0x72, 0x69, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x6d, 0x6d, 0x5f, 0x70, 0x72, 0x69, 0x63, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x6d, 0x6d, 0x50, 0x72, 0x69, 0x63, + 0x65, 0x22, 0x62, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, + 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, + 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, + 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x8e, 0x01, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, + 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x06, 0x70, 0x72, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, + 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x06, 0x70, 0x72, 0x69, 0x63, 0x65, 0x73, 0x12, 0x47, 0x0a, + 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, + 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0xa3, 0x11, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x12, 0x79, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1d, 0x2e, 0x65, 0x6c, 0x79, + 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x65, 0x6c, 0x79, 0x73, + 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x2a, 0x12, 0x28, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, + 0x74, 0x69, 0x65, 0x72, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x92, 0x01, 0x0a, 0x09, + 0x50, 0x6f, 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, 0x12, 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, + 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x50, 0x6f, + 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, - 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, - 0x61, 0x74, 0x65, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x43, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3d, 0x12, 0x3b, 0x2f, 0x65, 0x6c, - 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, - 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x63, - 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x7d, 0x12, 0x9c, 0x01, 0x0a, 0x0f, 0x4c, 0x65, 0x76, - 0x65, 0x72, 0x61, 0x67, 0x65, 0x4c, 0x70, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x26, 0x2e, 0x65, - 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x65, - 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x4c, 0x70, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x4c, 0x70, - 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x12, 0x30, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x6c, - 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x6c, 0x70, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, - 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x7d, 0x12, 0x8f, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x77, 0x61, - 0x72, 0x64, 0x73, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, - 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, - 0x73, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, - 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, - 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x65, 0x6c, - 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, - 0x74, 0x69, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x7d, 0x12, 0x87, 0x01, 0x0a, 0x0a, 0x53, 0x74, - 0x61, 0x6b, 0x65, 0x64, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x21, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, - 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, - 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x65, 0x6c, - 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, - 0x6b, 0x65, 0x64, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x32, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x12, 0x2a, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, - 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x7b, 0x75, 0x73, - 0x65, 0x72, 0x7d, 0x12, 0x82, 0x01, 0x0a, 0x09, 0x50, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, - 0x6c, 0x12, 0x20, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x50, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, + 0x47, 0x65, 0x74, 0x50, 0x6f, 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x12, 0x32, 0x2f, 0x65, + 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, + 0x2f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x74, 0x69, 0x65, 0x72, 0x2f, + 0x70, 0x6f, 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x7d, + 0x12, 0x8e, 0x01, 0x0a, 0x0c, 0x50, 0x6f, 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, 0x41, 0x6c, + 0x6c, 0x12, 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x50, 0x6f, 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, + 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x50, 0x6f, 0x72, 0x74, 0x66, + 0x6f, 0x6c, 0x69, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, + 0x68, 0x69, 0x70, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x70, 0x6f, 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, + 0x6f, 0x12, 0xad, 0x01, 0x0a, 0x11, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x44, + 0x69, 0x73, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, + 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, + 0x74, 0x65, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x29, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x44, 0x69, 0x73, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x3d, 0x12, 0x3b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, + 0x68, 0x69, 0x70, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, + 0x65, 0x5f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, + 0x7d, 0x12, 0x9c, 0x01, 0x0a, 0x0f, 0x4c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x4c, 0x70, + 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x26, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, + 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x4c, + 0x70, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, + 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, + 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x4c, 0x70, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x12, 0x30, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, - 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, - 0x6c, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x7d, 0x12, 0x8b, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x71, - 0x75, 0x69, 0x64, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x22, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, - 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, - 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x65, - 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x69, - 0x71, 0x75, 0x69, 0x64, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x65, 0x6c, 0x79, 0x73, - 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, - 0x65, 0x72, 0x2f, 0x6c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x2f, - 0x7b, 0x75, 0x73, 0x65, 0x72, 0x7d, 0x12, 0x8b, 0x01, 0x0a, 0x0b, 0x4c, 0x6f, 0x63, 0x6b, 0x65, - 0x64, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x22, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, - 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x4f, 0x72, - 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x65, 0x6c, 0x79, - 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x6b, - 0x65, 0x64, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, + 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, + 0x5f, 0x6c, 0x70, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x7d, + 0x12, 0x8f, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x54, 0x6f, 0x74, 0x61, + 0x6c, 0x12, 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, + 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x54, + 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x2f, 0x7b, 0x75, 0x73, 0x65, + 0x72, 0x7d, 0x12, 0x87, 0x01, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x50, 0x6f, 0x6f, + 0x6c, 0x12, 0x21, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x50, 0x6f, 0x6f, 0x6c, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, + 0x12, 0x2a, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, + 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x64, + 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x7d, 0x12, 0x82, 0x01, 0x0a, + 0x09, 0x50, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x12, 0x20, 0x2e, 0x65, 0x6c, 0x79, + 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x65, 0x72, 0x70, + 0x65, 0x74, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x65, + 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x65, + 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, - 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2f, 0x7b, 0x75, - 0x73, 0x65, 0x72, 0x7d, 0x12, 0x97, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x41, 0x6d, 0x6d, 0x50, - 0x72, 0x69, 0x63, 0x65, 0x12, 0x22, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x6d, 0x6d, 0x50, 0x72, 0x69, 0x63, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, - 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x6d, 0x6d, - 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3f, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x39, 0x12, 0x37, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x67, - 0x65, 0x74, 0x5f, 0x61, 0x6d, 0x6d, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x2f, 0x7b, 0x64, 0x65, - 0x6e, 0x6f, 0x6d, 0x7d, 0x2f, 0x7b, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x7d, 0x12, 0xb1, - 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x65, 0x64, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x2b, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, - 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, - 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x64, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x65, 0x64, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x3e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x38, 0x12, 0x36, 0x2f, 0x65, 0x6c, 0x79, - 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, - 0x69, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, - 0x6d, 0x7d, 0x12, 0x76, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x12, 0x1d, 0x2e, 0x65, - 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, - 0x61, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x65, 0x6c, - 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, - 0x6b, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, - 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x73, 0x74, 0x61, - 0x6b, 0x65, 0x64, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x7d, 0x12, 0x9a, 0x01, 0x0a, 0x10, 0x47, - 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x50, 0x6f, 0x6f, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x12, - 0x27, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x50, 0x6f, 0x6f, 0x6c, 0x44, 0x61, 0x74, - 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, - 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, - 0x72, 0x73, 0x50, 0x6f, 0x6f, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x65, 0x6c, 0x79, - 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, - 0x69, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x5f, 0x70, 0x6f, - 0x6f, 0x6c, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x12, 0x89, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, - 0x6c, 0x6c, 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x12, 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, - 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, - 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, + 0x2f, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, + 0x7d, 0x12, 0x8b, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x54, 0x6f, 0x74, 0x61, + 0x6c, 0x12, 0x22, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, + 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x54, 0x6f, 0x74, + 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x6c, 0x69, 0x71, 0x75, + 0x69, 0x64, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x7d, 0x12, + 0x8b, 0x01, 0x0a, 0x0b, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, + 0x22, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x4f, 0x72, 0x64, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, + 0x12, 0x2b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, + 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, + 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x7d, 0x12, 0x97, 0x01, + 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x41, 0x6d, 0x6d, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x22, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, - 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x65, 0x6c, - 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, - 0x74, 0x69, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x6c, 0x6c, 0x5f, 0x70, 0x72, 0x69, - 0x63, 0x65, 0x73, 0x42, 0x8c, 0x01, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x65, 0x6c, 0x79, 0x73, - 0x2e, 0x74, 0x69, 0x65, 0x72, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, - 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0xa2, - 0x02, 0x03, 0x45, 0x54, 0x58, 0xaa, 0x02, 0x09, 0x45, 0x6c, 0x79, 0x73, 0x2e, 0x54, 0x69, 0x65, - 0x72, 0xca, 0x02, 0x09, 0x45, 0x6c, 0x79, 0x73, 0x5c, 0x54, 0x69, 0x65, 0x72, 0xe2, 0x02, 0x15, - 0x45, 0x6c, 0x79, 0x73, 0x5c, 0x54, 0x69, 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0a, 0x45, 0x6c, 0x79, 0x73, 0x3a, 0x3a, 0x54, 0x69, - 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x74, 0x41, 0x6d, 0x6d, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x6d, 0x6d, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x39, 0x12, 0x37, + 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, + 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x6d, 0x6d, 0x5f, + 0x70, 0x72, 0x69, 0x63, 0x65, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x2f, 0x7b, 0x64, + 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x7d, 0x12, 0xb1, 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x43, + 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x64, 0x50, 0x72, 0x69, 0x63, 0x65, + 0x12, 0x2b, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, + 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, + 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x64, 0x50, 0x72, + 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3e, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x38, 0x12, 0x36, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, + 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x72, + 0x69, 0x63, 0x65, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x12, 0x76, 0x0a, 0x06, 0x53, + 0x74, 0x61, 0x6b, 0x65, 0x64, 0x12, 0x1d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, + 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x65, + 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, + 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x2f, 0x7b, 0x75, 0x73, + 0x65, 0x72, 0x7d, 0x12, 0x9a, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, + 0x50, 0x6f, 0x6f, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x12, 0x27, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, + 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, + 0x72, 0x73, 0x50, 0x6f, 0x6f, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x28, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x50, 0x6f, 0x6f, 0x6c, 0x44, + 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x64, 0x61, 0x74, 0x61, + 0x12, 0x89, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x50, 0x72, 0x69, 0x63, 0x65, + 0x73, 0x12, 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, + 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x50, 0x72, + 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x67, 0x65, + 0x74, 0x5f, 0x61, 0x6c, 0x6c, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x73, 0x42, 0x8c, 0x01, 0x0a, + 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x42, 0x0a, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, + 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x45, 0x54, 0x58, 0xaa, 0x02, + 0x09, 0x45, 0x6c, 0x79, 0x73, 0x2e, 0x54, 0x69, 0x65, 0x72, 0xca, 0x02, 0x09, 0x45, 0x6c, 0x79, + 0x73, 0x5c, 0x54, 0x69, 0x65, 0x72, 0xe2, 0x02, 0x15, 0x45, 0x6c, 0x79, 0x73, 0x5c, 0x54, 0x69, + 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x0a, 0x45, 0x6c, 0x79, 0x73, 0x3a, 0x3a, 0x54, 0x69, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( diff --git a/go.mod b/go.mod index 70bbe0987..244517182 100644 --- a/go.mod +++ b/go.mod @@ -40,6 +40,7 @@ require ( cloud.google.com/go/compute/metadata v0.5.0 // indirect cloud.google.com/go/iam v1.1.9 // indirect cloud.google.com/go/storage v1.41.0 // indirect + github.com/gogo/protobuf v1.3.3 // indirect github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect @@ -52,6 +53,7 @@ require ( github.com/cosmos/ibc-apps/modules/ibc-hooks/v8 v8.0.0-20240904212233-8cb681e31589 github.com/google/uuid v1.6.0 github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 + github.com/regen-network/regen-ledger/types/v2 v2.3.1 golang.org/x/tools v0.22.0 google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 @@ -131,7 +133,6 @@ require ( github.com/gofrs/flock v0.8.1 // indirect github.com/gofrs/uuid/v5 v5.0.0 // indirect github.com/gogo/googleapis v1.4.1 // indirect - github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/glog v1.2.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/mock v1.6.0 // indirect @@ -261,6 +262,8 @@ replace ( // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.8.1 + + github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 // replace broken goleveldb github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 ) diff --git a/go.sum b/go.sum index 1dad4aea6..7871253d5 100644 --- a/go.sum +++ b/go.sum @@ -1647,14 +1647,6 @@ github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4Oe github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= @@ -2183,8 +2175,6 @@ github.com/kataras/sitemap v0.0.6/go.mod h1:dW4dOCNs896OR1HmG+dMLdT7JjDk7mYBzoIR github.com/kataras/tunnel v0.0.4/go.mod h1:9FkU4LaeifdMWqZu7o20ojmW4B7hdhv2CMLwfnHGpYw= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/errcheck v1.6.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/errcheck v1.6.2/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d8NLy0LPw= @@ -2787,6 +2777,10 @@ github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqn github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/regen-network/gocuke v0.6.2/go.mod h1:zYaqIHZobHyd0xOrHGPQjbhGJsuZ1oElx150u2o1xuk= +github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= +github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= +github.com/regen-network/regen-ledger/types/v2 v2.3.1 h1:PeO0O4xsGrIZWl6jjBlqddFIDU+wFkaUu5Ygp30PbBw= +github.com/regen-network/regen-ledger/types/v2 v2.3.1/go.mod h1:h2pp1rYMAHwLuTet6XJVI6fX2lpvpiSoJVrEFfzK9n8= github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/remyoudompheng/go-dbus v0.0.0-20121104212943-b7232d34b1d5/go.mod h1:+u151txRmLpwxBmpYn9z3d1sdJdjRPQpsXuYeY9jNls= @@ -3892,7 +3886,6 @@ golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181219222714-6e267b5cc78e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -4164,6 +4157,7 @@ google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200324203455-a04cca1dde73/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= diff --git a/proto/elys/tier/query.proto b/proto/elys/tier/query.proto index 8771e3580..9317dfe2d 100644 --- a/proto/elys/tier/query.proto +++ b/proto/elys/tier/query.proto @@ -278,16 +278,8 @@ message QueryGetUsersPoolDataResponse { message Price { string denom = 1; - string oracle_price = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string amm_price = 3 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; + string oracle_price = 2; + string amm_price = 3; } message QueryGetAllPricesRequest { diff --git a/types/dec34.go b/types/dec34.go new file mode 100644 index 000000000..223a88a0f --- /dev/null +++ b/types/dec34.go @@ -0,0 +1,109 @@ +package types + +import ( + "cosmossdk.io/math" + regenmath "github.com/regen-network/regen-ledger/types/v2/math" +) + +type Dec34 regenmath.Dec + +func NewDec34FromLegacyDec(d math.LegacyDec) Dec34 { + y, err := regenmath.NewDecFromString(d.String()) + if err != nil { + return ZeroDec34() + } + return Dec34(y) +} + +func NewDec34FromInt(i math.Int) Dec34 { + y, err := regenmath.NewDecFromString(i.String()) + if err != nil { + return ZeroDec34() + } + return Dec34(y) +} + +func NewDec34FromInt64(i int64) Dec34 { + return Dec34(regenmath.NewDecFromInt64(i)) +} + +func NewDec34WithPrec(i int64, prec int32) Dec34 { + return Dec34(regenmath.NewDecFinite(i, prec)) +} + +func ZeroDec34() Dec34 { return NewDec34FromInt64(0) } +func OneDec34() Dec34 { return NewDec34FromInt64(1) } +func TwoDec34() Dec34 { return NewDec34FromInt64(2) } +func ThreeDec34() Dec34 { return NewDec34FromInt64(3) } +func FourDec34() Dec34 { return NewDec34FromInt64(4) } +func FiveDec34() Dec34 { return NewDec34FromInt64(5) } +func MinusOneDec34() Dec34 { return NewDec34FromInt64(-1) } + +func (d Dec34) String() string { + return regenmath.Dec(d).String() +} + +func (d Dec34) Mul(other Dec34) Dec34 { + y, err := regenmath.Dec(d).Mul(regenmath.Dec(other)) + if err != nil { + panic(err) + } + return Dec34(y) +} + +func (d Dec34) Quo(other Dec34) Dec34 { + res, err := regenmath.Dec(d).Quo(regenmath.Dec(other)) + if err != nil { + panic(err) + } + return Dec34(res) +} + +func (d Dec34) Add(other Dec34) Dec34 { + res, err := regenmath.Dec(d).Add(regenmath.Dec(other)) + if err != nil { + panic(err) + } + return Dec34(res) +} + +func (d Dec34) Sub(other Dec34) Dec34 { + res, err := regenmath.Dec(d).Sub(regenmath.Dec(other)) + if err != nil { + panic(err) + } + return Dec34(res) +} + +func (d Dec34) ToLegacyDec() math.LegacyDec { + y, _ := regenmath.Dec(d).Reduce() + return math.LegacyMustNewDecFromStr(y.String()) +} + +func (d Dec34) ToInt() math.Int { + return regenmath.Dec(d).SdkIntTrim() +} + +func (d Dec34) ToInt64() int64 { + res, err := regenmath.Dec(d).Int64() + if err != nil { + panic(err) + } + return res +} + +func (d Dec34) Equal(other Dec34) bool { + return regenmath.Dec(d).Equal(regenmath.Dec(other)) +} + +func (d Dec34) IsZero() bool { + return regenmath.Dec(d).IsZero() +} + +func (d Dec34) IsNegative() bool { + return regenmath.Dec(d).IsNegative() +} + +func (d Dec34) IsPositive() bool { + return regenmath.Dec(d).IsPositive() +} diff --git a/types/dec34_test.go b/types/dec34_test.go new file mode 100644 index 000000000..e44c6ba03 --- /dev/null +++ b/types/dec34_test.go @@ -0,0 +1,90 @@ +package types + +import ( + "testing" + + "cosmossdk.io/math" + "github.com/stretchr/testify/require" +) + +func TestDec34(t *testing.T) { + // Test constructors + require.Equal(t, NewDec34FromInt64(1), NewDec34FromInt64(1)) + require.Equal(t, NewDec34FromInt64(1), OneDec34()) + require.Equal(t, NewDec34FromInt64(2), TwoDec34()) + require.Equal(t, NewDec34FromInt64(3), ThreeDec34()) + require.Equal(t, NewDec34FromInt64(4), FourDec34()) + require.Equal(t, NewDec34FromInt64(5), FiveDec34()) + require.Equal(t, NewDec34FromInt64(-1), MinusOneDec34()) + require.Equal(t, NewDec34FromInt64(0), ZeroDec34()) + + // Test NewDec34FromLegacyDec + legacyDec := math.LegacyNewDec(123) + dec34FromLegacy := NewDec34FromLegacyDec(legacyDec) + require.Equal(t, "123.000000000000000000", dec34FromLegacy.String()) + + // Test NewDec34FromInt + intVal := math.NewInt(456) + dec34FromInt := NewDec34FromInt(intVal) + require.Equal(t, "456", dec34FromInt.String()) + + // Test arithmetic operations + one := OneDec34() + two := TwoDec34() + three := ThreeDec34() + + // Test Add + sum := one.Add(two) + require.Equal(t, three, sum) + + // Test Sub + diff := three.Sub(two) + require.Equal(t, one, diff) + + // Test Mul + prod := two.Mul(three) + require.Equal(t, NewDec34FromInt64(6), prod) + + // Test Quo + quot := three.Quo(two) + require.Equal(t, "1.5", quot.String()) + + // Test division by zero panic + require.Panics(t, func() { + three.Quo(ZeroDec34()) + }) + + // Test ToLegacyDec + legacyResult := three.ToLegacyDec() + require.Equal(t, math.LegacyNewDec(3), legacyResult) + + // Test ToInt + intResult := three.ToInt() + require.Equal(t, math.NewInt(3), intResult) + + // Test String + require.Equal(t, "3", three.String()) + + // Test Int64 + require.Equal(t, int64(3), three.ToInt64()) + + // Test Equal + require.True(t, three.Equal(three)) + require.False(t, three.Equal(two)) + + // Test IsZero + require.False(t, three.IsZero()) + require.True(t, ZeroDec34().IsZero()) + + // Test IsNegative + require.False(t, three.IsNegative()) + require.True(t, MinusOneDec34().IsNegative()) + + // Test IsPositive + require.True(t, three.IsPositive()) + require.False(t, MinusOneDec34().IsPositive()) + + // Test NewDec34WithPrec + require.Equal(t, NewDec34WithPrec(1, 2).String(), NewDec34WithPrec(1, 2).String()) + require.Equal(t, NewDec34FromInt64(100).String(), NewDec34WithPrec(1, 2).Mul(NewDec34WithPrec(1, 0)).String()) +} diff --git a/x/amm/keeper/estimate_price.go b/x/amm/keeper/estimate_price.go index 1d929c1bd..eccc6ce14 100644 --- a/x/amm/keeper/estimate_price.go +++ b/x/amm/keeper/estimate_price.go @@ -4,6 +4,7 @@ import ( "cosmossdk.io/math" sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/amm/types" ptypes "github.com/elys-network/elys/x/parameter/types" ) @@ -28,25 +29,26 @@ func (k Keeper) EstimatePrice(ctx sdk.Context, tokenInDenom, baseCurrency string return rate } -func (k Keeper) GetEdenDenomPrice(ctx sdk.Context, baseCurrency string) math.LegacyDec { +func (k Keeper) GetEdenDenomPrice(ctx sdk.Context, baseCurrency string) elystypes.Dec34 { // Calc ueden / uusdc rate edenUsdcRate := k.EstimatePrice(ctx, ptypes.Elys, baseCurrency) - if edenUsdcRate.IsZero() { - edenUsdcRate = math.LegacyOneDec() + edenUsdcRateDec34 := elystypes.NewDec34FromLegacyDec(edenUsdcRate) + if edenUsdcRateDec34.IsZero() { + edenUsdcRateDec34 = elystypes.OneDec34() } usdcDenomPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) if usdcDenomPrice.IsZero() { - usdcDecimal := int64(6) + usdcDecimal := int32(6) usdcEntry, found := k.assetProfileKeeper.GetEntry(ctx, ptypes.BaseCurrency) if found { - usdcDecimal = int64(usdcEntry.Decimals) + usdcDecimal = int32(usdcEntry.Decimals) } - usdcDenomPrice = math.LegacyNewDecWithPrec(1, usdcDecimal) + usdcDenomPrice = elystypes.NewDec34WithPrec(1, usdcDecimal) } - return edenUsdcRate.Mul(usdcDenomPrice) + return edenUsdcRateDec34.Mul(usdcDenomPrice) } -func (k Keeper) GetTokenPrice(ctx sdk.Context, tokenInDenom, baseCurrency string) math.LegacyDec { +func (k Keeper) GetTokenPrice(ctx sdk.Context, tokenInDenom, baseCurrency string) elystypes.Dec34 { oraclePrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, tokenInDenom) if !oraclePrice.IsZero() { return oraclePrice @@ -54,52 +56,54 @@ func (k Keeper) GetTokenPrice(ctx sdk.Context, tokenInDenom, baseCurrency string // Calc tokenIn / uusdc rate tokenUsdcRate := k.EstimatePrice(ctx, tokenInDenom, baseCurrency) + tokenUsdcRateDec34 := elystypes.NewDec34FromLegacyDec(tokenUsdcRate) usdcDenomPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) if usdcDenomPrice.IsZero() { - usdcDecimal := int64(6) + usdcDecimal := int32(6) usdcEntry, found := k.assetProfileKeeper.GetEntry(ctx, ptypes.BaseCurrency) if found { - usdcDecimal = int64(usdcEntry.Decimals) + usdcDecimal = int32(usdcEntry.Decimals) } - usdcDenomPrice = math.LegacyNewDecWithPrec(1, usdcDecimal) + usdcDenomPrice = elystypes.NewDec34WithPrec(1, usdcDecimal) } - return tokenUsdcRate.Mul(usdcDenomPrice) + return tokenUsdcRateDec34.Mul(usdcDenomPrice) } -func (k Keeper) CalculateUSDValue(ctx sdk.Context, denom string, amount sdkmath.Int) sdkmath.LegacyDec { +func (k Keeper) CalculateUSDValue(ctx sdk.Context, denom string, amount sdkmath.Int) elystypes.Dec34 { asset, found := k.assetProfileKeeper.GetEntryByDenom(ctx, denom) if !found { - sdkmath.LegacyZeroDec() + return elystypes.ZeroDec34() } tokenPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, denom) - if tokenPrice.Equal(sdkmath.LegacyZeroDec()) { + if tokenPrice.IsZero() { tokenPrice = k.CalcAmmPrice(ctx, asset.Denom, asset.Decimals) } - return amount.ToLegacyDec().Mul(tokenPrice) + return elystypes.NewDec34FromInt(amount).Mul(tokenPrice) } -func (k Keeper) CalcAmmPrice(ctx sdk.Context, denom string, decimal uint64) sdkmath.LegacyDec { +func (k Keeper) CalcAmmPrice(ctx sdk.Context, denom string, decimal uint64) elystypes.Dec34 { usdcDenom, found := k.assetProfileKeeper.GetUsdcDenom(ctx) if !found || denom == usdcDenom { - return sdkmath.LegacyZeroDec() + return elystypes.ZeroDec34() } usdcPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, usdcDenom) resp, err := k.InRouteByDenom(ctx, &types.QueryInRouteByDenomRequest{DenomIn: denom, DenomOut: usdcDenom}) if err != nil { - return sdkmath.LegacyZeroDec() + return elystypes.ZeroDec34() } routes := resp.InRoute - tokenIn := sdk.NewCoin(denom, sdkmath.NewInt(Pow10(decimal).TruncateInt64())) + tokenIn := sdk.NewCoin(denom, sdkmath.NewInt(Pow10AsLegacyDec(decimal).TruncateInt64())) discount := sdkmath.LegacyNewDec(1) spotPrice, _, _, _, _, _, _, _, err := k.CalcInRouteSpotPrice(ctx, tokenIn, routes, discount, sdkmath.LegacyZeroDec()) if err != nil { - return sdkmath.LegacyZeroDec() + return elystypes.ZeroDec34() } - return spotPrice.Mul(usdcPrice) + spotPriceDec34 := elystypes.NewDec34FromLegacyDec(spotPrice) + return spotPriceDec34.Mul(usdcPrice) } -func Pow10(decimal uint64) (value sdkmath.LegacyDec) { +func Pow10AsLegacyDec(decimal uint64) (value sdkmath.LegacyDec) { value = sdkmath.LegacyNewDec(1) for i := 0; i < int(decimal); i++ { value = value.Mul(sdkmath.LegacyNewDec(10)) diff --git a/x/amm/types/expected_keepers.go b/x/amm/types/expected_keepers.go index 197d3c823..82baa7bed 100644 --- a/x/amm/types/expected_keepers.go +++ b/x/amm/types/expected_keepers.go @@ -6,6 +6,7 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + elystypes "github.com/elys-network/elys/types" atypes "github.com/elys-network/elys/x/assetprofile/types" oracletypes "github.com/elys-network/elys/x/oracle/types" ) @@ -38,7 +39,7 @@ type BankKeeper interface { //go:generate mockery --srcpkg . --name OracleKeeper --structname OracleKeeper --filename oracle_keeper.go --with-expecter type OracleKeeper interface { GetAssetPrice(ctx sdk.Context, asset string) (oracletypes.Price, bool) - GetAssetPriceFromDenom(ctx sdk.Context, denom string) sdkmath.LegacyDec + GetAssetPriceFromDenom(ctx sdk.Context, denom string) elystypes.Dec34 GetPriceFeeder(ctx sdk.Context, feeder sdk.AccAddress) (val oracletypes.PriceFeeder, found bool) } diff --git a/x/masterchef/types/expected_keepers.go b/x/masterchef/types/expected_keepers.go index ef0c2521b..a49776cfb 100644 --- a/x/masterchef/types/expected_keepers.go +++ b/x/masterchef/types/expected_keepers.go @@ -6,6 +6,7 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + elystypes "github.com/elys-network/elys/types" ammtypes "github.com/elys-network/elys/x/amm/types" assetprofiletypes "github.com/elys-network/elys/x/assetprofile/types" ctypes "github.com/elys-network/elys/x/commitment/types" @@ -97,7 +98,7 @@ type AmmKeeper interface { // OracleKeeper defines the expected interface needed to retrieve price info type OracleKeeper interface { GetAssetPrice(ctx sdk.Context, asset string) (oracletypes.Price, bool) - GetAssetPriceFromDenom(ctx sdk.Context, denom string) math.LegacyDec + GetAssetPriceFromDenom(ctx sdk.Context, denom string) elystypes.Dec34 GetPriceFeeder(ctx sdk.Context, feeder sdk.AccAddress) (val oracletypes.PriceFeeder, found bool) } diff --git a/x/oracle/keeper/price.go b/x/oracle/keeper/price.go index 9cad3baec..cb15b237d 100644 --- a/x/oracle/keeper/price.go +++ b/x/oracle/keeper/price.go @@ -1,11 +1,11 @@ package keeper import ( - sdkmath "cosmossdk.io/math" "cosmossdk.io/store/prefix" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/oracle/types" ) @@ -119,22 +119,15 @@ func (k Keeper) GetAssetPrice(ctx sdk.Context, asset string) (types.Price, bool) return k.GetLatestPriceFromAnySource(ctx, asset) } -func Pow10(decimal uint64) (value sdkmath.LegacyDec) { - value = sdkmath.LegacyNewDec(1) - for i := 0; i < int(decimal); i++ { - value = value.Mul(sdkmath.LegacyNewDec(10)) - } - return -} - -func (k Keeper) GetAssetPriceFromDenom(ctx sdk.Context, denom string) sdkmath.LegacyDec { +func (k Keeper) GetAssetPriceFromDenom(ctx sdk.Context, denom string) elystypes.Dec34 { info, found := k.GetAssetInfo(ctx, denom) if !found { - return sdkmath.LegacyZeroDec() + return elystypes.ZeroDec34() } price, found := k.GetAssetPrice(ctx, info.Display) if !found { - return sdkmath.LegacyZeroDec() + return elystypes.ZeroDec34() } - return price.Price.Quo(Pow10(info.Decimal)) + + return elystypes.NewDec34FromLegacyDec(price.Price).Quo(types.Pow10(info.Decimal)) } diff --git a/x/oracle/types/pow.go b/x/oracle/types/pow.go new file mode 100644 index 000000000..6141b708f --- /dev/null +++ b/x/oracle/types/pow.go @@ -0,0 +1,13 @@ +package types + +import ( + elystypes "github.com/elys-network/elys/types" +) + +func Pow10(decimal uint64) elystypes.Dec34 { + value := elystypes.OneDec34() + for i := 0; i < int(decimal); i++ { + value = value.Mul(elystypes.NewDec34FromInt64(10)) + } + return value +} diff --git a/x/perpetual/types/expected_keepers.go b/x/perpetual/types/expected_keepers.go index 2974cadd8..a6e04e347 100644 --- a/x/perpetual/types/expected_keepers.go +++ b/x/perpetual/types/expected_keepers.go @@ -5,6 +5,7 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" ammtypes "github.com/elys-network/elys/x/amm/types" atypes "github.com/elys-network/elys/x/assetprofile/types" leveragelpmoduletypes "github.com/elys-network/elys/x/leveragelp/types" @@ -60,7 +61,7 @@ type AssetProfileKeeper interface { type OracleKeeper interface { GetAssetPrice(ctx sdk.Context, asset string) (oracletypes.Price, bool) - GetAssetPriceFromDenom(ctx sdk.Context, denom string) math.LegacyDec + GetAssetPriceFromDenom(ctx sdk.Context, denom string) elystypes.Dec34 GetPriceFeeder(ctx sdk.Context, feeder sdk.AccAddress) (val oracletypes.PriceFeeder, found bool) GetAssetInfo(ctx sdk.Context, denom string) (val oracletypes.AssetInfo, found bool) } diff --git a/x/tier/keeper/query_get_consolidated_price.go b/x/tier/keeper/query_get_consolidated_price.go index 271378619..761a72854 100644 --- a/x/tier/keeper/query_get_consolidated_price.go +++ b/x/tier/keeper/query_get_consolidated_price.go @@ -5,7 +5,7 @@ import ( "strings" sdk "github.com/cosmos/cosmos-sdk/types" - oracle "github.com/elys-network/elys/x/oracle/keeper" + oracletypes "github.com/elys-network/elys/x/oracle/types" ptypes "github.com/elys-network/elys/x/parameter/types" "github.com/elys-network/elys/x/tier/types" "google.golang.org/grpc/codes" @@ -45,12 +45,12 @@ func (k Keeper) GetAllPrices(goCtx context.Context, req *types.QueryGetAllPrices if assetEntry.Denom == ptypes.Eden { denom = ptypes.Elys } - tokenPriceOracle := k.oracleKeeper.GetAssetPriceFromDenom(ctx, denom).Mul(oracle.Pow10(assetEntry.Decimals)) - tokenPriceAmm := k.amm.CalcAmmPrice(ctx, denom, assetEntry.Decimals).Mul(oracle.Pow10(assetEntry.Decimals)) + tokenPriceOracle := k.oracleKeeper.GetAssetPriceFromDenomAsDec34(ctx, denom).Mul(oracletypes.Pow10AsDec34(assetEntry.Decimals)) + tokenPriceAmm := k.amm.CalcAmmPriceAsDec34(ctx, denom, assetEntry.Decimals).Mul(oracletypes.Pow10AsDec34(assetEntry.Decimals)) prices = append(prices, &types.Price{ Denom: assetEntry.Denom, - OraclePrice: tokenPriceOracle, - AmmPrice: tokenPriceAmm, + OraclePrice: tokenPriceOracle.String(), + AmmPrice: tokenPriceAmm.String(), }) } diff --git a/x/tier/types/expected_keepers.go b/x/tier/types/expected_keepers.go index 048ce99d1..f9616f88d 100644 --- a/x/tier/types/expected_keepers.go +++ b/x/tier/types/expected_keepers.go @@ -7,6 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + elystypes "github.com/elys-network/elys/types" ammtypes "github.com/elys-network/elys/x/amm/types" assetprofiletypes "github.com/elys-network/elys/x/assetprofile/types" commitmenttypes "github.com/elys-network/elys/x/commitment/types" @@ -37,7 +38,7 @@ type BankKeeper interface { type OracleKeeper interface { GetAssetInfo(ctx sdk.Context, denom string) (val oracletypes.AssetInfo, found bool) GetAssetPrice(ctx sdk.Context, asset string) (oracletypes.Price, bool) - GetAssetPriceFromDenom(ctx sdk.Context, denom string) math.LegacyDec + GetAssetPriceFromDenom(ctx sdk.Context, denom string) elystypes.Dec34 GetPriceFeeder(ctx sdk.Context, feeder sdk.AccAddress) (val oracletypes.PriceFeeder, found bool) } @@ -81,6 +82,7 @@ type AmmKeeper interface { GetEdenDenomPrice(ctx sdk.Context, baseCurrency string) math.LegacyDec CalculateUSDValue(ctx sdk.Context, denom string, amount math.Int) math.LegacyDec CalcAmmPrice(ctx sdk.Context, denom string, decimal uint64) math.LegacyDec + CalcAmmPriceAsDec34(ctx sdk.Context, denom string, decimal uint64) elystypes.Dec34 } type EstakingKeeper interface { diff --git a/x/tier/types/query.pb.go b/x/tier/types/query.pb.go index c6b2ebf88..b91020624 100644 --- a/x/tier/types/query.pb.go +++ b/x/tier/types/query.pb.go @@ -1282,9 +1282,9 @@ func (m *QueryGetUsersPoolDataResponse) GetPagination() *query.PageResponse { } type Price struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - OraclePrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=oracle_price,json=oraclePrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"oracle_price"` - AmmPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=amm_price,json=ammPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"amm_price"` + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + OraclePrice string `protobuf:"bytes,2,opt,name=oracle_price,json=oraclePrice,proto3" json:"oracle_price,omitempty"` + AmmPrice string `protobuf:"bytes,3,opt,name=amm_price,json=ammPrice,proto3" json:"amm_price,omitempty"` } func (m *Price) Reset() { *m = Price{} } @@ -1327,6 +1327,20 @@ func (m *Price) GetDenom() string { return "" } +func (m *Price) GetOraclePrice() string { + if m != nil { + return m.OraclePrice + } + return "" +} + +func (m *Price) GetAmmPrice() string { + if m != nil { + return m.AmmPrice + } + return "" +} + type QueryGetAllPricesRequest struct { Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -1461,103 +1475,103 @@ func init() { func init() { proto.RegisterFile("elys/tier/query.proto", fileDescriptor_461504ebf74c9a97) } var fileDescriptor_461504ebf74c9a97 = []byte{ - // 1525 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x98, 0xcd, 0x6f, 0xdc, 0x44, - 0x14, 0xc0, 0xe3, 0xb4, 0x09, 0xe4, 0x6d, 0xe8, 0xc7, 0x34, 0x2d, 0xe9, 0xb6, 0xdd, 0xb6, 0x6e, - 0x69, 0xb6, 0x6d, 0x62, 0x37, 0x69, 0x05, 0xe1, 0x5b, 0x4d, 0x56, 0x8d, 0x90, 0x02, 0xa4, 0xdb, - 0x52, 0x21, 0x38, 0xac, 0x66, 0xed, 0xe9, 0xd6, 0x8a, 0xed, 0xd9, 0x7a, 0x66, 0x53, 0xa2, 0xaa, - 0x97, 0x5e, 0x10, 0x42, 0x2a, 0x88, 0x1e, 0x90, 0x10, 0xe2, 0x82, 0xc4, 0x8d, 0x03, 0x12, 0xff, - 0x01, 0x1c, 0x2a, 0x4e, 0x15, 0x5c, 0x10, 0x87, 0x0a, 0xb5, 0x1c, 0xf8, 0x33, 0x90, 0x67, 0xc6, - 0xbb, 0xf6, 0xda, 0xeb, 0x5d, 0xb6, 0xcb, 0x81, 0x53, 0xd6, 0xe3, 0xf7, 0xf1, 0x9b, 0xf7, 0x66, - 0x9e, 0xdf, 0x0b, 0xec, 0x27, 0xee, 0x36, 0x33, 0xb9, 0x43, 0x02, 0xf3, 0x66, 0x8b, 0x04, 0xdb, - 0x46, 0x33, 0xa0, 0x9c, 0xa2, 0xa9, 0x70, 0xd9, 0x08, 0x97, 0x8b, 0x33, 0x0d, 0xda, 0xa0, 0x62, - 0xd5, 0x0c, 0x7f, 0x49, 0x81, 0xe2, 0xe1, 0x06, 0xa5, 0x0d, 0x97, 0x98, 0xb8, 0xe9, 0x98, 0xd8, - 0xf7, 0x29, 0xc7, 0xdc, 0xa1, 0x3e, 0x53, 0x6f, 0xcf, 0x58, 0x94, 0x79, 0x94, 0x99, 0x75, 0xcc, - 0x88, 0xb4, 0x6b, 0x6e, 0x2d, 0xd6, 0x09, 0xc7, 0x8b, 0x66, 0x13, 0x37, 0x1c, 0x5f, 0x08, 0x2b, - 0xd9, 0x03, 0x1d, 0x82, 0x26, 0x0e, 0xb0, 0x17, 0xd9, 0x38, 0x18, 0x5b, 0xa7, 0x01, 0xbf, 0x4e, - 0x5d, 0x27, 0x72, 0x3e, 0xdb, 0x79, 0xd5, 0x62, 0x24, 0xb0, 0x31, 0xc7, 0x91, 0x92, 0x74, 0x5c, - 0x93, 0xbc, 0xf2, 0x41, 0xbe, 0xd2, 0x67, 0x00, 0x5d, 0x0e, 0x49, 0x36, 0x84, 0x93, 0x2a, 0xb9, - 0xd9, 0x22, 0x8c, 0xeb, 0x97, 0x60, 0x5f, 0x62, 0x95, 0x35, 0xa9, 0xcf, 0x08, 0x32, 0x61, 0x52, - 0xc2, 0xcc, 0x6a, 0xc7, 0xb4, 0x72, 0x61, 0x69, 0xaf, 0xd1, 0x0e, 0x88, 0x21, 0x45, 0x57, 0x76, - 0x3e, 0x78, 0x74, 0x74, 0xac, 0xaa, 0xc4, 0x74, 0x03, 0x66, 0x85, 0x9d, 0x35, 0xc2, 0x37, 0x22, - 0x5a, 0xe5, 0x03, 0x21, 0xd8, 0x19, 0x62, 0x0a, 0x53, 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64, 0x67, 0xad, 0x2f, 0x08, 0x90, - 0x39, 0xf4, 0x42, 0xfe, 0x5d, 0x8b, 0xb2, 0xf8, 0x95, 0x06, 0x7b, 0xba, 0x1b, 0x39, 0x34, 0x97, - 0xb1, 0xf5, 0xac, 0x9e, 0xb2, 0x58, 0xee, 0x2f, 0x38, 0xe8, 0x11, 0x0b, 0xe3, 0x23, 0x7a, 0x42, - 0x51, 0x05, 0x6a, 0x76, 0xc8, 0xf1, 0x89, 0x06, 0xd3, 0xf1, 0x2e, 0x25, 0xf3, 0xbb, 0xdc, 0xdd, - 0x28, 0x65, 0x7e, 0x97, 0x53, 0x8d, 0x8e, 0x6e, 0x08, 0xa0, 0x32, 0x3a, 0x95, 0x7b, 0xca, 0x5c, - 0x57, 0xe6, 0x89, 0xad, 0xac, 0x3e, 0x78, 0x5c, 0xd2, 0x1e, 0x3e, 0x2e, 0x69, 0x7f, 0x3e, 0x2e, - 0x69, 0x9f, 0x3f, 0x29, 0x8d, 0x3d, 0x7c, 0x52, 0x1a, 0xfb, 0xfd, 0x49, 0x69, 0xec, 0x83, 0xd3, - 0x0d, 0x87, 0xdf, 0x68, 0xd5, 0x0d, 0x8b, 0x7a, 0x19, 0xb6, 0x3e, 0x92, 0xd6, 0xf8, 0x76, 0x93, - 0xb0, 0xfa, 0xa4, 0xf8, 0x27, 0xf4, 0xf9, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x8a, 0xba, 0x43, - 0xd2, 0x70, 0x17, 0x00, 0x00, + // 1528 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x98, 0xcf, 0x6f, 0xdc, 0x44, + 0x14, 0xc7, 0xe3, 0xb4, 0x09, 0xe4, 0x6d, 0xe8, 0x8f, 0x69, 0x5a, 0xd2, 0x6d, 0xbb, 0x6d, 0xdc, + 0xd2, 0x6c, 0xdb, 0xc4, 0x6e, 0xd2, 0x0a, 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0x0c, 0x5c, + 0x93, 0xbc, 0xf2, 0x41, 0xbe, 0xd2, 0x67, 0x00, 0x5d, 0x09, 0x49, 0x36, 0x45, 0x90, 0x2a, 0xb9, + 0xd5, 0x22, 0x8c, 0xeb, 0x97, 0xe1, 0x40, 0x62, 0x94, 0x35, 0xa9, 0xcf, 0x08, 0x32, 0x61, 0x52, + 0xc2, 0xcc, 0x6a, 0x27, 0xb4, 0x72, 0x61, 0x79, 0xbf, 0xd1, 0x4e, 0x88, 0x21, 0x4d, 0x57, 0x77, + 0x3f, 0x7c, 0x7c, 0x7c, 0xac, 0xaa, 0xcc, 0x74, 0x03, 0x66, 0x85, 0xce, 0x3a, 0xe1, 0x9b, 0x11, + 0xad, 0x8a, 0x81, 0x10, 0xec, 0x0e, 0x31, 0x85, 0xd4, 0x54, 0x55, 0xfc, 0xd6, 0x2b, 0x70, 0x38, + 0xc3, 0x5e, 0x45, 0x9f, 0x87, 0xbd, 0x9c, 0x72, 0xec, 0xd6, 0xda, 0x13, 0x57, 0xbe, 0x7b, 0xc4, + 0x70, 0xdb, 0x41, 0xaf, 0xab, 0xa8, 0x97, 0x5c, 0x37, 0x15, 0xf5, 0x32, 0x40, 0x27, 0xd7, 0x6a, + 0x1a, 0xa7, 0x0d, 0x95, 0x92, 0x70, 0x61, 0x0c, 0xb9, 0xe0, 0x6a, 0x61, 0x8c, 0x4d, 0xdc, 0x20, + 0xca, 0xb7, 0x1a, 0xf3, 0xd4, 0xbf, 0xd5, 0x14, 0x6a, 0x32, 0x88, 0x42, 0x5d, 0x81, 0xa9, 0x38, + 0xe4, 0xae, 0x72, 0x61, 0x79, 0x26, 0x9e, 0xab, 0xe8, 0x9d, 0x4a, 0x57, 0xc7, 0x18, 0xad, 0x27, + 0xf8, 0xc6, 0x05, 0xdf, 0x7c, 0x5f, 0x3e, 0x19, 0x36, 0x01, 0x78, 0x01, 0x8e, 0x09, 0xbe, 0x35, + 0xec, 0x5a, 0x2d, 0x17, 0x73, 0x52, 0x71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, 0x7a, 0x19, 0x5a, 0x1f, 0x4b, 0x35, + 0xbe, 0xd3, 0x24, 0xac, 0x3e, 0x29, 0xfe, 0x3b, 0x7c, 0xe1, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x58, 0x23, 0xca, 0x20, 0x09, 0x17, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2103,6 +2117,7 @@ func _Query_GetAllPrices_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.tier.Query", HandlerType: (*QueryServer)(nil), @@ -3225,26 +3240,20 @@ func (m *Price) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size := m.AmmPrice.Size() - i -= size - if _, err := m.AmmPrice.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.AmmPrice) > 0 { + i -= len(m.AmmPrice) + copy(dAtA[i:], m.AmmPrice) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AmmPrice))) + i-- + dAtA[i] = 0x1a } - i-- - dAtA[i] = 0x1a - { - size := m.OraclePrice.Size() - i -= size - if _, err := m.OraclePrice.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.OraclePrice) > 0 { + i -= len(m.OraclePrice) + copy(dAtA[i:], m.OraclePrice) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OraclePrice))) + i-- + dAtA[i] = 0x12 } - i-- - dAtA[i] = 0x12 if len(m.Denom) > 0 { i -= len(m.Denom) copy(dAtA[i:], m.Denom) @@ -3746,10 +3755,14 @@ func (m *Price) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - l = m.OraclePrice.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.AmmPrice.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.OraclePrice) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.AmmPrice) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -6628,9 +6641,7 @@ func (m *Price) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.OraclePrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.OraclePrice = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { @@ -6662,9 +6673,7 @@ func (m *Price) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.AmmPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.AmmPrice = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex From 4f10b2e7da8c4e5a41b2c598431b3b260d79db9d Mon Sep 17 00:00:00 2001 From: Cosmic Vagabond <121588426+cosmic-vagabond@users.noreply.github.com> Date: Wed, 8 Jan 2025 08:33:07 +0100 Subject: [PATCH 02/18] refactor: refactor modules to support dec34 --- api/elys/amm/query.pulsar.go | 588 +++++++------- api/elys/amm/tx.pulsar.go | 207 +++-- api/elys/leveragelp/query.pulsar.go | 529 +++++++------ api/elys/masterchef/query.pulsar.go | 558 +++++++------ api/elys/tier/query.pulsar.go | 557 ++++++------- go.mod | 2 +- proto/elys/amm/query.proto | 54 +- proto/elys/amm/tx.proto | 6 +- proto/elys/leveragelp/query.proto | 8 +- proto/elys/leveragelp/tx.proto | 6 +- proto/elys/masterchef/query.proto | 76 +- proto/elys/perpetual/tx.proto | 7 +- proto/elys/tier/query.proto | 106 +-- types/dec34.go | 129 ++- types/dec34_test.go | 85 ++ x/accountedpool/types/query.pb.go | 1 + x/accountedpool/types/tx.pb.go | 1 + x/amm/keeper/apply_join_pool_state_change.go | 3 +- x/amm/keeper/calc_in_amt_given_out.go | 5 +- x/amm/keeper/calc_in_route_spot_price.go | 33 +- x/amm/keeper/calc_out_amt_given_in.go | 5 +- x/amm/keeper/calc_out_route_spot_price.go | 27 +- x/amm/keeper/calc_swap_estimation_by_denom.go | 13 +- x/amm/keeper/estimate_price.go | 22 +- x/amm/keeper/fee.go | 9 +- x/amm/keeper/keeper_create_pool.go | 2 +- x/amm/keeper/keeper_swap_exact_amount_in.go | 6 +- x/amm/keeper/keeper_swap_exact_amount_out.go | 4 +- x/amm/keeper/msg_server_swap_by_denom.go | 4 +- x/amm/keeper/pool.go | 5 +- x/amm/keeper/query_exit_pool_estimation.go | 11 +- x/amm/keeper/query_join_pool_estimation.go | 15 +- x/amm/keeper/query_pool.go | 12 +- x/amm/keeper/query_swap_estimation.go | 7 +- .../keeper/query_swap_estimation_by_denom.go | 8 +- x/amm/keeper/swap_in_amt_given_out.go | 5 +- x/amm/keeper/swap_out_amt_given_in.go | 5 +- .../keeper/track_weight_breaking_slippage.go | 13 +- x/amm/keeper/update_pool_for_swap.go | 26 +- x/amm/types/amm_price.go | 15 +- x/amm/types/calc_exit_pool.go | 89 +-- x/amm/types/calc_in_amt_given_out.go | 43 +- x/amm/types/calc_out_amt_given_in.go | 40 +- x/amm/types/pool.go | 21 +- x/amm/types/pool_calc_join_pool_shares.go | 13 +- x/amm/types/pool_join_pool.go | 139 +--- x/amm/types/pow.go | 8 +- x/amm/types/query.pb.go | 535 +++++++------ .../solve_constant_function_invariant.go | 25 +- x/amm/types/swap_in_amt_given_out.go | 70 +- x/amm/types/swap_out_amt_given_in.go | 101 +-- x/amm/types/tx.pb.go | 224 +++--- x/amm/types/utils.go | 20 +- x/assetprofile/types/query.pb.go | 1 + x/assetprofile/types/tx.pb.go | 1 + x/burner/types/query.pb.go | 1 + x/burner/types/tx.pb.go | 1 + x/commitment/types/query.pb.go | 1 + x/commitment/types/tx.pb.go | 1 + x/epochs/types/query.pb.go | 1 + x/estaking/types/query.pb.go | 1 + x/estaking/types/tx.pb.go | 1 + x/leveragelp/keeper/begin_blocker.go | 3 +- x/leveragelp/keeper/hooks_amm.go | 4 +- x/leveragelp/keeper/query_position.go | 5 +- x/leveragelp/keeper/utils.go | 2 +- x/leveragelp/types/expected_keepers.go | 6 +- x/leveragelp/types/query.pb.go | 261 ++++--- x/leveragelp/types/tx.pb.go | 1 + x/masterchef/keeper/abci.go | 104 +-- x/masterchef/keeper/apr_denom.go | 76 +- x/masterchef/keeper/apr_stable_stake.go | 31 +- x/masterchef/keeper/query.go | 3 +- .../keeper/query_all_liquidity_pool_tvl.go | 12 +- x/masterchef/keeper/query_apr.go | 2 +- x/masterchef/keeper/query_aprs.go | 20 +- x/masterchef/keeper/query_chain_tvl.go | 20 +- x/masterchef/keeper/query_pool_rewards.go | 22 +- x/masterchef/types/expected_keepers.go | 8 +- x/masterchef/types/query.pb.go | 644 ++++++++------- x/masterchef/types/tx.pb.go | 1 + x/oracle/types/query.pb.go | 1 + x/oracle/types/tx.pb.go | 1 + x/parameter/types/query.pb.go | 1 + x/parameter/types/tx.pb.go | 1 + x/perpetual/types/expected_keepers.go | 4 +- x/perpetual/types/query.pb.go | 1 + x/perpetual/types/tx.pb.go | 1 + x/stablestake/keeper/tvl.go | 8 +- x/stablestake/types/expected_keepers.go | 5 +- x/stablestake/types/query.pb.go | 1 + x/stablestake/types/tx.pb.go | 1 + x/tier/keeper/portfolio.go | 116 ++- x/tier/keeper/query_get_amm_price.go | 2 +- x/tier/keeper/query_get_consolidated_price.go | 10 +- x/tier/keeper/query_get_users_pool_data.go | 2 +- x/tier/keeper/query_leverage_lp_total.go | 4 +- x/tier/keeper/query_liquid_total.go | 2 +- x/tier/keeper/query_locked_order.go | 2 +- x/tier/keeper/query_perpetual.go | 4 +- x/tier/keeper/query_rewards_total.go | 2 +- x/tier/keeper/query_staked.go | 8 +- x/tier/keeper/query_staked_pool.go | 2 +- x/tier/types/expected_keepers.go | 3 +- x/tier/types/query.pb.go | 734 ++++++++++-------- x/tier/types/tx.pb.go | 1 + x/tokenomics/types/query.pb.go | 1 + x/tokenomics/types/tx.pb.go | 1 + x/tradeshield/types/events.go | 8 +- x/tradeshield/types/query.pb.go | 1 + x/tradeshield/types/tx.pb.go | 1 + x/transferhook/types/query.pb.go | 1 + 112 files changed, 3334 insertions(+), 3333 deletions(-) diff --git a/api/elys/amm/query.pulsar.go b/api/elys/amm/query.pulsar.go index 1d7abefff..0da5d09ef 100644 --- a/api/elys/amm/query.pulsar.go +++ b/api/elys/amm/query.pulsar.go @@ -16733,7 +16733,7 @@ var file_elys_amm_query_proto_rawDesc = []byte{ 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5f, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, - 0x52, 0x09, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x49, 0x6e, 0x22, 0xe0, 0x02, 0x0a, 0x1f, + 0x52, 0x09, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x49, 0x6e, 0x22, 0xfa, 0x01, 0x0a, 0x1f, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4a, 0x6f, 0x69, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x10, 0x73, 0x68, 0x61, 0x72, 0x65, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, @@ -16744,332 +16744,304 @@ var file_elys_amm_query_proto_rawDesc = []byte{ 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5f, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, - 0x09, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x49, 0x6e, 0x12, 0x4d, 0x0a, 0x08, 0x73, 0x6c, - 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, - 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, - 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, - 0x08, 0x73, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x12, 0x63, 0x0a, 0x14, 0x77, 0x65, 0x69, - 0x67, 0x68, 0x74, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, - 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, - 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x12, 0x77, 0x65, 0x69, 0x67, - 0x68, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x22, 0xb6, - 0x01, 0x0a, 0x1e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x50, 0x6f, 0x6f, 0x6c, - 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x06, 0x70, 0x6f, 0x6f, 0x6c, 0x49, 0x64, 0x12, 0x53, 0x0a, 0x0f, 0x73, 0x68, - 0x61, 0x72, 0x65, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, - 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, - 0x52, 0x0d, 0x73, 0x68, 0x61, 0x72, 0x65, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x12, - 0x26, 0x0a, 0x0f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x5f, 0x64, 0x65, 0x6e, - 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x4f, - 0x75, 0x74, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x63, 0x0a, 0x1f, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x45, 0x78, 0x69, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5f, 0x6f, 0x75, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, - 0x52, 0x0a, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x4f, 0x75, 0x74, 0x22, 0xd0, 0x04, 0x0a, - 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x77, 0x61, 0x70, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0a, - 0x73, 0x70, 0x6f, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, - 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x44, 0x65, 0x63, 0x52, 0x09, 0x73, 0x70, 0x6f, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x3c, - 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, - 0x1f, 0x00, 0x52, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x4f, 0x75, 0x74, 0x12, 0x4c, 0x0a, 0x08, - 0x73, 0x77, 0x61, 0x70, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, - 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, - 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, - 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, - 0x63, 0x52, 0x07, 0x73, 0x77, 0x61, 0x70, 0x46, 0x65, 0x65, 0x12, 0x4d, 0x0a, 0x08, 0x64, 0x69, - 0x73, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, - 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, - 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, - 0x08, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x50, 0x0a, 0x13, 0x61, 0x76, 0x61, - 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, - 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x12, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, - 0x6c, 0x65, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x12, 0x4d, 0x0a, 0x08, 0x73, - 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, - 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, - 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, - 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, - 0x52, 0x08, 0x73, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x12, 0x63, 0x0a, 0x14, 0x77, 0x65, - 0x69, 0x67, 0x68, 0x74, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, - 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, - 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, - 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x12, 0x77, 0x65, 0x69, - 0x67, 0x68, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x22, - 0x34, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, - 0x54, 0x72, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, - 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x70, - 0x6f, 0x6f, 0x6c, 0x49, 0x64, 0x22, 0x5b, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x6c, - 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x05, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x4f, 0x72, - 0x61, 0x63, 0x6c, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, - 0x54, 0x72, 0x61, 0x63, 0x6b, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x74, 0x72, 0x61, - 0x63, 0x6b, 0x22, 0x1e, 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x6c, 0x69, 0x70, 0x70, - 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x22, 0x60, 0x0a, 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x6c, 0x69, 0x70, 0x70, - 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x06, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x4f, - 0x72, 0x61, 0x63, 0x6c, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, - 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x74, 0x72, - 0x61, 0x63, 0x6b, 0x73, 0x22, 0x45, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x51, 0x0a, 0x14, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, - 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x54, - 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x42, 0x79, - 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, - 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x49, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x65, 0x6e, 0x6f, 0x6d, - 0x5f, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x6e, 0x6f, - 0x6d, 0x4f, 0x75, 0x74, 0x22, 0x55, 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x52, - 0x6f, 0x75, 0x74, 0x65, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x08, 0x69, 0x6e, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, - 0x2e, 0x53, 0x77, 0x61, 0x70, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x52, 0x6f, 0x75, - 0x74, 0x65, 0x52, 0x07, 0x69, 0x6e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x22, 0x55, 0x0a, 0x1b, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x4f, 0x75, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x42, 0x79, 0x44, 0x65, - 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x65, - 0x6e, 0x6f, 0x6d, 0x5f, 0x6f, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, - 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x75, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x64, 0x65, 0x6e, 0x6f, 0x6d, - 0x5f, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x6e, 0x6f, 0x6d, - 0x49, 0x6e, 0x22, 0x59, 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x75, 0x74, 0x52, 0x6f, - 0x75, 0x74, 0x65, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x39, 0x0a, 0x09, 0x6f, 0x75, 0x74, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, - 0x2e, 0x53, 0x77, 0x61, 0x70, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x52, 0x6f, - 0x75, 0x74, 0x65, 0x52, 0x08, 0x6f, 0x75, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x22, 0xae, 0x01, - 0x0a, 0x21, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x77, 0x61, 0x70, 0x45, 0x73, 0x74, 0x69, 0x6d, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, - 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, - 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x49, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x65, 0x6e, 0x6f, 0x6d, - 0x5f, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x6e, 0x6f, - 0x6d, 0x4f, 0x75, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x9b, - 0x06, 0x0a, 0x22, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x77, 0x61, 0x70, 0x45, 0x73, 0x74, 0x69, - 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x08, 0x69, 0x6e, 0x5f, 0x72, 0x6f, 0x75, 0x74, - 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, - 0x6d, 0x6d, 0x2e, 0x53, 0x77, 0x61, 0x70, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x52, - 0x6f, 0x75, 0x74, 0x65, 0x52, 0x07, 0x69, 0x6e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x12, 0x39, 0x0a, - 0x09, 0x6f, 0x75, 0x74, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x1c, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x53, 0x77, 0x61, 0x70, - 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x52, 0x08, - 0x6f, 0x75, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x12, 0x50, 0x0a, 0x0a, 0x73, 0x70, 0x6f, 0x74, - 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, - 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, - 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, - 0x09, 0x73, 0x70, 0x6f, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x61, 0x6d, 0x6f, - 0x75, 0x6e, 0x74, 0x12, 0x4c, 0x0a, 0x08, 0x73, 0x77, 0x61, 0x70, 0x5f, 0x66, 0x65, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, + 0x09, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x49, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x6c, + 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x6c, + 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x22, 0xb6, 0x01, 0x0a, 0x1e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x70, + 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x70, 0x6f, + 0x6f, 0x6c, 0x49, 0x64, 0x12, 0x53, 0x0a, 0x0f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x5f, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, + 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, + 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0d, 0x73, 0x68, 0x61, 0x72, + 0x65, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x12, 0x26, 0x0a, 0x0f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x4f, 0x75, 0x74, 0x44, 0x65, 0x6e, 0x6f, + 0x6d, 0x22, 0x63, 0x0a, 0x1f, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x50, 0x6f, + 0x6f, 0x6c, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5f, + 0x6f, 0x75, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0a, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x4f, 0x75, 0x74, 0x22, 0xb7, 0x03, 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x53, 0x77, 0x61, 0x70, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x70, 0x6f, 0x74, 0x5f, 0x70, + 0x72, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x70, 0x6f, 0x74, + 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x3c, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6f, + 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, + 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x4f, 0x75, 0x74, 0x12, 0x4c, 0x0a, 0x08, 0x73, 0x77, 0x61, 0x70, 0x5f, 0x66, 0x65, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x07, 0x73, 0x77, 0x61, 0x70, 0x46, 0x65, - 0x65, 0x12, 0x4d, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, + 0x65, 0x12, 0x4d, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x08, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x50, 0x0a, 0x13, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6c, 0x69, - 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x12, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, - 0x74, 0x79, 0x12, 0x63, 0x0a, 0x14, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x62, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, - 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x44, 0x65, 0x63, 0x52, 0x12, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x4d, 0x0a, 0x08, 0x73, 0x6c, 0x69, 0x70, 0x70, - 0x61, 0x67, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, - 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, - 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, - 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x08, 0x73, 0x6c, - 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x12, 0x54, 0x0a, 0x0c, 0x70, 0x72, 0x69, 0x63, 0x65, 0x5f, - 0x69, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, - 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, - 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, - 0x0b, 0x70, 0x72, 0x69, 0x63, 0x65, 0x49, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x22, 0xa1, 0x01, 0x0a, - 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x4d, 0x4d, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3a, 0x0a, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x69, - 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, - 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x07, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x49, - 0x6e, 0x12, 0x4d, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, + 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x12, 0x30, + 0x0a, 0x14, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x77, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x61, 0x74, 0x69, 0x6f, + 0x22, 0x34, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, + 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, + 0x07, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, + 0x70, 0x6f, 0x6f, 0x6c, 0x49, 0x64, 0x22, 0x5b, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, + 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x05, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x4f, + 0x72, 0x61, 0x63, 0x6c, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, + 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x74, 0x72, + 0x61, 0x63, 0x6b, 0x22, 0x1e, 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x6c, 0x69, 0x70, + 0x70, 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x22, 0x60, 0x0a, 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x6c, 0x69, 0x70, + 0x70, 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x06, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, + 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x6c, 0x69, 0x70, 0x70, 0x61, + 0x67, 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x74, + 0x72, 0x61, 0x63, 0x6b, 0x73, 0x22, 0x45, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, + 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x51, 0x0a, 0x14, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, + 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, + 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x22, + 0x54, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x42, + 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, + 0x08, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x49, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x65, 0x6e, 0x6f, + 0x6d, 0x5f, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x6e, + 0x6f, 0x6d, 0x4f, 0x75, 0x74, 0x22, 0x55, 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, + 0x52, 0x6f, 0x75, 0x74, 0x65, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x08, 0x69, 0x6e, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, + 0x6d, 0x2e, 0x53, 0x77, 0x61, 0x70, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x52, 0x6f, + 0x75, 0x74, 0x65, 0x52, 0x07, 0x69, 0x6e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x22, 0x55, 0x0a, 0x1b, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x75, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x42, 0x79, 0x44, + 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x64, + 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x6f, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x75, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x64, 0x65, 0x6e, 0x6f, + 0x6d, 0x5f, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x6e, 0x6f, + 0x6d, 0x49, 0x6e, 0x22, 0x59, 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x75, 0x74, 0x52, + 0x6f, 0x75, 0x74, 0x65, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x09, 0x6f, 0x75, 0x74, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, + 0x6d, 0x2e, 0x53, 0x77, 0x61, 0x70, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x52, + 0x6f, 0x75, 0x74, 0x65, 0x52, 0x08, 0x6f, 0x75, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x22, 0xae, + 0x01, 0x0a, 0x21, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x77, 0x61, 0x70, 0x45, 0x73, 0x74, 0x69, + 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, + 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x19, 0x0a, + 0x08, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x49, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x65, 0x6e, 0x6f, + 0x6d, 0x5f, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x6e, + 0x6f, 0x6d, 0x4f, 0x75, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, + 0xcf, 0x04, 0x0a, 0x22, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x77, 0x61, 0x70, 0x45, 0x73, 0x74, + 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x08, 0x69, 0x6e, 0x5f, 0x72, 0x6f, 0x75, + 0x74, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, + 0x61, 0x6d, 0x6d, 0x2e, 0x53, 0x77, 0x61, 0x70, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, + 0x52, 0x6f, 0x75, 0x74, 0x65, 0x52, 0x07, 0x69, 0x6e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x12, 0x39, + 0x0a, 0x09, 0x6f, 0x75, 0x74, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x53, 0x77, 0x61, + 0x70, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x52, + 0x08, 0x6f, 0x75, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x70, 0x6f, + 0x74, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, + 0x70, 0x6f, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, + 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x4c, 0x0a, 0x08, 0x73, 0x77, 0x61, 0x70, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x08, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x32, 0x98, 0x10, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x6c, 0x0a, 0x06, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1c, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x65, 0x6c, 0x79, 0x73, - 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x6d, - 0x6d, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x74, 0x0a, 0x04, 0x50, 0x6f, 0x6f, 0x6c, - 0x12, 0x1d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1e, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x6d, 0x6d, 0x2f, - 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x7b, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x6d, - 0x0a, 0x07, 0x50, 0x6f, 0x6f, 0x6c, 0x41, 0x6c, 0x6c, 0x12, 0x1d, 0x2e, 0x65, 0x6c, 0x79, 0x73, - 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x50, 0x6f, 0x6f, - 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, - 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x50, 0x6f, 0x6f, 0x6c, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, - 0x12, 0x1b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, - 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x6d, 0x6d, 0x2f, 0x70, 0x6f, 0x6f, 0x6c, 0x12, 0x9b, 0x01, - 0x0a, 0x0e, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, - 0x12, 0x27, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x47, 0x65, 0x74, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, - 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x65, 0x6c, 0x79, 0x73, - 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x44, 0x65, 0x6e, - 0x6f, 0x6d, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x65, 0x6c, - 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, - 0x61, 0x6d, 0x6d, 0x2f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x6c, 0x69, 0x71, 0x75, 0x69, 0x64, - 0x69, 0x74, 0x79, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x12, 0x96, 0x01, 0x0a, 0x11, - 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x41, 0x6c, - 0x6c, 0x12, 0x27, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, - 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x65, 0x6c, 0x79, - 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x44, 0x65, - 0x6e, 0x6f, 0x6d, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x65, - 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, - 0x2f, 0x61, 0x6d, 0x6d, 0x2f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x6c, 0x69, 0x71, 0x75, 0x69, - 0x64, 0x69, 0x74, 0x79, 0x12, 0x8d, 0x01, 0x0a, 0x0e, 0x53, 0x77, 0x61, 0x70, 0x45, 0x73, 0x74, - 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, - 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x77, 0x61, 0x70, 0x45, 0x73, 0x74, 0x69, - 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, - 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x77, - 0x61, 0x70, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x65, + 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x07, 0x73, 0x77, 0x61, 0x70, 0x46, 0x65, 0x65, 0x12, + 0x4d, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, + 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x44, 0x65, 0x63, 0x52, 0x08, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x50, + 0x0a, 0x13, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6c, 0x69, 0x71, 0x75, + 0x69, 0x64, 0x69, 0x74, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x12, 0x61, 0x76, + 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, + 0x12, 0x30, 0x0a, 0x14, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, + 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x61, 0x74, + 0x69, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x12, 0x21, + 0x0a, 0x0c, 0x70, 0x72, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x69, 0x63, 0x65, 0x49, 0x6d, 0x70, 0x61, 0x63, + 0x74, 0x22, 0xa1, 0x01, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x4d, 0x4d, 0x50, 0x72, + 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3a, 0x0a, 0x08, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x5f, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x07, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x49, 0x6e, 0x12, 0x4d, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, + 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, + 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, + 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x08, 0x64, 0x69, 0x73, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0x98, 0x10, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, + 0x6c, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1c, 0x2e, 0x65, 0x6c, 0x79, 0x73, + 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, + 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, + 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, + 0x79, 0x73, 0x2f, 0x61, 0x6d, 0x6d, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x74, 0x0a, + 0x04, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x1d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, - 0x2f, 0x61, 0x6d, 0x6d, 0x2f, 0x73, 0x77, 0x61, 0x70, 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x9e, 0x01, 0x0a, 0x12, 0x4a, 0x6f, 0x69, 0x6e, 0x50, 0x6f, 0x6f, - 0x6c, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x2e, 0x65, 0x6c, - 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4a, 0x6f, 0x69, 0x6e, + 0x2f, 0x61, 0x6d, 0x6d, 0x2f, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x7b, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, + 0x69, 0x64, 0x7d, 0x12, 0x6d, 0x0a, 0x07, 0x50, 0x6f, 0x6f, 0x6c, 0x41, 0x6c, 0x6c, 0x12, 0x1d, + 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, + 0x6c, 0x6c, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, + 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, + 0x6c, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x6d, 0x6d, 0x2f, 0x70, 0x6f, + 0x6f, 0x6c, 0x12, 0x9b, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4c, 0x69, 0x71, 0x75, + 0x69, 0x64, 0x69, 0x74, 0x79, 0x12, 0x27, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4c, 0x69, + 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, + 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, + 0x65, 0x74, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, + 0x12, 0x2e, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, + 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x6d, 0x6d, 0x2f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x6c, + 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, + 0x12, 0x96, 0x01, 0x0a, 0x11, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, + 0x69, 0x74, 0x79, 0x41, 0x6c, 0x6c, 0x12, 0x27, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, + 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4c, + 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x28, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x41, 0x6c, 0x6c, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x28, 0x12, 0x26, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x6d, 0x6d, 0x2f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, + 0x6c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x12, 0x8d, 0x01, 0x0a, 0x0e, 0x53, 0x77, + 0x61, 0x70, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x65, + 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x77, 0x61, + 0x70, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x53, 0x77, 0x61, 0x70, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x28, 0x12, 0x26, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x6d, 0x6d, 0x2f, 0x73, 0x77, 0x61, 0x70, 0x5f, 0x65, + 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x9e, 0x01, 0x0a, 0x12, 0x4a, 0x6f, + 0x69, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x28, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x4a, 0x6f, 0x69, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x65, 0x6c, 0x79, + 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4a, 0x6f, 0x69, 0x6e, 0x50, + 0x6f, 0x6f, 0x6c, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, + 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, + 0x73, 0x2f, 0x61, 0x6d, 0x6d, 0x2f, 0x6a, 0x6f, 0x69, 0x6e, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, + 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x9e, 0x01, 0x0a, 0x12, 0x45, + 0x78, 0x69, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x28, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x65, 0x6c, + 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4a, 0x6f, 0x69, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x45, 0x73, - 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, - 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x6d, 0x6d, - 0x2f, 0x6a, 0x6f, 0x69, 0x6e, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x9e, 0x01, 0x0a, 0x12, 0x45, 0x78, 0x69, 0x74, 0x50, 0x6f, - 0x6f, 0x6c, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x2e, 0x65, - 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x78, 0x69, - 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, - 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x78, 0x69, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x45, - 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x65, 0x6c, 0x79, 0x73, - 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x6d, - 0x6d, 0x2f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x65, 0x73, 0x74, 0x69, - 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x93, 0x01, 0x0a, 0x0d, 0x53, 0x6c, 0x69, 0x70, 0x70, - 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x12, 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, - 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, - 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, + 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, + 0x79, 0x73, 0x2f, 0x61, 0x6d, 0x6d, 0x2f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, + 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x93, 0x01, 0x0a, 0x0d, + 0x53, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x12, 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x6c, - 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x37, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x12, 0x2f, 0x2f, 0x65, 0x6c, - 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, - 0x61, 0x6d, 0x6d, 0x2f, 0x73, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x72, 0x61, - 0x63, 0x6b, 0x2f, 0x7b, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x93, 0x01, 0x0a, - 0x10, 0x53, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x41, 0x6c, - 0x6c, 0x12, 0x26, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x53, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x41, - 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x65, 0x6c, 0x79, 0x73, - 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x6c, 0x69, 0x70, 0x70, 0x61, - 0x67, 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x65, 0x6c, 0x79, + 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x53, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, + 0x12, 0x2f, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, + 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x6d, 0x6d, 0x2f, 0x73, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, + 0x65, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x2f, 0x7b, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x64, + 0x7d, 0x12, 0x93, 0x01, 0x0a, 0x10, 0x53, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x54, 0x72, + 0x61, 0x63, 0x6b, 0x41, 0x6c, 0x6c, 0x12, 0x26, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, + 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x54, + 0x72, 0x61, 0x63, 0x6b, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, + 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, + 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x41, 0x6c, 0x6c, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, + 0x26, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, + 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x6d, 0x6d, 0x2f, 0x73, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, + 0x5f, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x73, 0x12, 0x82, 0x01, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x12, 0x30, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, - 0x6d, 0x6d, 0x2f, 0x73, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x63, - 0x6b, 0x73, 0x12, 0x82, 0x01, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1d, - 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, - 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, - 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x12, 0x30, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x6d, 0x6d, 0x2f, 0x62, 0x61, - 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x2f, - 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x12, 0xa6, 0x01, 0x0a, 0x0e, 0x49, 0x6e, 0x52, 0x6f, - 0x75, 0x74, 0x65, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x24, 0x2e, 0x65, 0x6c, 0x79, - 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x52, 0x6f, 0x75, + 0x6d, 0x6d, 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x7d, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x12, 0xa6, 0x01, 0x0a, + 0x0e, 0x49, 0x6e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, + 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x49, 0x6e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x42, 0x79, 0x44, + 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x47, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x41, 0x12, 0x3f, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x6d, 0x6d, 0x2f, 0x69, 0x6e, 0x5f, + 0x72, 0x6f, 0x75, 0x74, 0x65, 0x5f, 0x62, 0x79, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x2f, 0x7b, + 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x69, 0x6e, 0x7d, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, + 0x5f, 0x6f, 0x75, 0x74, 0x7d, 0x12, 0xaa, 0x01, 0x0a, 0x0f, 0x4f, 0x75, 0x74, 0x52, 0x6f, 0x75, + 0x74, 0x65, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, + 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x75, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x49, 0x6e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x47, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x41, 0x12, - 0x3f, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, - 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x6d, 0x6d, 0x2f, 0x69, 0x6e, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, - 0x5f, 0x62, 0x79, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, - 0x5f, 0x69, 0x6e, 0x7d, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x6f, 0x75, 0x74, 0x7d, - 0x12, 0xaa, 0x01, 0x0a, 0x0f, 0x4f, 0x75, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x42, 0x79, 0x44, - 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x75, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x42, 0x79, 0x44, - 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x65, 0x6c, - 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x75, 0x74, 0x52, - 0x6f, 0x75, 0x74, 0x65, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x48, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x42, 0x12, 0x40, 0x2f, 0x65, 0x6c, - 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, - 0x61, 0x6d, 0x6d, 0x2f, 0x6f, 0x75, 0x74, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x5f, 0x62, 0x79, - 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x6f, 0x75, - 0x74, 0x7d, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x69, 0x6e, 0x7d, 0x12, 0xab, 0x01, - 0x0a, 0x15, 0x53, 0x77, 0x61, 0x70, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x2b, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, - 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x77, 0x61, 0x70, 0x45, 0x73, 0x74, 0x69, - 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x77, 0x61, 0x70, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x37, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x12, 0x2f, 0x2f, 0x65, 0x6c, 0x79, - 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, - 0x6d, 0x6d, 0x2f, 0x73, 0x77, 0x61, 0x70, 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x62, 0x79, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x42, 0x86, 0x01, 0x0a, 0x0c, - 0x63, 0x6f, 0x6d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x42, 0x0a, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x6c, 0x79, - 0x73, 0x2f, 0x61, 0x6d, 0x6d, 0xa2, 0x02, 0x03, 0x45, 0x41, 0x58, 0xaa, 0x02, 0x08, 0x45, 0x6c, - 0x79, 0x73, 0x2e, 0x41, 0x6d, 0x6d, 0xca, 0x02, 0x08, 0x45, 0x6c, 0x79, 0x73, 0x5c, 0x41, 0x6d, - 0x6d, 0xe2, 0x02, 0x14, 0x45, 0x6c, 0x79, 0x73, 0x5c, 0x41, 0x6d, 0x6d, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x45, 0x6c, 0x79, 0x73, 0x3a, - 0x3a, 0x41, 0x6d, 0x6d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x1a, 0x26, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x4f, 0x75, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x48, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x42, + 0x12, 0x40, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, + 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x6d, 0x6d, 0x2f, 0x6f, 0x75, 0x74, 0x5f, 0x72, 0x6f, 0x75, + 0x74, 0x65, 0x5f, 0x62, 0x79, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x2f, 0x7b, 0x64, 0x65, 0x6e, + 0x6f, 0x6d, 0x5f, 0x6f, 0x75, 0x74, 0x7d, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x69, + 0x6e, 0x7d, 0x12, 0xab, 0x01, 0x0a, 0x15, 0x53, 0x77, 0x61, 0x70, 0x45, 0x73, 0x74, 0x69, 0x6d, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x2b, 0x2e, 0x65, + 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x77, 0x61, + 0x70, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x44, 0x65, 0x6e, + 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x65, 0x6c, 0x79, 0x73, + 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x77, 0x61, 0x70, 0x45, 0x73, + 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x12, + 0x2f, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, + 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x6d, 0x6d, 0x2f, 0x73, 0x77, 0x61, 0x70, 0x5f, 0x65, 0x73, 0x74, + 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x79, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, + 0x42, 0x86, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, + 0x6d, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x79, 0x73, + 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x6d, 0x6d, 0xa2, 0x02, 0x03, 0x45, 0x41, 0x58, + 0xaa, 0x02, 0x08, 0x45, 0x6c, 0x79, 0x73, 0x2e, 0x41, 0x6d, 0x6d, 0xca, 0x02, 0x08, 0x45, 0x6c, + 0x79, 0x73, 0x5c, 0x41, 0x6d, 0x6d, 0xe2, 0x02, 0x14, 0x45, 0x6c, 0x79, 0x73, 0x5c, 0x41, 0x6d, + 0x6d, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, + 0x45, 0x6c, 0x79, 0x73, 0x3a, 0x3a, 0x41, 0x6d, 0x6d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/api/elys/amm/tx.pulsar.go b/api/elys/amm/tx.pulsar.go index aed8d51a6..3a5916cb9 100644 --- a/api/elys/amm/tx.pulsar.go +++ b/api/elys/amm/tx.pulsar.go @@ -13260,7 +13260,7 @@ var file_elys_amm_tx_proto_rawDesc = []byte{ 0x67, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x3a, 0x22, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x12, 0x61, 0x6d, 0x6d, 0x2f, 0x4d, 0x73, 0x67, 0x53, 0x77, 0x61, 0x70, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, - 0x22, 0xd1, 0x03, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x53, 0x77, 0x61, 0x70, 0x42, 0x79, 0x44, 0x65, + 0x22, 0x9e, 0x03, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x53, 0x77, 0x61, 0x70, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, @@ -13272,113 +13272,110 @@ var file_elys_amm_tx_proto_rawDesc = []byte{ 0x6f, 0x75, 0x74, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x53, 0x77, 0x61, 0x70, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x52, 0x08, 0x6f, - 0x75, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x12, 0x50, 0x0a, 0x0a, 0x73, 0x70, 0x6f, 0x74, 0x5f, - 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, - 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, - 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, - 0x73, 0x70, 0x6f, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x4c, 0x0a, 0x08, 0x73, 0x77, 0x61, - 0x70, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, - 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, - 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x07, - 0x73, 0x77, 0x61, 0x70, 0x46, 0x65, 0x65, 0x12, 0x4d, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, - 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, - 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, - 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x08, 0x64, 0x69, - 0x73, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, - 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, - 0x69, 0x65, 0x6e, 0x74, 0x22, 0xcf, 0x01, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, - 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, - 0x72, 0x69, 0x74, 0x79, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x70, 0x6f, 0x6f, 0x6c, 0x49, 0x64, 0x12, 0x3b, 0x0a, - 0x0b, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x50, 0x6f, - 0x6f, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0a, - 0x70, 0x6f, 0x6f, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x2a, 0x82, 0xe7, 0xb0, 0x2a, - 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x17, 0x61, - 0x6d, 0x6d, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6f, 0x6c, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x6d, 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x70, 0x6f, 0x6f, 0x6c, 0x49, 0x64, 0x12, 0x35, - 0x0a, 0x0b, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x50, - 0x6f, 0x6f, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x0a, 0x70, 0x6f, 0x6f, 0x6c, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x9b, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, + 0x75, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x70, 0x6f, 0x74, 0x5f, + 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x70, 0x6f, + 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x4c, 0x0a, 0x08, 0x73, 0x77, 0x61, 0x70, 0x5f, 0x66, + 0x65, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, + 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, + 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, + 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x07, 0x73, 0x77, 0x61, + 0x70, 0x46, 0x65, 0x65, 0x12, 0x4d, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, + 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x08, 0x64, 0x69, 0x73, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, + 0x74, 0x22, 0xcf, 0x01, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x6f, 0x6f, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, - 0x79, 0x12, 0x28, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x10, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x26, 0x82, 0xe7, 0xb0, - 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x13, - 0x61, 0x6d, 0x6d, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x89, - 0x06, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x46, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x17, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, - 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x1a, 0x1f, 0x2e, - 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, - 0x0a, 0x08, 0x4a, 0x6f, 0x69, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x15, 0x2e, 0x65, 0x6c, 0x79, - 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x4d, 0x73, 0x67, 0x4a, 0x6f, 0x69, 0x6e, 0x50, 0x6f, 0x6f, - 0x6c, 0x1a, 0x1d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x4d, 0x73, 0x67, - 0x4a, 0x6f, 0x69, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x40, 0x0a, 0x08, 0x45, 0x78, 0x69, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x15, 0x2e, 0x65, - 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x69, 0x74, 0x50, - 0x6f, 0x6f, 0x6c, 0x1a, 0x1d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x4d, - 0x73, 0x67, 0x45, 0x78, 0x69, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x5b, 0x0a, 0x11, 0x53, 0x77, 0x61, 0x70, 0x45, 0x78, 0x61, 0x63, 0x74, 0x41, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x12, 0x1e, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, - 0x6d, 0x6d, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x77, 0x61, 0x70, 0x45, 0x78, 0x61, 0x63, 0x74, 0x41, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x1a, 0x26, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, - 0x6d, 0x6d, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x77, 0x61, 0x70, 0x45, 0x78, 0x61, 0x63, 0x74, 0x41, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x5e, 0x0a, 0x12, 0x53, 0x77, 0x61, 0x70, 0x45, 0x78, 0x61, 0x63, 0x74, 0x41, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x12, 0x1f, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, - 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x77, 0x61, 0x70, 0x45, 0x78, 0x61, 0x63, 0x74, 0x41, 0x6d, 0x6f, - 0x75, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x1a, 0x27, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, - 0x6d, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x77, 0x61, 0x70, 0x45, 0x78, 0x61, 0x63, 0x74, 0x41, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x49, 0x0a, 0x0b, 0x53, 0x77, 0x61, 0x70, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x18, - 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x77, 0x61, - 0x70, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x1a, 0x20, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, - 0x61, 0x6d, 0x6d, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x77, 0x61, 0x70, 0x42, 0x79, 0x44, 0x65, 0x6e, - 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7f, 0x0a, 0x1d, 0x46, 0x65, - 0x65, 0x64, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x12, 0x2a, 0x2e, 0x65, 0x6c, - 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x4d, 0x73, 0x67, 0x46, 0x65, 0x65, 0x64, 0x4d, 0x75, - 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x4c, 0x69, - 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x1a, 0x32, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, - 0x6d, 0x6d, 0x2e, 0x4d, 0x73, 0x67, 0x46, 0x65, 0x65, 0x64, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, - 0x6c, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, - 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x10, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, - 0x1d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x25, - 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x19, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, - 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x1a, 0x21, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x4d, 0x73, 0x67, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x83, 0x01, 0x0a, 0x0c, 0x63, - 0x6f, 0x6d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x42, 0x07, 0x54, 0x78, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, - 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x6d, - 0x6d, 0xa2, 0x02, 0x03, 0x45, 0x41, 0x58, 0xaa, 0x02, 0x08, 0x45, 0x6c, 0x79, 0x73, 0x2e, 0x41, - 0x6d, 0x6d, 0xca, 0x02, 0x08, 0x45, 0x6c, 0x79, 0x73, 0x5c, 0x41, 0x6d, 0x6d, 0xe2, 0x02, 0x14, - 0x45, 0x6c, 0x79, 0x73, 0x5c, 0x41, 0x6d, 0x6d, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x45, 0x6c, 0x79, 0x73, 0x3a, 0x3a, 0x41, 0x6d, 0x6d, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x06, 0x70, 0x6f, 0x6f, 0x6c, 0x49, 0x64, 0x12, 0x3b, 0x0a, 0x0b, 0x70, 0x6f, + 0x6f, 0x6c, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x14, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x50, 0x6f, 0x6f, 0x6c, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0a, 0x70, 0x6f, 0x6f, + 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x2a, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x17, 0x61, 0x6d, 0x6d, 0x2f, + 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x22, 0x6d, 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x6f, 0x6f, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x06, 0x70, 0x6f, 0x6f, 0x6c, 0x49, 0x64, 0x12, 0x35, 0x0a, 0x0b, 0x70, + 0x6f, 0x6f, 0x6c, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x50, 0x6f, 0x6f, 0x6c, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x0a, 0x70, 0x6f, 0x6f, 0x6c, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x22, 0x9b, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x28, + 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, + 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x26, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x13, 0x61, 0x6d, 0x6d, + 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x89, 0x06, 0x0a, 0x03, + 0x4d, 0x73, 0x67, 0x12, 0x46, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6f, + 0x6c, 0x12, 0x17, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x4d, 0x73, 0x67, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x1a, 0x1f, 0x2e, 0x65, 0x6c, 0x79, + 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, + 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x08, 0x4a, + 0x6f, 0x69, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x15, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, + 0x6d, 0x6d, 0x2e, 0x4d, 0x73, 0x67, 0x4a, 0x6f, 0x69, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x1a, 0x1d, + 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x4d, 0x73, 0x67, 0x4a, 0x6f, 0x69, + 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, + 0x08, 0x45, 0x78, 0x69, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x15, 0x2e, 0x65, 0x6c, 0x79, 0x73, + 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x69, 0x74, 0x50, 0x6f, 0x6f, 0x6c, + 0x1a, 0x1d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x4d, 0x73, 0x67, 0x45, + 0x78, 0x69, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x5b, 0x0a, 0x11, 0x53, 0x77, 0x61, 0x70, 0x45, 0x78, 0x61, 0x63, 0x74, 0x41, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x49, 0x6e, 0x12, 0x1e, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, + 0x4d, 0x73, 0x67, 0x53, 0x77, 0x61, 0x70, 0x45, 0x78, 0x61, 0x63, 0x74, 0x41, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x49, 0x6e, 0x1a, 0x26, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, + 0x4d, 0x73, 0x67, 0x53, 0x77, 0x61, 0x70, 0x45, 0x78, 0x61, 0x63, 0x74, 0x41, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x49, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5e, 0x0a, 0x12, + 0x53, 0x77, 0x61, 0x70, 0x45, 0x78, 0x61, 0x63, 0x74, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x4f, + 0x75, 0x74, 0x12, 0x1f, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x4d, 0x73, + 0x67, 0x53, 0x77, 0x61, 0x70, 0x45, 0x78, 0x61, 0x63, 0x74, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x4f, 0x75, 0x74, 0x1a, 0x27, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x4d, + 0x73, 0x67, 0x53, 0x77, 0x61, 0x70, 0x45, 0x78, 0x61, 0x63, 0x74, 0x41, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x4f, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0b, + 0x53, 0x77, 0x61, 0x70, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x18, 0x2e, 0x65, 0x6c, + 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x77, 0x61, 0x70, 0x42, 0x79, + 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x1a, 0x20, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, + 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x77, 0x61, 0x70, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7f, 0x0a, 0x1d, 0x46, 0x65, 0x65, 0x64, 0x4d, + 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x4c, + 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x12, 0x2a, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, + 0x61, 0x6d, 0x6d, 0x2e, 0x4d, 0x73, 0x67, 0x46, 0x65, 0x65, 0x64, 0x4d, 0x75, 0x6c, 0x74, 0x69, + 0x70, 0x6c, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x4c, 0x69, 0x71, 0x75, 0x69, + 0x64, 0x69, 0x74, 0x79, 0x1a, 0x32, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, + 0x4d, 0x73, 0x67, 0x46, 0x65, 0x65, 0x64, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x45, + 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1d, 0x2e, 0x65, + 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x25, 0x2e, 0x65, 0x6c, + 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x6f, 0x6f, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x19, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x4d, 0x73, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x21, 0x2e, + 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x83, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, + 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x61, 0x6d, 0x6d, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, + 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x6d, 0x6d, 0xa2, 0x02, + 0x03, 0x45, 0x41, 0x58, 0xaa, 0x02, 0x08, 0x45, 0x6c, 0x79, 0x73, 0x2e, 0x41, 0x6d, 0x6d, 0xca, + 0x02, 0x08, 0x45, 0x6c, 0x79, 0x73, 0x5c, 0x41, 0x6d, 0x6d, 0xe2, 0x02, 0x14, 0x45, 0x6c, 0x79, + 0x73, 0x5c, 0x41, 0x6d, 0x6d, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x09, 0x45, 0x6c, 0x79, 0x73, 0x3a, 0x3a, 0x41, 0x6d, 0x6d, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/elys/leveragelp/query.pulsar.go b/api/elys/leveragelp/query.pulsar.go index 0babd1c7f..2786183e1 100644 --- a/api/elys/leveragelp/query.pulsar.go +++ b/api/elys/leveragelp/query.pulsar.go @@ -16384,284 +16384,281 @@ var file_elys_leveragelp_query_proto_rawDesc = []byte{ 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x0a, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x68, + 0x28, 0x04, 0x52, 0x0a, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x35, 0x0a, 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x47, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, - 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, - 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, - 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, - 0x63, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x89, 0x02, 0x0a, 0x13, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x4f, 0x70, 0x65, 0x6e, 0x45, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x5f, 0x61, - 0x73, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6c, 0x6c, - 0x61, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x58, 0x0a, 0x11, 0x63, - 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, - 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x49, 0x6e, 0x74, 0x52, 0x10, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x41, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0b, 0x61, 0x6d, 0x6d, 0x5f, 0x70, 0x6f, 0x6f, - 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x61, 0x6d, 0x6d, 0x50, - 0x6f, 0x6f, 0x6c, 0x49, 0x64, 0x12, 0x4d, 0x0a, 0x08, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, - 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, - 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x08, 0x6c, 0x65, 0x76, 0x65, - 0x72, 0x61, 0x67, 0x65, 0x22, 0x9f, 0x02, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x70, - 0x65, 0x6e, 0x45, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, - 0x0d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, + 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x89, 0x02, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, + 0x70, 0x65, 0x6e, 0x45, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, + 0x10, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x5f, 0x61, 0x73, 0x73, 0x65, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x65, + 0x72, 0x61, 0x6c, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x58, 0x0a, 0x11, 0x63, 0x6f, 0x6c, 0x6c, + 0x61, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, + 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, + 0x52, 0x10, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x41, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0b, 0x61, 0x6d, 0x6d, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x61, 0x6d, 0x6d, 0x50, 0x6f, 0x6f, 0x6c, + 0x49, 0x64, 0x12, 0x4d, 0x0a, 0x08, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, - 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, - 0x74, 0x52, 0x0c, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x7a, 0x65, 0x12, - 0x63, 0x0a, 0x14, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, - 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, - 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, - 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, - 0x52, 0x12, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, - 0x61, 0x74, 0x69, 0x6f, 0x12, 0x50, 0x0a, 0x0a, 0x62, 0x6f, 0x72, 0x72, 0x6f, 0x77, 0x5f, 0x66, - 0x65, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, - 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, - 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, - 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, 0x62, 0x6f, 0x72, - 0x72, 0x6f, 0x77, 0x46, 0x65, 0x65, 0x22, 0x86, 0x01, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x45, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x48, 0x0a, 0x09, 0x6c, 0x70, 0x5f, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, - 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, - 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x08, 0x6c, 0x70, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, - 0x41, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x52, 0x03, 0x69, - 0x64, 0x73, 0x22, 0x92, 0x01, 0x0a, 0x0a, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, - 0x6f, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x49, 0x64, 0x12, 0x63, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x30, 0xc8, - 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, - 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, - 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x22, 0xbf, 0x01, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x35, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, - 0x65, 0x6c, 0x70, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, - 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x70, 0x0a, 0x0d, 0x74, 0x6f, 0x74, 0x61, 0x6c, - 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, - 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x0c, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x22, 0x9d, 0x02, 0x0a, 0x15, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x45, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x09, 0x6c, 0x69, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, - 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x49, 0x6e, 0x74, 0x52, 0x09, 0x6c, 0x69, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x63, - 0x0a, 0x14, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, - 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, - 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, - 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, - 0x12, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x61, - 0x74, 0x69, 0x6f, 0x12, 0x54, 0x0a, 0x0f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x72, 0x65, - 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, - 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0e, 0x61, 0x6d, 0x6f, 0x75, 0x6e, - 0x74, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x22, 0x3d, 0x0a, 0x21, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x73, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, - 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xac, 0x02, 0x0a, 0x22, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x73, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x76, 0x0a, 0x10, 0x6c, 0x6f, 0x63, - 0x6b, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x30, - 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, - 0x52, 0x0f, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, - 0x64, 0x12, 0x74, 0x0a, 0x0f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x0e, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x32, 0xc9, 0x12, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x12, 0x77, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1e, 0x2e, 0x65, 0x6c, - 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x65, 0x6c, - 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, - 0x65, 0x6c, 0x70, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x99, 0x01, 0x0a, 0x0e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x21, 0x2e, + 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x08, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, + 0x65, 0x22, 0x9f, 0x02, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x70, 0x65, 0x6e, 0x45, + 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0d, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, + 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0c, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x63, 0x0a, 0x14, + 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, + 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, + 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x12, 0x77, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x61, 0x74, 0x69, + 0x6f, 0x12, 0x50, 0x0a, 0x0a, 0x62, 0x6f, 0x72, 0x72, 0x6f, 0x77, 0x5f, 0x66, 0x65, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, + 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, 0x62, 0x6f, 0x72, 0x72, 0x6f, 0x77, + 0x46, 0x65, 0x65, 0x22, 0x86, 0x01, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6c, 0x6f, + 0x73, 0x65, 0x45, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, + 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, + 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x48, 0x0a, 0x09, 0x6c, 0x70, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, + 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, + 0x6e, 0x74, 0x52, 0x08, 0x6c, 0x70, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x41, 0x0a, 0x13, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, + 0x03, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, + 0x92, 0x01, 0x0a, 0x0a, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1f, + 0x0a, 0x0b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, + 0x63, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, + 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x06, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x22, 0xbf, 0x01, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, + 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, + 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x73, 0x12, 0x70, 0x0a, 0x0d, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x22, 0x9d, 0x02, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x45, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x49, 0x0a, 0x09, 0x6c, 0x69, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, + 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, + 0x52, 0x09, 0x6c, 0x69, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x63, 0x0a, 0x14, 0x77, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, + 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, + 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, + 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x12, 0x77, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x61, 0x74, 0x69, 0x6f, + 0x12, 0x54, 0x0a, 0x0f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x74, 0x75, 0x72, + 0x6e, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, + 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, + 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0e, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, + 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x22, 0x3d, 0x0a, 0x21, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x4c, 0x6f, + 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xac, 0x02, 0x0a, 0x22, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x4c, 0x6f, + 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x76, 0x0a, 0x10, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, + 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x30, 0xc8, 0xde, 0x1f, + 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, + 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x0f, 0x6c, + 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x12, 0x74, + 0x0a, 0x0f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, + 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, + 0x69, 0x6e, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, + 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x0e, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x74, 0x65, 0x64, 0x32, 0xc9, 0x12, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x77, + 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1e, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, + 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, + 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x26, 0x12, 0x24, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, + 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x99, 0x01, 0x0a, 0x0e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x21, 0x2e, 0x65, 0x6c, 0x79, + 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x50, 0x6f, 0x73, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, - 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x22, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, - 0x6c, 0x70, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x12, 0x38, 0x2f, 0x65, - 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, - 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x6b, 0x65, 0x79, 0x7d, 0x12, 0xc1, 0x01, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x12, - 0x27, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, - 0x70, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x50, 0x6f, 0x6f, - 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, - 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x56, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x50, 0x12, 0x4e, 0x2f, 0x65, 0x6c, 0x79, - 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, - 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x2d, 0x62, 0x79, 0x2d, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x7b, 0x61, 0x6d, 0x6d, - 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x7b, 0x70, 0x61, 0x67, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6b, 0x65, 0x79, 0x7d, 0x12, 0x7a, 0x0a, 0x09, 0x47, 0x65, - 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, - 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, - 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, - 0x12, 0x24, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, - 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0xcd, 0x01, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x46, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x2b, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, - 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x46, - 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2c, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, + 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x40, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x12, 0x38, 0x2f, 0x65, 0x6c, 0x79, 0x73, + 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, + 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2f, 0x7b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6b, + 0x65, 0x79, 0x7d, 0x12, 0xc1, 0x01, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x73, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x27, 0x2e, 0x65, + 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x50, + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, + 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x42, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x56, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x50, 0x12, 0x4e, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, + 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2d, 0x62, 0x79, 0x2d, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x7b, 0x61, 0x6d, 0x6d, 0x5f, 0x70, 0x6f, + 0x6f, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x7b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x6b, 0x65, 0x79, 0x7d, 0x12, 0x7a, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, + 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, + 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, + 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, + 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0xcd, 0x01, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x73, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x46, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x2b, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x46, 0x6f, 0x72, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x56, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x50, 0x12, 0x4e, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, - 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, - 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2d, - 0x66, 0x6f, 0x72, 0x2d, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2f, 0x7b, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x7d, 0x2f, 0x7b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x6b, 0x65, 0x79, 0x7d, 0x12, 0x97, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x57, 0x68, - 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x21, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, + 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, + 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x46, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x56, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x50, 0x12, 0x4e, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, + 0x6c, 0x70, 0x2f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2d, 0x66, 0x6f, 0x72, + 0x2d, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x7d, 0x2f, 0x7b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6b, + 0x65, 0x79, 0x7d, 0x12, 0x97, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x57, 0x68, 0x69, 0x74, 0x65, + 0x6c, 0x69, 0x73, 0x74, 0x12, 0x21, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, + 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, - 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x65, 0x6c, 0x79, - 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x57, 0x68, 0x69, - 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x12, 0x38, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x3a, 0x12, 0x38, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, + 0x6c, 0x70, 0x2f, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x2f, 0x7b, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6b, 0x65, 0x79, 0x7d, 0x12, 0x94, 0x01, + 0x0a, 0x0d, 0x49, 0x73, 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x12, + 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, + 0x70, 0x2e, 0x49, 0x73, 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, + 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x49, 0x73, 0x57, 0x68, 0x69, 0x74, 0x65, + 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, - 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x2f, - 0x7b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6b, 0x65, 0x79, 0x7d, - 0x12, 0x94, 0x01, 0x0a, 0x0d, 0x49, 0x73, 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, - 0x65, 0x64, 0x12, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, - 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x49, 0x73, 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, - 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x65, 0x6c, 0x79, 0x73, - 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x49, 0x73, 0x57, 0x68, - 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x65, 0x6c, 0x79, 0x73, - 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, - 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x69, 0x73, 0x2d, 0x77, 0x68, 0x69, 0x74, - 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x12, 0x87, 0x01, 0x0a, 0x04, 0x50, 0x6f, 0x6f, 0x6c, - 0x12, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, - 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, - 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, - 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x12, 0x2a, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, - 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x7b, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x7d, 0x12, 0x91, 0x01, 0x0a, 0x05, 0x50, 0x6f, 0x6f, 0x6c, 0x73, 0x12, 0x24, 0x2e, 0x65, 0x6c, - 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, - 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x50, 0x6f, 0x6f, 0x6c, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x35, - 0x12, 0x33, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, - 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, - 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x7b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x6b, 0x65, 0x79, 0x7d, 0x12, 0x8e, 0x01, 0x0a, 0x08, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x20, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, - 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, - 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x37, 0x12, - 0x35, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, - 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x7d, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0xb8, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x71, 0x75, 0x69, - 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x2d, 0x2e, 0x65, 0x6c, - 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, - 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x65, 0x6c, 0x79, - 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x69, - 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x45, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x3f, 0x12, 0x3d, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, - 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, - 0x70, 0x2f, 0x6c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, - 0x69, 0x63, 0x65, 0x2f, 0x7b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, - 0x7d, 0x12, 0x8d, 0x01, 0x0a, 0x07, 0x4f, 0x70, 0x65, 0x6e, 0x45, 0x73, 0x74, 0x12, 0x24, 0x2e, + 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x69, 0x73, 0x2d, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, + 0x73, 0x74, 0x65, 0x64, 0x12, 0x87, 0x01, 0x0a, 0x04, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x70, 0x65, 0x6e, 0x45, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, - 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x70, 0x65, 0x6e, 0x45, - 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x2f, 0x12, 0x2d, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x50, 0x6f, + 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x2c, 0x12, 0x2a, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, - 0x70, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x91, 0x01, 0x0a, 0x08, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x45, 0x73, 0x74, 0x12, 0x25, + 0x70, 0x2f, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x7b, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x7d, 0x12, 0x91, + 0x01, 0x0a, 0x05, 0x50, 0x6f, 0x6f, 0x6c, 0x73, 0x12, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, + 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x41, 0x6c, 0x6c, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x45, 0x73, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, - 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6c, 0x6f, - 0x73, 0x65, 0x45, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, - 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x8f, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, - 0x73, 0x12, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, - 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, - 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, - 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x12, 0x2f, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, - 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, - 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2f, 0x7b, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0xc9, 0x01, 0x0a, 0x15, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x74, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x4c, 0x6f, 0x63, 0x6b, 0x65, - 0x64, 0x12, 0x32, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, - 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, - 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, - 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x4c, 0x6f, 0x63, 0x6b, - 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x47, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x41, 0x12, 0x3f, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x12, 0x33, 0x2f, + 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, + 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x70, 0x6f, 0x6f, + 0x6c, 0x2f, 0x7b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6b, 0x65, + 0x79, 0x7d, 0x12, 0x8e, 0x01, 0x0a, 0x08, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x20, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, + 0x70, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x21, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, + 0x65, 0x6c, 0x70, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x37, 0x12, 0x35, 0x2f, 0x65, + 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, + 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x2f, 0x7b, + 0x69, 0x64, 0x7d, 0x12, 0xb8, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x2d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, + 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, + 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, + 0x69, 0x71, 0x75, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x45, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3f, 0x12, + 0x3d, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, + 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x6c, + 0x69, 0x71, 0x75, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, + 0x2f, 0x7b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x8d, + 0x01, 0x0a, 0x07, 0x4f, 0x70, 0x65, 0x6e, 0x45, 0x73, 0x74, 0x12, 0x24, 0x2e, 0x65, 0x6c, 0x79, + 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x4f, 0x70, 0x65, 0x6e, 0x45, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, + 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x70, 0x65, 0x6e, 0x45, 0x73, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x12, + 0x2d, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, + 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x6f, + 0x70, 0x65, 0x6e, 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x91, + 0x01, 0x0a, 0x08, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x45, 0x73, 0x74, 0x12, 0x25, 0x2e, 0x65, 0x6c, + 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x45, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, + 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x45, + 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, - 0x70, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x73, 0x5f, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x7d, 0x42, 0xb0, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x65, 0x6c, 0x79, 0x73, - 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x42, 0x0a, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, - 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x6c, 0x79, 0x73, - 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0xa2, 0x02, 0x03, 0x45, 0x4c, - 0x58, 0xaa, 0x02, 0x0f, 0x45, 0x6c, 0x79, 0x73, 0x2e, 0x4c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, - 0x65, 0x6c, 0x70, 0xca, 0x02, 0x0f, 0x45, 0x6c, 0x79, 0x73, 0x5c, 0x4c, 0x65, 0x76, 0x65, 0x72, - 0x61, 0x67, 0x65, 0x6c, 0x70, 0xe2, 0x02, 0x1b, 0x45, 0x6c, 0x79, 0x73, 0x5c, 0x4c, 0x65, 0x76, - 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x45, 0x6c, 0x79, 0x73, 0x3a, 0x3a, 0x4c, 0x65, 0x76, 0x65, - 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x2f, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x8f, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x24, + 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, + 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x31, 0x12, 0x2f, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, + 0x6c, 0x70, 0x2f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x7d, 0x12, 0xc9, 0x01, 0x0a, 0x15, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, + 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x32, + 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, + 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x74, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x47, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x41, 0x12, + 0x3f, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, + 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x63, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x5f, + 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, + 0x42, 0xb0, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, + 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, + 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, + 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0xa2, 0x02, 0x03, 0x45, 0x4c, 0x58, 0xaa, 0x02, + 0x0f, 0x45, 0x6c, 0x79, 0x73, 0x2e, 0x4c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, + 0xca, 0x02, 0x0f, 0x45, 0x6c, 0x79, 0x73, 0x5c, 0x4c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, + 0x6c, 0x70, 0xe2, 0x02, 0x1b, 0x45, 0x6c, 0x79, 0x73, 0x5c, 0x4c, 0x65, 0x76, 0x65, 0x72, 0x61, + 0x67, 0x65, 0x6c, 0x70, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x10, 0x45, 0x6c, 0x79, 0x73, 0x3a, 0x3a, 0x4c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, + 0x65, 0x6c, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/elys/masterchef/query.pulsar.go b/api/elys/masterchef/query.pulsar.go index fe9020c7c..9b3486763 100644 --- a/api/elys/masterchef/query.pulsar.go +++ b/api/elys/masterchef/query.pulsar.go @@ -17735,326 +17735,288 @@ var file_elys_masterchef_query_proto_rawDesc = []byte{ 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x22, 0x32, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x62, 0x0a, 0x1b, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x2f, 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x6b, 0x65, - 0x41, 0x70, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x03, 0x61, - 0x70, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, - 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, - 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, - 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x03, 0x61, 0x70, 0x72, - 0x22, 0x31, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x41, 0x70, 0x72, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x6f, 0x6f, 0x6c, - 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x07, 0x70, 0x6f, 0x6f, 0x6c, - 0x49, 0x64, 0x73, 0x22, 0x4b, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, - 0x41, 0x70, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x04, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x65, 0x6c, 0x79, - 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x50, 0x6f, 0x6f, - 0x6c, 0x41, 0x70, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, - 0x22, 0x8e, 0x02, 0x0a, 0x07, 0x50, 0x6f, 0x6f, 0x6c, 0x41, 0x70, 0x72, 0x12, 0x17, 0x0a, 0x07, - 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x70, - 0x6f, 0x6f, 0x6c, 0x49, 0x64, 0x12, 0x4c, 0x0a, 0x08, 0x65, 0x64, 0x65, 0x6e, 0x5f, 0x61, 0x70, - 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, - 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, - 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x07, 0x65, 0x64, 0x65, 0x6e, - 0x41, 0x70, 0x72, 0x12, 0x4c, 0x0a, 0x08, 0x75, 0x73, 0x64, 0x63, 0x5f, 0x61, 0x70, 0x72, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, - 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x07, 0x75, 0x73, 0x64, 0x63, 0x41, 0x70, - 0x72, 0x12, 0x4e, 0x0a, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x61, 0x70, 0x72, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, - 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x08, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x41, 0x70, - 0x72, 0x22, 0x2d, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x68, 0x6f, 0x77, 0x46, 0x65, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, - 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x65, - 0x22, 0x55, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x68, 0x6f, 0x77, 0x46, 0x65, 0x65, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x08, - 0x66, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, - 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, - 0x2e, 0x46, 0x65, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x07, - 0x66, 0x65, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x19, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x4c, 0x69, 0x73, 0x74, 0x46, 0x65, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x22, 0x55, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x46, - 0x65, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, - 0x0a, 0x08, 0x66, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x18, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, - 0x65, 0x66, 0x2e, 0x46, 0x65, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, - 0x52, 0x07, 0x66, 0x65, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x67, 0x0a, 0x0f, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x41, 0x70, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x0d, - 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x45, 0x61, 0x72, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0c, - 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, - 0x6f, 0x6d, 0x22, 0x57, 0x0a, 0x10, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x70, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x03, 0x61, 0x70, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, - 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x03, 0x61, 0x70, 0x72, 0x22, 0x12, 0x0a, 0x10, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x41, 0x70, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, - 0x81, 0x07, 0x0a, 0x11, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x70, 0x72, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0d, 0x75, 0x73, 0x64, 0x63, 0x5f, 0x61, 0x70, - 0x72, 0x5f, 0x75, 0x73, 0x64, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, - 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, - 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, - 0x0b, 0x75, 0x73, 0x64, 0x63, 0x41, 0x70, 0x72, 0x55, 0x73, 0x64, 0x63, 0x12, 0x55, 0x0a, 0x0d, - 0x65, 0x64, 0x65, 0x6e, 0x5f, 0x61, 0x70, 0x72, 0x5f, 0x75, 0x73, 0x64, 0x63, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, - 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0b, 0x65, 0x64, 0x65, 0x6e, 0x41, 0x70, 0x72, 0x55, - 0x73, 0x64, 0x63, 0x12, 0x57, 0x0a, 0x0e, 0x75, 0x73, 0x64, 0x63, 0x5f, 0x61, 0x70, 0x72, 0x5f, - 0x65, 0x64, 0x65, 0x6e, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, - 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, - 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0c, - 0x75, 0x73, 0x64, 0x63, 0x41, 0x70, 0x72, 0x45, 0x64, 0x65, 0x6e, 0x62, 0x12, 0x57, 0x0a, 0x0e, - 0x65, 0x64, 0x65, 0x6e, 0x5f, 0x61, 0x70, 0x72, 0x5f, 0x65, 0x64, 0x65, 0x6e, 0x62, 0x18, 0x04, + 0x41, 0x70, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x61, + 0x70, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x61, 0x70, 0x72, 0x22, 0x31, 0x0a, + 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x41, 0x70, 0x72, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x64, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x07, 0x70, 0x6f, 0x6f, 0x6c, 0x49, 0x64, 0x73, + 0x22, 0x4b, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x41, 0x70, 0x72, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, + 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x50, 0x6f, 0x6f, 0x6c, 0x41, 0x70, + 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x8e, 0x02, + 0x0a, 0x07, 0x50, 0x6f, 0x6f, 0x6c, 0x41, 0x70, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x6f, 0x6f, + 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x70, 0x6f, 0x6f, 0x6c, + 0x49, 0x64, 0x12, 0x4c, 0x0a, 0x08, 0x65, 0x64, 0x65, 0x6e, 0x5f, 0x61, 0x70, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0c, 0x65, 0x64, 0x65, 0x6e, 0x41, 0x70, 0x72, - 0x45, 0x64, 0x65, 0x6e, 0x62, 0x12, 0x55, 0x0a, 0x0d, 0x75, 0x73, 0x64, 0x63, 0x5f, 0x61, 0x70, - 0x72, 0x5f, 0x65, 0x64, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, - 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, - 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, - 0x0b, 0x75, 0x73, 0x64, 0x63, 0x41, 0x70, 0x72, 0x45, 0x64, 0x65, 0x6e, 0x12, 0x55, 0x0a, 0x0d, - 0x65, 0x64, 0x65, 0x6e, 0x5f, 0x61, 0x70, 0x72, 0x5f, 0x65, 0x64, 0x65, 0x6e, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, - 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0b, 0x65, 0x64, 0x65, 0x6e, 0x41, 0x70, 0x72, 0x45, - 0x64, 0x65, 0x6e, 0x12, 0x57, 0x0a, 0x0e, 0x65, 0x64, 0x65, 0x6e, 0x62, 0x5f, 0x61, 0x70, 0x72, - 0x5f, 0x65, 0x64, 0x65, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, - 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, - 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0c, - 0x65, 0x64, 0x65, 0x6e, 0x62, 0x41, 0x70, 0x72, 0x45, 0x64, 0x65, 0x6e, 0x12, 0x55, 0x0a, 0x0d, - 0x75, 0x73, 0x64, 0x63, 0x5f, 0x61, 0x70, 0x72, 0x5f, 0x65, 0x6c, 0x79, 0x73, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, - 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0b, 0x75, 0x73, 0x64, 0x63, 0x41, 0x70, 0x72, 0x45, - 0x6c, 0x79, 0x73, 0x12, 0x55, 0x0a, 0x0d, 0x65, 0x64, 0x65, 0x6e, 0x5f, 0x61, 0x70, 0x72, 0x5f, - 0x65, 0x6c, 0x79, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, - 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, - 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, - 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0b, 0x65, - 0x64, 0x65, 0x6e, 0x41, 0x70, 0x72, 0x45, 0x6c, 0x79, 0x73, 0x12, 0x57, 0x0a, 0x0e, 0x65, 0x64, - 0x65, 0x6e, 0x62, 0x5f, 0x61, 0x70, 0x72, 0x5f, 0x65, 0x6c, 0x79, 0x73, 0x18, 0x0a, 0x20, 0x01, + 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x07, 0x65, 0x64, 0x65, 0x6e, 0x41, 0x70, 0x72, + 0x12, 0x4c, 0x0a, 0x08, 0x75, 0x73, 0x64, 0x63, 0x5f, 0x61, 0x70, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0c, 0x65, 0x64, 0x65, 0x6e, 0x62, 0x41, 0x70, 0x72, 0x45, - 0x6c, 0x79, 0x73, 0x22, 0x7c, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, - 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, - 0x0a, 0x08, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, - 0x52, 0x07, 0x70, 0x6f, 0x6f, 0x6c, 0x49, 0x64, 0x73, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x22, 0xee, 0x03, 0x0a, 0x0b, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, - 0x73, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x06, 0x70, 0x6f, 0x6f, 0x6c, 0x49, 0x64, 0x12, 0x52, 0x0a, 0x0b, 0x72, 0x65, - 0x77, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x75, 0x73, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, - 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, - 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, - 0x65, 0x63, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x55, 0x73, 0x64, 0x12, 0x6e, - 0x0a, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, - 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, - 0x73, 0x52, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x12, 0x42, - 0x0a, 0x0c, 0x65, 0x64, 0x65, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, - 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0b, 0x65, 0x64, 0x65, 0x6e, 0x46, 0x6f, 0x72, 0x77, 0x61, - 0x72, 0x64, 0x12, 0x59, 0x0a, 0x0f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x75, 0x73, - 0x64, 0x5f, 0x61, 0x70, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, - 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, - 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0d, - 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x55, 0x73, 0x64, 0x41, 0x70, 0x72, 0x12, 0x63, 0x0a, - 0x14, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, - 0x73, 0x5f, 0x61, 0x70, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, + 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x07, 0x75, 0x73, 0x64, 0x63, 0x41, 0x70, 0x72, 0x12, 0x4e, + 0x0a, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x61, 0x70, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, + 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x44, 0x65, 0x63, 0x52, 0x08, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x41, 0x70, 0x72, 0x22, 0x2d, + 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x68, 0x6f, 0x77, 0x46, 0x65, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x65, 0x22, 0x55, 0x0a, + 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x68, 0x6f, 0x77, 0x46, 0x65, 0x65, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x08, 0x66, 0x65, 0x65, + 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x65, 0x6c, + 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x46, 0x65, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x07, 0x66, 0x65, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x19, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x69, 0x73, + 0x74, 0x46, 0x65, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, + 0x55, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x65, 0x65, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x08, 0x66, + 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, + 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, + 0x46, 0x65, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x07, 0x66, + 0x65, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x67, 0x0a, 0x0f, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, + 0x70, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x77, 0x69, 0x74, + 0x68, 0x64, 0x72, 0x61, 0x77, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x19, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, + 0x6e, 0x74, 0x2e, 0x45, 0x61, 0x72, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0c, 0x77, 0x69, 0x74, + 0x68, 0x64, 0x72, 0x61, 0x77, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, + 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x22, + 0x24, 0x0a, 0x10, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x70, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x70, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x61, 0x70, 0x72, 0x22, 0x12, 0x0a, 0x10, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x70, + 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x83, 0x03, 0x0a, 0x11, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x41, 0x70, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x22, 0x0a, 0x0d, 0x75, 0x73, 0x64, 0x63, 0x5f, 0x61, 0x70, 0x72, 0x5f, 0x75, 0x73, 0x64, 0x63, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x75, 0x73, 0x64, 0x63, 0x41, 0x70, 0x72, 0x55, + 0x73, 0x64, 0x63, 0x12, 0x22, 0x0a, 0x0d, 0x65, 0x64, 0x65, 0x6e, 0x5f, 0x61, 0x70, 0x72, 0x5f, + 0x75, 0x73, 0x64, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x64, 0x65, 0x6e, + 0x41, 0x70, 0x72, 0x55, 0x73, 0x64, 0x63, 0x12, 0x24, 0x0a, 0x0e, 0x75, 0x73, 0x64, 0x63, 0x5f, + 0x61, 0x70, 0x72, 0x5f, 0x65, 0x64, 0x65, 0x6e, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x75, 0x73, 0x64, 0x63, 0x41, 0x70, 0x72, 0x45, 0x64, 0x65, 0x6e, 0x62, 0x12, 0x24, 0x0a, + 0x0e, 0x65, 0x64, 0x65, 0x6e, 0x5f, 0x61, 0x70, 0x72, 0x5f, 0x65, 0x64, 0x65, 0x6e, 0x62, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x64, 0x65, 0x6e, 0x41, 0x70, 0x72, 0x45, 0x64, + 0x65, 0x6e, 0x62, 0x12, 0x22, 0x0a, 0x0d, 0x75, 0x73, 0x64, 0x63, 0x5f, 0x61, 0x70, 0x72, 0x5f, + 0x65, 0x64, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x75, 0x73, 0x64, 0x63, + 0x41, 0x70, 0x72, 0x45, 0x64, 0x65, 0x6e, 0x12, 0x22, 0x0a, 0x0d, 0x65, 0x64, 0x65, 0x6e, 0x5f, + 0x61, 0x70, 0x72, 0x5f, 0x65, 0x64, 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x65, 0x64, 0x65, 0x6e, 0x41, 0x70, 0x72, 0x45, 0x64, 0x65, 0x6e, 0x12, 0x24, 0x0a, 0x0e, 0x65, + 0x64, 0x65, 0x6e, 0x62, 0x5f, 0x61, 0x70, 0x72, 0x5f, 0x65, 0x64, 0x65, 0x6e, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x64, 0x65, 0x6e, 0x62, 0x41, 0x70, 0x72, 0x45, 0x64, 0x65, + 0x6e, 0x12, 0x22, 0x0a, 0x0d, 0x75, 0x73, 0x64, 0x63, 0x5f, 0x61, 0x70, 0x72, 0x5f, 0x65, 0x6c, + 0x79, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x75, 0x73, 0x64, 0x63, 0x41, 0x70, + 0x72, 0x45, 0x6c, 0x79, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x65, 0x64, 0x65, 0x6e, 0x5f, 0x61, 0x70, + 0x72, 0x5f, 0x65, 0x6c, 0x79, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x64, + 0x65, 0x6e, 0x41, 0x70, 0x72, 0x45, 0x6c, 0x79, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x65, 0x64, 0x65, + 0x6e, 0x62, 0x5f, 0x61, 0x70, 0x72, 0x5f, 0x65, 0x6c, 0x79, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x65, 0x64, 0x65, 0x6e, 0x62, 0x41, 0x70, 0x72, 0x45, 0x6c, 0x79, 0x73, 0x22, + 0x7c, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x6f, + 0x6f, 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x07, 0x70, 0x6f, + 0x6f, 0x6c, 0x49, 0x64, 0x73, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xee, 0x03, + 0x0a, 0x0b, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x17, 0x0a, + 0x07, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, + 0x70, 0x6f, 0x6f, 0x6c, 0x49, 0x64, 0x12, 0x52, 0x0a, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x73, 0x5f, 0x75, 0x73, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, - 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x12, - 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x41, - 0x70, 0x72, 0x22, 0x54, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, - 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, - 0x0a, 0x05, 0x70, 0x6f, 0x6f, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, - 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, - 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, - 0x00, 0x52, 0x05, 0x70, 0x6f, 0x6f, 0x6c, 0x73, 0x32, 0xa4, 0x12, 0x0a, 0x05, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x12, 0x81, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x23, 0x2e, - 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, - 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, - 0x12, 0x24, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, - 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0xae, 0x01, 0x0a, 0x11, 0x45, 0x78, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x69, 0x76, 0x65, 0x12, 0x2e, 0x2e, 0x65, - 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x63, 0x65, - 0x6e, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x65, + 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0a, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x55, 0x73, 0x64, 0x12, 0x6e, 0x0a, 0x0c, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x30, 0xc8, 0xde, 0x1f, + 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, + 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x0b, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x12, 0x42, 0x0a, 0x0c, 0x65, 0x64, + 0x65, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, + 0x00, 0x52, 0x0b, 0x65, 0x64, 0x65, 0x6e, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x12, 0x59, + 0x0a, 0x0f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x75, 0x73, 0x64, 0x5f, 0x61, 0x70, + 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, + 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, + 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0d, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x73, 0x55, 0x73, 0x64, 0x41, 0x70, 0x72, 0x12, 0x63, 0x0a, 0x14, 0x65, 0x78, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x61, 0x70, + 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, + 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, + 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x12, 0x65, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x41, 0x70, 0x72, 0x22, 0x54, + 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x05, 0x70, 0x6f, + 0x6f, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x65, 0x6c, 0x79, 0x73, + 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x50, 0x6f, 0x6f, 0x6c, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x70, + 0x6f, 0x6f, 0x6c, 0x73, 0x32, 0xa4, 0x12, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x81, + 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, + 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, + 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x65, + 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, + 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0xae, 0x01, 0x0a, 0x11, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x49, + 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x69, 0x76, 0x65, 0x12, 0x2e, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, + 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x69, 0x76, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, + 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x69, 0x76, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x32, 0x12, 0x30, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, + 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x63, 0x65, 0x6e, 0x74, + 0x69, 0x76, 0x65, 0x12, 0x8a, 0x01, 0x0a, 0x08, 0x50, 0x6f, 0x6f, 0x6c, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, + 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, + 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, + 0x6f, 0x6f, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x61, 0x73, 0x74, + 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x6e, 0x66, 0x6f, + 0x12, 0xa3, 0x01, 0x0a, 0x0e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x2b, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, + 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2c, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, + 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, + 0x72, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0xa3, 0x01, 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2b, 0x2e, 0x65, 0x6c, 0x79, 0x73, + 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, + 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x65, + 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, + 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x75, 0x73, 0x65, 0x72, + 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0xaa, 0x01, 0x0a, + 0x11, 0x55, 0x73, 0x65, 0x72, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x12, 0x2e, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, + 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x73, 0x65, 0x72, 0x50, 0x65, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, + 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x73, 0x65, 0x72, 0x50, 0x65, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x65, 0x6c, + 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, + 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x70, 0x65, 0x6e, 0x64, 0x69, + 0x6e, 0x67, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0xab, 0x01, 0x0a, 0x0e, 0x53, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x72, 0x12, 0x2b, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x63, 0x65, - 0x6e, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x12, 0x30, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, - 0x63, 0x68, 0x65, 0x66, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x6e, - 0x63, 0x65, 0x6e, 0x74, 0x69, 0x76, 0x65, 0x12, 0x8a, 0x01, 0x0a, 0x08, 0x50, 0x6f, 0x6f, 0x6c, - 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, + 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x41, + 0x70, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x65, 0x6c, 0x79, 0x73, + 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x53, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x38, 0x12, + 0x36, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, + 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x73, + 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x5f, 0x61, 0x70, 0x72, 0x2f, + 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x12, 0x8a, 0x01, 0x0a, 0x08, 0x50, 0x6f, 0x6f, 0x6c, + 0x41, 0x70, 0x72, 0x73, 0x12, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x65, 0x6c, + 0x41, 0x70, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x41, 0x70, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, - 0x69, 0x6e, 0x66, 0x6f, 0x12, 0xa3, 0x01, 0x0a, 0x0e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x77, - 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2b, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, - 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, - 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, - 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, - 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x65, 0x6c, 0x79, - 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, - 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x72, - 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0xa3, 0x01, 0x0a, 0x0e, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2b, 0x2e, - 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x65, 0x6c, 0x79, - 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, - 0x12, 0x2e, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, - 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2f, - 0x75, 0x73, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x6e, 0x66, 0x6f, - 0x12, 0xaa, 0x01, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, - 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x2e, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, - 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x73, - 0x65, 0x72, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, - 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x73, - 0x65, 0x72, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, - 0x2c, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, - 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x70, - 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0xab, 0x01, - 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x72, - 0x12, 0x2b, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, - 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, - 0x61, 0x6b, 0x65, 0x41, 0x70, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, - 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x6b, 0x65, - 0x41, 0x70, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3e, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x38, 0x12, 0x36, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, - 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, - 0x65, 0x66, 0x2f, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x5f, - 0x61, 0x70, 0x72, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x12, 0x8a, 0x01, 0x0a, 0x08, - 0x50, 0x6f, 0x6f, 0x6c, 0x41, 0x70, 0x72, 0x73, 0x12, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, - 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x50, 0x6f, 0x6f, 0x6c, 0x41, 0x70, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x26, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, - 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x41, 0x70, 0x72, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, - 0x27, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, - 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x70, - 0x6f, 0x6f, 0x6c, 0x5f, 0x61, 0x70, 0x72, 0x73, 0x12, 0x9e, 0x01, 0x0a, 0x0b, 0x53, 0x68, 0x6f, - 0x77, 0x46, 0x65, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x28, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, - 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x53, 0x68, 0x6f, 0x77, 0x46, 0x65, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, - 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x68, 0x6f, 0x77, 0x46, 0x65, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x12, 0x32, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, - 0x63, 0x68, 0x65, 0x66, 0x2f, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x69, 0x6e, - 0x66, 0x6f, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x65, 0x7d, 0x12, 0x97, 0x01, 0x0a, 0x0b, 0x4c, 0x69, - 0x73, 0x74, 0x46, 0x65, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x28, 0x2e, 0x65, 0x6c, 0x79, 0x73, + 0x61, 0x70, 0x72, 0x73, 0x12, 0x9e, 0x01, 0x0a, 0x0b, 0x53, 0x68, 0x6f, 0x77, 0x46, 0x65, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x28, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, + 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x68, 0x6f, 0x77, + 0x46, 0x65, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, + 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x68, 0x6f, 0x77, 0x46, 0x65, 0x65, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x34, 0x12, 0x32, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, + 0x2f, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x7b, + 0x64, 0x61, 0x74, 0x65, 0x7d, 0x12, 0x97, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x65, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x28, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, + 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x69, 0x73, + 0x74, 0x46, 0x65, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x29, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, + 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x65, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, + 0x66, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x12, + 0x8d, 0x01, 0x0a, 0x03, 0x41, 0x70, 0x72, 0x12, 0x20, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, + 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, + 0x70, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x65, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, - 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x46, - 0x65, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, + 0x79, 0x41, 0x70, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x41, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x3b, 0x12, 0x39, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, + 0x68, 0x65, 0x66, 0x2f, 0x61, 0x70, 0x72, 0x2f, 0x7b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, + 0x77, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x7d, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x12, + 0x79, 0x0a, 0x04, 0x41, 0x70, 0x72, 0x73, 0x12, 0x21, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, + 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, + 0x70, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x65, 0x6c, 0x79, + 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x41, 0x70, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x12, 0x22, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, - 0x72, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x69, - 0x6e, 0x66, 0x6f, 0x12, 0x8d, 0x01, 0x0a, 0x03, 0x41, 0x70, 0x72, 0x12, 0x20, 0x2e, 0x65, 0x6c, + 0x72, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, 0x70, 0x72, 0x73, 0x12, 0x96, 0x01, 0x0a, 0x0b, 0x50, + 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x28, 0x2e, 0x65, 0x6c, 0x79, + 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, + 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x32, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x12, 0x2a, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x61, 0x73, 0x74, + 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x73, 0x12, 0xb8, 0x01, 0x0a, 0x13, 0x41, 0x6c, 0x6c, 0x4c, 0x69, 0x71, 0x75, 0x69, + 0x64, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x54, 0x56, 0x4c, 0x12, 0x30, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x41, 0x70, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, + 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x50, + 0x6f, 0x6f, 0x6c, 0x54, 0x56, 0x4c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x70, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x41, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3b, 0x12, 0x39, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, + 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x54, 0x56, 0x4c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x3c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x36, 0x12, 0x34, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x61, 0x73, - 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, 0x70, 0x72, 0x2f, 0x7b, 0x77, 0x69, 0x74, - 0x68, 0x64, 0x72, 0x61, 0x77, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x7d, 0x2f, 0x7b, 0x64, 0x65, 0x6e, - 0x6f, 0x6d, 0x7d, 0x12, 0x79, 0x0a, 0x04, 0x41, 0x70, 0x72, 0x73, 0x12, 0x21, 0x2e, 0x65, 0x6c, + 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, 0x6c, 0x6c, 0x5f, 0x6c, 0x69, 0x71, 0x75, + 0x69, 0x64, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x74, 0x76, 0x6c, 0x12, 0x8a, + 0x01, 0x0a, 0x08, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x56, 0x4c, 0x12, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x41, 0x70, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, - 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x70, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x12, 0x22, 0x2f, 0x65, 0x6c, 0x79, - 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, - 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, 0x70, 0x72, 0x73, 0x12, 0x96, - 0x01, 0x0a, 0x0b, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x28, - 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, - 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x32, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x12, 0x2a, 0x2f, 0x65, 0x6c, + 0x65, 0x72, 0x79, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x56, 0x4c, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, + 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, + 0x56, 0x4c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x29, 0x12, 0x27, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, + 0x66, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x74, 0x76, 0x6c, 0x42, 0xb0, 0x01, 0x0a, 0x13, + 0x63, 0x6f, 0x6d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, + 0x68, 0x65, 0x66, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, - 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, - 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0xb8, 0x01, 0x0a, 0x13, 0x41, 0x6c, 0x6c, 0x4c, - 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x54, 0x56, 0x4c, 0x12, - 0x30, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, - 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, - 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x54, 0x56, 0x4c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x31, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, - 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x4c, 0x69, 0x71, 0x75, - 0x69, 0x64, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x54, 0x56, 0x4c, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x36, 0x12, 0x34, 0x2f, 0x65, - 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, - 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, 0x6c, 0x6c, 0x5f, - 0x6c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x74, - 0x76, 0x6c, 0x12, 0x8a, 0x01, 0x0a, 0x08, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x56, 0x4c, 0x12, - 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, - 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x56, 0x4c, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, - 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x68, - 0x61, 0x69, 0x6e, 0x54, 0x56, 0x4c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, - 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, - 0x72, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x74, 0x76, 0x6c, 0x42, - 0xb0, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6d, 0x61, 0x73, - 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, - 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x61, 0x73, - 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0xa2, 0x02, 0x03, 0x45, 0x4d, 0x58, 0xaa, 0x02, 0x0f, - 0x45, 0x6c, 0x79, 0x73, 0x2e, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0xca, - 0x02, 0x0f, 0x45, 0x6c, 0x79, 0x73, 0x5c, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, - 0x66, 0xe2, 0x02, 0x1b, 0x45, 0x6c, 0x79, 0x73, 0x5c, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, - 0x68, 0x65, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x10, 0x45, 0x6c, 0x79, 0x73, 0x3a, 0x3a, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, - 0x65, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x70, 0x69, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, + 0x68, 0x65, 0x66, 0xa2, 0x02, 0x03, 0x45, 0x4d, 0x58, 0xaa, 0x02, 0x0f, 0x45, 0x6c, 0x79, 0x73, + 0x2e, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0xca, 0x02, 0x0f, 0x45, 0x6c, + 0x79, 0x73, 0x5c, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0xe2, 0x02, 0x1b, + 0x45, 0x6c, 0x79, 0x73, 0x5c, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x45, 0x6c, + 0x79, 0x73, 0x3a, 0x3a, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x63, 0x68, 0x65, 0x66, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/elys/tier/query.pulsar.go b/api/elys/tier/query.pulsar.go index a85d6305b..106e16db7 100644 --- a/api/elys/tier/query.pulsar.go +++ b/api/elys/tier/query.pulsar.go @@ -15932,321 +15932,270 @@ var file_elys_tier_query_proto_rawDesc = []byte{ 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x4c, 0x70, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, - 0x22, 0xca, 0x01, 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x72, 0x61, - 0x67, 0x65, 0x4c, 0x70, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x52, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, - 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x56, 0x0a, 0x0d, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x62, - 0x6f, 0x72, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, - 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, - 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, - 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x6f, 0x72, 0x72, 0x6f, 0x77, 0x73, 0x22, 0x2e, 0x0a, - 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x54, 0x6f, 0x74, - 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x64, 0x0a, - 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x54, 0x6f, 0x74, - 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x05, 0x74, 0x6f, - 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, - 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, - 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, - 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x05, 0x74, 0x6f, - 0x74, 0x61, 0x6c, 0x22, 0x2c, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x6b, - 0x65, 0x64, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, - 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, - 0x72, 0x22, 0x62, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, - 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x05, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, - 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, - 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x05, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x2b, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x65, - 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, - 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, - 0x65, 0x72, 0x22, 0xc4, 0x01, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x65, 0x72, 0x70, - 0x65, 0x74, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, - 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, - 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x56, 0x0a, 0x0d, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x62, 0x6f, 0x72, 0x72, 0x6f, - 0x77, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, - 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, - 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, - 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0c, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x42, 0x6f, 0x72, 0x72, 0x6f, 0x77, 0x73, 0x22, 0x2d, 0x0a, 0x17, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x63, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, - 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x2d, 0x0a, - 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x4f, 0x72, 0x64, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x63, 0x0a, 0x18, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x4f, 0x72, 0x64, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, - 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, - 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, - 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, - 0x6c, 0x22, 0x49, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x6d, 0x6d, - 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, - 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, - 0x6f, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x07, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x22, 0x64, 0x0a, 0x19, - 0x47, 0x65, 0x74, 0x41, 0x6d, 0x6d, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x47, 0x0a, 0x05, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, - 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, - 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, - 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x05, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x22, 0x58, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x6d, - 0x6d, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, - 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, - 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6d, - 0x6d, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x38, 0x0a, 0x20, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x65, 0x64, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0xa6, 0x02, 0x0a, 0x21, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x64, 0x50, - 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x09, - 0x61, 0x6d, 0x6d, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, - 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, - 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, - 0x65, 0x63, 0x52, 0x08, 0x61, 0x6d, 0x6d, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x54, 0x0a, 0x0c, + 0x22, 0x64, 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, + 0x65, 0x4c, 0x70, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x62, 0x6f, 0x72, 0x72, 0x6f, + 0x77, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, + 0x6f, 0x72, 0x72, 0x6f, 0x77, 0x73, 0x22, 0x2e, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x31, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x2c, 0x0a, 0x16, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x2f, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x2b, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x50, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x5e, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x65, + 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x23, 0x0a, 0x0d, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x62, 0x6f, 0x72, 0x72, 0x6f, 0x77, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x6f, + 0x72, 0x72, 0x6f, 0x77, 0x73, 0x22, 0x2d, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x69, + 0x71, 0x75, 0x69, 0x64, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x75, 0x73, 0x65, 0x72, 0x22, 0x30, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x69, 0x71, + 0x75, 0x69, 0x64, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x2d, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, + 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x30, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x6f, + 0x63, 0x6b, 0x65, 0x64, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x49, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x47, 0x65, 0x74, 0x41, 0x6d, 0x6d, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x63, 0x69, + 0x6d, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x64, 0x65, 0x63, 0x69, 0x6d, + 0x61, 0x6c, 0x22, 0x31, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x41, 0x6d, 0x6d, 0x50, 0x72, 0x69, 0x63, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x58, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, + 0x74, 0x41, 0x6d, 0x6d, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x47, 0x65, + 0x74, 0x41, 0x6d, 0x6d, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, + 0x38, 0x0a, 0x20, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x64, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x8d, 0x01, 0x0a, 0x21, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x65, 0x64, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x1b, 0x0a, 0x09, 0x61, 0x6d, 0x6d, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x61, 0x6d, 0x6d, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, - 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0b, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x50, 0x72, 0x69, - 0x63, 0x65, 0x12, 0x5b, 0x0a, 0x10, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5f, 0x70, 0x72, 0x69, - 0x63, 0x65, 0x5f, 0x64, 0x65, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, - 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, - 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, - 0x0e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x50, 0x72, 0x69, 0x63, 0x65, 0x44, 0x65, 0x63, 0x22, - 0x28, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0xe8, 0x02, 0x0a, 0x13, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x53, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, - 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x53, 0x0a, 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, - 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, - 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0b, - 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x51, 0x0a, 0x0a, 0x75, - 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, - 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, - 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, - 0x65, 0x63, 0x52, 0x0a, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x54, - 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x76, 0x65, 0x73, 0x74, 0x65, 0x64, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, - 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x56, 0x65, - 0x73, 0x74, 0x65, 0x64, 0x22, 0x66, 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, - 0x55, 0x73, 0x65, 0x72, 0x73, 0x50, 0x6f, 0x6f, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x93, 0x01, 0x0a, - 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x50, 0x6f, - 0x6f, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, - 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, - 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x44, 0x61, - 0x74, 0x61, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x22, 0x5d, 0x0a, 0x05, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x64, - 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, - 0x6d, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5f, 0x70, 0x72, 0x69, 0x63, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x50, - 0x72, 0x69, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x6d, 0x6d, 0x5f, 0x70, 0x72, 0x69, 0x63, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x6d, 0x6d, 0x50, 0x72, 0x69, 0x63, - 0x65, 0x22, 0x62, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, - 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, - 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, - 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x8e, 0x01, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, - 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x06, 0x70, 0x72, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, - 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x06, 0x70, 0x72, 0x69, 0x63, 0x65, 0x73, 0x12, 0x47, 0x0a, - 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, - 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0xa3, 0x11, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x12, 0x79, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1d, 0x2e, 0x65, 0x6c, 0x79, - 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x65, 0x6c, 0x79, 0x73, - 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x2a, 0x12, 0x28, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, - 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, - 0x74, 0x69, 0x65, 0x72, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x92, 0x01, 0x0a, 0x09, - 0x50, 0x6f, 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, 0x12, 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, - 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x50, 0x6f, - 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, - 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x47, 0x65, 0x74, 0x50, 0x6f, 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x12, 0x32, 0x2f, 0x65, + 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, + 0x28, 0x0a, 0x10, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x5f, + 0x64, 0x65, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x72, 0x61, 0x63, 0x6c, + 0x65, 0x50, 0x72, 0x69, 0x63, 0x65, 0x44, 0x65, 0x63, 0x22, 0x28, 0x0a, 0x12, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, + 0x73, 0x65, 0x72, 0x22, 0x9c, 0x01, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, + 0x6b, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x20, 0x0a, + 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x1e, 0x0a, 0x0a, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x12, + 0x21, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x76, 0x65, 0x73, 0x74, 0x65, 0x64, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x56, 0x65, 0x73, 0x74, + 0x65, 0x64, 0x22, 0x66, 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x55, 0x73, + 0x65, 0x72, 0x73, 0x50, 0x6f, 0x6f, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x93, 0x01, 0x0a, 0x1d, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x50, 0x6f, 0x6f, 0x6c, + 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x05, + 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x65, 0x6c, + 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, + 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x22, 0x5d, 0x0a, 0x05, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, + 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, + 0x21, 0x0a, 0x0c, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x50, 0x72, 0x69, + 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x6d, 0x6d, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x6d, 0x6d, 0x50, 0x72, 0x69, 0x63, 0x65, 0x22, + 0x62, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x50, 0x72, + 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0a, 0x70, + 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x22, 0x8e, 0x01, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, + 0x41, 0x6c, 0x6c, 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x28, 0x0a, 0x06, 0x70, 0x72, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x50, 0x72, + 0x69, 0x63, 0x65, 0x52, 0x06, 0x70, 0x72, 0x69, 0x63, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, + 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x32, 0xa3, 0x11, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x79, + 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, + 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, + 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, + 0x28, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, + 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x74, 0x69, + 0x65, 0x72, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x92, 0x01, 0x0a, 0x09, 0x50, 0x6f, + 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, 0x12, 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, + 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x72, 0x74, + 0x66, 0x6f, 0x6c, 0x69, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x65, + 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, + 0x74, 0x50, 0x6f, 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x12, 0x32, 0x2f, 0x65, 0x6c, 0x79, + 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, + 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x70, 0x6f, + 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x7d, 0x12, 0x8e, + 0x01, 0x0a, 0x0c, 0x50, 0x6f, 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, 0x41, 0x6c, 0x6c, 0x12, + 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x41, 0x6c, 0x6c, 0x50, 0x6f, 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x50, 0x6f, 0x72, 0x74, 0x66, 0x6f, 0x6c, + 0x69, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, + 0x70, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x70, 0x6f, 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, 0x12, + 0xad, 0x01, 0x0a, 0x11, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x44, 0x69, 0x73, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, + 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, + 0x44, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x29, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x3d, 0x12, 0x3b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, + 0x70, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x5f, + 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x7d, 0x12, + 0x9c, 0x01, 0x0a, 0x0f, 0x4c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x4c, 0x70, 0x54, 0x6f, + 0x74, 0x61, 0x6c, 0x12, 0x26, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x4c, 0x70, 0x54, + 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x65, 0x6c, + 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x65, 0x76, + 0x65, 0x72, 0x61, 0x67, 0x65, 0x4c, 0x70, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x12, 0x30, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, - 0x2f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x74, 0x69, 0x65, 0x72, 0x2f, - 0x70, 0x6f, 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x7d, - 0x12, 0x8e, 0x01, 0x0a, 0x0c, 0x50, 0x6f, 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, 0x41, 0x6c, - 0x6c, 0x12, 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x50, 0x6f, 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, - 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x50, 0x6f, 0x72, 0x74, 0x66, - 0x6f, 0x6c, 0x69, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, - 0x68, 0x69, 0x70, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x70, 0x6f, 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, - 0x6f, 0x12, 0xad, 0x01, 0x0a, 0x11, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x44, - 0x69, 0x73, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, - 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, - 0x74, 0x65, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x29, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x44, 0x69, 0x73, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x3d, 0x12, 0x3b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, - 0x68, 0x69, 0x70, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, - 0x65, 0x5f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, - 0x7d, 0x12, 0x9c, 0x01, 0x0a, 0x0f, 0x4c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x4c, 0x70, - 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x26, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, - 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x4c, - 0x70, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, - 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, - 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x4c, 0x70, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x12, 0x30, + 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x6c, + 0x70, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x7d, 0x12, 0x8f, + 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x12, + 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x54, 0x6f, 0x74, + 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x73, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x7d, + 0x12, 0x87, 0x01, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x50, 0x6f, 0x6f, 0x6c, 0x12, + 0x21, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x12, 0x2a, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, - 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, - 0x5f, 0x6c, 0x70, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x7d, - 0x12, 0x8f, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x54, 0x6f, 0x74, 0x61, - 0x6c, 0x12, 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, - 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x54, - 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x72, 0x65, - 0x77, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x2f, 0x7b, 0x75, 0x73, 0x65, - 0x72, 0x7d, 0x12, 0x87, 0x01, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x50, 0x6f, 0x6f, - 0x6c, 0x12, 0x21, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x50, 0x6f, 0x6f, 0x6c, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, - 0x12, 0x2a, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, - 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x64, - 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x7d, 0x12, 0x82, 0x01, 0x0a, - 0x09, 0x50, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x12, 0x20, 0x2e, 0x65, 0x6c, 0x79, + 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x5f, 0x70, + 0x6f, 0x6f, 0x6c, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x7d, 0x12, 0x82, 0x01, 0x0a, 0x09, 0x50, + 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x12, 0x20, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, + 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x65, 0x72, 0x70, 0x65, 0x74, + 0x75, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x65, 0x72, 0x70, - 0x65, 0x74, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x65, - 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x65, - 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, - 0x2f, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, - 0x7d, 0x12, 0x8b, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x54, 0x6f, 0x74, 0x61, - 0x6c, 0x12, 0x22, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, - 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x54, 0x6f, 0x74, - 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, - 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x6c, 0x69, 0x71, 0x75, - 0x69, 0x64, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x7d, 0x12, - 0x8b, 0x01, 0x0a, 0x0b, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, + 0x65, 0x74, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x70, + 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x7d, 0x12, + 0x8b, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x22, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, + 0x79, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x4f, 0x72, 0x64, 0x65, 0x72, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, - 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, - 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x7d, 0x12, 0x97, 0x01, - 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x41, 0x6d, 0x6d, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x22, 0x2e, - 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, - 0x65, 0x74, 0x41, 0x6d, 0x6d, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x6c, 0x69, 0x71, 0x75, 0x69, 0x64, + 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x7d, 0x12, 0x8b, 0x01, + 0x0a, 0x0b, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x22, 0x2e, + 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, + 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x6d, 0x6d, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x39, 0x12, 0x37, + 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, - 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x6d, 0x6d, 0x5f, - 0x70, 0x72, 0x69, 0x63, 0x65, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x2f, 0x7b, 0x64, - 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x7d, 0x12, 0xb1, 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x43, - 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x64, 0x50, 0x72, 0x69, 0x63, 0x65, - 0x12, 0x2b, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, - 0x64, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, - 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, - 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x64, 0x50, 0x72, - 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3e, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x38, 0x12, 0x36, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, - 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, - 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x72, - 0x69, 0x63, 0x65, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x12, 0x76, 0x0a, 0x06, 0x53, - 0x74, 0x61, 0x6b, 0x65, 0x64, 0x12, 0x1d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, - 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x65, + 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x6f, + 0x72, 0x64, 0x65, 0x72, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x7d, 0x12, 0x97, 0x01, 0x0a, 0x0b, + 0x47, 0x65, 0x74, 0x41, 0x6d, 0x6d, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x22, 0x2e, 0x65, 0x6c, + 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, + 0x41, 0x6d, 0x6d, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x47, 0x65, 0x74, 0x41, 0x6d, 0x6d, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x39, 0x12, 0x37, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, - 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x2f, 0x7b, 0x75, 0x73, - 0x65, 0x72, 0x7d, 0x12, 0x9a, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, - 0x50, 0x6f, 0x6f, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x12, 0x27, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, - 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, - 0x72, 0x73, 0x50, 0x6f, 0x6f, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x28, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x50, 0x6f, 0x6f, 0x6c, 0x44, - 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, - 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, - 0x5f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x64, 0x61, 0x74, 0x61, - 0x12, 0x89, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x50, 0x72, 0x69, 0x63, 0x65, - 0x73, 0x12, 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, - 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x50, 0x72, - 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x67, 0x65, - 0x74, 0x5f, 0x61, 0x6c, 0x6c, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x73, 0x42, 0x8c, 0x01, 0x0a, - 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x42, 0x0a, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, - 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, - 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x45, 0x54, 0x58, 0xaa, 0x02, - 0x09, 0x45, 0x6c, 0x79, 0x73, 0x2e, 0x54, 0x69, 0x65, 0x72, 0xca, 0x02, 0x09, 0x45, 0x6c, 0x79, - 0x73, 0x5c, 0x54, 0x69, 0x65, 0x72, 0xe2, 0x02, 0x15, 0x45, 0x6c, 0x79, 0x73, 0x5c, 0x54, 0x69, - 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x0a, 0x45, 0x6c, 0x79, 0x73, 0x3a, 0x3a, 0x54, 0x69, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x6d, 0x6d, 0x5f, 0x70, 0x72, + 0x69, 0x63, 0x65, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x2f, 0x7b, 0x64, 0x65, 0x63, + 0x69, 0x6d, 0x61, 0x6c, 0x7d, 0x12, 0xb1, 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, + 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x64, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x2b, + 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x64, 0x50, + 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x65, 0x6c, + 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, + 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x64, 0x50, 0x72, 0x69, 0x63, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3e, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x38, 0x12, 0x36, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x63, + 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x69, 0x63, + 0x65, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x12, 0x76, 0x0a, 0x06, 0x53, 0x74, 0x61, + 0x6b, 0x65, 0x64, 0x12, 0x1d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x65, 0x6c, 0x79, + 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, + 0x69, 0x65, 0x72, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, + 0x7d, 0x12, 0x9a, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x50, 0x6f, + 0x6f, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x12, 0x27, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, + 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, + 0x50, 0x6f, 0x6f, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x28, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x50, 0x6f, 0x6f, 0x6c, 0x44, 0x61, 0x74, + 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x2d, 0x12, 0x2b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x73, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x12, 0x89, + 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x12, + 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x50, 0x72, 0x69, 0x63, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x28, 0x12, 0x26, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x5f, + 0x61, 0x6c, 0x6c, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x73, 0x42, 0x8c, 0x01, 0x0a, 0x0d, 0x63, + 0x6f, 0x6d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x74, 0x69, 0x65, 0x72, 0x42, 0x0a, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x6c, 0x79, + 0x73, 0x2f, 0x74, 0x69, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x45, 0x54, 0x58, 0xaa, 0x02, 0x09, 0x45, + 0x6c, 0x79, 0x73, 0x2e, 0x54, 0x69, 0x65, 0x72, 0xca, 0x02, 0x09, 0x45, 0x6c, 0x79, 0x73, 0x5c, + 0x54, 0x69, 0x65, 0x72, 0xe2, 0x02, 0x15, 0x45, 0x6c, 0x79, 0x73, 0x5c, 0x54, 0x69, 0x65, 0x72, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0a, 0x45, + 0x6c, 0x79, 0x73, 0x3a, 0x3a, 0x54, 0x69, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/go.mod b/go.mod index 244517182..a44506584 100644 --- a/go.mod +++ b/go.mod @@ -49,6 +49,7 @@ require ( require ( github.com/bufbuild/buf v1.15.1 + github.com/cockroachdb/apd/v2 v2.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/ibc-apps/modules/ibc-hooks/v8 v8.0.0-20240904212233-8cb681e31589 github.com/google/uuid v1.6.0 @@ -84,7 +85,6 @@ require ( github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chzyer/readline v1.5.1 // indirect - github.com/cockroachdb/apd/v2 v2.0.2 // indirect github.com/cockroachdb/errors v1.11.3 // indirect github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect diff --git a/proto/elys/amm/query.proto b/proto/elys/amm/query.proto index 4bdfe409d..821d41ae4 100644 --- a/proto/elys/amm/query.proto +++ b/proto/elys/amm/query.proto @@ -157,16 +157,8 @@ message QueryJoinPoolEstimationResponse { [ (gogoproto.nullable) = false ]; repeated cosmos.base.v1beta1.Coin amounts_in = 2 [ (gogoproto.nullable) = false ]; - string slippage = 3 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string weight_balance_ratio = 4 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; + string slippage = 3; + string weight_balance_ratio = 4; } message QueryExitPoolEstimationRequest { @@ -185,11 +177,7 @@ message QueryExitPoolEstimationResponse { } message QuerySwapEstimationResponse { - string spot_price = 1 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; + string spot_price = 1; cosmos.base.v1beta1.Coin token_out = 2 [ (gogoproto.nullable) = false ]; string swap_fee = 3 [ (cosmos_proto.scalar) = "cosmos.Dec", @@ -203,16 +191,8 @@ message QuerySwapEstimationResponse { ]; cosmos.base.v1beta1.Coin available_liquidity = 5 [ (gogoproto.nullable) = false ]; - string slippage = 6 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string weight_balance_ratio = 7 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; + string slippage = 6; + string weight_balance_ratio = 7; } message QuerySlippageTrackRequest { uint64 pool_id = 1; } @@ -262,11 +242,7 @@ message QuerySwapEstimationByDenomRequest { message QuerySwapEstimationByDenomResponse { repeated SwapAmountInRoute in_route = 1; repeated SwapAmountOutRoute out_route = 2; - string spot_price = 3 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; + string spot_price = 3; cosmos.base.v1beta1.Coin amount = 4 [ (gogoproto.nullable) = false ]; string swap_fee = 5 [ (cosmos_proto.scalar) = "cosmos.Dec", @@ -280,21 +256,9 @@ message QuerySwapEstimationByDenomResponse { ]; cosmos.base.v1beta1.Coin available_liquidity = 7 [ (gogoproto.nullable) = false ]; - string weight_balance_ratio = 8 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string slippage = 9 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string price_impact = 10 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; + string weight_balance_ratio = 8; + string slippage = 9; + string price_impact = 10; } message QueryAMMPriceRequest { diff --git a/proto/elys/amm/tx.proto b/proto/elys/amm/tx.proto index 093db97d8..e8d2b920e 100644 --- a/proto/elys/amm/tx.proto +++ b/proto/elys/amm/tx.proto @@ -201,11 +201,7 @@ message MsgSwapByDenomResponse { cosmos.base.v1beta1.Coin amount = 1 [ (gogoproto.nullable) = false ]; repeated SwapAmountInRoute in_route = 2; repeated SwapAmountOutRoute out_route = 3; - string spot_price = 4 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; + string spot_price = 4; string swap_fee = 5 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", diff --git a/proto/elys/leveragelp/query.proto b/proto/elys/leveragelp/query.proto index 9277ea8b9..f4bde672f 100644 --- a/proto/elys/leveragelp/query.proto +++ b/proto/elys/leveragelp/query.proto @@ -196,13 +196,7 @@ message QueryLiquidationPriceRequest { uint64 position_id = 2; } -message QueryLiquidationPriceResponse { - string price = 1 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; -} +message QueryLiquidationPriceResponse { string price = 1; } message QueryOpenEstRequest { string collateral_asset = 1; diff --git a/proto/elys/leveragelp/tx.proto b/proto/elys/leveragelp/tx.proto index 7cf4fc5cf..cc9e4fb37 100644 --- a/proto/elys/leveragelp/tx.proto +++ b/proto/elys/leveragelp/tx.proto @@ -26,8 +26,10 @@ service Msg { rpc Dewhitelist(MsgDewhitelist) returns (MsgDewhitelistResponse); rpc UpdateStopLoss(MsgUpdateStopLoss) returns (MsgUpdateStopLossResponse); rpc ClosePositions(MsgClosePositions) returns (MsgClosePositionsResponse); - rpc UpdateMaxLeverageForPool(MsgUpdateMaxLeverageForPool) returns (MsgUpdateMaxLeverageForPoolResponse); - rpc UpdateEnabledPools(MsgUpdateEnabledPools) returns (MsgUpdateEnabledPoolsResponse); + rpc UpdateMaxLeverageForPool(MsgUpdateMaxLeverageForPool) + returns (MsgUpdateMaxLeverageForPoolResponse); + rpc UpdateEnabledPools(MsgUpdateEnabledPools) + returns (MsgUpdateEnabledPoolsResponse); } message MsgOpen { option (cosmos.msg.v1.signer) = "creator"; diff --git a/proto/elys/masterchef/query.proto b/proto/elys/masterchef/query.proto index 2d4362de4..abdd14bf5 100644 --- a/proto/elys/masterchef/query.proto +++ b/proto/elys/masterchef/query.proto @@ -206,13 +206,7 @@ message QueryUserPendingRewardResponse { message QueryStableStakeAprRequest { string denom = 1; } -message QueryStableStakeAprResponse { - string apr = 1 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; -} +message QueryStableStakeAprResponse { string apr = 1; } message QueryPoolAprsRequest { repeated uint64 pool_ids = 1; } @@ -256,67 +250,21 @@ message QueryAprRequest { string denom = 2; } -message QueryAprResponse { - string apr = 1 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; -} +message QueryAprResponse { string apr = 1; } message QueryAprsRequest {} message QueryAprsResponse { - string usdc_apr_usdc = 1 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string eden_apr_usdc = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string usdc_apr_edenb = 3 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string eden_apr_edenb = 4 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string usdc_apr_eden = 5 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string eden_apr_eden = 6 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string edenb_apr_eden = 7 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string usdc_apr_elys = 8 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string eden_apr_elys = 9 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string edenb_apr_elys = 10 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; + string usdc_apr_usdc = 1; + string eden_apr_usdc = 2; + string usdc_apr_edenb = 3; + string eden_apr_edenb = 4; + string usdc_apr_eden = 5; + string eden_apr_eden = 6; + string edenb_apr_eden = 7; + string usdc_apr_elys = 8; + string eden_apr_elys = 9; + string edenb_apr_elys = 10; } message QueryPoolRewardsRequest { diff --git a/proto/elys/perpetual/tx.proto b/proto/elys/perpetual/tx.proto index 0cd6701b9..9ab67cdb3 100644 --- a/proto/elys/perpetual/tx.proto +++ b/proto/elys/perpetual/tx.proto @@ -24,9 +24,10 @@ service Msg { rpc ClosePositions(MsgClosePositions) returns (MsgClosePositionsResponse); rpc UpdateTakeProfitPrice(MsgUpdateTakeProfitPrice) returns (MsgUpdateTakeProfitPriceResponse); - rpc UpdateMaxLeverageForPool(MsgUpdateMaxLeverageForPool) returns (MsgUpdateMaxLeverageForPoolResponse); - rpc UpdateEnabledPools(MsgUpdateEnabledPools) returns (MsgUpdateEnabledPoolsResponse); - + rpc UpdateMaxLeverageForPool(MsgUpdateMaxLeverageForPool) + returns (MsgUpdateMaxLeverageForPoolResponse); + rpc UpdateEnabledPools(MsgUpdateEnabledPools) + returns (MsgUpdateEnabledPoolsResponse); } message MsgOpen { option (cosmos.msg.v1.signer) = "creator"; diff --git a/proto/elys/tier/query.proto b/proto/elys/tier/query.proto index 9317dfe2d..51e0609b8 100644 --- a/proto/elys/tier/query.proto +++ b/proto/elys/tier/query.proto @@ -138,72 +138,32 @@ message QueryCalculateDiscountResponse { message QueryLeverageLpTotalRequest { string user = 1; } message QueryLeverageLpTotalResponse { - string total_value = 1 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string total_borrows = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; + string total_value = 1; + string total_borrows = 2; } message QueryRewardsTotalRequest { string user = 1; } -message QueryRewardsTotalResponse { - string total = 1 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; -} +message QueryRewardsTotalResponse { string total = 1; } message QueryStakedPoolRequest { string user = 1; } -message QueryStakedPoolResponse { - string total = 1 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; -} +message QueryStakedPoolResponse { string total = 1; } message QueryPerpetualRequest { string user = 1; } message QueryPerpetualResponse { - string total_value = 1 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string total_borrows = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; + string total_value = 1; + string total_borrows = 2; } message QueryLiquidTotalRequest { string user = 1; } -message QueryLiquidTotalResponse { - string total = 1 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; -} +message QueryLiquidTotalResponse { string total = 1; } message QueryLockedOrderRequest { string user = 1; } -message QueryLockedOrderResponse { - string total = 1 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; -} +message QueryLockedOrderResponse { string total = 1; } message QueryGetAmmPriceRequest { string denom = 1; @@ -212,59 +172,25 @@ message QueryGetAmmPriceRequest { // We use a submessage to avoid the issue with the gRPC codec // https://github.com/cosmos/cosmos-sdk/issues/18430 -message GetAmmPriceResponseResult { - string total = 1 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; -} +message GetAmmPriceResponseResult { string total = 1; } message QueryGetAmmPriceResponse { GetAmmPriceResponseResult result = 1; } message QueryGetConsolidatedPriceRequest { string denom = 1; } message QueryGetConsolidatedPriceResponse { - string amm_price = 1 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string oracle_price = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string oracle_price_dec = 3 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; + string amm_price = 1; + string oracle_price = 2; + string oracle_price_dec = 3; } message QueryStakedRequest { string user = 1; } message QueryStakedResponse { - string commitments = 1 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string delegations = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string unbondings = 3 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string total_vested = 4 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; + string commitments = 1; + string delegations = 2; + string unbondings = 3; + string total_vested = 4; } message QueryGetUsersPoolDataRequest { diff --git a/types/dec34.go b/types/dec34.go index 223a88a0f..0627d6995 100644 --- a/types/dec34.go +++ b/types/dec34.go @@ -2,11 +2,20 @@ package types import ( "cosmossdk.io/math" + "github.com/cockroachdb/apd/v2" regenmath "github.com/regen-network/regen-ledger/types/v2/math" ) type Dec34 regenmath.Dec +func NewDec34FromString(s string) Dec34 { + y, err := regenmath.NewDecFromString(s) + if err != nil { + return ZeroDec34() + } + return Dec34(y) +} + func NewDec34FromLegacyDec(d math.LegacyDec) Dec34 { y, err := regenmath.NewDecFromString(d.String()) if err != nil { @@ -39,6 +48,20 @@ func FourDec34() Dec34 { return NewDec34FromInt64(4) } func FiveDec34() Dec34 { return NewDec34FromInt64(5) } func MinusOneDec34() Dec34 { return NewDec34FromInt64(-1) } +func MinDec34(a, b Dec34) Dec34 { + if a.LT(b) { + return a + } + return b +} + +func MaxDec34(a, b Dec34) Dec34 { + if a.GT(b) { + return a + } + return b +} + func (d Dec34) String() string { return regenmath.Dec(d).String() } @@ -51,28 +74,102 @@ func (d Dec34) Mul(other Dec34) Dec34 { return Dec34(y) } +func (d Dec34) MulInt(i math.Int) Dec34 { + return d.Mul(NewDec34FromInt(i)) +} + +func (d Dec34) MulInt64(i int64) Dec34 { + return d.Mul(NewDec34FromInt64(i)) +} + +func (d Dec34) MulLegacyDec(other math.LegacyDec) Dec34 { + return d.Mul(NewDec34FromLegacyDec(other)) +} + func (d Dec34) Quo(other Dec34) Dec34 { - res, err := regenmath.Dec(d).Quo(regenmath.Dec(other)) + y, err := regenmath.Dec(d).Quo(regenmath.Dec(other)) + if err != nil { + panic(err) + } + return Dec34(y) +} + +func (d Dec34) QuoInt(i math.Int) Dec34 { + y, err := regenmath.Dec(d).QuoInteger(regenmath.Dec(NewDec34FromInt(i))) if err != nil { panic(err) } - return Dec34(res) + return Dec34(y) +} + +func (d Dec34) QuoInt64(i int64) Dec34 { + return d.QuoInt(math.NewInt(i)) +} + +func (d Dec34) QuoLegacyDec(other math.LegacyDec) Dec34 { + return d.Quo(NewDec34FromLegacyDec(other)) } func (d Dec34) Add(other Dec34) Dec34 { - res, err := regenmath.Dec(d).Add(regenmath.Dec(other)) + y, err := regenmath.Dec(d).Add(regenmath.Dec(other)) if err != nil { panic(err) } - return Dec34(res) + return Dec34(y) +} + +func (d Dec34) AddInt(i math.Int) Dec34 { + return d.Add(NewDec34FromInt(i)) +} + +func (d Dec34) AddInt64(i int64) Dec34 { + return d.Add(NewDec34FromInt64(i)) +} + +func (d Dec34) AddLegacyDec(other math.LegacyDec) Dec34 { + return d.Add(NewDec34FromLegacyDec(other)) } func (d Dec34) Sub(other Dec34) Dec34 { - res, err := regenmath.Dec(d).Sub(regenmath.Dec(other)) + y, err := regenmath.Dec(d).Sub(regenmath.Dec(other)) + if err != nil { + panic(err) + } + return Dec34(y) +} + +func (d Dec34) SubInt(i math.Int) Dec34 { + return d.Sub(NewDec34FromInt(i)) +} + +func (d Dec34) SubInt64(i int64) Dec34 { + return d.Sub(NewDec34FromInt64(i)) +} + +func (d Dec34) SubLegacyDec(other math.LegacyDec) Dec34 { + return d.Sub(NewDec34FromLegacyDec(other)) +} + +func (d Dec34) Abs() Dec34 { + x, _, err := apd.NewFromString(d.String()) + if err != nil { + panic(err) + } + + x.Abs(x) + + return NewDec34FromString(x.String()) +} + +func (d Dec34) Neg() Dec34 { + x, _, err := apd.NewFromString(d.String()) if err != nil { panic(err) } - return Dec34(res) + + x.Neg(x) + + return NewDec34FromString(x.String()) } func (d Dec34) ToLegacyDec() math.LegacyDec { @@ -85,17 +182,33 @@ func (d Dec34) ToInt() math.Int { } func (d Dec34) ToInt64() int64 { - res, err := regenmath.Dec(d).Int64() + y, err := regenmath.Dec(d).Int64() if err != nil { panic(err) } - return res + return y } func (d Dec34) Equal(other Dec34) bool { return regenmath.Dec(d).Equal(regenmath.Dec(other)) } +func (d Dec34) GT(other Dec34) bool { + return regenmath.Dec(d).Cmp(regenmath.Dec(other)) == 1 +} + +func (d Dec34) LT(other Dec34) bool { + return regenmath.Dec(d).Cmp(regenmath.Dec(other)) == -1 +} + +func (d Dec34) GTE(other Dec34) bool { + return regenmath.Dec(d).Cmp(regenmath.Dec(other)) >= 0 +} + +func (d Dec34) LTE(other Dec34) bool { + return regenmath.Dec(d).Cmp(regenmath.Dec(other)) <= 0 +} + func (d Dec34) IsZero() bool { return regenmath.Dec(d).IsZero() } diff --git a/types/dec34_test.go b/types/dec34_test.go index e44c6ba03..1255f347b 100644 --- a/types/dec34_test.go +++ b/types/dec34_test.go @@ -37,18 +37,54 @@ func TestDec34(t *testing.T) { sum := one.Add(two) require.Equal(t, three, sum) + // Test AddInt + require.Equal(t, NewDec34FromInt64(3), one.AddInt(math.NewInt(2))) + + // Test AddInt64 + require.Equal(t, NewDec34FromInt64(3), one.AddInt64(2)) + + // Test AddLegacyDec + require.Equal(t, NewDec34FromLegacyDec(math.LegacyNewDec(3)), one.AddLegacyDec(math.LegacyNewDec(2))) + // Test Sub diff := three.Sub(two) require.Equal(t, one, diff) + // Test SubInt + require.Equal(t, NewDec34FromInt64(1), three.SubInt(math.NewInt(2))) + + // Test SubInt64 + require.Equal(t, NewDec34FromInt64(1), three.SubInt64(2)) + + // Test SubLegacyDec + require.Equal(t, NewDec34FromLegacyDec(math.LegacyNewDec(1)), three.SubLegacyDec(math.LegacyNewDec(2))) + // Test Mul prod := two.Mul(three) require.Equal(t, NewDec34FromInt64(6), prod) + // Test MulInt + require.Equal(t, NewDec34FromInt64(10000).String(), NewDec34WithPrec(1, 2).MulInt(math.NewInt(100)).String()) + + // Test MulInt64 + require.Equal(t, NewDec34FromInt64(10000).String(), NewDec34WithPrec(1, 2).MulInt64(100).String()) + + // Test MulLegacyDec + require.Equal(t, NewDec34FromString("10000.0000000000000000").String(), NewDec34WithPrec(1, 2).MulLegacyDec(math.LegacyNewDec(100)).String()) + // Test Quo quot := three.Quo(two) require.Equal(t, "1.5", quot.String()) + // Test QuoInt + require.Equal(t, NewDec34FromInt64(1).String(), NewDec34WithPrec(1, 2).QuoInt(math.NewInt(100)).String()) + + // Test QuoInt64 + require.Equal(t, NewDec34FromInt64(1).String(), NewDec34WithPrec(1, 2).QuoInt64(100).String()) + + // Test QuoLegacyDec + require.Equal(t, OneDec34().String(), NewDec34WithPrec(1, 2).QuoLegacyDec(math.LegacyNewDec(100)).String()) + // Test division by zero panic require.Panics(t, func() { three.Quo(ZeroDec34()) @@ -87,4 +123,53 @@ func TestDec34(t *testing.T) { // Test NewDec34WithPrec require.Equal(t, NewDec34WithPrec(1, 2).String(), NewDec34WithPrec(1, 2).String()) require.Equal(t, NewDec34FromInt64(100).String(), NewDec34WithPrec(1, 2).Mul(NewDec34WithPrec(1, 0)).String()) + + // Test NewDec34FromString + require.Equal(t, NewDec34FromString("1.234567890123456789").String(), NewDec34FromString("1.234567890123456789").String()) + require.Equal(t, + NewDec34FromString("1000000000000000000000000000000000000123456789.00000000").String(), + NewDec34FromString("1000000000000000000000000000000000000123456789.00000000").String(), + ) + + // Test Abs + require.Equal(t, NewDec34FromInt64(1).String(), NewDec34FromInt64(-1).Abs().String()) + require.Equal(t, NewDec34FromInt64(0).String(), ZeroDec34().Abs().String()) + require.Equal(t, + NewDec34FromString("1000000000000000000000000000000000000123456789.00000000").String(), + NewDec34FromString("-1000000000000000000000000000000000000123456789.00000000").Abs().String(), + ) + + // Test Neg + require.Equal(t, NewDec34FromInt64(-1).String(), NewDec34FromInt64(1).Neg().String()) + require.Equal(t, NewDec34FromInt64(0).String(), ZeroDec34().Neg().String()) + require.Equal(t, + NewDec34FromString("-1000000000000000000000000000000000000123456789.00000000").String(), + NewDec34FromString("1000000000000000000000000000000000000123456789.00000000").Neg().String(), + ) + + // Test GT + require.True(t, NewDec34FromInt64(2).GT(NewDec34FromInt64(1))) + require.False(t, NewDec34FromInt64(1).GT(NewDec34FromInt64(2))) + + // Test LT + require.True(t, NewDec34FromInt64(1).LT(NewDec34FromInt64(2))) + require.False(t, NewDec34FromInt64(2).LT(NewDec34FromInt64(1))) + + // Test GTE + require.True(t, NewDec34FromInt64(2).GTE(NewDec34FromInt64(1))) + require.False(t, NewDec34FromInt64(1).GTE(NewDec34FromInt64(2))) + require.True(t, NewDec34FromInt64(2).GTE(NewDec34FromInt64(2))) + + // Test LTE + require.True(t, NewDec34FromInt64(1).LTE(NewDec34FromInt64(2))) + require.False(t, NewDec34FromInt64(2).LTE(NewDec34FromInt64(1))) + require.True(t, NewDec34FromInt64(2).LTE(NewDec34FromInt64(2))) + + // Test MinDec34 + require.Equal(t, NewDec34FromInt64(1), MinDec34(NewDec34FromInt64(1), NewDec34FromInt64(2))) + require.Equal(t, NewDec34FromInt64(1), MinDec34(NewDec34FromInt64(2), NewDec34FromInt64(1))) + + // Test MaxDec34 + require.Equal(t, NewDec34FromInt64(2), MaxDec34(NewDec34FromInt64(1), NewDec34FromInt64(2))) + require.Equal(t, NewDec34FromInt64(2), MaxDec34(NewDec34FromInt64(2), NewDec34FromInt64(1))) } diff --git a/x/accountedpool/types/query.pb.go b/x/accountedpool/types/query.pb.go index 80e07df7e..8baceeffa 100644 --- a/x/accountedpool/types/query.pb.go +++ b/x/accountedpool/types/query.pb.go @@ -356,6 +356,7 @@ func _Query_AccountedPoolAll_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.accountedpool.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/accountedpool/types/tx.pb.go b/x/accountedpool/types/tx.pb.go index 154953843..41a8b321c 100644 --- a/x/accountedpool/types/tx.pb.go +++ b/x/accountedpool/types/tx.pb.go @@ -78,6 +78,7 @@ func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.accountedpool.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/amm/keeper/apply_join_pool_state_change.go b/x/amm/keeper/apply_join_pool_state_change.go index 9fa8e132f..261370814 100644 --- a/x/amm/keeper/apply_join_pool_state_change.go +++ b/x/amm/keeper/apply_join_pool_state_change.go @@ -3,6 +3,7 @@ package keeper import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/amm/types" ) @@ -12,7 +13,7 @@ func (k Keeper) ApplyJoinPoolStateChange( joiner sdk.AccAddress, numShares math.Int, joinCoins sdk.Coins, - weightBalanceBonus math.LegacyDec, + weightBalanceBonus elystypes.Dec34, ) error { if err := k.bankKeeper.SendCoins(ctx, joiner, sdk.MustAccAddressFromBech32(pool.GetAddress()), joinCoins); err != nil { return err diff --git a/x/amm/keeper/calc_in_amt_given_out.go b/x/amm/keeper/calc_in_amt_given_out.go index 4f5f0e423..bdd03e60e 100644 --- a/x/amm/keeper/calc_in_amt_given_out.go +++ b/x/amm/keeper/calc_in_amt_given_out.go @@ -4,6 +4,7 @@ import ( errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/amm/types" ) @@ -15,11 +16,11 @@ func (k Keeper) CalcInAmtGivenOut( oracle types.OracleKeeper, snapshot *types.Pool, tokensOut sdk.Coins, tokenInDenom string, swapFee sdkmath.LegacyDec) ( - tokenIn sdk.Coin, slippage sdkmath.LegacyDec, err error, + tokenIn sdk.Coin, slippage elystypes.Dec34, err error, ) { p, found := k.GetPool(ctx, poolId) if !found { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), errorsmod.Wrapf(types.ErrInvalidPool, "invalid pool") + return sdk.Coin{}, elystypes.ZeroDec34(), errorsmod.Wrapf(types.ErrInvalidPool, "invalid pool") } return p.CalcInAmtGivenOut(ctx, oracle, snapshot, tokensOut, tokenInDenom, swapFee, k.accountedPoolKeeper) diff --git a/x/amm/keeper/calc_in_route_spot_price.go b/x/amm/keeper/calc_in_route_spot_price.go index 6a70429aa..95b1ae1db 100644 --- a/x/amm/keeper/calc_in_route_spot_price.go +++ b/x/amm/keeper/calc_in_route_spot_price.go @@ -3,6 +3,7 @@ package keeper import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/amm/types" ) @@ -12,9 +13,9 @@ func (k Keeper) CalcInRouteSpotPrice(ctx sdk.Context, routes []*types.SwapAmountInRoute, discount sdkmath.LegacyDec, overrideSwapFee sdkmath.LegacyDec, -) (sdkmath.LegacyDec, sdkmath.LegacyDec, sdk.Coin, sdkmath.LegacyDec, sdkmath.LegacyDec, sdk.Coin, sdkmath.LegacyDec, sdkmath.LegacyDec, error) { +) (elystypes.Dec34, elystypes.Dec34, sdk.Coin, sdkmath.LegacyDec, sdkmath.LegacyDec, sdk.Coin, elystypes.Dec34, elystypes.Dec34, error) { if len(routes) == 0 { - return sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), types.ErrEmptyRoutes + return elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), types.ErrEmptyRoutes } // Start with the initial token input @@ -33,7 +34,7 @@ func (k Keeper) CalcInRouteSpotPrice(ctx sdk.Context, route := types.SwapAmountInRoutes(routesNoPtr) if err := route.Validate(); err != nil { - return sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err + return elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), err } // In this loop, we check if: @@ -51,7 +52,7 @@ func (k Keeper) CalcInRouteSpotPrice(ctx sdk.Context, var err error routeSwapFee, sumOfSwapFees, err = k.getElysRoutedMultihopTotalSwapFee(ctx, route) if err != nil { - return sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err + return elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), err } } @@ -61,8 +62,8 @@ func (k Keeper) CalcInRouteSpotPrice(ctx sdk.Context, // Track the total available liquidity in the pool for final token out denom var availableLiquidity sdk.Coin - weightBalance := sdkmath.LegacyZeroDec() - slippage := sdkmath.LegacyZeroDec() + weightBalance := elystypes.ZeroDec34() + slippage := elystypes.ZeroDec34() for _, route := range routes { poolId := route.PoolId @@ -70,7 +71,7 @@ func (k Keeper) CalcInRouteSpotPrice(ctx sdk.Context, pool, found := k.GetPool(ctx, poolId) if !found { - return sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), types.ErrPoolNotFound + return elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), types.ErrPoolNotFound } // Get Pool swap fee @@ -95,14 +96,14 @@ func (k Keeper) CalcInRouteSpotPrice(ctx sdk.Context, cacheCtx, _ := ctx.CacheContext() tokenOut, swapSlippage, _, weightBalanceBonus, _, swapFee, err := k.SwapOutAmtGivenIn(cacheCtx, pool.PoolId, k.oracleKeeper, &snapshot, tokensIn, tokenOutDenom, swapFee, sdkmath.LegacyOneDec()) if err != nil { - return sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err + return elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), err } // Calculate the total discounted swap fee totalDiscountedSwapFee = totalDiscountedSwapFee.Add(swapFee) if tokenOut.IsZero() { - return sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), types.ErrAmountTooLow + return elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), types.ErrAmountTooLow } // Use the current swap result as the input for the next iteration @@ -111,7 +112,7 @@ func (k Keeper) CalcInRouteSpotPrice(ctx sdk.Context, // Get the available liquidity for the final token out denom _, poolAsset, err := pool.GetPoolAssetAndIndex(tokenOutDenom) if err != nil { - return sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err + return elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), err } // Use accounted pool balance accAmount := k.accountedPoolKeeper.GetAccountedBalance(ctx, pool.PoolId, poolAsset.Token.Denom) @@ -125,14 +126,14 @@ func (k Keeper) CalcInRouteSpotPrice(ctx sdk.Context, // Ensure tokenIn.Amount is not zero to avoid division by zero if tokenIn.IsZero() { - return sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), types.ErrAmountTooLow + return elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), types.ErrAmountTooLow } // Calculate the spot price given the initial token in and the final token out - impactedPrice := sdkmath.LegacyNewDecFromInt(tokensIn[0].Amount).Quo(sdkmath.LegacyNewDecFromInt(tokenIn.Amount)) + impactedPrice := elystypes.NewDec34FromInt(tokensIn[0].Amount).QuoInt(tokenIn.Amount) // Calculate spot price with GetTokenARate - spotPrice := sdkmath.LegacyOneDec() + spotPrice := elystypes.OneDec34() tokenInDenom := tokenIn.Denom for _, route := range routes { poolId := route.PoolId @@ -140,14 +141,14 @@ func (k Keeper) CalcInRouteSpotPrice(ctx sdk.Context, pool, found := k.GetPool(ctx, poolId) if !found { - return sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), types.ErrPoolNotFound + return elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), types.ErrPoolNotFound } // Estimate swap snapshot := k.GetAccountedPoolSnapshotOrSet(ctx, pool) rate, err := pool.GetTokenARate(ctx, k.oracleKeeper, &snapshot, tokenInDenom, tokenOutDenom, k.accountedPoolKeeper) if err != nil { - return sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err + return elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), err } // set new tokenIn denom for multihop @@ -156,7 +157,7 @@ func (k Keeper) CalcInRouteSpotPrice(ctx sdk.Context, } if !spotPrice.IsPositive() { - return sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), types.ErrSpotPriceIsZero + return elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), types.ErrSpotPriceIsZero } // Construct the token out coin diff --git a/x/amm/keeper/calc_out_amt_given_in.go b/x/amm/keeper/calc_out_amt_given_in.go index 2feaa53fc..631dfe7c6 100644 --- a/x/amm/keeper/calc_out_amt_given_in.go +++ b/x/amm/keeper/calc_out_amt_given_in.go @@ -4,6 +4,7 @@ import ( errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/amm/types" ) @@ -17,10 +18,10 @@ func (k Keeper) CalcOutAmtGivenIn( tokensIn sdk.Coins, tokenOutDenom string, swapFee sdkmath.LegacyDec, -) (sdk.Coin, sdkmath.LegacyDec, error) { +) (sdk.Coin, elystypes.Dec34, error) { p, found := k.GetPool(ctx, poolId) if !found { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), errorsmod.Wrapf(types.ErrInvalidPool, "invalid pool") + return sdk.Coin{}, elystypes.ZeroDec34(), errorsmod.Wrapf(types.ErrInvalidPool, "invalid pool") } return p.CalcOutAmtGivenIn(ctx, oracle, snapshot, tokensIn, tokenOutDenom, swapFee, k.accountedPoolKeeper) diff --git a/x/amm/keeper/calc_out_route_spot_price.go b/x/amm/keeper/calc_out_route_spot_price.go index 18469d12e..c6885bb08 100644 --- a/x/amm/keeper/calc_out_route_spot_price.go +++ b/x/amm/keeper/calc_out_route_spot_price.go @@ -3,13 +3,14 @@ package keeper import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/amm/types" ) // CalcOutRouteSpotPrice calculates the spot price of the given token and out route -func (k Keeper) CalcOutRouteSpotPrice(ctx sdk.Context, tokenOut sdk.Coin, routes []*types.SwapAmountOutRoute, discount sdkmath.LegacyDec, overrideSwapFee sdkmath.LegacyDec) (sdkmath.LegacyDec, sdkmath.LegacyDec, sdk.Coin, sdkmath.LegacyDec, sdkmath.LegacyDec, sdk.Coin, sdkmath.LegacyDec, sdkmath.LegacyDec, error) { +func (k Keeper) CalcOutRouteSpotPrice(ctx sdk.Context, tokenOut sdk.Coin, routes []*types.SwapAmountOutRoute, discount sdkmath.LegacyDec, overrideSwapFee sdkmath.LegacyDec) (elystypes.Dec34, elystypes.Dec34, sdk.Coin, sdkmath.LegacyDec, sdkmath.LegacyDec, sdk.Coin, elystypes.Dec34, elystypes.Dec34, error) { if len(routes) == 0 { - return sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), types.ErrEmptyRoutes + return elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), types.ErrEmptyRoutes } // Start with the initial token input @@ -24,8 +25,8 @@ func (k Keeper) CalcOutRouteSpotPrice(ctx sdk.Context, tokenOut sdk.Coin, routes // Track the total available liquidity in the pool for final token out denom var availableLiquidity sdk.Coin - weightBonus := sdkmath.LegacyZeroDec() - slippage := sdkmath.LegacyZeroDec() + weightBonus := elystypes.ZeroDec34() + slippage := elystypes.ZeroDec34() for _, route := range routes { poolId := route.PoolId @@ -33,7 +34,7 @@ func (k Keeper) CalcOutRouteSpotPrice(ctx sdk.Context, tokenOut sdk.Coin, routes pool, found := k.GetPool(ctx, poolId) if !found { - return sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), types.ErrPoolNotFound + return elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), types.ErrPoolNotFound } // Get Pool swap fee @@ -52,14 +53,14 @@ func (k Keeper) CalcOutRouteSpotPrice(ctx sdk.Context, tokenOut sdk.Coin, routes cacheCtx, _ := ctx.CacheContext() swapResult, swapSlippage, _, weightBalanceBonus, _, swapFee, err := k.SwapInAmtGivenOut(cacheCtx, pool.PoolId, k.oracleKeeper, &snapshot, tokensOut, tokenInDenom, swapFee, sdkmath.LegacyOneDec()) if err != nil { - return sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err + return elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), err } // Calculate the total discounted swap fee totalDiscountedSwapFee = totalDiscountedSwapFee.Add(swapFee) if swapResult.IsZero() { - return sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), types.ErrAmountTooLow + return elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), types.ErrAmountTooLow } // Use the current swap result as the input for the next iteration @@ -68,7 +69,7 @@ func (k Keeper) CalcOutRouteSpotPrice(ctx sdk.Context, tokenOut sdk.Coin, routes // Get the available liquidity for the final token in denom _, poolAsset, err := pool.GetPoolAssetAndIndex(tokenInDenom) if err != nil { - return sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err + return elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), err } availableLiquidity = poolAsset.Token weightBonus = weightBonus.Add(weightBalanceBonus) @@ -77,14 +78,14 @@ func (k Keeper) CalcOutRouteSpotPrice(ctx sdk.Context, tokenOut sdk.Coin, routes // Ensure tokenIn.Amount is not zero to avoid division by zero if tokenOut.IsZero() { - return sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), types.ErrAmountTooLow + return elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), types.ErrAmountTooLow } // Calculate the spot price given the initial token in and the final token in - impactedPrice := sdkmath.LegacyNewDecFromInt(tokensOut[0].Amount).Quo(sdkmath.LegacyNewDecFromInt(tokenOut.Amount)) + impactedPrice := elystypes.NewDec34FromInt(tokensOut[0].Amount).QuoInt(tokenOut.Amount) // Calculate spot price with GetTokenARate - spotPrice := sdkmath.LegacyOneDec() + spotPrice := elystypes.OneDec34() tokenOutDenom := tokenOut.Denom for _, route := range routes { poolId := route.PoolId @@ -92,14 +93,14 @@ func (k Keeper) CalcOutRouteSpotPrice(ctx sdk.Context, tokenOut sdk.Coin, routes pool, found := k.GetPool(ctx, poolId) if !found { - return sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), types.ErrPoolNotFound + return elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), types.ErrPoolNotFound } // Estimate swap snapshot := k.GetAccountedPoolSnapshotOrSet(ctx, pool) rate, err := pool.GetTokenARate(ctx, k.oracleKeeper, &snapshot, tokenInDenom, tokenOutDenom, k.accountedPoolKeeper) if err != nil { - return sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err + return elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), err } // set new tokenIn denom for multihop diff --git a/x/amm/keeper/calc_swap_estimation_by_denom.go b/x/amm/keeper/calc_swap_estimation_by_denom.go index f4eb4a537..431f89ff6 100644 --- a/x/amm/keeper/calc_swap_estimation_by_denom.go +++ b/x/amm/keeper/calc_swap_estimation_by_denom.go @@ -3,6 +3,7 @@ package keeper import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/amm/types" ) @@ -20,17 +21,17 @@ func (k Keeper) CalcSwapEstimationByDenom( inRoute []*types.SwapAmountInRoute, outRoute []*types.SwapAmountOutRoute, outAmount sdk.Coin, - spotPrice sdkmath.LegacyDec, + spotPrice elystypes.Dec34, swapFeeOut sdkmath.LegacyDec, discountOut sdkmath.LegacyDec, availableLiquidity sdk.Coin, - slippage sdkmath.LegacyDec, - weightBonus sdkmath.LegacyDec, - priceImpact sdkmath.LegacyDec, + slippage elystypes.Dec34, + weightBonus elystypes.Dec34, + priceImpact elystypes.Dec34, err error, ) { var ( - impactedPrice sdkmath.LegacyDec + impactedPrice elystypes.Dec34 ) addr, err := sdk.AccAddressFromBech32(address) @@ -42,7 +43,7 @@ func (k Keeper) CalcSwapEstimationByDenom( // Initialize return variables inRoute, outRoute = nil, nil outAmount, availableLiquidity = sdk.Coin{}, sdk.Coin{} - spotPrice, swapFeeOut, discountOut, weightBonus, priceImpact = sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), tier.Discount, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec() + spotPrice, swapFeeOut, discountOut, weightBonus, priceImpact = elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), tier.Discount, elystypes.ZeroDec34(), elystypes.ZeroDec34() // Determine the correct route based on the amount's denom if amount.Denom == denomIn { diff --git a/x/amm/keeper/estimate_price.go b/x/amm/keeper/estimate_price.go index eccc6ce14..5eef8e294 100644 --- a/x/amm/keeper/estimate_price.go +++ b/x/amm/keeper/estimate_price.go @@ -1,7 +1,6 @@ package keeper import ( - "cosmossdk.io/math" sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" elystypes "github.com/elys-network/elys/types" @@ -10,11 +9,11 @@ import ( ) // Estimate the price : eg, 1 Eden -> x usdc -func (k Keeper) EstimatePrice(ctx sdk.Context, tokenInDenom, baseCurrency string) math.LegacyDec { +func (k Keeper) EstimatePrice(ctx sdk.Context, tokenInDenom, baseCurrency string) elystypes.Dec34 { // Find a pool that can convert tokenIn to usdc pool, found := k.GetBestPoolWithDenoms(ctx, []string{tokenInDenom, baseCurrency}, false) if !found { - return math.LegacyZeroDec() + return elystypes.ZeroDec34() } // Executes the swap in the pool and stores the output. Updates pool assets but @@ -23,7 +22,7 @@ func (k Keeper) EstimatePrice(ctx sdk.Context, tokenInDenom, baseCurrency string rate, err := pool.GetTokenARate(ctx, k.oracleKeeper, &snapshot, tokenInDenom, baseCurrency, k.accountedPoolKeeper) if err != nil { - return math.LegacyZeroDec() + return elystypes.ZeroDec34() } return rate @@ -32,9 +31,8 @@ func (k Keeper) EstimatePrice(ctx sdk.Context, tokenInDenom, baseCurrency string func (k Keeper) GetEdenDenomPrice(ctx sdk.Context, baseCurrency string) elystypes.Dec34 { // Calc ueden / uusdc rate edenUsdcRate := k.EstimatePrice(ctx, ptypes.Elys, baseCurrency) - edenUsdcRateDec34 := elystypes.NewDec34FromLegacyDec(edenUsdcRate) - if edenUsdcRateDec34.IsZero() { - edenUsdcRateDec34 = elystypes.OneDec34() + if edenUsdcRate.IsZero() { + edenUsdcRate = elystypes.OneDec34() } usdcDenomPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) if usdcDenomPrice.IsZero() { @@ -45,7 +43,7 @@ func (k Keeper) GetEdenDenomPrice(ctx sdk.Context, baseCurrency string) elystype } usdcDenomPrice = elystypes.NewDec34WithPrec(1, usdcDecimal) } - return edenUsdcRateDec34.Mul(usdcDenomPrice) + return edenUsdcRate.Mul(usdcDenomPrice) } func (k Keeper) GetTokenPrice(ctx sdk.Context, tokenInDenom, baseCurrency string) elystypes.Dec34 { @@ -56,7 +54,6 @@ func (k Keeper) GetTokenPrice(ctx sdk.Context, tokenInDenom, baseCurrency string // Calc tokenIn / uusdc rate tokenUsdcRate := k.EstimatePrice(ctx, tokenInDenom, baseCurrency) - tokenUsdcRateDec34 := elystypes.NewDec34FromLegacyDec(tokenUsdcRate) usdcDenomPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) if usdcDenomPrice.IsZero() { usdcDecimal := int32(6) @@ -66,7 +63,7 @@ func (k Keeper) GetTokenPrice(ctx sdk.Context, tokenInDenom, baseCurrency string } usdcDenomPrice = elystypes.NewDec34WithPrec(1, usdcDecimal) } - return tokenUsdcRateDec34.Mul(usdcDenomPrice) + return tokenUsdcRate.Mul(usdcDenomPrice) } func (k Keeper) CalculateUSDValue(ctx sdk.Context, denom string, amount sdkmath.Int) elystypes.Dec34 { @@ -78,7 +75,7 @@ func (k Keeper) CalculateUSDValue(ctx sdk.Context, denom string, amount sdkmath. if tokenPrice.IsZero() { tokenPrice = k.CalcAmmPrice(ctx, asset.Denom, asset.Decimals) } - return elystypes.NewDec34FromInt(amount).Mul(tokenPrice) + return tokenPrice.MulInt(amount) } func (k Keeper) CalcAmmPrice(ctx sdk.Context, denom string, decimal uint64) elystypes.Dec34 { @@ -99,8 +96,7 @@ func (k Keeper) CalcAmmPrice(ctx sdk.Context, denom string, decimal uint64) elys if err != nil { return elystypes.ZeroDec34() } - spotPriceDec34 := elystypes.NewDec34FromLegacyDec(spotPrice) - return spotPriceDec34.Mul(usdcPrice) + return spotPrice.Mul(usdcPrice) } func Pow10AsLegacyDec(decimal uint64) (value sdkmath.LegacyDec) { diff --git a/x/amm/keeper/fee.go b/x/amm/keeper/fee.go index 6fba7238f..278158f1c 100644 --- a/x/amm/keeper/fee.go +++ b/x/amm/keeper/fee.go @@ -4,13 +4,14 @@ import ( errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/amm/types" ) -func PortionCoins(coins sdk.Coins, portion sdkmath.LegacyDec) sdk.Coins { +func PortionCoins(coins sdk.Coins, portion elystypes.Dec34) sdk.Coins { portionCoins := sdk.Coins{} for _, coin := range coins { - portionAmount := coin.Amount.ToLegacyDec().Mul(portion).RoundInt() + portionAmount := portion.MulInt(coin.Amount).ToInt() portionCoins = portionCoins.Add(sdk.NewCoin( coin.Denom, portionAmount, )) @@ -23,7 +24,7 @@ func (k Keeper) OnCollectFee(ctx sdk.Context, pool types.Pool, fee sdk.Coins) er revenueAmount := fee if pool.PoolParams.UseOracle { params := k.GetParams(ctx) - weightRecoveryFee := PortionCoins(fee, params.WeightRecoveryFeePortion) + weightRecoveryFee := PortionCoins(fee, elystypes.NewDec34FromLegacyDec(params.WeightRecoveryFeePortion)) revenueAmount = fee.Sub(weightRecoveryFee...) } @@ -66,7 +67,7 @@ func (k Keeper) SwapFeesToRevenueToken(ctx sdk.Context, pool types.Pool, fee sdk // Settles balances between the tx sender and the pool to match the swap that was executed earlier. // Also emits a swap event and updates related liquidity metrics. - err = k.UpdatePoolForSwap(ctx, pool, poolRevenueAddress, poolRevenueAddress, tokenIn, tokenOutCoin, sdkmath.LegacyZeroDec(), sdkmath.ZeroInt(), oracleOutAmount.TruncateInt(), sdkmath.LegacyZeroDec(), false) + err = k.UpdatePoolForSwap(ctx, pool, poolRevenueAddress, poolRevenueAddress, tokenIn, tokenOutCoin, sdkmath.LegacyZeroDec(), sdkmath.ZeroInt(), oracleOutAmount.ToInt(), elystypes.ZeroDec34(), false) if err != nil { return err } diff --git a/x/amm/keeper/keeper_create_pool.go b/x/amm/keeper/keeper_create_pool.go index 1c027c4e5..4e55614c2 100644 --- a/x/amm/keeper/keeper_create_pool.go +++ b/x/amm/keeper/keeper_create_pool.go @@ -91,7 +91,7 @@ func (k Keeper) InitializePool(ctx sdk.Context, pool *types.Pool, sender sdk.Acc } if tvl.IsPositive() { - pool.TotalShares = sdk.NewCoin(pool.TotalShares.Denom, tvl.Mul(types.OneShare.ToLegacyDec()).RoundInt()) + pool.TotalShares = sdk.NewCoin(pool.TotalShares.Denom, tvl.MulInt(types.OneShare).ToInt()) } // Mint the initial pool shares token to the sender diff --git a/x/amm/keeper/keeper_swap_exact_amount_in.go b/x/amm/keeper/keeper_swap_exact_amount_in.go index ef217d367..b17c0001b 100644 --- a/x/amm/keeper/keeper_swap_exact_amount_in.go +++ b/x/amm/keeper/keeper_swap_exact_amount_in.go @@ -59,16 +59,16 @@ func (k Keeper) InternalSwapExactAmountIn( // Settles balances between the tx sender and the pool to match the swap that was executed earlier. // Also emits a swap event and updates related liquidity metrics. - err = k.UpdatePoolForSwap(ctx, pool, sender, recipient, tokenIn, tokenOutCoin, swapFee, math.ZeroInt(), oracleOutAmount.TruncateInt(), weightBalanceBonus, false) + err = k.UpdatePoolForSwap(ctx, pool, sender, recipient, tokenIn, tokenOutCoin, swapFee, math.ZeroInt(), oracleOutAmount.ToInt(), weightBalanceBonus, false) if err != nil { return math.Int{}, err } // track slippage - k.TrackSlippage(ctx, pool.PoolId, sdk.NewCoin(tokenOutCoin.Denom, slippageAmount.RoundInt())) + k.TrackSlippage(ctx, pool.PoolId, sdk.NewCoin(tokenOutCoin.Denom, slippageAmount.ToInt())) if pool.PoolParams.UseOracle { - k.TrackWeightBreakingSlippage(ctx, pool.PoolId, sdk.NewCoin(tokenOutCoin.Denom, slippageAmount.RoundInt())) + k.TrackWeightBreakingSlippage(ctx, pool.PoolId, sdk.NewCoin(tokenOutCoin.Denom, slippageAmount.ToInt())) } return tokenOutAmount, nil diff --git a/x/amm/keeper/keeper_swap_exact_amount_out.go b/x/amm/keeper/keeper_swap_exact_amount_out.go index ecc2daac5..b9b22eff8 100644 --- a/x/amm/keeper/keeper_swap_exact_amount_out.go +++ b/x/amm/keeper/keeper_swap_exact_amount_out.go @@ -56,13 +56,13 @@ func (k Keeper) InternalSwapExactAmountOut( return math.Int{}, errorsmod.Wrapf(types.ErrLimitMaxAmount, "swap requires %s, which is greater than the amount %s", tokenIn, tokenInMaxAmount) } - err = k.UpdatePoolForSwap(ctx, pool, sender, recipient, tokenIn, tokenOut, swapFee, oracleInAmount.TruncateInt(), math.ZeroInt(), weightBalanceBonus, true) + err = k.UpdatePoolForSwap(ctx, pool, sender, recipient, tokenIn, tokenOut, swapFee, oracleInAmount.ToInt(), math.ZeroInt(), weightBalanceBonus, true) if err != nil { return math.Int{}, err } // track slippage - k.TrackSlippage(ctx, pool.PoolId, sdk.NewCoin(tokenIn.Denom, slippageAmount.RoundInt())) + k.TrackSlippage(ctx, pool.PoolId, sdk.NewCoin(tokenIn.Denom, slippageAmount.ToInt())) return tokenInAmount, nil } diff --git a/x/amm/keeper/msg_server_swap_by_denom.go b/x/amm/keeper/msg_server_swap_by_denom.go index aef5e8c20..00ef8139e 100644 --- a/x/amm/keeper/msg_server_swap_by_denom.go +++ b/x/amm/keeper/msg_server_swap_by_denom.go @@ -66,7 +66,7 @@ func (k Keeper) SwapByDenom(ctx sdk.Context, msg *types.MsgSwapByDenom) (*types. Amount: sdk.NewCoin(msg.DenomOut, res.TokenOutAmount), InRoute: inRoute, OutRoute: nil, - SpotPrice: spotPrice, + SpotPrice: spotPrice.String(), SwapFee: res.SwapFee, Discount: res.Discount, Recipient: res.Recipient, @@ -103,7 +103,7 @@ func (k Keeper) SwapByDenom(ctx sdk.Context, msg *types.MsgSwapByDenom) (*types. Amount: sdk.NewCoin(msg.DenomIn, res.TokenInAmount), InRoute: nil, OutRoute: outRoute, - SpotPrice: spotPrice, + SpotPrice: spotPrice.String(), SwapFee: res.SwapFee, Discount: res.Discount, Recipient: res.Recipient, diff --git a/x/amm/keeper/pool.go b/x/amm/keeper/pool.go index 6e44d140d..8b52b21bc 100644 --- a/x/amm/keeper/pool.go +++ b/x/amm/keeper/pool.go @@ -6,6 +6,7 @@ import ( storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/amm/types" ) @@ -112,7 +113,7 @@ func (k Keeper) GetBestPoolWithDenoms(ctx sdk.Context, denoms []string, usesOrac // Get all pools pools := k.GetAllPool(ctx) - maxTvl := sdkmath.LegacyNewDec(-1) + maxTvl := elystypes.MinusOneDec34() bestPool := types.Pool{} for _, p := range pools { // If usesOracle is false, function filters in all pools. @@ -145,7 +146,7 @@ func (k Keeper) GetBestPoolWithDenoms(ctx sdk.Context, denoms []string, usesOrac poolTvl, err := p.TVL(ctx, k.oracleKeeper, k.accountedPoolKeeper) if err != nil { - poolTvl = sdkmath.LegacyZeroDec() + poolTvl = elystypes.ZeroDec34() } // If all denoms are found in this pool, return the pool id diff --git a/x/amm/keeper/query_exit_pool_estimation.go b/x/amm/keeper/query_exit_pool_estimation.go index c9d732dcc..6715b34e1 100644 --- a/x/amm/keeper/query_exit_pool_estimation.go +++ b/x/amm/keeper/query_exit_pool_estimation.go @@ -6,6 +6,7 @@ import ( errorsmod "cosmossdk.io/errors" "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/amm/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -33,23 +34,23 @@ func (k Keeper) ExitPoolEst( poolId uint64, shareInAmount math.Int, tokenOutDenom string, -) (exitCoins sdk.Coins, weightBalanceBonus math.LegacyDec, err error) { +) (exitCoins sdk.Coins, weightBalanceBonus elystypes.Dec34, err error) { pool, poolExists := k.GetPool(ctx, poolId) if !poolExists { - return sdk.Coins{}, math.LegacyZeroDec(), types.ErrInvalidPoolId + return sdk.Coins{}, elystypes.ZeroDec34(), types.ErrInvalidPoolId } totalSharesAmount := pool.GetTotalShares() if shareInAmount.GTE(totalSharesAmount.Amount) { - return sdk.Coins{}, math.LegacyZeroDec(), errorsmod.Wrapf(types.ErrInvalidMathApprox, "Trying to exit >= the number of shares contained in the pool.") + return sdk.Coins{}, elystypes.ZeroDec34(), errorsmod.Wrapf(types.ErrInvalidMathApprox, "Trying to exit >= the number of shares contained in the pool.") } else if shareInAmount.LTE(math.ZeroInt()) { - return sdk.Coins{}, math.LegacyZeroDec(), errorsmod.Wrapf(types.ErrInvalidMathApprox, "Trying to exit a negative amount of shares") + return sdk.Coins{}, elystypes.ZeroDec34(), errorsmod.Wrapf(types.ErrInvalidMathApprox, "Trying to exit a negative amount of shares") } params := k.GetParams(ctx) exitCoins, weightBalanceBonus, err = pool.CalcExitPoolCoinsFromShares(ctx, k.oracleKeeper, k.accountedPoolKeeper, shareInAmount, tokenOutDenom, params) if err != nil { - return sdk.Coins{}, math.LegacyZeroDec(), err + return sdk.Coins{}, elystypes.ZeroDec34(), err } return exitCoins, weightBalanceBonus, nil diff --git a/x/amm/keeper/query_join_pool_estimation.go b/x/amm/keeper/query_join_pool_estimation.go index 196ee5e8e..2d625b34b 100644 --- a/x/amm/keeper/query_join_pool_estimation.go +++ b/x/amm/keeper/query_join_pool_estimation.go @@ -5,6 +5,7 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/amm/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -25,8 +26,8 @@ func (k Keeper) JoinPoolEstimation(goCtx context.Context, req *types.QueryJoinPo return &types.QueryJoinPoolEstimationResponse{ ShareAmountOut: sdk.NewCoin(shareDenom, sharesOut), AmountsIn: tokensIn, - Slippage: slippage, - WeightBalanceRatio: weightBalanceBonus, + Slippage: slippage.String(), + WeightBalanceRatio: weightBalanceBonus.String(), }, nil } @@ -34,11 +35,11 @@ func (k Keeper) JoinPoolEst( ctx sdk.Context, poolId uint64, tokenInMaxs sdk.Coins, -) (tokensIn sdk.Coins, sharesOut math.Int, slippage math.LegacyDec, weightBalanceBonus math.LegacyDec, err error) { +) (tokensIn sdk.Coins, sharesOut math.Int, slippage elystypes.Dec34, weightBalanceBonus elystypes.Dec34, err error) { // all pools handled within this method are pointer references, `JoinPool` directly updates the pools pool, poolExists := k.GetPool(ctx, poolId) if !poolExists { - return nil, math.ZeroInt(), math.LegacyZeroDec(), math.LegacyZeroDec(), types.ErrInvalidPoolId + return nil, math.ZeroInt(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), types.ErrInvalidPoolId } if !pool.PoolParams.UseOracle { @@ -46,7 +47,7 @@ func (k Keeper) JoinPoolEst( if len(tokensIn) != 1 { numShares, tokensIn, err := pool.CalcJoinPoolNoSwapShares(tokenInMaxs) if err != nil { - return tokensIn, numShares, math.LegacyZeroDec(), math.LegacyZeroDec(), err + return tokensIn, numShares, elystypes.ZeroDec34(), elystypes.ZeroDec34(), err } } @@ -55,7 +56,7 @@ func (k Keeper) JoinPoolEst( cacheCtx, _ := ctx.CacheContext() tokensJoined, sharesOut, slippage, weightBalanceBonus, err := pool.JoinPool(cacheCtx, &snapshot, k.oracleKeeper, k.accountedPoolKeeper, tokensIn, params) if err != nil { - return nil, math.ZeroInt(), math.LegacyZeroDec(), math.LegacyZeroDec(), err + return nil, math.ZeroInt(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), err } return tokensJoined, sharesOut, slippage, weightBalanceBonus, err @@ -67,7 +68,7 @@ func (k Keeper) JoinPoolEst( cacheCtx, _ := ctx.CacheContext() tokensJoined, sharesOut, slippage, weightBalanceBonus, err := pool.JoinPool(cacheCtx, &snapshot, k.oracleKeeper, k.accountedPoolKeeper, tokenInMaxs, params) if err != nil { - return nil, math.ZeroInt(), math.LegacyZeroDec(), math.LegacyZeroDec(), err + return nil, math.ZeroInt(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), err } return tokensJoined, sharesOut, slippage, weightBalanceBonus, err diff --git a/x/amm/keeper/query_pool.go b/x/amm/keeper/query_pool.go index cb7db08d3..5bf857be4 100644 --- a/x/amm/keeper/query_pool.go +++ b/x/amm/keeper/query_pool.go @@ -5,10 +5,10 @@ import ( "github.com/cosmos/cosmos-sdk/runtime" - "cosmossdk.io/math" "cosmossdk.io/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/amm/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -18,14 +18,14 @@ func (k Keeper) PoolExtraInfo(ctx sdk.Context, pool types.Pool) types.PoolExtraI tvl, _ := pool.TVL(ctx, k.oracleKeeper, k.accountedPoolKeeper) lpTokenPrice, _ := pool.LpTokenPrice(ctx, k.oracleKeeper, k.accountedPoolKeeper) avg := k.GetWeightBreakingSlippageAvg(ctx, pool.PoolId) - apr := math.LegacyZeroDec() + apr := elystypes.ZeroDec34() if tvl.IsPositive() { - apr = avg.Mul(math.LegacyNewDec(365)).Quo(tvl) + apr = avg.MulInt64(365).Quo(tvl) } return types.PoolExtraInfo{ - Tvl: tvl, - LpTokenPrice: lpTokenPrice, - LpSavedApr: apr, + Tvl: tvl.ToLegacyDec(), + LpTokenPrice: lpTokenPrice.ToLegacyDec(), + LpSavedApr: apr.ToLegacyDec(), } } diff --git a/x/amm/keeper/query_swap_estimation.go b/x/amm/keeper/query_swap_estimation.go index 5b3fc8ecc..1ab7bcda7 100644 --- a/x/amm/keeper/query_swap_estimation.go +++ b/x/amm/keeper/query_swap_estimation.go @@ -2,6 +2,7 @@ package keeper import ( "context" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" @@ -23,12 +24,12 @@ func (k Keeper) SwapEstimation(goCtx context.Context, req *types.QuerySwapEstima } return &types.QuerySwapEstimationResponse{ - SpotPrice: spotPrice, + SpotPrice: spotPrice.String(), TokenOut: tokenOut, SwapFee: swapFee, Discount: discount, AvailableLiquidity: availableLiquidity, - Slippage: slippage, - WeightBalanceRatio: weightBonus, + Slippage: slippage.String(), + WeightBalanceRatio: weightBonus.String(), }, nil } diff --git a/x/amm/keeper/query_swap_estimation_by_denom.go b/x/amm/keeper/query_swap_estimation_by_denom.go index 816a1041b..5ef6d9ff1 100644 --- a/x/amm/keeper/query_swap_estimation_by_denom.go +++ b/x/amm/keeper/query_swap_estimation_by_denom.go @@ -42,12 +42,12 @@ func (k Keeper) SwapEstimationByDenom(goCtx context.Context, req *types.QuerySwa InRoute: inRoute, OutRoute: outRoute, Amount: amount, - SpotPrice: spotPrice, + SpotPrice: spotPrice.String(), SwapFee: swapFee, Discount: discount, AvailableLiquidity: availableLiquidity, - Slippage: slippage, - WeightBalanceRatio: weightBonus, - PriceImpact: priceImpact, + Slippage: slippage.String(), + WeightBalanceRatio: weightBonus.String(), + PriceImpact: priceImpact.String(), }, nil } diff --git a/x/amm/keeper/swap_in_amt_given_out.go b/x/amm/keeper/swap_in_amt_given_out.go index 19a386aa0..e5bb2d36d 100644 --- a/x/amm/keeper/swap_in_amt_given_out.go +++ b/x/amm/keeper/swap_in_amt_given_out.go @@ -6,6 +6,7 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/amm/types" ) @@ -14,11 +15,11 @@ import ( func (k Keeper) SwapInAmtGivenOut( ctx sdk.Context, poolId uint64, oracleKeeper types.OracleKeeper, snapshot *types.Pool, tokensOut sdk.Coins, tokenInDenom string, swapFee math.LegacyDec, weightBreakingFeePerpetualFactor math.LegacyDec) ( - tokenIn sdk.Coin, slippage, slippageAmount math.LegacyDec, weightBalanceBonus math.LegacyDec, oracleInAmount math.LegacyDec, swapFeeFinal math.LegacyDec, err error, + tokenIn sdk.Coin, slippage, slippageAmount, weightBalanceBonus, oracleInAmount elystypes.Dec34, swapFeeFinal math.LegacyDec, err error, ) { ammPool, found := k.GetPool(ctx, poolId) if !found { - return sdk.Coin{}, math.LegacyZeroDec(), math.LegacyZeroDec(), math.LegacyZeroDec(), math.LegacyZeroDec(), math.LegacyZeroDec(), fmt.Errorf("invalid pool: %d", poolId) + return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), math.LegacyZeroDec(), fmt.Errorf("invalid pool: %d", poolId) } params := k.GetParams(ctx) return ammPool.SwapInAmtGivenOut(ctx, oracleKeeper, snapshot, tokensOut, tokenInDenom, swapFee, k.accountedPoolKeeper, weightBreakingFeePerpetualFactor, params) diff --git a/x/amm/keeper/swap_out_amt_given_in.go b/x/amm/keeper/swap_out_amt_given_in.go index acfec92b5..621b2c317 100644 --- a/x/amm/keeper/swap_out_amt_given_in.go +++ b/x/amm/keeper/swap_out_amt_given_in.go @@ -5,6 +5,7 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/amm/types" ) @@ -17,10 +18,10 @@ func (k Keeper) SwapOutAmtGivenIn( tokenOutDenom string, swapFee sdkmath.LegacyDec, weightBreakingFeePerpetualFactor sdkmath.LegacyDec, -) (tokenOut sdk.Coin, slippage sdkmath.LegacyDec, slippageAmount sdkmath.LegacyDec, weightBalanceBonus sdkmath.LegacyDec, oracleOutAmount sdkmath.LegacyDec, swapFeeFinal sdkmath.LegacyDec, err error) { +) (tokenOut sdk.Coin, slippage, slippageAmount, weightBalanceBonus, oracleOutAmount elystypes.Dec34, swapFeeFinal sdkmath.LegacyDec, err error) { ammPool, found := k.GetPool(ctx, poolId) if !found { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), fmt.Errorf("invalid pool: %d", poolId) + return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), fmt.Errorf("invalid pool: %d", poolId) } params := k.GetParams(ctx) return ammPool.SwapOutAmtGivenIn(ctx, oracleKeeper, snapshot, tokensIn, tokenOutDenom, swapFee, k.accountedPoolKeeper, weightBreakingFeePerpetualFactor, params) diff --git a/x/amm/keeper/track_weight_breaking_slippage.go b/x/amm/keeper/track_weight_breaking_slippage.go index 6fb4d57ee..e1b128db1 100644 --- a/x/amm/keeper/track_weight_breaking_slippage.go +++ b/x/amm/keeper/track_weight_breaking_slippage.go @@ -5,6 +5,7 @@ import ( "cosmossdk.io/store/prefix" "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/amm/types" ) @@ -56,29 +57,29 @@ func (k Keeper) TrackWeightBreakingSlippage(ctx sdk.Context, poolId uint64, toke track := types.WeightBreakingSlippage{ PoolId: poolId, Date: ctx.BlockTime().Format("2006-01-02"), - Amount: price.Mul(math.LegacyNewDecFromInt(token.Amount)), + Amount: price.MulInt(token.Amount).ToLegacyDec(), } k.AddWeightAndSlippageFee(ctx, track) } // Returns last 7 days avg for weight breaking and slippage -func (k Keeper) GetWeightBreakingSlippageAvg(ctx sdk.Context, poolId uint64) math.LegacyDec { +func (k Keeper) GetWeightBreakingSlippageAvg(ctx sdk.Context, poolId uint64) elystypes.Dec34 { start := ctx.BlockTime() count := math.ZeroInt() - total := math.LegacyZeroDec() + total := elystypes.ZeroDec34() for i := 0; i < 7; i++ { date := start.AddDate(0, 0, i*-1).Format("2006-01-02") info := k.GetWeightAndSlippageFee(ctx, poolId, date) if info.Amount.IsPositive() { - total = total.Add(info.Amount) + total = total.AddLegacyDec(info.Amount) count = count.Add(math.OneInt()) } } if count.IsZero() { - return math.LegacyZeroDec() + return elystypes.ZeroDec34() } - return total.Quo(math.LegacyNewDecFromInt(count)) + return total.QuoInt(count) } diff --git a/x/amm/keeper/update_pool_for_swap.go b/x/amm/keeper/update_pool_for_swap.go index b88ab1039..46f825fd5 100644 --- a/x/amm/keeper/update_pool_for_swap.go +++ b/x/amm/keeper/update_pool_for_swap.go @@ -3,6 +3,7 @@ package keeper import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/amm/types" ) @@ -21,7 +22,7 @@ func (k Keeper) UpdatePoolForSwap( swapFee sdkmath.LegacyDec, oracleInAmount sdkmath.Int, oracleOutAmount sdkmath.Int, - weightBalanceBonus sdkmath.LegacyDec, + weightBalanceBonus elystypes.Dec34, givenOut bool, ) error { tokensIn := sdk.Coins{tokenIn} @@ -51,16 +52,17 @@ func (k Keeper) UpdatePoolForSwap( // apply swap fee when weight balance bonus is not available swapFeeInCoins := sdk.Coins{} - if swapFee.IsPositive() { + swapFeeDec34 := elystypes.NewDec34FromLegacyDec(swapFee) + if swapFeeDec34.IsPositive() { if givenOut { takeFeesFrom := sdk.NewCoins(sdk.NewCoin(tokenIn.Denom, oracleInAmount)) if !pool.PoolParams.UseOracle { takeFeesFrom = tokensIn } // if swapInGivenOut, use oracleIn amount to get swap fees - swapFeeInCoins = PortionCoins(takeFeesFrom, swapFee) + swapFeeInCoins = PortionCoins(takeFeesFrom, swapFeeDec34) } else { - swapFeeInCoins = PortionCoins(tokensIn, swapFee) + swapFeeInCoins = PortionCoins(tokensIn, swapFeeDec34) } } @@ -91,12 +93,12 @@ func (k Keeper) UpdatePoolForSwap( params := k.GetParams(ctx) rebalanceTreasury := sdk.MustAccAddressFromBech32(pool.GetRebalanceTreasury()) // we are multiplying here by params.WeightBreakingFeePortion as we didn't multiply in pool.SwapIn/OutGiveOut/In for weight breaking fee - weightRecoveryFee := weightBalanceBonus.Abs().Mul(params.WeightBreakingFeePortion) + weightRecoveryFee := weightBalanceBonus.Abs().MulLegacyDec(params.WeightBreakingFeePortion) if givenOut { - weightRecoveryFeeAmount = oracleInAmount.ToLegacyDec().Mul(weightRecoveryFee).RoundInt() + weightRecoveryFeeAmount = weightRecoveryFee.MulInt(oracleInAmount).ToInt() } else { - weightRecoveryFeeAmount = tokenIn.Amount.ToLegacyDec().Mul(weightRecoveryFee).RoundInt() + weightRecoveryFeeAmount = weightRecoveryFee.MulInt(tokenIn.Amount).ToInt() } if weightRecoveryFeeAmount.IsPositive() { @@ -115,11 +117,11 @@ func (k Keeper) UpdatePoolForSwap( // Track amount in pool weightRecoveryFeeAmountForPool := sdkmath.ZeroInt() - weightRecoveryFeeForPool := weightBalanceBonus.Abs().Mul(sdkmath.LegacyOneDec().Sub(params.WeightBreakingFeePortion)) + weightRecoveryFeeForPool := weightBalanceBonus.Abs().Mul(elystypes.OneDec34().SubLegacyDec(params.WeightBreakingFeePortion)) if givenOut { - weightRecoveryFeeAmountForPool = oracleInAmount.ToLegacyDec().Mul(weightRecoveryFeeForPool).RoundInt() + weightRecoveryFeeAmountForPool = weightRecoveryFeeForPool.MulInt(oracleInAmount).ToInt() } else { - weightRecoveryFeeAmountForPool = tokenIn.Amount.ToLegacyDec().Mul(weightRecoveryFeeForPool).RoundInt() + weightRecoveryFeeAmountForPool = weightRecoveryFeeForPool.MulInt(tokenIn.Amount).ToInt() } k.TrackWeightBreakingSlippage(ctx, pool.PoolId, sdk.NewCoin(tokenIn.Denom, weightRecoveryFeeAmountForPool)) } @@ -135,9 +137,9 @@ func (k Keeper) UpdatePoolForSwap( bonusTokenAmount := sdkmath.ZeroInt() // bonus token amount is the tokenOut amount times weightBalanceBonus if givenOut { - bonusTokenAmount = tokenOut.Amount.ToLegacyDec().Mul(weightBalanceBonus).TruncateInt() + bonusTokenAmount = weightBalanceBonus.MulInt(tokenOut.Amount).ToInt() } else { - bonusTokenAmount = oracleOutAmount.ToLegacyDec().Mul(weightBalanceBonus).TruncateInt() + bonusTokenAmount = weightBalanceBonus.MulInt(oracleOutAmount).ToInt() } // if treasury balance is less than bonusTokenAmount, set bonusTokenAmount to treasury balance diff --git a/x/amm/types/amm_price.go b/x/amm/types/amm_price.go index 2f645e81a..f7a5951b1 100644 --- a/x/amm/types/amm_price.go +++ b/x/amm/types/amm_price.go @@ -1,9 +1,10 @@ package types import ( - sdkmath "cosmossdk.io/math" "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" ) // SwapOutAmtGivenIn is a mutative method for CalcOutAmtGivenIn, which includes the actual swap. @@ -14,26 +15,26 @@ func (p *Pool) GetTokenARate( tokenA string, tokenB string, accPoolKeeper AccountedPoolKeeper, -) (rate sdkmath.LegacyDec, err error) { +) (rate elystypes.Dec34, err error) { // balancer pricing if normal amm pool if !p.PoolParams.UseOracle { Aasset, Basset, err := p.parsePoolAssetsByDenoms(tokenA, tokenB) if err != nil { - return sdkmath.LegacyZeroDec(), err + return elystypes.ZeroDec34(), err } - return CalculateTokenARate( + return elystypes.NewDec34FromLegacyDec(CalculateTokenARate( Aasset.Token.Amount.ToLegacyDec(), Aasset.Weight.ToLegacyDec(), Basset.Token.Amount.ToLegacyDec(), Basset.Weight.ToLegacyDec(), - ), nil + )), nil } priceA := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenA) if priceA.IsZero() { - return sdkmath.LegacyZeroDec(), fmt.Errorf("token price not set: %s", tokenA) + return elystypes.ZeroDec34(), fmt.Errorf("token price not set: %s", tokenA) } priceB := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenB) if priceB.IsZero() { - return sdkmath.LegacyZeroDec(), fmt.Errorf("token price not set: %s", tokenB) + return elystypes.ZeroDec34(), fmt.Errorf("token price not set: %s", tokenB) } return priceA.Quo(priceB), nil diff --git a/x/amm/types/calc_exit_pool.go b/x/amm/types/calc_exit_pool.go index 05c2f4033..b7ad930f3 100644 --- a/x/amm/types/calc_exit_pool.go +++ b/x/amm/types/calc_exit_pool.go @@ -1,80 +1,35 @@ package types import ( + "errors" + errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" - "errors" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" ) -func CalcExitValueWithoutSlippage(ctx sdk.Context, oracleKeeper OracleKeeper, accPoolKeeper AccountedPoolKeeper, pool Pool, exitingShares sdkmath.Int, tokenOutDenom string) (sdkmath.LegacyDec, error) { +func CalcExitValueWithoutSlippage(ctx sdk.Context, oracleKeeper OracleKeeper, accPoolKeeper AccountedPoolKeeper, pool Pool, exitingShares sdkmath.Int, tokenOutDenom string) (elystypes.Dec34, error) { tvl, err := pool.TVL(ctx, oracleKeeper, accPoolKeeper) if err != nil { - return sdkmath.LegacyZeroDec(), err + return elystypes.ZeroDec34(), err } totalShares := pool.GetTotalShares() - var refundedShares sdkmath.LegacyDec - refundedShares = sdkmath.LegacyNewDecFromInt(exitingShares) + refundedShares := elystypes.NewDec34FromInt(exitingShares) // Ensure totalShares is not zero to avoid division by zero if totalShares.IsZero() { - return sdkmath.LegacyZeroDec(), ErrAmountTooLow + return elystypes.ZeroDec34(), ErrAmountTooLow } - exitValue := tvl.Mul(refundedShares).Quo(sdkmath.LegacyNewDecFromInt(totalShares.Amount)) + exitValue := tvl.Mul(refundedShares).Quo(elystypes.NewDec34FromInt(totalShares.Amount)) if exitingShares.GTE(totalShares.Amount) { - return sdkmath.LegacyZeroDec(), errorsmod.Wrapf(ErrLimitMaxAmount, ErrMsgFormatSharesLargerThanMax, exitingShares, totalShares) + return elystypes.ZeroDec34(), errorsmod.Wrapf(ErrLimitMaxAmount, ErrMsgFormatSharesLargerThanMax, exitingShares, totalShares) } return exitValue, nil - - // Note: Disable slippage handling for oracle pool due to 1 hour lockup on oracle lp - // shareOutRatio := refundedShares.QuoInt(totalShares.Amount) - // // exitedCoins = shareOutRatio * pool liquidity - // exitedCoins := sdk.Coins{} - // poolLiquidity := pool.GetTotalPoolLiquidity() - - // for _, asset := range poolLiquidity { - // // round down here, due to not wanting to over-exit - // exitAmt := shareOutRatio.MulInt(asset.Amount).TruncateInt() - // if exitAmt.LTE(sdkmath.ZeroInt()) { - // continue - // } - // if exitAmt.GTE(asset.Amount) { - // return sdkmath.LegacyZeroDec(), errors.New("too many shares out") - // } - // exitedCoins = exitedCoins.Add(sdk.NewCoin(asset.Denom, exitAmt)) - // } - - // slippageValue := sdkmath.LegacyZeroDec() - // for _, exitedCoin := range exitedCoins { - // if exitedCoin.Denom == tokenOutDenom { - // continue - // } - // inTokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, exitedCoin.Denom) - // if inTokenPrice.IsZero() { - // return sdkmath.LegacyZeroDec(), fmt.Errorf("token price not set: %s", exitedCoin.Denom) - // } - // resizedAmount := sdkmath.LegacyNewDecFromInt(exitedCoin.Amount). - // Quo(pool.PoolParams.ExternalLiquidityRatio).RoundInt() - // slippageAmount, err := pool.CalcGivenInSlippage( - // ctx, - // oracleKeeper, - // &pool, - // sdk.Coins{sdk.NewCoin(exitedCoin.Denom, resizedAmount)}, - // tokenOutDenom, - // accPoolKeeper, - // ) - // if err != nil { - // return sdkmath.LegacyZeroDec(), err - // } - - // slippageValue = slippageValue.Add(slippageAmount.Mul(inTokenPrice)) - // } - // exitValueWithoutSlippage := exitValue.Sub(slippageValue) - // return exitValueWithoutSlippage, nil } // CalcExitPool returns how many tokens should come out, when exiting k LP shares against a "standard" CFMM @@ -86,10 +41,10 @@ func CalcExitPool( exitingShares sdkmath.Int, tokenOutDenom string, params Params, -) (exitCoins sdk.Coins, weightBalanceBonus sdkmath.LegacyDec, err error) { +) (exitCoins sdk.Coins, weightBalanceBonus elystypes.Dec34, err error) { totalShares := pool.GetTotalShares() if exitingShares.GTE(totalShares.Amount) { - return sdk.Coins{}, sdkmath.LegacyZeroDec(), errorsmod.Wrapf(ErrLimitMaxAmount, ErrMsgFormatSharesLargerThanMax, exitingShares, totalShares) + return sdk.Coins{}, elystypes.ZeroDec34(), errorsmod.Wrapf(ErrLimitMaxAmount, ErrMsgFormatSharesLargerThanMax, exitingShares, totalShares) } // refundedShares = exitingShares * (1 - exit fee) @@ -108,26 +63,26 @@ func CalcExitPool( tokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenOutDenom) exitValueWithoutSlippage, err := CalcExitValueWithoutSlippage(ctx, oracleKeeper, accountedPoolKeeper, pool, exitingShares, tokenOutDenom) if err != nil { - return sdk.Coins{}, sdkmath.LegacyZeroDec(), err + return sdk.Coins{}, elystypes.ZeroDec34(), err } // Ensure tokenPrice is not zero to avoid division by zero if tokenPrice.IsZero() { - return sdk.Coins{}, sdkmath.LegacyZeroDec(), ErrAmountTooLow + return sdk.Coins{}, elystypes.ZeroDec34(), ErrAmountTooLow } oracleOutAmount := exitValueWithoutSlippage.Quo(tokenPrice) newAssetPools, err := pool.NewPoolAssetsAfterSwap(ctx, sdk.Coins{}, - sdk.Coins{sdk.NewCoin(tokenOutDenom, oracleOutAmount.RoundInt())}, accountedAssets, + sdk.Coins{sdk.NewCoin(tokenOutDenom, oracleOutAmount.ToInt())}, accountedAssets, ) if err != nil { - return sdk.Coins{}, sdkmath.LegacyZeroDec(), err + return sdk.Coins{}, elystypes.ZeroDec34(), err } for _, asset := range newAssetPools { if asset.Token.Amount.IsNegative() { - return sdk.Coins{}, sdkmath.LegacyZeroDec(), errors.New("out amount exceeds liquidity balance") + return sdk.Coins{}, elystypes.ZeroDec34(), errors.New("out amount exceeds liquidity balance") } } @@ -136,20 +91,20 @@ func CalcExitPool( // target weight targetWeightOut := GetDenomNormalizedWeight(pool.PoolAssets, tokenOutDenom) - targetWeightIn := sdkmath.LegacyOneDec().Sub(targetWeightOut) + targetWeightIn := elystypes.OneDec34().Sub(targetWeightOut) // weight breaking fee as in Plasma pool finalWeightOut := GetDenomOracleAssetWeight(ctx, pool.PoolId, oracleKeeper, newAssetPools, tokenOutDenom) - finalWeightIn := sdkmath.LegacyOneDec().Sub(finalWeightOut) + finalWeightIn := elystypes.OneDec34().Sub(finalWeightOut) initialAssetPools, err := pool.NewPoolAssetsAfterSwap(ctx, sdk.NewCoins(), sdk.NewCoins(), accountedAssets, ) initialWeightOut := GetDenomOracleAssetWeight(ctx, pool.PoolId, oracleKeeper, initialAssetPools, tokenOutDenom) - initialWeightIn := sdkmath.LegacyOneDec().Sub(initialWeightOut) + initialWeightIn := elystypes.OneDec34().Sub(initialWeightOut) weightBreakingFee := GetWeightBreakingFee(finalWeightIn, finalWeightOut, targetWeightIn, targetWeightOut, initialWeightIn, initialWeightOut, distanceDiff, params) - tokenOutAmount := oracleOutAmount.Mul(sdkmath.LegacyOneDec().Sub(weightBreakingFee)).RoundInt() + tokenOutAmount := oracleOutAmount.Mul(elystypes.OneDec34().Sub(weightBreakingFee)).ToInt() return sdk.Coins{sdk.NewCoin(tokenOutDenom, tokenOutAmount)}, weightBreakingFee.Neg(), nil } @@ -160,10 +115,10 @@ func CalcExitPool( continue } if exitAmt.GTE(asset.Amount) { - return sdk.Coins{}, sdkmath.LegacyZeroDec(), errors.New("too many shares out") + return sdk.Coins{}, elystypes.ZeroDec34(), errors.New("too many shares out") } exitedCoins = exitedCoins.Add(sdk.NewCoin(asset.Denom, exitAmt)) } - return exitedCoins, sdkmath.LegacyZeroDec(), nil + return exitedCoins, elystypes.ZeroDec34(), nil } diff --git a/x/amm/types/calc_in_amt_given_out.go b/x/amm/types/calc_in_amt_given_out.go index e1bc1abef..4f4a9e175 100644 --- a/x/amm/types/calc_in_amt_given_out.go +++ b/x/amm/types/calc_in_amt_given_out.go @@ -4,6 +4,7 @@ import ( errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" ) // CalcInAmtGivenOut calculates token to be provided, fee added, @@ -13,44 +14,44 @@ func (p Pool) CalcInAmtGivenOut( oracle OracleKeeper, snapshot *Pool, tokensOut sdk.Coins, tokenInDenom string, swapFee sdkmath.LegacyDec, accountedPool AccountedPoolKeeper) ( - tokenIn sdk.Coin, slippage sdkmath.LegacyDec, err error, + tokenIn sdk.Coin, slippage elystypes.Dec34, err error, ) { tokenOut, poolAssetOut, poolAssetIn, err := p.parsePoolAssets(tokensOut, tokenInDenom) if err != nil { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), err + return sdk.Coin{}, elystypes.ZeroDec34(), err } - outWeight := sdkmath.LegacyNewDecFromInt(poolAssetOut.Weight) - inWeight := sdkmath.LegacyNewDecFromInt(poolAssetIn.Weight) + outWeight := elystypes.NewDec34FromInt(poolAssetOut.Weight) + inWeight := elystypes.NewDec34FromInt(poolAssetIn.Weight) if p.PoolParams.UseOracle { _, poolAssetOut, poolAssetIn, err := snapshot.parsePoolAssets(tokensOut, tokenInDenom) if err != nil { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), err + return sdk.Coin{}, elystypes.ZeroDec34(), err } oracleWeights, err := GetOraclePoolNormalizedWeights(ctx, p.PoolId, oracle, []PoolAsset{poolAssetIn, poolAssetOut}) if err != nil { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), err + return sdk.Coin{}, elystypes.ZeroDec34(), err } inWeight = oracleWeights[0].Weight outWeight = oracleWeights[1].Weight } // delta balanceOut is positive(tokens inside the pool decreases) - poolTokenOutBalance := sdkmath.LegacyNewDecFromInt(poolAssetOut.Token.Amount) + poolTokenOutBalance := elystypes.NewDec34FromInt(poolAssetOut.Token.Amount) // accounted pool balance acountedPoolAssetOutAmt := accountedPool.GetAccountedBalance(ctx, p.PoolId, poolAssetOut.Token.Denom) if acountedPoolAssetOutAmt.IsPositive() { - poolTokenOutBalance = sdkmath.LegacyNewDecFromInt(acountedPoolAssetOutAmt) + poolTokenOutBalance = elystypes.NewDec34FromInt(acountedPoolAssetOutAmt) } - poolTokenInBalance := sdkmath.LegacyNewDecFromInt(poolAssetIn.Token.Amount) + poolTokenInBalance := elystypes.NewDec34FromInt(poolAssetIn.Token.Amount) // accounted pool balance acountedPoolAssetInAmt := accountedPool.GetAccountedBalance(ctx, p.PoolId, poolAssetIn.Token.Denom) if acountedPoolAssetInAmt.IsPositive() { - poolTokenInBalance = sdkmath.LegacyNewDecFromInt(acountedPoolAssetInAmt) + poolTokenInBalance = elystypes.NewDec34FromInt(acountedPoolAssetInAmt) } - poolPostSwapOutBalance := poolTokenOutBalance.Sub(sdkmath.LegacyNewDecFromInt(tokenOut.Amount)) + poolPostSwapOutBalance := poolTokenOutBalance.Sub(elystypes.NewDec34FromInt(tokenOut.Amount)) // (x_0)(y_0) = (x_0 + in)(y_0 - out) tokenAmountIn, err := solveConstantFunctionInvariant( poolTokenOutBalance, poolPostSwapOutBalance, @@ -59,38 +60,40 @@ func (p Pool) CalcInAmtGivenOut( inWeight, ) if err != nil { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), err + return sdk.Coin{}, elystypes.ZeroDec34(), err } tokenAmountIn = tokenAmountIn.Neg() rate, err := p.GetTokenARate(ctx, oracle, snapshot, tokenInDenom, tokenOut.Denom, accountedPool) if err != nil { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), err + return sdk.Coin{}, elystypes.ZeroDec34(), err } - amountInWithoutSlippage := sdkmath.LegacyNewDecFromInt(tokenOut.Amount).Quo(rate) + amountInWithoutSlippage := elystypes.NewDec34FromInt(tokenOut.Amount).Quo(rate) if tokenAmountIn.IsZero() { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), ErrAmountTooLow + return sdk.Coin{}, elystypes.ZeroDec34(), ErrAmountTooLow } - slippage = sdkmath.LegacyOneDec().Sub(tokenAmountIn.Quo(amountInWithoutSlippage)) + slippage = elystypes.OneDec34().Sub(tokenAmountIn.Quo(amountInWithoutSlippage)) // Ensure (1 - swapfee) is not zero to avoid division by zero if swapFee.GTE(sdkmath.LegacyOneDec()) { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), ErrTooMuchSwapFee + return sdk.Coin{}, elystypes.ZeroDec34(), ErrTooMuchSwapFee } + swapFeeDec34 := elystypes.NewDec34FromLegacyDec(swapFee) + // We deduct a swap fee on the input asset. The swap happens by following the invariant curve on the input * (1 - swap fee) // and then the swap fee is added to the pool. // Thus in order to give X amount out, we solve the invariant for the invariant input. However invariant input = (1 - swapfee) * trade input. // Therefore we divide by (1 - swapfee) here - tokenAmountInBeforeFee := tokenAmountIn.Quo(sdkmath.LegacyOneDec().Sub(swapFee)) + tokenAmountInBeforeFee := tokenAmountIn.Quo(elystypes.OneDec34().Sub(swapFeeDec34)) // We round up tokenInAmt, as this is whats charged for the swap, for the precise amount out. // Otherwise, the pool would under-charge by this rounding error. - tokenInAmt := tokenAmountInBeforeFee.Ceil().TruncateInt() + tokenInAmt := tokenAmountInBeforeFee.ToInt() if !tokenInAmt.IsPositive() { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), errorsmod.Wrapf(ErrInvalidMathApprox, "token amount must be positive") + return sdk.Coin{}, elystypes.ZeroDec34(), errorsmod.Wrapf(ErrInvalidMathApprox, "token amount must be positive") } return sdk.NewCoin(tokenInDenom, tokenInAmt), slippage, nil } diff --git a/x/amm/types/calc_out_amt_given_in.go b/x/amm/types/calc_out_amt_given_in.go index 9fa1d2cc3..623eb6577 100644 --- a/x/amm/types/calc_out_amt_given_in.go +++ b/x/amm/types/calc_out_amt_given_in.go @@ -4,6 +4,7 @@ import ( errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" ) // CalcOutAmtGivenIn calculates tokens to be swapped out given the provided @@ -16,39 +17,41 @@ func (p Pool) CalcOutAmtGivenIn( tokenOutDenom string, swapFee sdkmath.LegacyDec, accountedPool AccountedPoolKeeper, -) (sdk.Coin, sdkmath.LegacyDec, error) { +) (sdk.Coin, elystypes.Dec34, error) { tokenIn, poolAssetIn, poolAssetOut, err := p.parsePoolAssets(tokensIn, tokenOutDenom) if err != nil { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), err + return sdk.Coin{}, elystypes.ZeroDec34(), err } - tokenAmountInAfterFee := sdkmath.LegacyNewDecFromInt(tokenIn.Amount).Mul(sdkmath.LegacyOneDec().Sub(swapFee)) - poolTokenInBalance := sdkmath.LegacyNewDecFromInt(poolAssetIn.Token.Amount) + swapFeeDec34 := elystypes.NewDec34FromLegacyDec(swapFee) + + tokenAmountInAfterFee := elystypes.NewDec34FromInt(tokenIn.Amount).Mul(elystypes.OneDec34().Sub(swapFeeDec34)) + poolTokenInBalance := elystypes.NewDec34FromInt(poolAssetIn.Token.Amount) // accounted pool balance acountedPoolAssetInAmt := accountedPool.GetAccountedBalance(ctx, p.PoolId, poolAssetIn.Token.Denom) if acountedPoolAssetInAmt.IsPositive() { - poolTokenInBalance = sdkmath.LegacyNewDecFromInt(acountedPoolAssetInAmt) + poolTokenInBalance = elystypes.NewDec34FromInt(acountedPoolAssetInAmt) } - poolTokenOutBalance := sdkmath.LegacyNewDecFromInt(poolAssetOut.Token.Amount) + poolTokenOutBalance := elystypes.NewDec34FromInt(poolAssetOut.Token.Amount) // accounted pool balance accountedPoolAssetOutAmt := accountedPool.GetAccountedBalance(ctx, p.PoolId, poolAssetOut.Token.Denom) if accountedPoolAssetOutAmt.IsPositive() { - poolTokenOutBalance = sdkmath.LegacyNewDecFromInt(accountedPoolAssetOutAmt) + poolTokenOutBalance = elystypes.NewDec34FromInt(accountedPoolAssetOutAmt) } poolPostSwapInBalance := poolTokenInBalance.Add(tokenAmountInAfterFee) - outWeight := sdkmath.LegacyNewDecFromInt(poolAssetOut.Weight) - inWeight := sdkmath.LegacyNewDecFromInt(poolAssetIn.Weight) + outWeight := elystypes.NewDec34FromInt(poolAssetOut.Weight) + inWeight := elystypes.NewDec34FromInt(poolAssetIn.Weight) if p.PoolParams.UseOracle { _, poolAssetIn, poolAssetOut, err := snapshot.parsePoolAssets(tokensIn, tokenOutDenom) if err != nil { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), err + return sdk.Coin{}, elystypes.ZeroDec34(), err } oracleWeights, err := GetOraclePoolNormalizedWeights(ctx, p.PoolId, oracle, []PoolAsset{poolAssetIn, poolAssetOut}) if err != nil { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), err + return sdk.Coin{}, elystypes.ZeroDec34(), err } inWeight = oracleWeights[0].Weight outWeight = oracleWeights[1].Weight @@ -64,31 +67,30 @@ func (p Pool) CalcOutAmtGivenIn( outWeight, ) if err != nil { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), err + return sdk.Coin{}, elystypes.ZeroDec34(), err } - if tokenAmountOut.IsZero() { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), ErrTokenOutAmountZero + return sdk.Coin{}, elystypes.ZeroDec34(), ErrTokenOutAmountZero } rate, err := p.GetTokenARate(ctx, oracle, snapshot, tokenIn.Denom, tokenOutDenom, accountedPool) if err != nil { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), err + return sdk.Coin{}, elystypes.ZeroDec34(), err } amountOutWithoutSlippage := tokenAmountInAfterFee.Mul(rate) // check if amountOutWithoutSlippage is zero to avoid division by zero if amountOutWithoutSlippage.IsZero() { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), errorsmod.Wrapf(ErrInvalidMathApprox, "amount out without slippage must be positive") + return sdk.Coin{}, elystypes.ZeroDec34(), errorsmod.Wrapf(ErrInvalidMathApprox, "amount out without slippage must be positive") } - slippage := sdkmath.LegacyOneDec().Sub(tokenAmountOut.Quo(amountOutWithoutSlippage)) + slippage := elystypes.OneDec34().Sub(tokenAmountOut.Quo(amountOutWithoutSlippage)) // We ignore the decimal component, as we round down the token amount out. - tokenAmountOutInt := tokenAmountOut.TruncateInt() + tokenAmountOutInt := tokenAmountOut.ToInt() if !tokenAmountOutInt.IsPositive() { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), ErrTokenOutAmountZero + return sdk.Coin{}, elystypes.ZeroDec34(), ErrTokenOutAmountZero } return sdk.NewCoin(tokenOutDenom, tokenAmountOutInt), slippage, nil diff --git a/x/amm/types/pool.go b/x/amm/types/pool.go index b81e5a332..fb4c3b5eb 100644 --- a/x/amm/types/pool.go +++ b/x/amm/types/pool.go @@ -10,6 +10,7 @@ import ( errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" ) func (p *Pool) addToPoolAssetBalances(coins sdk.Coins) error { @@ -288,16 +289,16 @@ func (p *Pool) CalcExitPoolCoinsFromShares( exitingShares sdkmath.Int, tokenOutDenom string, params Params, -) (exitedCoins sdk.Coins, weightBalanceBonus sdkmath.LegacyDec, err error) { +) (exitedCoins sdk.Coins, weightBalanceBonus elystypes.Dec34, err error) { return CalcExitPool(ctx, oracleKeeper, *p, accountedPoolKeeper, exitingShares, tokenOutDenom, params) } -func (p *Pool) TVL(ctx sdk.Context, oracleKeeper OracleKeeper, accountedPoolKeeper AccountedPoolKeeper) (sdkmath.LegacyDec, error) { +func (p *Pool) TVL(ctx sdk.Context, oracleKeeper OracleKeeper, accountedPoolKeeper AccountedPoolKeeper) (elystypes.Dec34, error) { // OracleAssetsTVL * TotalWeight / OracleAssetsWeight // E.g. JUNO / USDT / USDC (30:30:30) // TVL = USDC_USDT_liquidity * 90 / 60 - oracleAssetsTVL := sdkmath.LegacyZeroDec() + oracleAssetsTVL := elystypes.ZeroDec34() totalWeight := sdkmath.ZeroInt() oracleAssetsWeight := sdkmath.ZeroInt() for _, asset := range p.PoolAssets { @@ -305,7 +306,7 @@ func (p *Pool) TVL(ctx sdk.Context, oracleKeeper OracleKeeper, accountedPoolKeep totalWeight = totalWeight.Add(asset.Weight) if tokenPrice.IsZero() { if p.PoolParams.UseOracle { - return sdkmath.LegacyZeroDec(), fmt.Errorf("token price not set: %s", asset.Token.Denom) + return elystypes.ZeroDec34(), fmt.Errorf("token price not set: %s", asset.Token.Denom) } } else { amount := asset.Token.Amount @@ -315,27 +316,27 @@ func (p *Pool) TVL(ctx sdk.Context, oracleKeeper OracleKeeper, accountedPoolKeep amount = accountedPoolAmt } } - v := amount.ToLegacyDec().Mul(tokenPrice) + v := elystypes.NewDec34FromInt(amount).Mul(tokenPrice) oracleAssetsTVL = oracleAssetsTVL.Add(v) oracleAssetsWeight = oracleAssetsWeight.Add(asset.Weight) } } if oracleAssetsWeight.IsZero() { - return sdkmath.LegacyZeroDec(), nil + return elystypes.ZeroDec34(), nil } - return oracleAssetsTVL.Mul(sdkmath.LegacyNewDecFromInt(totalWeight)).Quo(sdkmath.LegacyNewDecFromInt(oracleAssetsWeight)), nil + return oracleAssetsTVL.Mul(elystypes.NewDec34FromInt(totalWeight)).Quo(elystypes.NewDec34FromInt(oracleAssetsWeight)), nil } -func (p *Pool) LpTokenPrice(ctx sdk.Context, oracleKeeper OracleKeeper, accPoolKeeper AccountedPoolKeeper) (sdkmath.LegacyDec, error) { +func (p *Pool) LpTokenPrice(ctx sdk.Context, oracleKeeper OracleKeeper, accPoolKeeper AccountedPoolKeeper) (elystypes.Dec34, error) { ammPoolTvl, err := p.TVL(ctx, oracleKeeper, accPoolKeeper) if err != nil { - return sdkmath.LegacyZeroDec(), err + return elystypes.ZeroDec34(), err } // Ensure ammPool.TotalShares is not zero to avoid division by zero if p.TotalShares.IsZero() { - return sdkmath.LegacyOneDec(), nil + return elystypes.ZeroDec34(), nil } lpTokenPrice := ammPoolTvl.MulInt(OneShare).QuoInt(p.TotalShares.Amount) return lpTokenPrice, nil diff --git a/x/amm/types/pool_calc_join_pool_shares.go b/x/amm/types/pool_calc_join_pool_shares.go index 0a9f83eb8..e8ce1e5ec 100644 --- a/x/amm/types/pool_calc_join_pool_shares.go +++ b/x/amm/types/pool_calc_join_pool_shares.go @@ -5,6 +5,7 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" ) // calcPoolOutGivenSingleIn - balance pAo. @@ -13,18 +14,18 @@ func (p *Pool) calcSingleAssetJoin(tokenIn sdk.Coin, spreadFactor sdkmath.Legacy if totalWeight.IsZero() { return sdkmath.ZeroInt(), errors.New("pool misconfigured, total weight = 0") } - normalizedWeight := sdkmath.LegacyNewDecFromInt(tokenInPoolAsset.Weight).Quo(sdkmath.LegacyNewDecFromInt(totalWeight)) + normalizedWeight := elystypes.NewDec34FromInt(tokenInPoolAsset.Weight).Quo(elystypes.NewDec34FromInt(totalWeight)) poolShares, err := calcPoolSharesOutGivenSingleAssetIn( - sdkmath.LegacyNewDecFromInt(tokenInPoolAsset.Token.Amount), + elystypes.NewDec34FromInt(tokenInPoolAsset.Token.Amount), normalizedWeight, - sdkmath.LegacyNewDecFromInt(totalShares), - sdkmath.LegacyNewDecFromInt(tokenIn.Amount), - spreadFactor, + elystypes.NewDec34FromInt(totalShares), + elystypes.NewDec34FromInt(tokenIn.Amount), + elystypes.NewDec34FromLegacyDec(spreadFactor), ) if err != nil { return sdkmath.ZeroInt(), err } - return poolShares.TruncateInt(), nil + return poolShares.ToInt(), nil } // CalcSingleAssetJoinPoolShares calculates the number of shares created to join pool with the provided amount of `tokenIn`. diff --git a/x/amm/types/pool_join_pool.go b/x/amm/types/pool_join_pool.go index 28987bcb4..1e6d6f2b4 100644 --- a/x/amm/types/pool_join_pool.go +++ b/x/amm/types/pool_join_pool.go @@ -5,6 +5,7 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" ) type PoolAssetUSDValue struct { @@ -17,101 +18,17 @@ type InternalSwapRequest struct { OutToken string } -func (p *Pool) CalcJoinValueWithoutSlippage(ctx sdk.Context, oracleKeeper OracleKeeper, accountedPoolKeeper AccountedPoolKeeper, tokensIn sdk.Coins) (sdkmath.LegacyDec, error) { - joinValue := sdkmath.LegacyZeroDec() +func (p *Pool) CalcJoinValueWithoutSlippage(ctx sdk.Context, oracleKeeper OracleKeeper, accountedPoolKeeper AccountedPoolKeeper, tokensIn sdk.Coins) (elystypes.Dec34, error) { + joinValue := elystypes.ZeroDec34() for _, asset := range tokensIn { tokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, asset.Denom) if tokenPrice.IsZero() { - return sdkmath.LegacyZeroDec(), fmt.Errorf("token price not set: %s", asset.Denom) + return elystypes.ZeroDec34(), fmt.Errorf("token price not set: %s", asset.Denom) } - v := tokenPrice.Mul(sdkmath.LegacyNewDecFromInt(asset.Amount)) + v := tokenPrice.Mul(elystypes.NewDec34FromInt(asset.Amount)) joinValue = joinValue.Add(v) } return joinValue, nil - - // Note: Disable slippage handling for oracle pool due to 1 hour lockup on oracle lp - // // weights := NormalizedWeights(p.PoolAssets) - // weights, err := GetOraclePoolNormalizedWeights(ctx, oracleKeeper, p.PoolAssets) - // if err != nil { - // return sdkmath.LegacyZeroDec(), err - // } - - // inAmounts := []PoolAssetUSDValue{} - // outAmounts := []PoolAssetUSDValue{} - - // for _, weight := range weights { - // targetAmount := joinValue.Mul(weight.Weight) - // tokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, weight.Asset) - // if tokenPrice.IsZero() { - // return sdkmath.LegacyZeroDec(), fmt.Errorf("token price not set: %s", weight.Asset) - // } - // inAmount := tokenPrice.Mul(sdkmath.LegacyNewDecFromInt(tokensIn.AmountOf(weight.Asset))) - // if targetAmount.GT(inAmount) { - // outAmounts = append(outAmounts, PoolAssetUSDValue{ - // Asset: weight.Asset, - // Value: targetAmount.Sub(inAmount), - // }) - // } - - // if targetAmount.LT(inAmount) { - // inAmounts = append(inAmounts, PoolAssetUSDValue{ - // Asset: weight.Asset, - // Value: inAmount.Sub(targetAmount), - // }) - // } - // } - - // internalSwapRequests := []InternalSwapRequest{} - // for i, j := 0, 0; i < len(inAmounts) && j < len(outAmounts); { - // inTokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, inAmounts[i].Asset) - // if inTokenPrice.IsZero() { - // return sdkmath.LegacyZeroDec(), fmt.Errorf("token price not set: %s", inAmounts[i].Asset) - // } - // inAsset := inAmounts[i].Asset - // outAsset := outAmounts[j].Asset - // inAmount := sdkmath.ZeroInt() - // if inAmounts[i].Value.GT(outAmounts[j].Value) { - // inAmount = outAmounts[j].Value.Quo(inTokenPrice).RoundInt() - // j++ - // } else if inAmounts[i].Value.LT(outAmounts[j].Value) { - // inAmount = inAmounts[i].Value.Quo(inTokenPrice).RoundInt() - // i++ - // } else { - // inAmount = inAmounts[i].Value.Quo(inTokenPrice).RoundInt() - // i++ - // j++ - // } - // internalSwapRequests = append(internalSwapRequests, InternalSwapRequest{ - // InAmount: sdk.NewCoin(inAsset, inAmount), - // OutToken: outAsset, - // }) - // } - - // slippageValue := sdkmath.LegacyZeroDec() - // for _, req := range internalSwapRequests { - // inTokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, req.InAmount.Denom) - // if inTokenPrice.IsZero() { - // return sdkmath.LegacyZeroDec(), fmt.Errorf("token price not set: %s", req.InAmount.Denom) - // } - // resizedAmount := sdkmath.LegacyNewDecFromInt(req.InAmount.Amount). - // Quo(p.PoolParams.ExternalLiquidityRatio).RoundInt() - // slippageAmount, err := p.CalcGivenInSlippage( - // ctx, - // oracleKeeper, - // p, - // sdk.Coins{sdk.NewCoin(req.InAmount.Denom, resizedAmount)}, - // req.OutToken, - // accountedPoolKeeper, - // ) - // if err != nil { - // return sdkmath.LegacyZeroDec(), err - // } - - // slippageValue = slippageValue.Add(slippageAmount.Mul(inTokenPrice)) - // } - // joinValueWithoutSlippage := joinValue.Sub(slippageValue) - - // return joinValueWithoutSlippage, nil } // JoinPool calculates the number of shares needed for an all-asset join given tokensIn with swapFee applied. @@ -121,25 +38,25 @@ func (p *Pool) JoinPool( oracleKeeper OracleKeeper, accountedPoolKeeper AccountedPoolKeeper, tokensIn sdk.Coins, params Params, -) (tokensJoined sdk.Coins, numShares sdkmath.Int, slippage sdkmath.LegacyDec, weightBalanceBonus sdkmath.LegacyDec, err error) { +) (tokensJoined sdk.Coins, numShares sdkmath.Int, slippage elystypes.Dec34, weightBalanceBonus elystypes.Dec34, err error) { // if it's not single sided liquidity, add at pool ratio if len(tokensIn) != 1 { numShares, tokensJoined, err := p.CalcJoinPoolNoSwapShares(tokensIn) if err != nil { - return sdk.NewCoins(), sdkmath.Int{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err + return sdk.NewCoins(), sdkmath.Int{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), err } // update pool with the calculated share and liquidity needed to join pool err = p.IncreaseLiquidity(numShares, tokensJoined) if err != nil { - return sdk.NewCoins(), sdkmath.Int{}, sdkmath.LegacyDec{}, sdkmath.LegacyDec{}, err + return sdk.NewCoins(), sdkmath.Int{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), err } - return tokensJoined, numShares, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), nil + return tokensJoined, numShares, elystypes.ZeroDec34(), elystypes.ZeroDec34(), nil } if !p.PoolParams.UseOracle { tokenIn := tokensIn[0] - totalSlippage := sdkmath.LegacyZeroDec() + totalSlippage := elystypes.ZeroDec34() normalizedWeights := NormalizedWeights(p.PoolAssets) for _, weight := range normalizedWeights { if weight.Asset != tokenIn.Denom { @@ -152,37 +69,37 @@ func (p *Pool) JoinPool( numShares, tokensJoined, err := p.CalcSingleAssetJoinPoolShares(tokensIn) if err != nil { - return sdk.NewCoins(), sdkmath.Int{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err + return sdk.NewCoins(), sdkmath.Int{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), err } // update pool with the calculated share and liquidity needed to join pool err = p.IncreaseLiquidity(numShares, tokensJoined) if err != nil { - return sdk.NewCoins(), sdkmath.Int{}, sdkmath.LegacyDec{}, sdkmath.LegacyDec{}, err + return sdk.NewCoins(), sdkmath.Int{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), err } - return tokensJoined, numShares, totalSlippage, sdkmath.LegacyZeroDec(), nil + return tokensJoined, numShares, totalSlippage, elystypes.ZeroDec34(), nil } joinValueWithoutSlippage, err := p.CalcJoinValueWithoutSlippage(ctx, oracleKeeper, accountedPoolKeeper, tokensIn) if err != nil { - return sdk.NewCoins(), sdkmath.ZeroInt(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err + return sdk.NewCoins(), sdkmath.ZeroInt(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), err } accountedAssets := p.GetAccountedBalance(ctx, accountedPoolKeeper, p.PoolAssets) initialWeightDistance := p.WeightDistanceFromTarget(ctx, oracleKeeper, accountedAssets) tvl, err := p.TVL(ctx, oracleKeeper, accountedPoolKeeper) if err != nil { - return sdk.NewCoins(), sdkmath.ZeroInt(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err + return sdk.NewCoins(), sdkmath.ZeroInt(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), err } // Ensure tvl is not zero to avoid division by zero if tvl.IsZero() { - return sdk.NewCoins(), sdkmath.ZeroInt(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), ErrAmountTooLow + return sdk.NewCoins(), sdkmath.ZeroInt(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), ErrAmountTooLow } newAssetPools, err := p.NewPoolAssetsAfterSwap(ctx, tokensIn, sdk.NewCoins(), accountedAssets) if err != nil { - return sdk.NewCoins(), sdkmath.ZeroInt(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err + return sdk.NewCoins(), sdkmath.ZeroInt(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), err } weightDistance := p.WeightDistanceFromTarget(ctx, oracleKeeper, newAssetPools) distanceDiff := weightDistance.Sub(initialWeightDistance) @@ -191,44 +108,44 @@ func (p *Pool) JoinPool( tokenInDenom := tokensIn[0].Denom // target weight targetWeightIn := GetDenomNormalizedWeight(p.PoolAssets, tokenInDenom) - targetWeightOut := sdkmath.LegacyOneDec().Sub(targetWeightIn) + targetWeightOut := elystypes.OneDec34().Sub(targetWeightIn) // weight breaking fee as in Plasma pool finalWeightIn := GetDenomOracleAssetWeight(ctx, p.PoolId, oracleKeeper, newAssetPools, tokenInDenom) - finalWeightOut := sdkmath.LegacyOneDec().Sub(finalWeightIn) + finalWeightOut := elystypes.OneDec34().Sub(finalWeightIn) initialAssetPools, err := p.NewPoolAssetsAfterSwap(ctx, sdk.NewCoins(), sdk.NewCoins(), accountedAssets, ) initialWeightIn := GetDenomOracleAssetWeight(ctx, p.PoolId, oracleKeeper, initialAssetPools, tokenInDenom) - initialWeightOut := sdkmath.LegacyOneDec().Sub(initialWeightIn) + initialWeightOut := elystypes.OneDec34().Sub(initialWeightIn) weightBreakingFee := GetWeightBreakingFee(finalWeightIn, finalWeightOut, targetWeightIn, targetWeightOut, initialWeightIn, initialWeightOut, distanceDiff, params) // apply percentage to fees, consider improvement or reduction of other token // Other denom weight ratio to reduce the weight breaking fees weightBreakingFee = weightBreakingFee.Mul(finalWeightOut) // weight recovery reward = weight breaking fee * weight breaking fee portion - weightRecoveryReward := weightBreakingFee.Mul(params.WeightBreakingFeePortion) + weightRecoveryReward := weightBreakingFee.Mul(elystypes.NewDec34FromLegacyDec(params.WeightBreakingFeePortion)) // bonus is valid when distance is lower than original distance and when threshold weight reached weightBalanceBonus = weightBreakingFee.Neg() - if initialWeightDistance.GT(params.ThresholdWeightDifference) && distanceDiff.IsNegative() { + if initialWeightDistance.GT(elystypes.NewDec34FromLegacyDec(params.ThresholdWeightDifference)) && distanceDiff.IsNegative() { weightBalanceBonus = weightRecoveryReward // set weight breaking fee to zero if bonus is applied - weightBreakingFee = sdkmath.LegacyZeroDec() + weightBreakingFee = elystypes.ZeroDec34() } totalShares := p.GetTotalShares() - numSharesDec := sdkmath.LegacyNewDecFromInt(totalShares.Amount). + numSharesDec := elystypes.NewDec34FromInt(totalShares.Amount). Mul(joinValueWithoutSlippage).Quo(tvl). - Mul(sdkmath.LegacyOneDec().Sub(weightBreakingFee)) - numShares = numSharesDec.RoundInt() + Mul(elystypes.OneDec34().Sub(weightBreakingFee)) + numShares = numSharesDec.ToInt() err = p.IncreaseLiquidity(numShares, tokensIn) if err != nil { - return sdk.NewCoins(), sdkmath.ZeroInt(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err + return sdk.NewCoins(), sdkmath.ZeroInt(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), err } // No slippage in oracle pool due to 1 hr lock - return tokensIn, numShares, sdkmath.LegacyZeroDec(), weightBalanceBonus, nil + return tokensIn, numShares, elystypes.ZeroDec34(), weightBalanceBonus, nil } diff --git a/x/amm/types/pow.go b/x/amm/types/pow.go index 928503a12..88cd50bb8 100644 --- a/x/amm/types/pow.go +++ b/x/amm/types/pow.go @@ -1,8 +1,10 @@ package types import ( - sdkmath "cosmossdk.io/math" "fmt" + + sdkmath "cosmossdk.io/math" + elystypes "github.com/elys-network/elys/types" ) // Pow computes base^(exp) @@ -37,3 +39,7 @@ func Pow(base sdkmath.LegacyDec, exp sdkmath.LegacyDec) sdkmath.LegacyDec { return integerPow.Mul(fractionalPow) } + +func PowDec34(base elystypes.Dec34, exp elystypes.Dec34) elystypes.Dec34 { + return elystypes.NewDec34FromLegacyDec(Pow(base.ToLegacyDec(), exp.ToLegacyDec())) +} diff --git a/x/amm/types/query.pb.go b/x/amm/types/query.pb.go index b3e8b7446..94ecdabc2 100644 --- a/x/amm/types/query.pb.go +++ b/x/amm/types/query.pb.go @@ -606,10 +606,10 @@ func (m *QueryJoinPoolEstimationRequest) GetAmountsIn() []types.Coin { } type QueryJoinPoolEstimationResponse struct { - ShareAmountOut types.Coin `protobuf:"bytes,1,opt,name=share_amount_out,json=shareAmountOut,proto3" json:"share_amount_out"` - AmountsIn []types.Coin `protobuf:"bytes,2,rep,name=amounts_in,json=amountsIn,proto3" json:"amounts_in"` - Slippage cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=slippage,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"slippage"` - WeightBalanceRatio cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=weight_balance_ratio,json=weightBalanceRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"weight_balance_ratio"` + ShareAmountOut types.Coin `protobuf:"bytes,1,opt,name=share_amount_out,json=shareAmountOut,proto3" json:"share_amount_out"` + AmountsIn []types.Coin `protobuf:"bytes,2,rep,name=amounts_in,json=amountsIn,proto3" json:"amounts_in"` + Slippage string `protobuf:"bytes,3,opt,name=slippage,proto3" json:"slippage,omitempty"` + WeightBalanceRatio string `protobuf:"bytes,4,opt,name=weight_balance_ratio,json=weightBalanceRatio,proto3" json:"weight_balance_ratio,omitempty"` } func (m *QueryJoinPoolEstimationResponse) Reset() { *m = QueryJoinPoolEstimationResponse{} } @@ -659,6 +659,20 @@ func (m *QueryJoinPoolEstimationResponse) GetAmountsIn() []types.Coin { return nil } +func (m *QueryJoinPoolEstimationResponse) GetSlippage() string { + if m != nil { + return m.Slippage + } + return "" +} + +func (m *QueryJoinPoolEstimationResponse) GetWeightBalanceRatio() string { + if m != nil { + return m.WeightBalanceRatio + } + return "" +} + type QueryExitPoolEstimationRequest struct { PoolId uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"` ShareAmountIn cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=share_amount_in,json=shareAmountIn,proto3,customtype=cosmossdk.io/math.Int" json:"share_amount_in"` @@ -757,13 +771,13 @@ func (m *QueryExitPoolEstimationResponse) GetAmountsOut() []types.Coin { } type QuerySwapEstimationResponse struct { - SpotPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=spot_price,json=spotPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"spot_price"` + SpotPrice string `protobuf:"bytes,1,opt,name=spot_price,json=spotPrice,proto3" json:"spot_price,omitempty"` TokenOut types.Coin `protobuf:"bytes,2,opt,name=token_out,json=tokenOut,proto3" json:"token_out"` SwapFee cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=swap_fee,json=swapFee,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"swap_fee"` Discount cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=discount,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"discount"` AvailableLiquidity types.Coin `protobuf:"bytes,5,opt,name=available_liquidity,json=availableLiquidity,proto3" json:"available_liquidity"` - Slippage cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=slippage,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"slippage"` - WeightBalanceRatio cosmossdk_io_math.LegacyDec `protobuf:"bytes,7,opt,name=weight_balance_ratio,json=weightBalanceRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"weight_balance_ratio"` + Slippage string `protobuf:"bytes,6,opt,name=slippage,proto3" json:"slippage,omitempty"` + WeightBalanceRatio string `protobuf:"bytes,7,opt,name=weight_balance_ratio,json=weightBalanceRatio,proto3" json:"weight_balance_ratio,omitempty"` } func (m *QuerySwapEstimationResponse) Reset() { *m = QuerySwapEstimationResponse{} } @@ -799,6 +813,13 @@ func (m *QuerySwapEstimationResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QuerySwapEstimationResponse proto.InternalMessageInfo +func (m *QuerySwapEstimationResponse) GetSpotPrice() string { + if m != nil { + return m.SpotPrice + } + return "" +} + func (m *QuerySwapEstimationResponse) GetTokenOut() types.Coin { if m != nil { return m.TokenOut @@ -813,6 +834,20 @@ func (m *QuerySwapEstimationResponse) GetAvailableLiquidity() types.Coin { return types.Coin{} } +func (m *QuerySwapEstimationResponse) GetSlippage() string { + if m != nil { + return m.Slippage + } + return "" +} + +func (m *QuerySwapEstimationResponse) GetWeightBalanceRatio() string { + if m != nil { + return m.WeightBalanceRatio + } + return "" +} + type QuerySlippageTrackRequest struct { PoolId uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"` } @@ -1340,14 +1375,14 @@ func (m *QuerySwapEstimationByDenomRequest) GetAddress() string { type QuerySwapEstimationByDenomResponse struct { InRoute []*SwapAmountInRoute `protobuf:"bytes,1,rep,name=in_route,json=inRoute,proto3" json:"in_route,omitempty"` OutRoute []*SwapAmountOutRoute `protobuf:"bytes,2,rep,name=out_route,json=outRoute,proto3" json:"out_route,omitempty"` - SpotPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=spot_price,json=spotPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"spot_price"` + SpotPrice string `protobuf:"bytes,3,opt,name=spot_price,json=spotPrice,proto3" json:"spot_price,omitempty"` Amount types.Coin `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount"` SwapFee cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=swap_fee,json=swapFee,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"swap_fee"` Discount cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=discount,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"discount"` AvailableLiquidity types.Coin `protobuf:"bytes,7,opt,name=available_liquidity,json=availableLiquidity,proto3" json:"available_liquidity"` - WeightBalanceRatio cosmossdk_io_math.LegacyDec `protobuf:"bytes,8,opt,name=weight_balance_ratio,json=weightBalanceRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"weight_balance_ratio"` - Slippage cosmossdk_io_math.LegacyDec `protobuf:"bytes,9,opt,name=slippage,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"slippage"` - PriceImpact cosmossdk_io_math.LegacyDec `protobuf:"bytes,10,opt,name=price_impact,json=priceImpact,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"price_impact"` + WeightBalanceRatio string `protobuf:"bytes,8,opt,name=weight_balance_ratio,json=weightBalanceRatio,proto3" json:"weight_balance_ratio,omitempty"` + Slippage string `protobuf:"bytes,9,opt,name=slippage,proto3" json:"slippage,omitempty"` + PriceImpact string `protobuf:"bytes,10,opt,name=price_impact,json=priceImpact,proto3" json:"price_impact,omitempty"` } func (m *QuerySwapEstimationByDenomResponse) Reset() { *m = QuerySwapEstimationByDenomResponse{} } @@ -1397,6 +1432,13 @@ func (m *QuerySwapEstimationByDenomResponse) GetOutRoute() []*SwapAmountOutRoute return nil } +func (m *QuerySwapEstimationByDenomResponse) GetSpotPrice() string { + if m != nil { + return m.SpotPrice + } + return "" +} + func (m *QuerySwapEstimationByDenomResponse) GetAmount() types.Coin { if m != nil { return m.Amount @@ -1411,6 +1453,27 @@ func (m *QuerySwapEstimationByDenomResponse) GetAvailableLiquidity() types.Coin return types.Coin{} } +func (m *QuerySwapEstimationByDenomResponse) GetWeightBalanceRatio() string { + if m != nil { + return m.WeightBalanceRatio + } + return "" +} + +func (m *QuerySwapEstimationByDenomResponse) GetSlippage() string { + if m != nil { + return m.Slippage + } + return "" +} + +func (m *QuerySwapEstimationByDenomResponse) GetPriceImpact() string { + if m != nil { + return m.PriceImpact + } + return "" +} + type QueryAMMPriceRequest struct { TokenIn types.Coin `protobuf:"bytes,1,opt,name=token_in,json=tokenIn,proto3" json:"token_in"` Discount cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=discount,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"discount"` @@ -1491,118 +1554,118 @@ func init() { func init() { proto.RegisterFile("elys/amm/query.proto", fileDescriptor_763da04a7298bbac) } var fileDescriptor_763da04a7298bbac = []byte{ - // 1773 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x59, 0xdd, 0x6f, 0x13, 0x57, - 0x16, 0xcf, 0x38, 0x8e, 0x3f, 0x4e, 0x96, 0x24, 0x7b, 0x09, 0x22, 0x71, 0x88, 0xb3, 0x0c, 0x90, - 0x64, 0x97, 0x8d, 0x4d, 0x60, 0x17, 0x76, 0x57, 0x2c, 0x10, 0x2f, 0x21, 0xeb, 0x15, 0x28, 0xc1, - 0xb0, 0x0f, 0x6d, 0x55, 0x4d, 0x27, 0xf6, 0xc5, 0x99, 0x66, 0x3c, 0xd7, 0x78, 0xc6, 0x24, 0x16, - 0x4a, 0x1f, 0x78, 0xaf, 0x54, 0x09, 0xa9, 0xaa, 0x84, 0x54, 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 0xba, 0xb0, 0xec, 0x12, 0xfc, - 0xf2, 0x72, 0x6e, 0x46, 0x88, 0xb0, 0x2b, 0xdb, 0x39, 0x83, 0xe5, 0x6b, 0xba, 0xb3, 0x95, 0xbb, - 0x4d, 0xab, 0x7a, 0xb9, 0x75, 0x93, 0x96, 0x7f, 0xfc, 0x6e, 0x09, 0x50, 0xc3, 0x4d, 0x5a, 0x2e, - 0xb5, 0x45, 0xa8, 0x2d, 0x0c, 0xc9, 0xff, 0x98, 0x61, 0xf1, 0x33, 0x11, 0xb2, 0x30, 0xaa, 0x08, - 0x91, 0x6b, 0x00, 0x3a, 0x37, 0xcf, 0x16, 0x76, 0x0c, 0xf7, 0x63, 0x47, 0x1a, 0x59, 0x8a, 0x96, - 0xfa, 0x2a, 0x06, 0x73, 0x91, 0xba, 0x31, 0x1f, 0x8a, 0x30, 0x61, 0x6f, 0xe9, 0x0d, 0xaa, 0x09, - 0x36, 0x8d, 0x35, 0x1d, 0x4c, 0xc0, 0x9e, 0x9a, 0xc6, 0x38, 0xa3, 0x08, 0xc0, 0x7a, 0xd3, 0x19, - 0x14, 0xae, 0xeb, 0x78, 0xdb, 0x34, 0xea, 0x75, 0xbd, 0x4a, 0x07, 0x70, 0xbc, 0x27, 0x82, 0x94, - 0x61, 0x72, 0x87, 0x1a, 0xd5, 0x2d, 0x47, 0xdb, 0xd4, 0x4d, 0xdd, 0x2a, 0x53, 0xad, 0xe1, 0x9a, - 0x3e, 0x15, 0x3f, 0xac, 0x68, 0x22, 0xc4, 0x15, 0x84, 0xb4, 0x92, 0x2b, 0x4c, 0xfd, 0xde, 0x3b, - 0x71, 0xab, 0xbb, 0x86, 0x73, 0xc0, 0xf0, 0xde, 0x83, 0x71, 0xc9, 0xf5, 0x98, 0xab, 0xe9, 0xc2, - 0x79, 0xc4, 0x76, 0x22, 0x8c, 0xad, 0x68, 0x39, 0x3e, 0x54, 0x45, 0xcb, 0x29, 0x1d, 0xf3, 0x45, - 0xa1, 0x68, 0x91,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0x33, 0xf3, 0x8f, 0x71, 0x8a, 0xd8, 0x23, 0x35, 0x48, 0xba, 0xec, 0x2b, 0x66, 0x58, - 0xb1, 0xfc, 0x34, 0x13, 0x52, 0x1c, 0x78, 0x59, 0x51, 0xcf, 0x70, 0xc5, 0xb3, 0x64, 0x66, 0x1f, - 0xc5, 0xe4, 0x99, 0x02, 0x63, 0xf2, 0xed, 0x9b, 0x2c, 0x84, 0x0d, 0xea, 0xfa, 0x88, 0x90, 0x59, - 0xec, 0x4d, 0x88, 0x50, 0x2e, 0x73, 0x28, 0x17, 0x48, 0x2e, 0x02, 0x4a, 0xe0, 0x81, 0x20, 0xff, - 0x98, 0x2f, 0xec, 0x91, 0x4f, 0x15, 0xf8, 0xa3, 0x2c, 0xd2, 0xf5, 0xcb, 0x42, 0xd8, 0xf0, 0xfe, - 0x00, 0x46, 0x3e, 0x52, 0xa8, 0x39, 0x0e, 0x70, 0x91, 0xcc, 0xf7, 0x07, 0x90, 0x7c, 0xac, 0xc0, - 0x98, 0xdc, 0x50, 0xc8, 0xd9, 0x80, 0xb2, 0xae, 0x8f, 0x0b, 0x99, 0x73, 0x3d, 0xa8, 0xfa, 0xc4, - 0xc3, 0xab, 0x35, 0xed, 0x28, 0xff, 0x5c, 0x01, 0x12, 0xbe, 0x73, 0x93, 0xa0, 0x03, 0x22, 0x9f, - 0x04, 0x32, 0x7f, 0xee, 0x83, 0x12, 0xb1, 0x5d, 0xe2, 0xd8, 0x96, 0xc8, 0xf9, 0x08, 0x6c, 0x1f, - 0x32, 0xc3, 0xd2, 0x78, 0x3e, 0x07, 0x00, 0x86, 0x6f, 0x7e, 0x21, 0x80, 0x91, 0x97, 0xda, 0x10, - 0xc0, 0xe8, 0x6b, 0x64, 0x4f, 0x80, 0x74, 0xd7, 0x70, 0x42, 0x00, 0x9f, 0x2a, 0x70, 0x4c, 0x9a, - 0x78, 0xc9, 0x99, 0x60, 0xa8, 0xba, 0x5c, 0x00, 0x32, 0x67, 0xf7, 0x27,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5e, 0x67, 0x95, 0x57, 0xaf, 0xb3, 0xca, 0x27, 0x6f, 0xb2, 0x43, 0x2f, 0xde, 0x64, - 0x87, 0x7e, 0x7e, 0x93, 0x1d, 0x7a, 0x77, 0xb1, 0x6a, 0x38, 0x5b, 0xcd, 0xcd, 0x5c, 0x99, 0xd5, - 0xba, 0x08, 0xdd, 0xe5, 0x62, 0x9d, 0x56, 0x9d, 0xda, 0x9b, 0x09, 0xfe, 0x67, 0xd0, 0xa5, 0xdf, - 0x03, 0x00, 0x00, 0xff, 0xff, 0x55, 0xdf, 0xc6, 0x49, 0x67, 0x1b, 0x00, 0x00, + // 1764 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x59, 0x5f, 0x6f, 0x13, 0xd9, + 0x15, 0xcf, 0x38, 0x8e, 0xff, 0x9c, 0x94, 0x24, 0xbd, 0x04, 0x91, 0x38, 0xc4, 0x29, 0x03, 0x24, + 0x69, 0x69, 0x6c, 0x02, 0x2d, 0xb4, 0x15, 0x05, 0xe2, 0x12, 0x52, 0x57, 0xa0, 0x04, 0x43, 0x1f, + 0xda, 0xaa, 0x9a, 0x4e, 0xec, 0x8b, 0x33, 0xcd, 0x78, 0xae, 0xf1, 0x8c, 0x49, 0x2c, 0x94, 0x3e, + 0xf0, 0x5e, 0xa9, 0x12, 0x52, 0x55, 0xa9, 0x52, 0xa5, 0xbe, 0xf4, 0xa1, 0x2b, 0xed, 0xc3, 0x6a, + 0xb5, 0xfb, 0x15, 0xd8, 0xa7, 0x45, 0xbb, 0x2f, 0xab, 0xd5, 0x0a, 0xad, 0x60, 0x3f, 0xc5, 0x3e, + 0xad, 0xe6, 0xde, 0x33, 0xe3, 0xb9, 0x33, 0x9e, 0x78, 0x42, 0xd8, 0x37, 0xcf, 0xbd, 0xe7, 0xcf, + 0xef, 0x77, 0xce, 0xb9, 0xe7, 0x9e, 0x9b, 0xc0, 0x34, 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 0xa5, 0x18, 0x28, 0xa1, 0x57, 0x65, 0xf9, 0x29, 0x5f, 0x38, 0x20, 0xff, 0x54, 0xe0, 0x87, + 0xb2, 0x49, 0x37, 0x2e, 0x4b, 0x51, 0xe2, 0xc9, 0x00, 0xc6, 0xbe, 0x6c, 0xd5, 0x12, 0x07, 0xb8, + 0x4c, 0x16, 0x93, 0x01, 0x24, 0x7f, 0x57, 0x60, 0x42, 0x6e, 0xc2, 0xe4, 0x7c, 0xc8, 0xd9, 0xc0, + 0x17, 0x69, 0xe1, 0xc2, 0x10, 0xa9, 0x84, 0x78, 0x78, 0x53, 0xa4, 0x7d, 0xe7, 0xff, 0x51, 0x80, + 0x44, 0x1f, 0x6a, 0x24, 0x1c, 0x80, 0xd8, 0x77, 0x64, 0xe1, 0xc7, 0x09, 0x24, 0x11, 0xdb, 0x15, + 0x8e, 0x6d, 0x85, 0x5c, 0x8c, 0xc1, 0xf6, 0x57, 0x66, 0x58, 0x1a, 0xaf, 0xe7, 0x10, 0xc0, 0xe8, + 0xa3, 0x24, 0x02, 0x30, 0xf6, 0xbd, 0x15, 0x01, 0x18, 0xff, 0xc2, 0x19, 0x0a, 0x90, 0xee, 0x1b, + 0x4e, 0x04, 0xe0, 0x73, 0x05, 0x4e, 0x48, 0x53, 0x22, 0x39, 0x17, 0x4e, 0xd5, 0x80, 0xa1, 0xb9, + 0x70, 0xfe, 0x70, 0x21, 0x44, 0x74, 0x8d, 0x23, 0x5a, 0x25, 0xe5, 0xb8, 0x74, 0xa2, 0x96, 0xc6, + 0x47, 0xd2, 0x40, 0x37, 0x78, 0xae, 0xc0, 0x54, 0x78, 0xf2, 0x25, 0x8b, 0x87, 0xf9, 0xec, 0x8f, + 0xce, 0x85, 0xa5, 0xa1, 0x72, 0x49, 0xab, 0x4d, 0x82, 0x67, 0x93, 0x67, 0x0a, 0x64, 0xf1, 0x16, + 0x8a, 0x34, 0x29, 0x79, 0x8a, 0x8e, 0x34, 0xa9, 0xd0, 0x74, 0xac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, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2112,6 +2175,7 @@ func _Query_SwapEstimationByDenom_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.amm.Query", HandlerType: (*QueryServer)(nil), @@ -2668,26 +2732,20 @@ func (m *QueryJoinPoolEstimationResponse) MarshalToSizedBuffer(dAtA []byte) (int _ = i var l int _ = l - { - size := m.WeightBalanceRatio.Size() - i -= size - if _, err := m.WeightBalanceRatio.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.WeightBalanceRatio) > 0 { + i -= len(m.WeightBalanceRatio) + copy(dAtA[i:], m.WeightBalanceRatio) + i = encodeVarintQuery(dAtA, i, uint64(len(m.WeightBalanceRatio))) + i-- + dAtA[i] = 0x22 } - i-- - dAtA[i] = 0x22 - { - size := m.Slippage.Size() - i -= size - if _, err := m.Slippage.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.Slippage) > 0 { + i -= len(m.Slippage) + copy(dAtA[i:], m.Slippage) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Slippage))) + i-- + dAtA[i] = 0x1a } - i-- - dAtA[i] = 0x1a if len(m.AmountsIn) > 0 { for iNdEx := len(m.AmountsIn) - 1; iNdEx >= 0; iNdEx-- { { @@ -2817,26 +2875,20 @@ func (m *QuerySwapEstimationResponse) MarshalToSizedBuffer(dAtA []byte) (int, er _ = i var l int _ = l - { - size := m.WeightBalanceRatio.Size() - i -= size - if _, err := m.WeightBalanceRatio.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.WeightBalanceRatio) > 0 { + i -= len(m.WeightBalanceRatio) + copy(dAtA[i:], m.WeightBalanceRatio) + i = encodeVarintQuery(dAtA, i, uint64(len(m.WeightBalanceRatio))) + i-- + dAtA[i] = 0x3a } - i-- - dAtA[i] = 0x3a - { - size := m.Slippage.Size() - i -= size - if _, err := m.Slippage.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.Slippage) > 0 { + i -= len(m.Slippage) + copy(dAtA[i:], m.Slippage) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Slippage))) + i-- + dAtA[i] = 0x32 } - i-- - dAtA[i] = 0x32 { size, err := m.AvailableLiquidity.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -2877,16 +2929,13 @@ func (m *QuerySwapEstimationResponse) MarshalToSizedBuffer(dAtA []byte) (int, er } i-- dAtA[i] = 0x12 - { - size := m.SpotPrice.Size() - i -= size - if _, err := m.SpotPrice.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.SpotPrice) > 0 { + i -= len(m.SpotPrice) + copy(dAtA[i:], m.SpotPrice) + i = encodeVarintQuery(dAtA, i, uint64(len(m.SpotPrice))) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -3303,36 +3352,27 @@ func (m *QuerySwapEstimationByDenomResponse) MarshalToSizedBuffer(dAtA []byte) ( _ = i var l int _ = l - { - size := m.PriceImpact.Size() - i -= size - if _, err := m.PriceImpact.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.PriceImpact) > 0 { + i -= len(m.PriceImpact) + copy(dAtA[i:], m.PriceImpact) + i = encodeVarintQuery(dAtA, i, uint64(len(m.PriceImpact))) + i-- + dAtA[i] = 0x52 } - i-- - dAtA[i] = 0x52 - { - size := m.Slippage.Size() - i -= size - if _, err := m.Slippage.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.Slippage) > 0 { + i -= len(m.Slippage) + copy(dAtA[i:], m.Slippage) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Slippage))) + i-- + dAtA[i] = 0x4a } - i-- - dAtA[i] = 0x4a - { - size := m.WeightBalanceRatio.Size() - i -= size - if _, err := m.WeightBalanceRatio.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.WeightBalanceRatio) > 0 { + i -= len(m.WeightBalanceRatio) + copy(dAtA[i:], m.WeightBalanceRatio) + i = encodeVarintQuery(dAtA, i, uint64(len(m.WeightBalanceRatio))) + i-- + dAtA[i] = 0x42 } - i-- - dAtA[i] = 0x42 { size, err := m.AvailableLiquidity.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -3373,16 +3413,13 @@ func (m *QuerySwapEstimationByDenomResponse) MarshalToSizedBuffer(dAtA []byte) ( } i-- dAtA[i] = 0x22 - { - size := m.SpotPrice.Size() - i -= size - if _, err := m.SpotPrice.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.SpotPrice) > 0 { + i -= len(m.SpotPrice) + copy(dAtA[i:], m.SpotPrice) + i = encodeVarintQuery(dAtA, i, uint64(len(m.SpotPrice))) + i-- + dAtA[i] = 0x1a } - i-- - dAtA[i] = 0x1a if len(m.OutRoute) > 0 { for iNdEx := len(m.OutRoute) - 1; iNdEx >= 0; iNdEx-- { { @@ -3658,10 +3695,14 @@ func (m *QueryJoinPoolEstimationResponse) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) } } - l = m.Slippage.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.WeightBalanceRatio.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.Slippage) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.WeightBalanceRatio) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -3704,8 +3745,10 @@ func (m *QuerySwapEstimationResponse) Size() (n int) { } var l int _ = l - l = m.SpotPrice.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.SpotPrice) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } l = m.TokenOut.Size() n += 1 + l + sovQuery(uint64(l)) l = m.SwapFee.Size() @@ -3714,10 +3757,14 @@ func (m *QuerySwapEstimationResponse) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) l = m.AvailableLiquidity.Size() n += 1 + l + sovQuery(uint64(l)) - l = m.Slippage.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.WeightBalanceRatio.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.Slippage) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.WeightBalanceRatio) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -3901,8 +3948,10 @@ func (m *QuerySwapEstimationByDenomResponse) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) } } - l = m.SpotPrice.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.SpotPrice) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } l = m.Amount.Size() n += 1 + l + sovQuery(uint64(l)) l = m.SwapFee.Size() @@ -3911,12 +3960,18 @@ func (m *QuerySwapEstimationByDenomResponse) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) l = m.AvailableLiquidity.Size() n += 1 + l + sovQuery(uint64(l)) - l = m.WeightBalanceRatio.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.Slippage.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.PriceImpact.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.WeightBalanceRatio) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Slippage) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.PriceImpact) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -5248,9 +5303,7 @@ func (m *QueryJoinPoolEstimationResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Slippage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Slippage = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { @@ -5282,9 +5335,7 @@ func (m *QueryJoinPoolEstimationResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.WeightBalanceRatio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.WeightBalanceRatio = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -5585,9 +5636,7 @@ func (m *QuerySwapEstimationResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.SpotPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.SpotPrice = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -5753,9 +5802,7 @@ func (m *QuerySwapEstimationResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Slippage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Slippage = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 7: if wireType != 2 { @@ -5787,9 +5834,7 @@ func (m *QuerySwapEstimationResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.WeightBalanceRatio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.WeightBalanceRatio = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -6997,9 +7042,7 @@ func (m *QuerySwapEstimationByDenomResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.SpotPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.SpotPrice = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { @@ -7165,9 +7208,7 @@ func (m *QuerySwapEstimationByDenomResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.WeightBalanceRatio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.WeightBalanceRatio = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 9: if wireType != 2 { @@ -7199,9 +7240,7 @@ func (m *QuerySwapEstimationByDenomResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Slippage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Slippage = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 10: if wireType != 2 { @@ -7233,9 +7272,7 @@ func (m *QuerySwapEstimationByDenomResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.PriceImpact.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.PriceImpact = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/amm/types/solve_constant_function_invariant.go b/x/amm/types/solve_constant_function_invariant.go index b8e277a90..29b8bd9ec 100644 --- a/x/amm/types/solve_constant_function_invariant.go +++ b/x/amm/types/solve_constant_function_invariant.go @@ -2,6 +2,7 @@ package types import ( sdkmath "cosmossdk.io/math" + elystypes "github.com/elys-network/elys/types" ) // solveConstantFunctionInvariant solves the constant function of an AMM @@ -19,11 +20,11 @@ func solveConstantFunctionInvariant( tokenBalanceFixedAfter, tokenWeightFixed, tokenBalanceUnknownBefore, - tokenWeightUnknown sdkmath.LegacyDec, -) (sdkmath.LegacyDec, error) { + tokenWeightUnknown elystypes.Dec34, +) (elystypes.Dec34, error) { // Ensure tokenWeightUnknown is not zero to avoid division by zero if tokenWeightUnknown.IsZero() { - return sdkmath.LegacyZeroDec(), ErrAmountTooLow + return elystypes.ZeroDec34(), ErrAmountTooLow } // weightRatio = (weightX/weightY) @@ -31,15 +32,15 @@ func solveConstantFunctionInvariant( // Ensure tokenBalanceFixedAfter is not zero to avoid division by zero if tokenBalanceFixedAfter.IsZero() || tokenBalanceFixedAfter.IsNegative() { - return sdkmath.LegacyZeroDec(), ErrAmountTooLow + return elystypes.ZeroDec34(), ErrAmountTooLow } // y = balanceXBefore/balanceXAfter y := tokenBalanceFixedBefore.Quo(tokenBalanceFixedAfter) // amountY = balanceY * (1 - (y ^ weightRatio)) - yToWeightRatio := Pow(y, weightRatio) - paranthetical := sdkmath.LegacyOneDec().Sub(yToWeightRatio) + yToWeightRatio := PowDec34(y, weightRatio) + paranthetical := elystypes.OneDec34().Sub(yToWeightRatio) amountY := tokenBalanceUnknownBefore.Mul(paranthetical) return amountY, nil } @@ -57,8 +58,8 @@ func CalculateTokenARate(tokenBalanceA, tokenWeightA, tokenBalanceB, tokenWeight // feeRatio returns the fee ratio that is defined as follows: // 1 - ((1 - normalizedTokenWeightOut) * spreadFactor) -func feeRatio(normalizedWeight, spreadFactor sdkmath.LegacyDec) sdkmath.LegacyDec { - return sdkmath.LegacyOneDec().Sub((sdkmath.LegacyOneDec().Sub(normalizedWeight)).Mul(spreadFactor)) +func feeRatio(normalizedWeight, spreadFactor elystypes.Dec34) elystypes.Dec34 { + return elystypes.OneDec34().Sub((elystypes.OneDec34().Sub(normalizedWeight)).Mul(spreadFactor)) } // balancer notation: pAo - pool shares amount out, given single asset in @@ -68,8 +69,8 @@ func calcPoolSharesOutGivenSingleAssetIn( normalizedTokenWeightIn, poolShares, tokenAmountIn, - spreadFactor sdkmath.LegacyDec, -) (sdkmath.LegacyDec, error) { + spreadFactor elystypes.Dec34, +) (elystypes.Dec34, error) { // deduct spread factor on the in asset. // We don't charge spread factor on the token amount that we imagine as unswapped (the normalized weight). // So effective_swapfee = spread factor * (1 - normalized_token_weight) @@ -89,9 +90,9 @@ func calcPoolSharesOutGivenSingleAssetIn( tokenBalanceIn, normalizedTokenWeightIn, poolShares, - sdkmath.LegacyOneDec()) + elystypes.OneDec34()) if err != nil { - return sdkmath.LegacyDec{}, err + return elystypes.ZeroDec34(), err } poolAmountOut = poolAmountOut.Neg() return poolAmountOut, nil diff --git a/x/amm/types/swap_in_amt_given_out.go b/x/amm/types/swap_in_amt_given_out.go index 15a6f3534..7c997a57e 100644 --- a/x/amm/types/swap_in_amt_given_out.go +++ b/x/amm/types/swap_in_amt_given_out.go @@ -5,6 +5,7 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" ) func (p Pool) CalcGivenOutSlippage( @@ -14,33 +15,33 @@ func (p Pool) CalcGivenOutSlippage( tokensOut sdk.Coins, tokenInDenom string, accPoolKeeper AccountedPoolKeeper, -) (sdkmath.LegacyDec, error) { +) (elystypes.Dec34, error) { balancerInCoin, _, err := p.CalcInAmtGivenOut(ctx, oracleKeeper, snapshot, tokensOut, tokenInDenom, sdkmath.LegacyZeroDec(), accPoolKeeper) if err != nil { - return sdkmath.LegacyZeroDec(), err + return elystypes.ZeroDec34(), err } tokenOut, poolAssetOut, poolAssetIn, err := p.parsePoolAssets(tokensOut, tokenInDenom) if err != nil { - return sdkmath.LegacyZeroDec(), err + return elystypes.ZeroDec34(), err } // ensure token prices for in/out tokens set properly inTokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenInDenom) if inTokenPrice.IsZero() { - return sdkmath.LegacyZeroDec(), fmt.Errorf("price for inToken not set: %s", poolAssetIn.Token.Denom) + return elystypes.ZeroDec34(), fmt.Errorf("price for inToken not set: %s", poolAssetIn.Token.Denom) } outTokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenOut.Denom) if outTokenPrice.IsZero() { - return sdkmath.LegacyZeroDec(), fmt.Errorf("price for outToken not set: %s", poolAssetOut.Token.Denom) + return elystypes.ZeroDec34(), fmt.Errorf("price for outToken not set: %s", poolAssetOut.Token.Denom) } // in amount is calculated in this formula - oracleInAmount := sdkmath.LegacyNewDecFromInt(tokenOut.Amount).Mul(outTokenPrice).Quo(inTokenPrice) - balancerIn := sdkmath.LegacyNewDecFromInt(balancerInCoin.Amount) + oracleInAmount := elystypes.NewDec34FromInt(tokenOut.Amount).Mul(outTokenPrice).Quo(inTokenPrice) + balancerIn := elystypes.NewDec34FromInt(balancerInCoin.Amount) balancerSlippage := balancerIn.Sub(oracleInAmount) if balancerSlippage.IsNegative() { - return sdkmath.LegacyZeroDec(), nil + return elystypes.ZeroDec34(), nil } return balancerSlippage, nil } @@ -51,7 +52,7 @@ func (p Pool) CalcGivenOutSlippage( func (p *Pool) SwapInAmtGivenOut( ctx sdk.Context, oracleKeeper OracleKeeper, snapshot *Pool, tokensOut sdk.Coins, tokenInDenom string, swapFee sdkmath.LegacyDec, accPoolKeeper AccountedPoolKeeper, weightBreakingFeePerpetualFactor sdkmath.LegacyDec, params Params) ( - tokenIn sdk.Coin, slippage, slippageAmount sdkmath.LegacyDec, weightBalanceBonus sdkmath.LegacyDec, oracleInAmount sdkmath.LegacyDec, swapFeeFinal sdkmath.LegacyDec, err error, + tokenIn sdk.Coin, slippage, slippageAmount elystypes.Dec34, weightBalanceBonus elystypes.Dec34, oracleInAmount elystypes.Dec34, swapFeeFinal sdkmath.LegacyDec, err error, ) { // Fixed gas consumption per swap to prevent spam ctx.GasMeter().ConsumeGas(BalancerGasFeeForSwap, "balancer swap computation") @@ -60,24 +61,24 @@ func (p *Pool) SwapInAmtGivenOut( if !p.PoolParams.UseOracle { balancerInCoin, slippage, err := p.CalcInAmtGivenOut(ctx, oracleKeeper, snapshot, tokensOut, tokenInDenom, swapFee, accPoolKeeper) if err != nil { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err + return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), err } - return balancerInCoin, slippage, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), swapFee, nil + return balancerInCoin, slippage, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), swapFee, nil } tokenOut, poolAssetOut, poolAssetIn, err := p.parsePoolAssets(tokensOut, tokenInDenom) if err != nil { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err + return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), err } // ensure token prices for in/out tokens set properly inTokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenInDenom) if inTokenPrice.IsZero() { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), fmt.Errorf("price for inToken not set: %s", poolAssetIn.Token.Denom) + return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), fmt.Errorf("price for inToken not set: %s", poolAssetIn.Token.Denom) } outTokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenOut.Denom) if outTokenPrice.IsZero() { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), fmt.Errorf("price for outToken not set: %s", poolAssetOut.Token.Denom) + return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), fmt.Errorf("price for outToken not set: %s", poolAssetOut.Token.Denom) } accountedAssets := p.GetAccountedBalance(ctx, accPoolKeeper, p.PoolAssets) @@ -87,15 +88,16 @@ func (p *Pool) SwapInAmtGivenOut( // balancer slippage amount = Max(oracleOutAmount-balancerOutAmount, 0) // resizedAmount = tokenIn / externalLiquidityRatio // actualSlippageAmount = balancer slippage(resizedAmount) - oracleInAmount = sdkmath.LegacyNewDecFromInt(tokenOut.Amount).Mul(outTokenPrice).Quo(inTokenPrice) + oracleInAmount = elystypes.NewDec34FromInt(tokenOut.Amount).Mul(outTokenPrice).Quo(inTokenPrice) externalLiquidityRatio, err := p.GetAssetExternalLiquidityRatio(tokenOut.Denom) if err != nil { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err + return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), err } + externalLiquidityRatioDec34 := elystypes.NewDec34FromLegacyDec(externalLiquidityRatio) // Ensure externalLiquidityRatio is not zero to avoid division by zero - if externalLiquidityRatio.IsZero() { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), ErrAmountTooLow + if externalLiquidityRatioDec34.IsZero() { + return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), ErrAmountTooLow } resizedAmount := sdkmath.LegacyNewDecFromInt(tokenOut.Amount).Quo(externalLiquidityRatio).RoundInt() @@ -108,19 +110,19 @@ func (p *Pool) SwapInAmtGivenOut( accPoolKeeper, ) if err != nil { - return sdk.Coin{}, sdkmath.LegacyOneDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err + return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), err } - inAmountAfterSlippage := oracleInAmount.Add(slippageAmount.Mul(externalLiquidityRatio)) - slippageAmount = slippageAmount.Mul(externalLiquidityRatio) + inAmountAfterSlippage := oracleInAmount.Add(slippageAmount.Mul(externalLiquidityRatioDec34)) + slippageAmount = slippageAmount.Mul(externalLiquidityRatioDec34) slippage = slippageAmount.Quo(oracleInAmount) // calculate weight distance difference to calculate bonus/cut on the operation newAssetPools, err := p.NewPoolAssetsAfterSwap(ctx, - sdk.Coins{sdk.NewCoin(tokenInDenom, inAmountAfterSlippage.TruncateInt())}, + sdk.Coins{sdk.NewCoin(tokenInDenom, inAmountAfterSlippage.ToInt())}, tokensOut, accountedAssets, ) if err != nil { - return sdk.Coin{}, sdkmath.LegacyOneDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err + return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), err } weightDistance := p.WeightDistanceFromTarget(ctx, oracleKeeper, newAssetPools) distanceDiff := weightDistance.Sub(initialWeightDistance) @@ -142,41 +144,43 @@ func (p *Pool) SwapInAmtGivenOut( weightBreakingFee := GetWeightBreakingFee(finalWeightIn, finalWeightOut, targetWeightIn, targetWeightOut, initialWeightIn, initialWeightOut, distanceDiff, params) // weightBreakingFeePerpetualFactor is 1 if not send by perpetual - weightBreakingFee = weightBreakingFee.Mul(weightBreakingFeePerpetualFactor) + weightBreakingFee = weightBreakingFee.Mul(elystypes.NewDec34FromLegacyDec(weightBreakingFeePerpetualFactor)) // weight recovery reward = weight breaking fee * weight breaking fee portion - weightRecoveryReward := weightBreakingFee.Mul(params.WeightBreakingFeePortion) + weightRecoveryReward := weightBreakingFee.Mul(elystypes.NewDec34FromLegacyDec(params.WeightBreakingFeePortion)) // bonus is valid when distance is lower than original distance and when threshold weight reached weightBalanceBonus = weightBreakingFee.Neg() // If swap is improving weight, set weight breaking fee to zero if distanceDiff.IsNegative() { - weightBreakingFee = sdkmath.LegacyZeroDec() - weightBalanceBonus = sdkmath.LegacyZeroDec() + weightBreakingFee = elystypes.ZeroDec34() + weightBalanceBonus = elystypes.ZeroDec34() // set weight breaking fee to zero if bonus is applied - if initialWeightDistance.GT(params.ThresholdWeightDifference) { + if initialWeightDistance.GT(elystypes.NewDec34FromLegacyDec(params.ThresholdWeightDifference)) { weightBalanceBonus = weightRecoveryReward } - if initialWeightDistance.GT(params.ThresholdWeightDifferenceSwapFee) { + if initialWeightDistance.GT(elystypes.NewDec34FromLegacyDec(params.ThresholdWeightDifferenceSwapFee)) { swapFee = sdkmath.LegacyZeroDec() } } if swapFee.GTE(sdkmath.LegacyOneDec()) { - return sdk.Coin{}, sdkmath.LegacyOneDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), ErrTooMuchSwapFee + return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), ErrTooMuchSwapFee } + swapFeeDec34 := elystypes.NewDec34FromLegacyDec(swapFee) + // We deduct a swap fee on the input asset. The swap happens by following the invariant curve on the input * (1 - swap fee) // and then the swap fee is added to the pool. // Thus in order to give X amount out, we solve the invariant for the invariant input. However invariant input = (1 - swapfee) * trade input. // Therefore we divide by (1 - swapfee) here tokenAmountInInt := inAmountAfterSlippage. - Quo(sdkmath.LegacyOneDec().Sub(weightBreakingFee)). - Quo(sdkmath.LegacyOneDec().Sub(swapFee)). - Ceil().TruncateInt() // We round up tokenInAmt, as this is whats charged for the swap, for the precise amount out. + Quo(elystypes.OneDec34().Sub(weightBreakingFee)). + Quo(elystypes.OneDec34().Sub(swapFeeDec34)). + ToInt() // We round up tokenInAmt, as this is whats charged for the swap, for the precise amount out. // Otherwise, the pool would under-charge by this rounding error. tokenIn = sdk.NewCoin(tokenInDenom, tokenAmountInInt) return tokenIn, slippage, slippageAmount, weightBalanceBonus, oracleInAmount, swapFee, nil diff --git a/x/amm/types/swap_out_amt_given_in.go b/x/amm/types/swap_out_amt_given_in.go index 7b61bf3f1..13decfaea 100644 --- a/x/amm/types/swap_out_amt_given_in.go +++ b/x/amm/types/swap_out_amt_given_in.go @@ -6,11 +6,12 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" ) type AssetWeight struct { Asset string - Weight sdkmath.LegacyDec + Weight elystypes.Dec34 } func NormalizedWeights(poolAssets []PoolAsset) (poolWeights []AssetWeight) { @@ -25,7 +26,7 @@ func NormalizedWeights(poolAssets []PoolAsset) (poolWeights []AssetWeight) { for _, asset := range poolAssets { poolWeights = append(poolWeights, AssetWeight{ Asset: asset.Token.Denom, - Weight: sdkmath.LegacyNewDecFromInt(asset.Weight).Quo(sdkmath.LegacyNewDecFromInt(totalWeight)), + Weight: elystypes.NewDec34FromInt(asset.Weight).Quo(elystypes.NewDec34FromInt(totalWeight)), }) } return poolWeights @@ -33,14 +34,14 @@ func NormalizedWeights(poolAssets []PoolAsset) (poolWeights []AssetWeight) { func GetOraclePoolNormalizedWeights(ctx sdk.Context, poolId uint64, oracleKeeper OracleKeeper, poolAssets []PoolAsset) ([]AssetWeight, error) { oraclePoolWeights := []AssetWeight{} - totalWeight := sdkmath.LegacyZeroDec() + totalWeight := elystypes.ZeroDec34() for _, asset := range poolAssets { tokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, asset.Token.Denom) if tokenPrice.IsZero() { return oraclePoolWeights, fmt.Errorf("price for token not set: %s", asset.Token.Denom) } amount := asset.Token.Amount - weight := amount.ToLegacyDec().Mul(tokenPrice) + weight := elystypes.NewDec34FromInt(amount).Mul(tokenPrice) oraclePoolWeights = append(oraclePoolWeights, AssetWeight{ Asset: asset.Token.Denom, Weight: weight, @@ -49,7 +50,7 @@ func GetOraclePoolNormalizedWeights(ctx sdk.Context, poolId uint64, oracleKeeper } if totalWeight.IsZero() { - totalWeight = sdkmath.LegacyOneDec() + totalWeight = elystypes.OneDec34() } for i, asset := range oraclePoolWeights { oraclePoolWeights[i].Weight = asset.Weight.Quo(totalWeight) @@ -89,46 +90,46 @@ func (p Pool) StackedRatioFromSnapshot(ctx sdk.Context, oracleKeeper OracleKeepe return stackedRatio } -func (p Pool) WeightDistanceFromTarget(ctx sdk.Context, oracleKeeper OracleKeeper, poolAssets []PoolAsset) sdkmath.LegacyDec { +func (p Pool) WeightDistanceFromTarget(ctx sdk.Context, oracleKeeper OracleKeeper, poolAssets []PoolAsset) elystypes.Dec34 { oracleWeights, err := GetOraclePoolNormalizedWeights(ctx, p.PoolId, oracleKeeper, poolAssets) if err != nil { - return sdkmath.LegacyZeroDec() + return elystypes.ZeroDec34() } targetWeights := NormalizedWeights(poolAssets) - distanceSum := sdkmath.LegacyZeroDec() + distanceSum := elystypes.ZeroDec34() for i := range poolAssets { distance := targetWeights[i].Weight.Sub(oracleWeights[i].Weight).Abs() distanceSum = distanceSum.Add(distance) } // Ensure len(p.PoolAssets) is not zero to avoid division by zero if len(p.PoolAssets) == 0 { - return sdkmath.LegacyZeroDec() + return elystypes.ZeroDec34() } - return distanceSum.Quo(sdkmath.LegacyNewDec(int64(len(p.PoolAssets)))) + return distanceSum.QuoInt64(int64(len(p.PoolAssets))) } -func GetDenomOracleAssetWeight(ctx sdk.Context, poolId uint64, oracleKeeper OracleKeeper, poolAssets []PoolAsset, denom string) sdkmath.LegacyDec { +func GetDenomOracleAssetWeight(ctx sdk.Context, poolId uint64, oracleKeeper OracleKeeper, poolAssets []PoolAsset, denom string) elystypes.Dec34 { oracleWeights, err := GetOraclePoolNormalizedWeights(ctx, poolId, oracleKeeper, poolAssets) if err != nil { - return sdkmath.LegacyZeroDec() + return elystypes.ZeroDec34() } for _, weight := range oracleWeights { if weight.Asset == denom { return weight.Weight } } - return sdkmath.LegacyZeroDec() + return elystypes.ZeroDec34() } -func GetDenomNormalizedWeight(poolAssets []PoolAsset, denom string) sdkmath.LegacyDec { +func GetDenomNormalizedWeight(poolAssets []PoolAsset, denom string) elystypes.Dec34 { targetWeights := NormalizedWeights(poolAssets) for _, weight := range targetWeights { if weight.Asset == denom { return weight.Weight } } - return sdkmath.LegacyZeroDec() + return elystypes.ZeroDec34() } func (p Pool) CalcGivenInSlippage( @@ -138,32 +139,32 @@ func (p Pool) CalcGivenInSlippage( tokensIn sdk.Coins, tokenOutDenom string, accPoolKeeper AccountedPoolKeeper, -) (sdkmath.LegacyDec, error) { +) (elystypes.Dec34, error) { balancerOutCoin, _, err := p.CalcOutAmtGivenIn(ctx, oracleKeeper, snapshot, tokensIn, tokenOutDenom, sdkmath.LegacyZeroDec(), accPoolKeeper) if err != nil { - return sdkmath.LegacyZeroDec(), err + return elystypes.ZeroDec34(), err } tokenIn, poolAssetIn, poolAssetOut, err := p.parsePoolAssets(tokensIn, tokenOutDenom) if err != nil { - return sdkmath.LegacyZeroDec(), err + return elystypes.ZeroDec34(), err } // ensure token prices for in/out tokens set properly inTokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenIn.Denom) if inTokenPrice.IsZero() { - return sdkmath.LegacyZeroDec(), fmt.Errorf("price for inToken not set: %s", poolAssetIn.Token.Denom) + return elystypes.ZeroDec34(), fmt.Errorf("price for inToken not set: %s", poolAssetIn.Token.Denom) } outTokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenOutDenom) if outTokenPrice.IsZero() { - return sdkmath.LegacyZeroDec(), fmt.Errorf("price for outToken not set: %s", poolAssetOut.Token.Denom) + return elystypes.ZeroDec34(), fmt.Errorf("price for outToken not set: %s", poolAssetOut.Token.Denom) } - oracleOutAmount := sdkmath.LegacyNewDecFromInt(tokenIn.Amount).Mul(inTokenPrice).Quo(outTokenPrice) - balancerOut := sdkmath.LegacyNewDecFromInt(balancerOutCoin.Amount) + oracleOutAmount := elystypes.NewDec34FromInt(tokenIn.Amount).Mul(inTokenPrice).Quo(outTokenPrice) + balancerOut := elystypes.NewDec34FromInt(balancerOutCoin.Amount) slippageAmount := oracleOutAmount.Sub(balancerOut) if slippageAmount.IsNegative() { - return sdkmath.LegacyZeroDec(), nil + return elystypes.ZeroDec34(), nil } return slippageAmount, nil } @@ -181,7 +182,7 @@ func (p *Pool) SwapOutAmtGivenIn( accPoolKeeper AccountedPoolKeeper, weightBreakingFeePerpetualFactor sdkmath.LegacyDec, params Params, -) (tokenOut sdk.Coin, slippage, slippageAmount sdkmath.LegacyDec, weightBalanceBonus sdkmath.LegacyDec, oracleOutAmount sdkmath.LegacyDec, swapFeeFinal sdkmath.LegacyDec, err error) { +) (tokenOut sdk.Coin, slippage, slippageAmount elystypes.Dec34, weightBalanceBonus elystypes.Dec34, oracleOutAmount elystypes.Dec34, swapFeeFinal sdkmath.LegacyDec, err error) { // Fixed gas consumption per swap to prevent spam ctx.GasMeter().ConsumeGas(BalancerGasFeeForSwap, "balancer swap computation") @@ -189,29 +190,29 @@ func (p *Pool) SwapOutAmtGivenIn( // early return with balancer swap if normal amm pool if !p.PoolParams.UseOracle { if len(tokensIn) != 1 { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), errors.New("expected tokensIn to be of length one") + return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), errors.New("expected tokensIn to be of length one") } balancerOutCoin, slippage, err := p.CalcOutAmtGivenIn(ctx, oracleKeeper, snapshot, tokensIn, tokenOutDenom, swapFee, accPoolKeeper) if err != nil { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err + return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), err } // Pools and it's bank balances are updated in keeper.UpdatePoolForSwap - return balancerOutCoin, slippage, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), swapFee, nil + return balancerOutCoin, slippage, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), swapFee, nil } tokenIn, poolAssetIn, poolAssetOut, err := p.parsePoolAssets(tokensIn, tokenOutDenom) if err != nil { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err + return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), err } // ensure token prices for in/out tokens set properly inTokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenIn.Denom) if inTokenPrice.IsZero() { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), fmt.Errorf("price for inToken not set: %s", poolAssetIn.Token.Denom) + return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), fmt.Errorf("price for inToken not set: %s", poolAssetIn.Token.Denom) } outTokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenOutDenom) if outTokenPrice.IsZero() { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), fmt.Errorf("price for outToken not set: %s", poolAssetOut.Token.Denom) + return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), fmt.Errorf("price for outToken not set: %s", poolAssetOut.Token.Denom) } accountedAssets := p.GetAccountedBalance(ctx, accPoolKeeper, p.PoolAssets) @@ -221,16 +222,16 @@ func (p *Pool) SwapOutAmtGivenIn( // balancer slippage amount = Max(oracleOutAmount-balancerOutAmount, 0) // resizedAmount = tokenIn / externalLiquidityRatio // actualSlippageAmount = balancer slippage(resizedAmount) - oracleOutAmount = sdkmath.LegacyNewDecFromInt(tokenIn.Amount).Mul(inTokenPrice).Quo(outTokenPrice) + oracleOutAmount = elystypes.NewDec34FromInt(tokenIn.Amount).Mul(inTokenPrice).Quo(outTokenPrice) externalLiquidityRatio, err := p.GetAssetExternalLiquidityRatio(tokenOutDenom) if err != nil { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err + return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), err } - + externalLiquidityRatioDec34 := elystypes.NewDec34FromLegacyDec(externalLiquidityRatio) // Ensure externalLiquidityRatio is not zero to avoid division by zero - if externalLiquidityRatio.IsZero() { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), ErrAmountTooLow + if externalLiquidityRatioDec34.IsZero() { + return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), ErrAmountTooLow } resizedAmount := sdkmath.LegacyNewDecFromInt(tokenIn.Amount).Quo(externalLiquidityRatio).RoundInt() @@ -243,10 +244,10 @@ func (p *Pool) SwapOutAmtGivenIn( accPoolKeeper, ) if err != nil { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err + return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), err } - outAmountAfterSlippage := oracleOutAmount.Sub(slippageAmount.Mul(externalLiquidityRatio)) - slippageAmount = slippageAmount.Mul(externalLiquidityRatio) + outAmountAfterSlippage := oracleOutAmount.Sub(slippageAmount.Mul(externalLiquidityRatioDec34)) + slippageAmount = slippageAmount.Mul(externalLiquidityRatioDec34) slippage = slippageAmount.Quo(oracleOutAmount) // oracleOutAmount = 100 ATOM @@ -294,10 +295,10 @@ func (p *Pool) SwapOutAmtGivenIn( // calculate weight distance difference to calculate bonus/cut on the operation newAssetPools, err := p.NewPoolAssetsAfterSwap(ctx, tokensIn, - sdk.Coins{sdk.NewCoin(tokenOutDenom, outAmountAfterSlippage.TruncateInt())}, accountedAssets, + sdk.Coins{sdk.NewCoin(tokenOutDenom, outAmountAfterSlippage.ToInt())}, accountedAssets, ) if err != nil { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err + return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), err } weightDistance := p.WeightDistanceFromTarget(ctx, oracleKeeper, newAssetPools) distanceDiff := weightDistance.Sub(initialWeightDistance) @@ -319,36 +320,38 @@ func (p *Pool) SwapOutAmtGivenIn( weightBreakingFee := GetWeightBreakingFee(finalWeightIn, finalWeightOut, targetWeightIn, targetWeightOut, initialWeightIn, initialWeightOut, distanceDiff, params) // weightBreakingFeePerpetualFactor is 1 if not send by perpetual - weightBreakingFee = weightBreakingFee.Mul(weightBreakingFeePerpetualFactor) + weightBreakingFee = weightBreakingFee.Mul(elystypes.NewDec34FromLegacyDec(weightBreakingFeePerpetualFactor)) // weight recovery reward = weight breaking fee * weight breaking fee portion - weightRecoveryReward := weightBreakingFee.Mul(params.WeightBreakingFeePortion) + weightRecoveryReward := weightBreakingFee.Mul(elystypes.NewDec34FromLegacyDec(params.WeightBreakingFeePortion)) // bonus is valid when distance is lower than original distance and when threshold weight reached weightBalanceBonus = weightBreakingFee.Neg() // If swap is improving weight, set weight breaking fee to zero if distanceDiff.IsNegative() { - weightBreakingFee = sdkmath.LegacyZeroDec() - weightBalanceBonus = sdkmath.LegacyZeroDec() + weightBreakingFee = elystypes.ZeroDec34() + weightBalanceBonus = elystypes.ZeroDec34() // set weight breaking fee to zero if bonus is applied - if initialWeightDistance.GT(params.ThresholdWeightDifference) { + if initialWeightDistance.GT(elystypes.NewDec34FromLegacyDec(params.ThresholdWeightDifference)) { weightBalanceBonus = weightRecoveryReward } - if initialWeightDistance.GT(params.ThresholdWeightDifferenceSwapFee) { + if initialWeightDistance.GT(elystypes.NewDec34FromLegacyDec(params.ThresholdWeightDifferenceSwapFee)) { swapFee = sdkmath.LegacyZeroDec() } } if swapFee.GTE(sdkmath.LegacyOneDec()) { - return sdk.Coin{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), ErrTooMuchSwapFee + return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), ErrTooMuchSwapFee } + swapFeeDec34 := elystypes.NewDec34FromLegacyDec(swapFee) + tokenAmountOutInt := outAmountAfterSlippage. - Mul(sdkmath.LegacyOneDec().Sub(weightBreakingFee)). - Mul(sdkmath.LegacyOneDec().Sub(swapFee)).TruncateInt() // We ignore the decimal component, as we round down the token amount out. + Mul(elystypes.OneDec34().Sub(weightBreakingFee)). + Mul(elystypes.OneDec34().Sub(swapFeeDec34)).ToInt() // We ignore the decimal component, as we round down the token amount out. oracleOutCoin := sdk.NewCoin(tokenOutDenom, tokenAmountOutInt) return oracleOutCoin, slippage, slippageAmount, weightBalanceBonus, oracleOutAmount, swapFee, nil } diff --git a/x/amm/types/tx.pb.go b/x/amm/types/tx.pb.go index 1f3bb4b19..9704c0641 100644 --- a/x/amm/types/tx.pb.go +++ b/x/amm/types/tx.pb.go @@ -874,7 +874,7 @@ type MsgSwapByDenomResponse struct { Amount types.Coin `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount"` InRoute []*SwapAmountInRoute `protobuf:"bytes,2,rep,name=in_route,json=inRoute,proto3" json:"in_route,omitempty"` OutRoute []*SwapAmountOutRoute `protobuf:"bytes,3,rep,name=out_route,json=outRoute,proto3" json:"out_route,omitempty"` - SpotPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=spot_price,json=spotPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"spot_price"` + SpotPrice string `protobuf:"bytes,4,opt,name=spot_price,json=spotPrice,proto3" json:"spot_price,omitempty"` SwapFee cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=swap_fee,json=swapFee,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"swap_fee"` Discount cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=discount,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"discount"` Recipient string `protobuf:"bytes,7,opt,name=recipient,proto3" json:"recipient,omitempty"` @@ -934,6 +934,13 @@ func (m *MsgSwapByDenomResponse) GetOutRoute() []*SwapAmountOutRoute { return nil } +func (m *MsgSwapByDenomResponse) GetSpotPrice() string { + if m != nil { + return m.SpotPrice + } + return "" +} + func (m *MsgSwapByDenomResponse) GetRecipient() string { if m != nil { return m.Recipient @@ -1167,102 +1174,101 @@ func init() { func init() { proto.RegisterFile("elys/amm/tx.proto", fileDescriptor_ed7ddafd861f6b7f) } var fileDescriptor_ed7ddafd861f6b7f = []byte{ - // 1506 bytes of a gzipped FileDescriptorProto + // 1503 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0xcf, 0x6f, 0x1b, 0xc5, - 0x17, 0xcf, 0xc6, 0x89, 0x7f, 0xbc, 0x34, 0x4d, 0xbc, 0x49, 0xbe, 0x71, 0x9c, 0xd6, 0x49, 0xf7, - 0x0b, 0xc5, 0x04, 0xd5, 0x26, 0x01, 0x8a, 0x6a, 0x2a, 0xa0, 0x6e, 0xd2, 0xca, 0x28, 0x56, 0x22, - 0x47, 0x95, 0x50, 0x41, 0x58, 0x1b, 0x7b, 0xea, 0xac, 0xea, 0xdd, 0x31, 0x9e, 0x71, 0xeb, 0x70, - 0x01, 0xf5, 0x06, 0x17, 0xb8, 0x71, 0xe0, 0x1f, 0xe0, 0x46, 0x0e, 0x3d, 0x22, 0x71, 0xad, 0xc4, - 0x81, 0xd2, 0x13, 0x42, 0xa2, 0x42, 0xe9, 0xa1, 0x7f, 0x06, 0x68, 0x7e, 0xec, 0x4f, 0xff, 0x88, - 0xb3, 0xed, 0x85, 0x4b, 0xe2, 0x7d, 0x6f, 0xde, 0x67, 0x66, 0x3e, 0xef, 0x33, 0x6f, 0xdf, 0x2c, - 0x24, 0x51, 0xf3, 0x90, 0xe4, 0x75, 0xd3, 0xcc, 0xd3, 0x6e, 0xae, 0xd5, 0xc6, 0x14, 0xab, 0x71, - 0x66, 0xca, 0xe9, 0xa6, 0x99, 0x9e, 0x6f, 0xe0, 0x06, 0xe6, 0xc6, 0x3c, 0xfb, 0x25, 0xfc, 0xe9, - 0x4c, 0x0d, 0x13, 0x13, 0x93, 0xfc, 0xbe, 0x4e, 0x50,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, 0x9d, 0x7e, 0x75, 0xa0, 0xdb, 0x45, 0xde, 0x81, + 0x33, 0x81, 0xb3, 0xb6, 0xd4, 0x2b, 0x4c, 0x20, 0x9e, 0xef, 0xeb, 0x72, 0xd0, 0xd2, 0x93, 0x5f, + 0x3d, 0x3f, 0x5a, 0x57, 0x8a, 0xc5, 0x47, 0xc7, 0x19, 0xe5, 0xf1, 0x71, 0x46, 0xf9, 0xfb, 0x38, + 0xa3, 0x7c, 0xf7, 0x2c, 0x33, 0xf6, 0xf8, 0x59, 0x66, 0xec, 0x8f, 0x67, 0x99, 0xb1, 0xdb, 0xd9, + 0x86, 0x41, 0x0f, 0xda, 0xfb, 0xb9, 0x1a, 0x36, 0xf3, 0x0c, 0xed, 0xa2, 0x85, 0xe8, 0x7d, 0x6c, + 0xdf, 0xe5, 0x0f, 0xf9, 0x8e, 0xf8, 0x14, 0x7b, 0xd8, 0x42, 0x64, 0x3f, 0xca, 0x3f, 0x4f, 0xbe, + 0xf5, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb8, 0x89, 0x6e, 0x2d, 0xa3, 0x15, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1588,6 +1594,7 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.amm.Msg", HandlerType: (*MsgServer)(nil), @@ -2473,16 +2480,13 @@ func (m *MsgSwapByDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) } i-- dAtA[i] = 0x2a - { - size := m.SpotPrice.Size() - i -= size - if _, err := m.SpotPrice.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) + if len(m.SpotPrice) > 0 { + i -= len(m.SpotPrice) + copy(dAtA[i:], m.SpotPrice) + i = encodeVarintTx(dAtA, i, uint64(len(m.SpotPrice))) + i-- + dAtA[i] = 0x22 } - i-- - dAtA[i] = 0x22 if len(m.OutRoute) > 0 { for iNdEx := len(m.OutRoute) - 1; iNdEx >= 0; iNdEx-- { { @@ -3008,8 +3012,10 @@ func (m *MsgSwapByDenomResponse) Size() (n int) { n += 1 + l + sovTx(uint64(l)) } } - l = m.SpotPrice.Size() - n += 1 + l + sovTx(uint64(l)) + l = len(m.SpotPrice) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } l = m.SwapFee.Size() n += 1 + l + sovTx(uint64(l)) l = m.Discount.Size() @@ -5531,9 +5537,7 @@ func (m *MsgSwapByDenomResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.SpotPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.SpotPrice = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 2 { diff --git a/x/amm/types/utils.go b/x/amm/types/utils.go index 73edd1a71..476fda918 100644 --- a/x/amm/types/utils.go +++ b/x/amm/types/utils.go @@ -1,14 +1,16 @@ package types import ( - sdkmath "cosmossdk.io/math" "errors" "fmt" "strconv" "strings" + sdkmath "cosmossdk.io/math" + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" ) func GetPoolShareDenom(poolId uint64) string { @@ -64,24 +66,24 @@ func ApplyDiscount(swapFee sdkmath.LegacyDec, discount sdkmath.LegacyDec) sdkmat // GetWeightBreakingFee When distanceDiff > 0, pool is getting worse so we calculate WBF based on final weight // When distanceDiff < 0, pool is improving, we need to use initial weights. Say target is 50:50, initially pool is 80:20 and now after it is becoming 30:70, // this is improving the pool but with finalWeightOut/finalWeightIn it will be 30/70 which doesn't provide enough bonus to user -func GetWeightBreakingFee(finalWeightIn, finalWeightOut, targetWeightIn, targetWeightOut, initialWeightIn, initialWeightOut sdkmath.LegacyDec, distanceDiff sdkmath.LegacyDec, params Params) sdkmath.LegacyDec { - weightBreakingFee := sdkmath.LegacyZeroDec() +func GetWeightBreakingFee(finalWeightIn, finalWeightOut, targetWeightIn, targetWeightOut, initialWeightIn, initialWeightOut, distanceDiff elystypes.Dec34, params Params) elystypes.Dec34 { + weightBreakingFee := elystypes.ZeroDec34() if !params.WeightBreakingFeeMultiplier.IsZero() { // (45/55*60/40) ^ 2.5 if distanceDiff.IsPositive() { if !finalWeightOut.IsZero() && !finalWeightIn.IsZero() && !targetWeightOut.IsZero() && !targetWeightIn.IsZero() { - weightBreakingFee = params.WeightBreakingFeeMultiplier. - Mul(Pow(finalWeightIn.Mul(targetWeightOut).Quo(finalWeightOut).Quo(targetWeightIn), params.WeightBreakingFeeExponent)) + weightBreakingFee = elystypes.NewDec34FromLegacyDec(params.WeightBreakingFeeMultiplier). + Mul(PowDec34(finalWeightIn.Mul(targetWeightOut).Quo(finalWeightOut).Quo(targetWeightIn), elystypes.NewDec34FromLegacyDec(params.WeightBreakingFeeExponent))) } } else { if !initialWeightOut.IsZero() && !initialWeightIn.IsZero() && !targetWeightOut.IsZero() && !targetWeightIn.IsZero() { - weightBreakingFee = params.WeightBreakingFeeMultiplier. - Mul(Pow(initialWeightOut.Mul(targetWeightIn).Quo(initialWeightIn).Quo(targetWeightOut), params.WeightBreakingFeeExponent)) + weightBreakingFee = elystypes.NewDec34FromLegacyDec(params.WeightBreakingFeeMultiplier). + Mul(PowDec34(initialWeightOut.Mul(targetWeightIn).Quo(initialWeightIn).Quo(targetWeightOut), elystypes.NewDec34FromLegacyDec(params.WeightBreakingFeeExponent))) } } - if weightBreakingFee.GT(sdkmath.LegacyNewDecWithPrec(99, 2)) { - weightBreakingFee = sdkmath.LegacyNewDecWithPrec(99, 2) + if weightBreakingFee.GT(elystypes.NewDec34WithPrec(99, 2)) { + weightBreakingFee = elystypes.NewDec34WithPrec(99, 2) } } return weightBreakingFee diff --git a/x/assetprofile/types/query.pb.go b/x/assetprofile/types/query.pb.go index c5be1ecdc..6ae69bea4 100644 --- a/x/assetprofile/types/query.pb.go +++ b/x/assetprofile/types/query.pb.go @@ -604,6 +604,7 @@ func _Query_EntryAll_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.assetprofile.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/assetprofile/types/tx.pb.go b/x/assetprofile/types/tx.pb.go index 43afdc982..39985877f 100644 --- a/x/assetprofile/types/tx.pb.go +++ b/x/assetprofile/types/tx.pb.go @@ -764,6 +764,7 @@ func _Msg_AddEntry_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.assetprofile.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/burner/types/query.pb.go b/x/burner/types/query.pb.go index 3bd23c387..6cbaf0b42 100644 --- a/x/burner/types/query.pb.go +++ b/x/burner/types/query.pb.go @@ -487,6 +487,7 @@ func _Query_HistoryAll_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.burner.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/burner/types/tx.pb.go b/x/burner/types/tx.pb.go index c30813fb1..60d1f9825 100644 --- a/x/burner/types/tx.pb.go +++ b/x/burner/types/tx.pb.go @@ -218,6 +218,7 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.burner.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/commitment/types/query.pb.go b/x/commitment/types/query.pb.go index 81f450f28..42fce780f 100644 --- a/x/commitment/types/query.pb.go +++ b/x/commitment/types/query.pb.go @@ -1201,6 +1201,7 @@ func _Query_Kol_Handler(srv interface{}, ctx context.Context, dec func(interface return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.commitment.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/commitment/types/tx.pb.go b/x/commitment/types/tx.pb.go index 5ee33114d..381b35ca6 100644 --- a/x/commitment/types/tx.pb.go +++ b/x/commitment/types/tx.pb.go @@ -2009,6 +2009,7 @@ func _Msg_ClaimKol_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.commitment.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/epochs/types/query.pb.go b/x/epochs/types/query.pb.go index 85ca8b0b0..45a4d5bbd 100644 --- a/x/epochs/types/query.pb.go +++ b/x/epochs/types/query.pb.go @@ -372,6 +372,7 @@ func _Query_CurrentEpoch_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.epochs.v1.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/estaking/types/query.pb.go b/x/estaking/types/query.pb.go index 0b4b58eb8..63b24e68b 100644 --- a/x/estaking/types/query.pb.go +++ b/x/estaking/types/query.pb.go @@ -535,6 +535,7 @@ func _Query_Invariant_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.estaking.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/estaking/types/tx.pb.go b/x/estaking/types/tx.pb.go index a9d5a880a..2187e633f 100644 --- a/x/estaking/types/tx.pb.go +++ b/x/estaking/types/tx.pb.go @@ -645,6 +645,7 @@ func _Msg_WithdrawAllRewards_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.estaking.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/leveragelp/keeper/begin_blocker.go b/x/leveragelp/keeper/begin_blocker.go index 362b5c94f..0bde3d1d0 100644 --- a/x/leveragelp/keeper/begin_blocker.go +++ b/x/leveragelp/keeper/begin_blocker.go @@ -12,6 +12,7 @@ import ( "github.com/elys-network/elys/x/leveragelp/types" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" ) func (k Keeper) BeginBlocker(ctx sdk.Context) { @@ -123,7 +124,7 @@ func (k Keeper) CheckAndCloseAtStopLoss(ctx sdk.Context, position *types.Positio return false, false, err } - underStopLossPrice = !position.StopLossPrice.IsNil() && lpTokenPrice.LTE(position.StopLossPrice) + underStopLossPrice = !position.StopLossPrice.IsNil() && lpTokenPrice.LTE(elystypes.NewDec34FromLegacyDec(position.StopLossPrice)) if !underStopLossPrice { return underStopLossPrice, false, errors.New("position stop loss price is not <= lp token price") } diff --git a/x/leveragelp/keeper/hooks_amm.go b/x/leveragelp/keeper/hooks_amm.go index 756772807..a8200a7a0 100644 --- a/x/leveragelp/keeper/hooks_amm.go +++ b/x/leveragelp/keeper/hooks_amm.go @@ -20,8 +20,8 @@ func (k Keeper) CheckAmmPoolUsdcBalance(ctx sdk.Context, ammPool ammtypes.Pool) return err } leverageLpTvl := tvl. - Mul(leveragePool.LeveragedLpAmount.ToLegacyDec()). - Quo(ammPool.TotalShares.Amount.ToLegacyDec()) + MulInt(leveragePool.LeveragedLpAmount). + QuoInt(ammPool.TotalShares.Amount) depositDenom := k.stableKeeper.GetDepositDenom(ctx) price := k.oracleKeeper.GetAssetPriceFromDenom(ctx, depositDenom) diff --git a/x/leveragelp/keeper/query_position.go b/x/leveragelp/keeper/query_position.go index 8b6b5206f..e2d5e188a 100644 --- a/x/leveragelp/keeper/query_position.go +++ b/x/leveragelp/keeper/query_position.go @@ -4,6 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" ammtypes "github.com/elys-network/elys/x/amm/types" "github.com/elys-network/elys/x/leveragelp/types" "google.golang.org/grpc/codes" @@ -63,9 +64,9 @@ func (k Keeper) LiquidationPrice(goCtx context.Context, req *types.QueryLiquidat totalDebt := debt.GetTotalLiablities() baseCurrency, _ := k.assetProfileKeeper.GetUsdcDenom(ctx) usdcDenomPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) - liquidationPrice := params.SafetyFactor.MulInt(totalDebt).Mul(usdcDenomPrice).MulInt(ammtypes.OneShare).QuoInt(position.LeveragedLpAmount) + liquidationPrice := elystypes.NewDec34FromLegacyDec(params.SafetyFactor).MulInt(totalDebt).Mul(usdcDenomPrice).MulInt(ammtypes.OneShare).QuoInt(position.LeveragedLpAmount) return &types.QueryLiquidationPriceResponse{ - Price: liquidationPrice, + Price: liquidationPrice.String(), }, nil } diff --git a/x/leveragelp/keeper/utils.go b/x/leveragelp/keeper/utils.go index f593f366a..1d38f0a92 100644 --- a/x/leveragelp/keeper/utils.go +++ b/x/leveragelp/keeper/utils.go @@ -111,7 +111,7 @@ func (k Keeper) GetInterestRateUsd(ctx sdk.Context, positions []*types.QueryPosi price := k.oracleKeeper.GetAssetPriceFromDenom(ctx, position.Position.Collateral.Denom) interestRateHour := params.InterestRate.Quo(hours) positionAndInterest.InterestRateHour = interestRateHour - positionAndInterest.InterestRateHourUsd = interestRateHour.Mul(sdkmath.LegacyDec(position.Position.Liabilities.Mul(price.RoundInt()))) + positionAndInterest.InterestRateHourUsd = interestRateHour.Mul(sdkmath.LegacyDec(position.Position.Liabilities.Mul(price.ToInt()))) positions_and_interest = append(positions_and_interest, &positionAndInterest) } diff --git a/x/leveragelp/types/expected_keepers.go b/x/leveragelp/types/expected_keepers.go index e2d064d8b..f5037e0f1 100644 --- a/x/leveragelp/types/expected_keepers.go +++ b/x/leveragelp/types/expected_keepers.go @@ -2,8 +2,10 @@ package types import ( "context" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" ammtypes "github.com/elys-network/elys/x/amm/types" assetprofiletypes "github.com/elys-network/elys/x/assetprofile/types" commitmenttypes "github.com/elys-network/elys/x/commitment/types" @@ -28,8 +30,8 @@ type AmmKeeper interface { IterateLiquidityPools(sdk.Context, func(ammtypes.Pool) bool) GetAccountedPoolSnapshotOrSet(ctx sdk.Context, pool ammtypes.Pool) (val ammtypes.Pool) - CalcOutAmtGivenIn(ctx sdk.Context, poolId uint64, oracle ammtypes.OracleKeeper, snapshot *ammtypes.Pool, tokensIn sdk.Coins, tokenOutDenom string, swapFee sdkmath.LegacyDec) (sdk.Coin, sdkmath.LegacyDec, error) - CalcInAmtGivenOut(ctx sdk.Context, poolId uint64, oracle ammtypes.OracleKeeper, snapshot *ammtypes.Pool, tokensOut sdk.Coins, tokenInDenom string, swapFee sdkmath.LegacyDec) (tokenIn sdk.Coin, slippage sdkmath.LegacyDec, err error) + CalcOutAmtGivenIn(ctx sdk.Context, poolId uint64, oracle ammtypes.OracleKeeper, snapshot *ammtypes.Pool, tokensIn sdk.Coins, tokenOutDenom string, swapFee sdkmath.LegacyDec) (sdk.Coin, elystypes.Dec34, error) + CalcInAmtGivenOut(ctx sdk.Context, poolId uint64, oracle ammtypes.OracleKeeper, snapshot *ammtypes.Pool, tokensOut sdk.Coins, tokenInDenom string, swapFee sdkmath.LegacyDec) (tokenIn sdk.Coin, slippage elystypes.Dec34, err error) JoinPoolNoSwap(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, shareOutAmount sdkmath.Int, tokenInMaxs sdk.Coins) (tokenIn sdk.Coins, sharesOut sdkmath.Int, err error) ExitPool(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, shareInAmount sdkmath.Int, tokenOutMins sdk.Coins, tokenOutDenom string, isLiquidation bool) (exitCoins sdk.Coins, err error) } diff --git a/x/leveragelp/types/query.pb.go b/x/leveragelp/types/query.pb.go index a6dbbc076..bca21b57c 100644 --- a/x/leveragelp/types/query.pb.go +++ b/x/leveragelp/types/query.pb.go @@ -983,7 +983,7 @@ func (m *QueryLiquidationPriceRequest) GetPositionId() uint64 { } type QueryLiquidationPriceResponse struct { - Price cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=price,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"price"` + Price string `protobuf:"bytes,1,opt,name=price,proto3" json:"price,omitempty"` } func (m *QueryLiquidationPriceResponse) Reset() { *m = QueryLiquidationPriceResponse{} } @@ -1019,6 +1019,13 @@ func (m *QueryLiquidationPriceResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryLiquidationPriceResponse proto.InternalMessageInfo +func (m *QueryLiquidationPriceResponse) GetPrice() string { + if m != nil { + return m.Price + } + return "" +} + type QueryOpenEstRequest struct { CollateralAsset string `protobuf:"bytes,1,opt,name=collateral_asset,json=collateralAsset,proto3" json:"collateral_asset,omitempty"` CollateralAmount cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=collateral_amount,json=collateralAmount,proto3,customtype=cosmossdk.io/math.Int" json:"collateral_amount"` @@ -1500,119 +1507,119 @@ func init() { func init() { proto.RegisterFile("elys/leveragelp/query.proto", fileDescriptor_76659893e638cc9b) } var fileDescriptor_76659893e638cc9b = []byte{ - // 1784 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x59, 0xdd, 0x6f, 0x1b, 0x59, - 0x15, 0xef, 0x38, 0x49, 0x1b, 0x9f, 0x34, 0x1f, 0xbd, 0x9b, 0xd0, 0xac, 0x5b, 0x9c, 0x76, 0xd4, - 0x76, 0xc3, 0xb6, 0xf6, 0xb4, 0x29, 0xdd, 0x45, 0x0b, 0xd5, 0x12, 0x77, 0xb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 0x63, 0xb5, 0x59, 0xca, 0xa8, 0x52, 0xea, 0xca, 0xbd, 0x57, 0x05, 0x04, 0x4b, 0x44, - 0x26, 0xbe, 0x88, 0x2d, 0x7d, 0x19, 0x16, 0x9b, 0xdc, 0x87, 0x89, 0x1f, 0xed, 0xe1, 0x90, 0xe9, - 0x75, 0x58, 0x52, 0x0b, 0xa1, 0x4f, 0xbd, 0x10, 0xa3, 0x5b, 0x70, 0x52, 0xc0, 0x58, 0xd7, 0x2e, - 0x68, 0x9b, 0x0b, 0x5b, 0x67, 0xab, 0x29, 0xda, 0xaa, 0x42, 0xa1, 0x36, 0xfb, 0xd1, 0xb3, 0x8d, - 0x13, 0xa6, 0x14, 0xd6, 0x1f, 0xc0, 0x4a, 0x93, 0x86, 0x84, 0x53, 0x25, 0x8d, 0xa3, 0xbb, 0x00, - 0x83, 0x98, 0xa5, 0xb9, 0x2b, 0x55, 0x09, 0x28, 0x22, 0xa8, 0x2a, 0xd2, 0x23, 0x09, 0xaa, 0x36, - 0xed, 0x0e, 0x96, 0xba, 0x66, 0x42, 0x53, 0xff, 0x8d, 0x06, 0x67, 0x12, 0xc6, 0x25, 0xd0, 0x2f, - 0x41, 0xd1, 0x57, 0x8b, 0xeb, 0xda, 0x85, 0x99, 0xcd, 0x85, 0xad, 0x72, 0x06, 0xeb, 0x37, 0x22, - 0x07, 0x4a, 0xd7, 0x1c, 0x28, 0xa0, 0xfa, 0x10, 0xb6, 0x02, 0xc7, 0xf6, 0xda, 0x44, 0x6c, 0xc2, - 0xf5, 0x10, 0xb8, 0xef, 0x69, 0xf0, 0x99, 0x18, 0x5c, 0xad, 0xdf, 0xa4, 0xd4, 0x55, 0xf1, 0x97, - 0x61, 0xc1, 0xee, 0x76, 0xad, 0x28, 0x35, 0x16, 0x71, 0x38, 0x01, 0xb3, 0x66, 0xd1, 0xee, 0x76, - 0x23, 0xa1, 0x86, 0x93, 0xe2, 0xa7, 0x70, 0x64, 0x7e, 0x7e, 0xaf, 0xc1,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, 0x26, 0x7b, 0x50, 0x75, 0xe8, 0x63, 0x0d, 0xd6, 0x46, 0x76, 0x6a, 0x68, 0x2b, - 0x87, 0x8b, 0x31, 0x6d, 0x61, 0xe9, 0xe6, 0xa1, 0x74, 0x24, 0xf6, 0x3a, 0xc7, 0xbe, 0x8d, 0xde, - 0x9e, 0x40, 0xa6, 0x32, 0x22, 0x7e, 0x1f, 0x09, 0x2d, 0xd1, 0xc0, 0x0d, 0x62, 0xa9, 0x35, 0x3e, - 0x7a, 0x5e, 0xd6, 0x3e, 0x79, 0x5e, 0xd6, 0xfe, 0xf3, 0xbc, 0xac, 0x7d, 0xf0, 0xa2, 0x7c, 0xe2, - 0x93, 0x17, 0xe5, 0x13, 0xff, 0x7c, 0x51, 0x3e, 0xf1, 0xc0, 0x48, 0xf4, 0x67, 0x59, 0x27, 0x4f, - 0x32, 0xff, 0x1a, 0x69, 0x9d, 0xe4, 0xff, 0xe4, 0xb8, 0xf9, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x99, 0x9d, 0xfa, 0x5d, 0x06, 0x1a, 0x00, 0x00, + // 1780 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x59, 0xcd, 0x6f, 0x23, 0x49, + 0x15, 0x4f, 0x3b, 0x9f, 0x7e, 0x99, 0x7c, 0xd5, 0x26, 0x4c, 0xd6, 0x19, 0x9c, 0x4c, 0x6b, 0x66, + 0x36, 0xec, 0xc4, 0xee, 0x49, 0x86, 0xec, 0xa2, 0x85, 0xd1, 0x92, 0xcc, 0xee, 0x04, 0x4b, 0x01, + 0x4c, 0xcf, 0x0a, 0x96, 0x91, 0x50, 0xab, 0xed, 0xae, 0x38, 0xa5, 0xb4, 0xbb, 0x7a, 0xba, 0x2b, + 0xe3, 0x71, 0xa2, 0x20, 0xc4, 0x01, 0xc4, 0x01, 0x58, 0x3e, 0x24, 0x04, 0x12, 0x02, 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, 0x89, 0x65, 0xb7, 0xf2, 0xd1, 0xf3, 0xa2, 0xf2, + 0xc9, 0xf3, 0xa2, 0xf2, 0x9f, 0xe7, 0x45, 0xe5, 0x83, 0x17, 0xc5, 0x91, 0x4f, 0x5e, 0x14, 0x47, + 0xfe, 0xf9, 0xa2, 0x38, 0xf2, 0x48, 0x8b, 0xf5, 0x67, 0x69, 0x27, 0x4f, 0x53, 0xff, 0xe7, 0xa8, + 0x4d, 0xf0, 0xff, 0x58, 0xdc, 0xfd, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc2, 0x13, 0x70, 0xba, + 0xd3, 0x19, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2158,6 +2165,7 @@ func _Query_CommittedTokensLocked_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.leveragelp.Query", HandlerType: (*QueryServer)(nil), @@ -2997,16 +3005,13 @@ func (m *QueryLiquidationPriceResponse) MarshalToSizedBuffer(dAtA []byte) (int, _ = i var l int _ = l - { - size := m.Price.Size() - i -= size - if _, err := m.Price.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.Price) > 0 { + i -= len(m.Price) + copy(dAtA[i:], m.Price) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Price))) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -3756,8 +3761,10 @@ func (m *QueryLiquidationPriceResponse) Size() (n int) { } var l int _ = l - l = m.Price.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.Price) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -5898,9 +5905,7 @@ func (m *QueryLiquidationPriceResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Price.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Price = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/leveragelp/types/tx.pb.go b/x/leveragelp/types/tx.pb.go index 0f1cbef76..b5af6fd1b 100644 --- a/x/leveragelp/types/tx.pb.go +++ b/x/leveragelp/types/tx.pb.go @@ -1693,6 +1693,7 @@ func _Msg_UpdateEnabledPools_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.leveragelp.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/masterchef/keeper/abci.go b/x/masterchef/keeper/abci.go index 6e13db8d0..3caed7f98 100644 --- a/x/masterchef/keeper/abci.go +++ b/x/masterchef/keeper/abci.go @@ -6,6 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ccvconsumertypes "github.com/cosmos/interchain-security/v6/x/ccv/consumer/types" + elystypes "github.com/elys-network/elys/types" ammkeeper "github.com/elys-network/elys/x/amm/keeper" ammtypes "github.com/elys-network/elys/x/amm/types" assetprofiletypes "github.com/elys-network/elys/x/assetprofile/types" @@ -29,11 +30,11 @@ func (k Keeper) EndBlocker(ctx sdk.Context) error { return nil } -func (k Keeper) GetPoolTVL(ctx sdk.Context, poolId uint64) math.LegacyDec { +func (k Keeper) GetPoolTVL(ctx sdk.Context, poolId uint64) elystypes.Dec34 { if poolId == stabletypes.PoolId { baseCurrency, found := k.assetProfileKeeper.GetUsdcDenom(ctx) if !found { - return math.LegacyZeroDec() + return elystypes.ZeroDec34() } return k.stableKeeper.TVL(ctx, k.oracleKeeper, baseCurrency) } @@ -41,11 +42,11 @@ func (k Keeper) GetPoolTVL(ctx sdk.Context, poolId uint64) math.LegacyDec { if found { tvl, err := ammPool.TVL(ctx, k.oracleKeeper, k.accountedPoolKeeper) if err != nil { - return math.LegacyZeroDec() + return elystypes.ZeroDec34() } return tvl } - return math.LegacyZeroDec() + return elystypes.ZeroDec34() } func (k Keeper) ProcessExternalRewardsDistribution(ctx sdk.Context) { @@ -54,7 +55,7 @@ func (k Keeper) ProcessExternalRewardsDistribution(ctx sdk.Context) { totalBlocksPerYear := int64(k.parameterKeeper.GetParams(ctx).TotalBlocksPerYear) externalIncentives := k.GetAllExternalIncentives(ctx) - externalIncentiveAprs := make(map[uint64]math.LegacyDec) + externalIncentiveAprs := make(map[uint64]elystypes.Dec34) for _, externalIncentive := range externalIncentives { pool, found := k.GetPoolInfo(ctx, externalIncentive.PoolId) if !found { @@ -81,19 +82,17 @@ func (k Keeper) ProcessExternalRewardsDistribution(ctx sdk.Context) { yearlyIncentiveRewardsTotal := externalIncentive.AmountPerBlock. Mul(math.NewInt(totalBlocksPerYear)) - apr := yearlyIncentiveRewardsTotal.ToLegacyDec(). - Mul(k.amm.GetTokenPrice(ctx, externalIncentive.RewardDenom, baseCurrency)). - Quo(tvl) - externalIncentive.Apr = apr + apr := k.amm.GetTokenPrice(ctx, externalIncentive.RewardDenom, baseCurrency).MulInt(yearlyIncentiveRewardsTotal).Quo(tvl) + externalIncentive.Apr = apr.ToLegacyDec() k.SetExternalIncentive(ctx, externalIncentive) poolExternalApr, ok := externalIncentiveAprs[pool.PoolId] if !ok { - poolExternalApr = math.LegacyZeroDec() + poolExternalApr = elystypes.ZeroDec34() } poolExternalApr = poolExternalApr.Add(apr) externalIncentiveAprs[pool.PoolId] = poolExternalApr - pool.ExternalIncentiveApr = poolExternalApr + pool.ExternalIncentiveApr = poolExternalApr.ToLegacyDec() k.SetPoolInfo(ctx, pool) } } @@ -205,13 +204,13 @@ func (k Keeper) UpdateLPRewards(ctx sdk.Context) error { for _, pool := range k.GetAllPoolInfos(ctx) { var err error tvl := k.GetPoolTVL(ctx, pool.PoolId) - proxyTVL := tvl.Mul(pool.Multiplier) + proxyTVL := tvl.MulLegacyDec(pool.Multiplier) if proxyTVL.IsZero() { continue } - poolShare := math.LegacyZeroDec() - poolShareEdenEnable := math.LegacyZeroDec() + poolShare := elystypes.ZeroDec34() + poolShareEdenEnable := elystypes.ZeroDec34() if totalProxyTVL.IsPositive() { poolShare = proxyTVL.Quo(totalProxyTVL) } @@ -221,20 +220,19 @@ func (k Keeper) UpdateLPRewards(ctx sdk.Context) error { } // Calculate new Eden for this pool - newEdenAllocatedForPool := math.LegacyZeroDec() + newEdenAllocatedForPool := elystypes.ZeroDec34() // Maximum eden APR - 30% by default - poolMaxEdenAmount := params.MaxEdenRewardAprLps. - Mul(proxyTVL). + poolMaxEdenAmount := proxyTVL.MulLegacyDec(params.MaxEdenRewardAprLps). QuoInt64(totalBlocksPerYear). Quo(edenDenomPrice) // Use min amount (eden allocation from tokenomics and max apr based eden amount) if pool.EnableEdenRewards { newEdenAllocatedForPool = poolShareEdenEnable.MulInt(lpsEdenAmount) - newEdenAllocatedForPool = math.LegacyMinDec(newEdenAllocatedForPool, poolMaxEdenAmount) + newEdenAllocatedForPool = elystypes.MinDec34(newEdenAllocatedForPool, poolMaxEdenAmount) if newEdenAllocatedForPool.IsPositive() { - err = k.commitmentKeeper.MintCoins(ctx, types.ModuleName, sdk.Coins{sdk.NewCoin(ptypes.Eden, newEdenAllocatedForPool.TruncateInt())}) + err = k.commitmentKeeper.MintCoins(ctx, types.ModuleName, sdk.Coins{sdk.NewCoin(ptypes.Eden, newEdenAllocatedForPool.ToInt())}) if err != nil { return err } @@ -242,7 +240,7 @@ func (k Keeper) UpdateLPRewards(ctx sdk.Context) error { } // Get gas fee rewards per pool - gasRewardsAllocatedForPool := poolShare.Mul(gasFeeUsdcAmountForLps) + gasRewardsAllocatedForPool := poolShare.MulLegacyDec(gasFeeUsdcAmountForLps) // ------------------- DEX rewards calculation ------------------- // --------------------------------------------------------------- @@ -253,14 +251,14 @@ func (k Keeper) UpdateLPRewards(ctx sdk.Context) error { dexRewardsAllocatedForPool = math.LegacyNewDec(0) } - k.AddEdenInfo(ctx, newEdenAllocatedForPool) + k.AddEdenInfo(ctx, newEdenAllocatedForPool.ToLegacyDec()) // Distribute Eden if pool.EnableEdenRewards { - k.UpdateAccPerShare(ctx, pool.PoolId, ptypes.Eden, newEdenAllocatedForPool.TruncateInt()) + k.UpdateAccPerShare(ctx, pool.PoolId, ptypes.Eden, newEdenAllocatedForPool.ToInt()) } // Distribute Gas fees + Dex rewards (USDC) - k.UpdateAccPerShare(ctx, pool.PoolId, k.GetBaseCurrencyDenom(ctx), gasRewardsAllocatedForPool.Add(dexRewardsAllocatedForPool).TruncateInt()) + k.UpdateAccPerShare(ctx, pool.PoolId, k.GetBaseCurrencyDenom(ctx), gasRewardsAllocatedForPool.AddLegacyDec(dexRewardsAllocatedForPool).ToInt()) // Track pool rewards accumulation edenReward := newEdenAllocatedForPool @@ -271,8 +269,8 @@ func (k Keeper) UpdateLPRewards(ctx sdk.Context) error { uint64(ctx.BlockTime().Unix()), ctx.BlockHeight(), dexRewardsAllocatedForPool, - gasRewardsAllocatedForPool, - edenReward, + gasRewardsAllocatedForPool.ToLegacyDec(), + edenReward.ToLegacyDec(), ) params := k.parameterKeeper.GetParams(ctx) dataLifetime := params.RewardsDataLifetime @@ -288,7 +286,8 @@ func (k Keeper) UpdateLPRewards(ctx sdk.Context) error { pool.EdenApr = newEdenAllocatedForPool. MulInt64(totalBlocksPerYear). Mul(edenDenomPrice). - Quo(tvl) + Quo(tvl). + ToLegacyDec() } else { pool.EdenApr = math.LegacyZeroDec() } @@ -297,7 +296,7 @@ func (k Keeper) UpdateLPRewards(ctx sdk.Context) error { } // Update APR for amm pools - k.UpdateAmmPoolAPR(ctx, totalBlocksPerYear, totalProxyTVL, edenDenomPrice) + k.UpdateAmmPoolAPR(ctx, totalBlocksPerYear, totalProxyTVL.ToLegacyDec(), edenDenomPrice.ToLegacyDec()) return nil } @@ -405,7 +404,7 @@ func (k Keeper) CollectGasFees(ctx sdk.Context, baseCurrency string) (sdk.DecCoi ctx.Logger().Error("Invalid protocol revenue address", "error", err) return gasFeesForLpsDec, err } - providerPortion := ammkeeper.PortionCoins(protocolGasFeeCoins, estakingParams.ProviderStakingRewardsPortion) + providerPortion := ammkeeper.PortionCoins(protocolGasFeeCoins, elystypes.NewDec34FromLegacyDec(estakingParams.ProviderStakingRewardsPortion)) consumerPortion := protocolGasFeeCoins.Sub(providerPortion...) // This will be sent to provider @@ -482,7 +481,7 @@ func (k Keeper) CollectDEXRevenue(ctx sdk.Context) (sdk.Coins, sdk.DecCoins, map // Send coins to protocol revenue address if protocolRevenueCoins.IsAllPositive() { - providerPortion := ammkeeper.PortionCoins(protocolRevenueCoins, estakingParams.ProviderStakingRewardsPortion) + providerPortion := ammkeeper.PortionCoins(protocolRevenueCoins, elystypes.NewDec34FromLegacyDec(estakingParams.ProviderStakingRewardsPortion)) consumerPortion := stakerRevenueCoins.Sub(providerPortion...) // This will be sent to provider @@ -518,7 +517,7 @@ func (k Keeper) CollectDEXRevenue(ctx sdk.Context) (sdk.Coins, sdk.DecCoins, map } // Calculate Proxy TVL -func (k Keeper) CalculateProxyTVL(ctx sdk.Context, baseCurrency string) (math.LegacyDec, math.LegacyDec) { +func (k Keeper) CalculateProxyTVL(ctx sdk.Context, baseCurrency string) (elystypes.Dec34, elystypes.Dec34) { // Ensure stablestakePoolParams exist stableStakePoolId := uint64(stabletypes.PoolId) _, found := k.GetPoolInfo(ctx, stableStakePoolId) @@ -526,11 +525,11 @@ func (k Keeper) CalculateProxyTVL(ctx sdk.Context, baseCurrency string) (math.Le k.InitStableStakePoolParams(ctx, stableStakePoolId) } - multipliedShareSum := math.LegacyZeroDec() - multipliedShareSumOnlyEden := math.LegacyZeroDec() + multipliedShareSum := elystypes.ZeroDec34() + multipliedShareSumOnlyEden := elystypes.ZeroDec34() for _, pool := range k.GetAllPoolInfos(ctx) { tvl := k.GetPoolTVL(ctx, pool.PoolId) - proxyTVL := tvl.Mul(pool.Multiplier) + proxyTVL := tvl.MulLegacyDec(pool.Multiplier) // Calculate total pool share by TVL and multiplier multipliedShareSum = multipliedShareSum.Add(proxyTVL) @@ -635,30 +634,35 @@ func (k Keeper) UpdateAmmPoolAPR(ctx sdk.Context, totalBlocksPerYear int64, tota } if firstAccum.Timestamp == lastAccum.Timestamp { - poolInfo.DexApr = lastAccum.DexReward. + poolInfo.DexApr = usdcDenomPrice. + MulLegacyDec(lastAccum.DexReward). MulInt64(totalBlocksPerYear). - Mul(usdcDenomPrice). - Quo(tvl) + Quo(tvl). + ToLegacyDec() - poolInfo.GasApr = lastAccum.GasReward. + poolInfo.GasApr = usdcDenomPrice. + MulLegacyDec(lastAccum.GasReward). MulInt64(totalBlocksPerYear). - Mul(usdcDenomPrice). - Quo(tvl) + Quo(tvl). + ToLegacyDec() } else { duration := lastAccum.Timestamp - firstAccum.Timestamp secondsInYear := int64(86400 * 360) - poolInfo.DexApr = lastAccum.DexReward.Sub(firstAccum.DexReward). - MulInt64(secondsInYear). - QuoInt64(int64(duration)). - Mul(usdcDenomPrice). - Quo(tvl) - - poolInfo.GasApr = lastAccum.GasReward.Sub(firstAccum.GasReward). - MulInt64(secondsInYear). - QuoInt64(int64(duration)). - Mul(usdcDenomPrice). - Quo(tvl) + poolInfo.DexApr = usdcDenomPrice. + MulLegacyDec(lastAccum.DexReward. + Sub(firstAccum.DexReward). + MulInt64(secondsInYear). + QuoInt64(int64(duration))). + Quo(tvl). + ToLegacyDec() + poolInfo.GasApr = usdcDenomPrice. + MulLegacyDec(lastAccum.GasReward. + Sub(firstAccum.GasReward). + MulInt64(secondsInYear). + QuoInt64(int64(duration))). + Quo(tvl). + ToLegacyDec() } k.SetPoolInfo(ctx, poolInfo) return false diff --git a/x/masterchef/keeper/apr_denom.go b/x/masterchef/keeper/apr_denom.go index 1e623bb37..902bfba25 100644 --- a/x/masterchef/keeper/apr_denom.go +++ b/x/masterchef/keeper/apr_denom.go @@ -2,8 +2,8 @@ package keeper import ( errorsmod "cosmossdk.io/errors" - "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" assetprofiletypes "github.com/elys-network/elys/x/assetprofile/types" commitmenttypes "github.com/elys-network/elys/x/commitment/types" "github.com/elys-network/elys/x/masterchef/types" @@ -11,18 +11,18 @@ import ( stabletypes "github.com/elys-network/elys/x/stablestake/types" ) -func (k Keeper) CalculateApr(ctx sdk.Context, query *types.QueryAprRequest) (math.LegacyDec, error) { +func (k Keeper) CalculateApr(ctx sdk.Context, query *types.QueryAprRequest) (elystypes.Dec34, error) { masterchefParams := k.GetParams(ctx) estakingParams := k.estakingKeeper.GetParams(ctx) // If we don't have enough params if estakingParams.StakeIncentives == nil || masterchefParams.LpIncentives == nil { - return math.LegacyZeroDec(), errorsmod.Wrap(types.ErrNoInflationaryParams, "no inflationary params available") + return elystypes.ZeroDec34(), errorsmod.Wrap(types.ErrNoInflationaryParams, "no inflationary params available") } baseCurrency, found := k.assetProfileKeeper.GetUsdcDenom(ctx) if !found { - return math.LegacyZeroDec(), errorsmod.Wrapf(assetprofiletypes.ErrAssetProfileNotFound, "asset %s not found", ptypes.BaseCurrency) + return elystypes.ZeroDec34(), errorsmod.Wrapf(assetprofiletypes.ErrAssetProfileNotFound, "asset %s not found", ptypes.BaseCurrency) } stkIncentive := estakingParams.StakeIncentives @@ -38,33 +38,33 @@ func (k Keeper) CalculateApr(ctx sdk.Context, query *types.QueryAprRequest) (mat // Elys staking, Eden committed, EdenB committed. totalStakedSnapshot, err := k.estakingKeeper.TotalBondedTokens(ctx) if err != nil { - return math.LegacyZeroDec(), err + return elystypes.ZeroDec34(), err } // Ensure totalStakedSnapshot is not zero to avoid division by zero if totalStakedSnapshot.IsZero() { - return math.LegacyZeroDec(), nil + return elystypes.ZeroDec34(), nil } if stkIncentive == nil || stkIncentive.EdenAmountPerYear.IsNil() { - return math.LegacyZeroDec(), nil + return elystypes.ZeroDec34(), nil } // Calculate - stakersEdenAmount := stkIncentive.EdenAmountPerYear.ToLegacyDec().Quo(math.NewInt(totalBlocksPerYear).ToLegacyDec()) + stakersEdenAmount := elystypes.NewDec34FromInt(stkIncentive.EdenAmountPerYear).QuoInt64(totalBlocksPerYear) // Maximum eden APR - 30% by default - stakersMaxEdenAmount := estakingParams.MaxEdenRewardAprStakers. + stakersMaxEdenAmount := elystypes.NewDec34FromLegacyDec(estakingParams.MaxEdenRewardAprStakers). MulInt(totalStakedSnapshot). QuoInt64(totalBlocksPerYear) // Use min amount (eden allocation from tokenomics and max apr based eden amount) - stakersEdenAmount = math.LegacyMinDec(stakersEdenAmount, stakersMaxEdenAmount) + stakersEdenAmount = elystypes.MinDec34(stakersEdenAmount, stakersMaxEdenAmount) // For Eden reward Apr for elys staking apr := stakersEdenAmount. - Mul(math.LegacyNewDec(totalBlocksPerYear)). - Quo(totalStakedSnapshot.ToLegacyDec()) + MulInt64(totalBlocksPerYear). + QuoInt(totalStakedSnapshot) return apr, nil } @@ -73,42 +73,42 @@ func (k Keeper) CalculateApr(ctx sdk.Context, query *types.QueryAprRequest) (mat params := k.stableKeeper.GetParams(ctx) res, err := k.stableKeeper.BorrowRatio(ctx, &stabletypes.QueryBorrowRatioRequest{}) if err != nil { - return math.LegacyZeroDec(), err + return elystypes.ZeroDec34(), err } - apr := params.InterestRate.Mul(res.BorrowRatio) + apr := elystypes.NewDec34FromLegacyDec(params.InterestRate).MulLegacyDec(res.BorrowRatio) return apr, nil } else { // Elys staking, Eden committed, EdenB committed. // Get 7 days average rewards usdcAmount := k.GetAvgStakerFeesCollected(ctx) if usdcAmount.IsZero() { - return math.LegacyZeroDec(), nil + return elystypes.ZeroDec34(), nil } // Calc Eden price in usdc // We put Elys as denom as Eden won't be avaialble in amm pool and has the same value as Elys edenDenomPrice := k.amm.GetEdenDenomPrice(ctx, baseCurrency) if edenDenomPrice.IsZero() { - return math.LegacyZeroDec(), nil + return elystypes.ZeroDec34(), nil } // Update total committed states totalStakedSnapshot, err := k.estakingKeeper.TotalBondedTokens(ctx) if err != nil { - return math.LegacyZeroDec(), err + return elystypes.ZeroDec34(), err } // Ensure totalStakedSnapshot is not zero to avoid division by zero if totalStakedSnapshot.IsZero() { - return math.LegacyZeroDec(), nil + return elystypes.ZeroDec34(), nil } // Mutiply by 365 to get yearly rewards entry, found := k.assetProfileKeeper.GetEntry(ctx, ptypes.BaseCurrency) if !found { - return math.LegacyZeroDec(), assetprofiletypes.ErrAssetProfileNotFound + return elystypes.ZeroDec34(), assetprofiletypes.ErrAssetProfileNotFound } - yearlyDexRewardAmount := usdcAmount.Mul(math.LegacyNewDec(365)).Quo(Pow10(entry.Decimals)) + yearlyDexRewardAmount := elystypes.NewDec34FromLegacyDec(usdcAmount).MulInt64(365).Quo(Pow10(entry.Decimals)) apr := yearlyDexRewardAmount. Quo(edenDenomPrice). @@ -117,39 +117,39 @@ func (k Keeper) CalculateApr(ctx sdk.Context, query *types.QueryAprRequest) (mat return apr, nil } } else if query.Denom == ptypes.EdenB { - apr := estakingParams.EdenBoostApr + apr := elystypes.NewDec34FromLegacyDec(estakingParams.EdenBoostApr) return apr, nil } - return math.LegacyZeroDec(), nil + return elystypes.ZeroDec34(), nil } // Get total dex rewards amount from the specified pool -func (k Keeper) GetDailyRewardsAmountForPool(ctx sdk.Context, poolId uint64) (math.LegacyDec, sdk.Coins) { - dailyDexRewardsTotal := math.LegacyZeroDec() - dailyGasRewardsTotal := math.LegacyZeroDec() - dailyEdenRewardsTotal := math.LegacyZeroDec() +func (k Keeper) GetDailyRewardsAmountForPool(ctx sdk.Context, poolId uint64) (elystypes.Dec34, sdk.Coins) { + dailyDexRewardsTotal := elystypes.ZeroDec34() + dailyGasRewardsTotal := elystypes.ZeroDec34() + dailyEdenRewardsTotal := elystypes.ZeroDec34() firstAccum := k.FirstPoolRewardsAccum(ctx, poolId) lastAccum := k.LastPoolRewardsAccum(ctx, poolId) if lastAccum.Timestamp != 0 { if firstAccum.Timestamp == lastAccum.Timestamp { - dailyDexRewardsTotal = lastAccum.DexReward - dailyGasRewardsTotal = lastAccum.GasReward - dailyEdenRewardsTotal = lastAccum.EdenReward + dailyDexRewardsTotal = elystypes.NewDec34FromLegacyDec(lastAccum.DexReward) + dailyGasRewardsTotal = elystypes.NewDec34FromLegacyDec(lastAccum.GasReward) + dailyEdenRewardsTotal = elystypes.NewDec34FromLegacyDec(lastAccum.EdenReward) } else { - dailyDexRewardsTotal = lastAccum.DexReward.Sub(firstAccum.DexReward) - dailyGasRewardsTotal = lastAccum.GasReward.Sub(firstAccum.GasReward) - dailyEdenRewardsTotal = lastAccum.EdenReward.Sub(firstAccum.EdenReward) + dailyDexRewardsTotal = elystypes.NewDec34FromLegacyDec(lastAccum.DexReward).SubLegacyDec(firstAccum.DexReward) + dailyGasRewardsTotal = elystypes.NewDec34FromLegacyDec(lastAccum.GasReward).SubLegacyDec(firstAccum.GasReward) + dailyEdenRewardsTotal = elystypes.NewDec34FromLegacyDec(lastAccum.EdenReward).SubLegacyDec(firstAccum.EdenReward) } } baseCurrency, found := k.assetProfileKeeper.GetUsdcDenom(ctx) if !found { - return math.LegacyZeroDec(), sdk.Coins{} + return elystypes.ZeroDec34(), sdk.Coins{} } - rewardCoins := sdk.NewCoins(sdk.NewCoin(ptypes.Eden, dailyEdenRewardsTotal.RoundInt())) - rewardCoins = rewardCoins.Add(sdk.NewCoin(baseCurrency, dailyDexRewardsTotal.Add(dailyGasRewardsTotal).RoundInt())) + rewardCoins := sdk.NewCoins(sdk.NewCoin(ptypes.Eden, dailyEdenRewardsTotal.ToInt())) + rewardCoins = rewardCoins.Add(sdk.NewCoin(baseCurrency, dailyDexRewardsTotal.Add(dailyGasRewardsTotal).ToInt())) usdcDenomPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) edenDenomPrice := k.amm.GetEdenDenomPrice(ctx, baseCurrency) @@ -159,10 +159,10 @@ func (k Keeper) GetDailyRewardsAmountForPool(ctx sdk.Context, poolId uint64) (ma return totalRewardsUsd, rewardCoins } -func Pow10(decimal uint64) (value math.LegacyDec) { - value = math.LegacyNewDec(1) +func Pow10(decimal uint64) (value elystypes.Dec34) { + value = elystypes.OneDec34() for i := 0; i < int(decimal); i++ { - value = value.Mul(math.LegacyNewDec(10)) + value = value.MulInt64(10) } return } diff --git a/x/masterchef/keeper/apr_stable_stake.go b/x/masterchef/keeper/apr_stable_stake.go index 61761c9b4..70e0ed6a3 100644 --- a/x/masterchef/keeper/apr_stable_stake.go +++ b/x/masterchef/keeper/apr_stable_stake.go @@ -4,13 +4,14 @@ import ( errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" assetprofiletypes "github.com/elys-network/elys/x/assetprofile/types" "github.com/elys-network/elys/x/masterchef/types" ptypes "github.com/elys-network/elys/x/parameter/types" stabletypes "github.com/elys-network/elys/x/stablestake/types" ) -func (k Keeper) CalculateStableStakeApr(ctx sdk.Context, query *types.QueryStableStakeAprRequest) (sdkmath.LegacyDec, error) { +func (k Keeper) CalculateStableStakeApr(ctx sdk.Context, query *types.QueryStableStakeAprRequest) (elystypes.Dec34, error) { // Fetch incentive params params := k.GetParams(ctx) @@ -21,22 +22,22 @@ func (k Keeper) CalculateStableStakeApr(ctx sdk.Context, query *types.QueryStabl if query.Denom == ptypes.Eden { lpIncentive := params.LpIncentives if lpIncentive == nil || lpIncentive.EdenAmountPerYear.IsNil() { - return sdkmath.LegacyZeroDec(), nil + return elystypes.ZeroDec34(), nil } totalBlocksPerYear := int64(k.parameterKeeper.GetParams(ctx).TotalBlocksPerYear) if totalBlocksPerYear == 0 { - return sdkmath.LegacyZeroDec(), nil + return elystypes.ZeroDec34(), nil } baseCurrency, found := k.assetProfileKeeper.GetUsdcDenom(ctx) if !found { - return sdkmath.LegacyZeroDec(), errorsmod.Wrapf(assetprofiletypes.ErrAssetProfileNotFound, "asset %s not found", ptypes.BaseCurrency) + return elystypes.ZeroDec34(), errorsmod.Wrapf(assetprofiletypes.ErrAssetProfileNotFound, "asset %s not found", ptypes.BaseCurrency) } stableTvl := k.stableKeeper.TVL(ctx, k.oracleKeeper, baseCurrency) if stableTvl.IsZero() { - return sdkmath.LegacyZeroDec(), nil + return elystypes.ZeroDec34(), nil } // Calculate total Proxy TVL @@ -49,24 +50,24 @@ func (k Keeper) CalculateStableStakeApr(ctx sdk.Context, query *types.QueryStabl // Get pool info from incentive param poolInfo, found := k.GetPoolInfo(ctx, uint64(stabletypes.PoolId)) if !found { - return sdkmath.LegacyZeroDec(), nil + return elystypes.ZeroDec34(), nil } // Calculate Proxy TVL share considering multiplier - proxyTVL := stableTvl.Mul(poolInfo.Multiplier) + proxyTVL := stableTvl.MulLegacyDec(poolInfo.Multiplier) if totalProxyTVL.IsZero() { - return sdkmath.LegacyZeroDec(), nil + return elystypes.ZeroDec34(), nil } stableStakePoolShare := proxyTVL.Quo(totalProxyTVL) - stableStakeEdenAmount := sdkmath.LegacyNewDecFromInt(edenAmount).Mul(stableStakePoolShare) + stableStakeEdenAmount := stableStakePoolShare.MulInt(edenAmount) params := k.GetParams(ctx) - poolMaxEdenAmount := params.MaxEdenRewardAprLps. - Mul(proxyTVL). + poolMaxEdenAmount := proxyTVL. + MulLegacyDec(params.MaxEdenRewardAprLps). QuoInt64(totalBlocksPerYear). Quo(edenDenomPrice) - stableStakeEdenAmount = sdkmath.LegacyMinDec(stableStakeEdenAmount, poolMaxEdenAmount) + stableStakeEdenAmount = elystypes.MinDec34(stableStakeEdenAmount, poolMaxEdenAmount) // Eden Apr for usdc earn program apr := stableStakeEdenAmount. @@ -78,11 +79,11 @@ func (k Keeper) CalculateStableStakeApr(ctx sdk.Context, query *types.QueryStabl params := k.stableKeeper.GetParams(ctx) res, err := k.stableKeeper.BorrowRatio(ctx, &stabletypes.QueryBorrowRatioRequest{}) if err != nil { - return sdkmath.LegacyZeroDec(), err + return elystypes.ZeroDec34(), err } - apr := params.InterestRate.Mul(res.BorrowRatio) + apr := elystypes.NewDec34FromLegacyDec(params.InterestRate).MulLegacyDec(res.BorrowRatio) return apr, nil } - return sdkmath.LegacyZeroDec(), nil + return elystypes.ZeroDec34(), nil } diff --git a/x/masterchef/keeper/query.go b/x/masterchef/keeper/query.go index 377d2a332..b7bb59d3b 100644 --- a/x/masterchef/keeper/query.go +++ b/x/masterchef/keeper/query.go @@ -2,6 +2,7 @@ package keeper import ( "context" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" @@ -113,7 +114,7 @@ func (k Keeper) StableStakeApr(goCtx context.Context, req *types.QueryStableStak return nil, err } - return &types.QueryStableStakeAprResponse{Apr: apr}, nil + return &types.QueryStableStakeAprResponse{Apr: apr.String()}, nil } func (k Keeper) PoolAprs(goCtx context.Context, req *types.QueryPoolAprsRequest) (*types.QueryPoolAprsResponse, error) { diff --git a/x/masterchef/keeper/query_all_liquidity_pool_tvl.go b/x/masterchef/keeper/query_all_liquidity_pool_tvl.go index c2b0a6bd4..f8ac65a14 100644 --- a/x/masterchef/keeper/query_all_liquidity_pool_tvl.go +++ b/x/masterchef/keeper/query_all_liquidity_pool_tvl.go @@ -2,10 +2,12 @@ package keeper import ( "context" + "cosmossdk.io/math" ptypes "github.com/elys-network/elys/x/parameter/types" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/masterchef/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -19,7 +21,7 @@ func (k Keeper) AllLiquidityPoolTVL(goCtx context.Context, req *types.QueryAllLi ctx := sdk.UnwrapSDKContext(goCtx) allPools := k.amm.GetAllPool(ctx) - poolsTVL := math.LegacyZeroDec() + poolsTVL := elystypes.ZeroDec34() totalTVL := math.ZeroInt() for _, pool := range allPools { @@ -30,7 +32,7 @@ func (k Keeper) AllLiquidityPoolTVL(goCtx context.Context, req *types.QueryAllLi poolsTVL = poolsTVL.Add(tvl) } - totalTVL = totalTVL.Add(poolsTVL.TruncateInt()) + totalTVL = totalTVL.Add(poolsTVL.ToInt()) entry, found := k.assetProfileKeeper.GetEntry(ctx, ptypes.BaseCurrency) if !found { @@ -38,11 +40,11 @@ func (k Keeper) AllLiquidityPoolTVL(goCtx context.Context, req *types.QueryAllLi } stableStakeTVL := k.stableKeeper.TVL(ctx, k.oracleKeeper, entry.Denom) - totalTVL = totalTVL.Add(stableStakeTVL.TruncateInt()) + totalTVL = totalTVL.Add(stableStakeTVL.ToInt()) return &types.QueryAllLiquidityPoolTVLResponse{ Total: totalTVL, - Pools: poolsTVL.TruncateInt(), - UsdcStaking: stableStakeTVL.TruncateInt(), + Pools: poolsTVL.ToInt(), + UsdcStaking: stableStakeTVL.ToInt(), }, nil } diff --git a/x/masterchef/keeper/query_apr.go b/x/masterchef/keeper/query_apr.go index 249c1f124..5f23373c7 100644 --- a/x/masterchef/keeper/query_apr.go +++ b/x/masterchef/keeper/query_apr.go @@ -21,5 +21,5 @@ func (k Keeper) Apr(goCtx context.Context, req *types.QueryAprRequest) (*types.Q return nil, err } - return &types.QueryAprResponse{Apr: apr}, nil + return &types.QueryAprResponse{Apr: apr.String()}, nil } diff --git a/x/masterchef/keeper/query_aprs.go b/x/masterchef/keeper/query_aprs.go index c01bab82a..9e7fbcf0e 100644 --- a/x/masterchef/keeper/query_aprs.go +++ b/x/masterchef/keeper/query_aprs.go @@ -69,15 +69,15 @@ func (k Keeper) Aprs(goCtx context.Context, req *types.QueryAprsRequest) (*types } return &types.QueryAprsResponse{ - UsdcAprUsdc: usdcAprUsdc, - EdenAprUsdc: edenAprUsdc, - UsdcAprEdenb: usdcAprEdenb, - EdenAprEdenb: edenAprEdenb, - UsdcAprEden: usdcAprEden, - EdenAprEden: edenAprEden, - EdenbAprEden: edenbAprEden, - UsdcAprElys: usdcAprElys, - EdenAprElys: edenAprElys, - EdenbAprElys: edenbAprElys, + UsdcAprUsdc: usdcAprUsdc.String(), + EdenAprUsdc: edenAprUsdc.String(), + UsdcAprEdenb: usdcAprEdenb.String(), + EdenAprEdenb: edenAprEdenb.String(), + UsdcAprEden: usdcAprEden.String(), + EdenAprEden: edenAprEden.String(), + EdenbAprEden: edenbAprEden.String(), + UsdcAprElys: usdcAprElys.String(), + EdenAprElys: edenAprElys.String(), + EdenbAprElys: edenbAprElys.String(), }, nil } diff --git a/x/masterchef/keeper/query_chain_tvl.go b/x/masterchef/keeper/query_chain_tvl.go index 8183afdd4..527dded8d 100644 --- a/x/masterchef/keeper/query_chain_tvl.go +++ b/x/masterchef/keeper/query_chain_tvl.go @@ -2,12 +2,14 @@ package keeper import ( "context" + "cosmossdk.io/math" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ptypes "github.com/elys-network/elys/x/parameter/types" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/masterchef/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -21,7 +23,7 @@ func (k Keeper) ChainTVL(goCtx context.Context, req *types.QueryChainTVLRequest) ctx := sdk.UnwrapSDKContext(goCtx) allPools := k.amm.GetAllPool(ctx) - poolsTVL := math.LegacyZeroDec() + poolsTVL := elystypes.ZeroDec34() totalTVL := math.ZeroInt() for _, pool := range allPools { @@ -31,7 +33,7 @@ func (k Keeper) ChainTVL(goCtx context.Context, req *types.QueryChainTVLRequest) } poolsTVL = poolsTVL.Add(tvl) } - totalTVL = totalTVL.Add(poolsTVL.TruncateInt()) + totalTVL = totalTVL.Add(poolsTVL.ToInt()) baseCurrencyEntry, found := k.assetProfileKeeper.GetEntry(ctx, ptypes.BaseCurrency) if !found { @@ -39,24 +41,24 @@ func (k Keeper) ChainTVL(goCtx context.Context, req *types.QueryChainTVLRequest) } stableStakeTVL := k.stableKeeper.TVL(ctx, k.oracleKeeper, baseCurrencyEntry.Denom) - totalTVL = totalTVL.Add(stableStakeTVL.TruncateInt()) + totalTVL = totalTVL.Add(stableStakeTVL.ToInt()) elysPrice := k.amm.GetTokenPrice(ctx, ptypes.Elys, baseCurrencyEntry.Denom) stakedElys := k.bankKeeper.GetBalance(ctx, authtypes.NewModuleAddress(stakingtypes.BondedPoolName), ptypes.Elys).Amount stakedElysValue := elysPrice.MulInt(stakedElys) - totalTVL = totalTVL.Add(stakedElysValue.TruncateInt()) + totalTVL = totalTVL.Add(stakedElysValue.ToInt()) commitmentParams := k.commitmentKeeper.GetParams(ctx) stakedEden := commitmentParams.TotalCommitted.AmountOf(ptypes.Eden) stakedEdenValue := elysPrice.MulInt(stakedEden) - totalTVL = totalTVL.Add(stakedEdenValue.TruncateInt()) + totalTVL = totalTVL.Add(stakedEdenValue.ToInt()) return &types.QueryChainTVLResponse{ Total: totalTVL, - Pools: poolsTVL.TruncateInt(), - UsdcStaking: stableStakeTVL.TruncateInt(), - StakedElys: stakedElysValue.TruncateInt(), - StakedEden: stakedEdenValue.TruncateInt(), + Pools: poolsTVL.ToInt(), + UsdcStaking: stableStakeTVL.ToInt(), + StakedElys: stakedElysValue.ToInt(), + StakedEden: stakedEdenValue.ToInt(), }, nil } diff --git a/x/masterchef/keeper/query_pool_rewards.go b/x/masterchef/keeper/query_pool_rewards.go index 1068877c7..74ba452dd 100644 --- a/x/masterchef/keeper/query_pool_rewards.go +++ b/x/masterchef/keeper/query_pool_rewards.go @@ -3,8 +3,8 @@ package keeper import ( "context" - "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" ammtypes "github.com/elys-network/elys/x/amm/types" "github.com/elys-network/elys/x/masterchef/types" ptypes "github.com/elys-network/elys/x/parameter/types" @@ -74,37 +74,37 @@ func (k Keeper) PoolRewards(goCtx context.Context, req *types.QueryPoolRewardsRe } // Generate earn pool struct -func (k *Keeper) generatePoolRewards(ctx sdk.Context, ammPool *ammtypes.Pool, externalRewardsAprs map[uint64]math.LegacyDec) types.PoolRewards { +func (k *Keeper) generatePoolRewards(ctx sdk.Context, ammPool *ammtypes.Pool, externalRewardsAprs map[uint64]elystypes.Dec34) types.PoolRewards { // Get rewards amount rewardsUsd, rewardCoins := k.GetDailyRewardsAmountForPool(ctx, ammPool.PoolId) edenForward := sdk.NewCoin(ptypes.Eden, k.ForwardEdenCalc(ctx, ammPool.PoolId).RoundInt()) tvl, err := ammPool.TVL(ctx, k.oracleKeeper, k.accountedPoolKeeper) - apr := rewardsUsd.Mul(math.LegacyNewDec(365)) + apr := rewardsUsd.MulInt64(365) if err != nil { - apr = math.LegacyZeroDec() + apr = elystypes.ZeroDec34() } else { apr = apr.Quo(tvl) } return types.PoolRewards{ PoolId: ammPool.PoolId, - RewardsUsd: rewardsUsd, + RewardsUsd: rewardsUsd.ToLegacyDec(), RewardCoins: rewardCoins, EdenForward: edenForward, - RewardsUsdApr: apr, - ExternalRewardsApr: externalRewardsAprs[ammPool.PoolId], + RewardsUsdApr: apr.ToLegacyDec(), + ExternalRewardsApr: externalRewardsAprs[ammPool.PoolId].ToLegacyDec(), } } -func (k Keeper) generateExternalRewardsApr(ctx sdk.Context) map[uint64]math.LegacyDec { +func (k Keeper) generateExternalRewardsApr(ctx sdk.Context) map[uint64]elystypes.Dec34 { externalIncentives := k.GetAllExternalIncentives(ctx) - rewardsPerPool := make(map[uint64]math.LegacyDec) + rewardsPerPool := make(map[uint64]elystypes.Dec34) curBlockHeight := ctx.BlockHeight() totalBlocksPerYear := int64(k.parameterKeeper.GetParams(ctx).TotalBlocksPerYear) for _, externalIncentive := range externalIncentives { if externalIncentive.FromBlock < curBlockHeight && curBlockHeight <= externalIncentive.ToBlock { - totalAmount := math.LegacyNewDecFromInt(externalIncentive.AmountPerBlock.Mul(math.NewInt(totalBlocksPerYear))) + totalAmount := elystypes.NewDec34FromInt(externalIncentive.AmountPerBlock).MulInt64(totalBlocksPerYear) price := k.oracleKeeper.GetAssetPriceFromDenom(ctx, externalIncentive.RewardDenom) rewardsPerPool[externalIncentive.PoolId] = rewardsPerPool[externalIncentive.PoolId].Add(totalAmount.Mul(price)) @@ -121,7 +121,7 @@ func (k Keeper) generateExternalRewardsApr(ctx sdk.Context) map[uint64]math.Lega } totalLiquidity, err := pool.TVL(ctx, k.oracleKeeper, k.accountedPoolKeeper) if err != nil { - rewardsPerPool[key] = math.LegacyZeroDec() + rewardsPerPool[key] = elystypes.ZeroDec34() } externalRewardsApr := value.Quo(totalLiquidity) rewardsPerPool[key] = externalRewardsApr diff --git a/x/masterchef/types/expected_keepers.go b/x/masterchef/types/expected_keepers.go index a49776cfb..24972b977 100644 --- a/x/masterchef/types/expected_keepers.go +++ b/x/masterchef/types/expected_keepers.go @@ -80,9 +80,9 @@ type AmmKeeper interface { IterateLiquidityPools(sdk.Context, func(ammtypes.Pool) bool) GetAccountedPoolSnapshotOrSet(ctx sdk.Context, pool ammtypes.Pool) (val ammtypes.Pool) - CalcOutAmtGivenIn(ctx sdk.Context, poolId uint64, oracle ammtypes.OracleKeeper, snapshot *ammtypes.Pool, tokensIn sdk.Coins, tokenOutDenom string, swapFee math.LegacyDec) (sdk.Coin, math.LegacyDec, error) - GetEdenDenomPrice(ctx sdk.Context, baseCurrency string) math.LegacyDec - GetTokenPrice(ctx sdk.Context, tokenInDenom, baseCurrency string) math.LegacyDec + CalcOutAmtGivenIn(ctx sdk.Context, poolId uint64, oracle ammtypes.OracleKeeper, snapshot *ammtypes.Pool, tokensIn sdk.Coins, tokenOutDenom string, swapFee math.LegacyDec) (sdk.Coin, elystypes.Dec34, error) + GetEdenDenomPrice(ctx sdk.Context, baseCurrency string) elystypes.Dec34 + GetTokenPrice(ctx sdk.Context, tokenInDenom, baseCurrency string) elystypes.Dec34 InternalSwapExactAmountIn( ctx sdk.Context, sender sdk.AccAddress, @@ -118,7 +118,7 @@ type AssetProfileKeeper interface { type StableStakeKeeper interface { GetParams(ctx sdk.Context) (params stabletypes.Params) BorrowRatio(goCtx context.Context, req *stabletypes.QueryBorrowRatioRequest) (*stabletypes.QueryBorrowRatioResponse, error) - TVL(ctx sdk.Context, oracleKeeper stabletypes.OracleKeeper, baseCurrency string) math.LegacyDec + TVL(ctx sdk.Context, oracleKeeper stabletypes.OracleKeeper, baseCurrency string) elystypes.Dec34 } // TokenomicsKeeper defines the expected tokenomics keeper used for simulations (noalias) diff --git a/x/masterchef/types/query.pb.go b/x/masterchef/types/query.pb.go index cb68bf4ef..c2683c0dc 100644 --- a/x/masterchef/types/query.pb.go +++ b/x/masterchef/types/query.pb.go @@ -839,7 +839,7 @@ func (m *QueryStableStakeAprRequest) GetDenom() string { } type QueryStableStakeAprResponse struct { - Apr cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=apr,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"apr"` + Apr string `protobuf:"bytes,1,opt,name=apr,proto3" json:"apr,omitempty"` } func (m *QueryStableStakeAprResponse) Reset() { *m = QueryStableStakeAprResponse{} } @@ -875,6 +875,13 @@ func (m *QueryStableStakeAprResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryStableStakeAprResponse proto.InternalMessageInfo +func (m *QueryStableStakeAprResponse) GetApr() string { + if m != nil { + return m.Apr + } + return "" +} + type QueryPoolAprsRequest struct { PoolIds []uint64 `protobuf:"varint,1,rep,packed,name=pool_ids,json=poolIds,proto3" json:"pool_ids,omitempty"` } @@ -1231,7 +1238,7 @@ func (m *QueryAprRequest) GetDenom() string { } type QueryAprResponse struct { - Apr cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=apr,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"apr"` + Apr string `protobuf:"bytes,1,opt,name=apr,proto3" json:"apr,omitempty"` } func (m *QueryAprResponse) Reset() { *m = QueryAprResponse{} } @@ -1267,6 +1274,13 @@ func (m *QueryAprResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryAprResponse proto.InternalMessageInfo +func (m *QueryAprResponse) GetApr() string { + if m != nil { + return m.Apr + } + return "" +} + type QueryAprsRequest struct { } @@ -1304,16 +1318,16 @@ func (m *QueryAprsRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryAprsRequest proto.InternalMessageInfo type QueryAprsResponse struct { - UsdcAprUsdc cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=usdc_apr_usdc,json=usdcAprUsdc,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"usdc_apr_usdc"` - EdenAprUsdc cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=eden_apr_usdc,json=edenAprUsdc,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"eden_apr_usdc"` - UsdcAprEdenb cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=usdc_apr_edenb,json=usdcAprEdenb,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"usdc_apr_edenb"` - EdenAprEdenb cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=eden_apr_edenb,json=edenAprEdenb,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"eden_apr_edenb"` - UsdcAprEden cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=usdc_apr_eden,json=usdcAprEden,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"usdc_apr_eden"` - EdenAprEden cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=eden_apr_eden,json=edenAprEden,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"eden_apr_eden"` - EdenbAprEden cosmossdk_io_math.LegacyDec `protobuf:"bytes,7,opt,name=edenb_apr_eden,json=edenbAprEden,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"edenb_apr_eden"` - UsdcAprElys cosmossdk_io_math.LegacyDec `protobuf:"bytes,8,opt,name=usdc_apr_elys,json=usdcAprElys,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"usdc_apr_elys"` - EdenAprElys cosmossdk_io_math.LegacyDec `protobuf:"bytes,9,opt,name=eden_apr_elys,json=edenAprElys,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"eden_apr_elys"` - EdenbAprElys cosmossdk_io_math.LegacyDec `protobuf:"bytes,10,opt,name=edenb_apr_elys,json=edenbAprElys,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"edenb_apr_elys"` + UsdcAprUsdc string `protobuf:"bytes,1,opt,name=usdc_apr_usdc,json=usdcAprUsdc,proto3" json:"usdc_apr_usdc,omitempty"` + EdenAprUsdc string `protobuf:"bytes,2,opt,name=eden_apr_usdc,json=edenAprUsdc,proto3" json:"eden_apr_usdc,omitempty"` + UsdcAprEdenb string `protobuf:"bytes,3,opt,name=usdc_apr_edenb,json=usdcAprEdenb,proto3" json:"usdc_apr_edenb,omitempty"` + EdenAprEdenb string `protobuf:"bytes,4,opt,name=eden_apr_edenb,json=edenAprEdenb,proto3" json:"eden_apr_edenb,omitempty"` + UsdcAprEden string `protobuf:"bytes,5,opt,name=usdc_apr_eden,json=usdcAprEden,proto3" json:"usdc_apr_eden,omitempty"` + EdenAprEden string `protobuf:"bytes,6,opt,name=eden_apr_eden,json=edenAprEden,proto3" json:"eden_apr_eden,omitempty"` + EdenbAprEden string `protobuf:"bytes,7,opt,name=edenb_apr_eden,json=edenbAprEden,proto3" json:"edenb_apr_eden,omitempty"` + UsdcAprElys string `protobuf:"bytes,8,opt,name=usdc_apr_elys,json=usdcAprElys,proto3" json:"usdc_apr_elys,omitempty"` + EdenAprElys string `protobuf:"bytes,9,opt,name=eden_apr_elys,json=edenAprElys,proto3" json:"eden_apr_elys,omitempty"` + EdenbAprElys string `protobuf:"bytes,10,opt,name=edenb_apr_elys,json=edenbAprElys,proto3" json:"edenb_apr_elys,omitempty"` } func (m *QueryAprsResponse) Reset() { *m = QueryAprsResponse{} } @@ -1349,6 +1363,76 @@ func (m *QueryAprsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryAprsResponse proto.InternalMessageInfo +func (m *QueryAprsResponse) GetUsdcAprUsdc() string { + if m != nil { + return m.UsdcAprUsdc + } + return "" +} + +func (m *QueryAprsResponse) GetEdenAprUsdc() string { + if m != nil { + return m.EdenAprUsdc + } + return "" +} + +func (m *QueryAprsResponse) GetUsdcAprEdenb() string { + if m != nil { + return m.UsdcAprEdenb + } + return "" +} + +func (m *QueryAprsResponse) GetEdenAprEdenb() string { + if m != nil { + return m.EdenAprEdenb + } + return "" +} + +func (m *QueryAprsResponse) GetUsdcAprEden() string { + if m != nil { + return m.UsdcAprEden + } + return "" +} + +func (m *QueryAprsResponse) GetEdenAprEden() string { + if m != nil { + return m.EdenAprEden + } + return "" +} + +func (m *QueryAprsResponse) GetEdenbAprEden() string { + if m != nil { + return m.EdenbAprEden + } + return "" +} + +func (m *QueryAprsResponse) GetUsdcAprElys() string { + if m != nil { + return m.UsdcAprElys + } + return "" +} + +func (m *QueryAprsResponse) GetEdenAprElys() string { + if m != nil { + return m.EdenAprElys + } + return "" +} + +func (m *QueryAprsResponse) GetEdenbAprElys() string { + if m != nil { + return m.EdenbAprElys + } + return "" +} + type QueryPoolRewardsRequest struct { PoolIds []uint64 `protobuf:"varint,1,rep,packed,name=pool_ids,json=poolIds,proto3" json:"pool_ids,omitempty"` Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` @@ -1547,124 +1631,123 @@ func init() { func init() { proto.RegisterFile("elys/masterchef/query.proto", fileDescriptor_e4939d0b7ced5d80) } var fileDescriptor_e4939d0b7ced5d80 = []byte{ - // 1859 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0xcf, 0x6f, 0x1b, 0x51, - 0x11, 0xce, 0xda, 0x4e, 0xec, 0x8c, 0x93, 0xb4, 0x79, 0x4d, 0xa9, 0xe3, 0x14, 0x27, 0x7d, 0x94, - 0x92, 0xb6, 0x89, 0x37, 0x71, 0x4b, 0xd5, 0x42, 0x55, 0x29, 0xe9, 0x0f, 0x29, 0xc2, 0x2a, 0xc1, - 0x6d, 0x28, 0x70, 0xb1, 0xd6, 0xde, 0x17, 0x67, 0x95, 0xf5, 0xae, 0xbb, 0xbb, 0x69, 0x6a, 0x95, - 0x1e, 0xca, 0x8d, 0x4a, 0x20, 0x24, 0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, 0x91, 0xac, 0x0d, 0x71, 0xaa, 0x54, 0x46, 0xc6, 0xe4, 0xf7, 0x0a, 0xcc, 0x85, - 0x87, 0xb9, 0x38, 0x97, 0xf6, 0x1d, 0x13, 0xe3, 0x5c, 0xda, 0x7f, 0x3e, 0xa4, 0xf7, 0x04, 0xc7, - 0xdb, 0xe4, 0xd6, 0x60, 0x8e, 0xae, 0xd0, 0x16, 0x3f, 0x29, 0x32, 0x5e, 0x0d, 0xd5, 0x57, 0xa2, - 0x4f, 0x7e, 0xdd, 0xc9, 0x19, 0xde, 0xba, 0x0e, 0xca, 0x99, 0x40, 0xbf, 0x3b, 0x28, 0x67, 0x82, - 0x1d, 0xf0, 0x89, 0x72, 0x46, 0xe3, 0xf6, 0x7f, 0xa3, 0x40, 0x36, 0x30, 0xe3, 0x90, 0xd5, 0x18, - 0x57, 0x44, 0xa6, 0xa6, 0xfc, 0xd5, 0x11, 0x24, 0x91, 0xd5, 0xb7, 0x04, 0xab, 0x9b, 0xa4, 0x34, - 0xc4, 0x63, 0x07, 0xf6, 0x71, 0xd5, 0x9f, 0x73, 0xd4, 0x57, 0x7c, 0x0e, 0x7b, 0x4d, 0x7e, 0xad, - 0x40, 0x36, 0x30, 0x12, 0xc5, 0x11, 0x8c, 0x0e, 0x54, 0x71, 0x04, 0xfb, 0xcc, 0x57, 0xf4, 0x86, - 0x20, 0xb8, 0x4e, 0xae, 0x0f, 0x26, 0x68, 0x1a, 0xae, 0xd7, 0x21, 0x48, 0x7e, 0xa6, 0x40, 0x92, - 0x87, 0xda, 0x4a, 0x7f, 0x3b, 0x81, 0xf8, 0xba, 0x34, 0x40, 0x02, 0x19, 0x6c, 0x09, 0x06, 0xdf, - 0x26, 0x77, 0x06, 0x33, 0x10, 0x71, 0x14, 0x1a, 0xde, 0x5e, 0x77, 0xe2, 0xaa, 0x0d, 0x29, 0x11, - 0x52, 0xf1, 0xd6, 0x3a, 0xe1, 0x44, 0x07, 0x89, 0x20, 0xa3, 0x6b, 0x82, 0xd1, 0x65, 0x42, 0x87, - 0x32, 0x72, 0xc9, 0xaf, 0x94, 0x70, 0x33, 0xb6, 0x3a, 0xac, 0x92, 0xba, 0x43, 0x0e, 0xa9, 0xcf, - 0x25, 0x4f, 0x4b, 0x82, 0xd0, 0x1a, 0xb9, 0x36, 0x72, 0xc1, 0x75, 0xc9, 0x9f, 0x14, 0x38, 0xd7, - 0xe7, 0x33, 0x0c, 0xd9, 0x88, 0x71, 0x40, 0xec, 0x57, 0x9d, 0xfc, 0xe6, 0x09, 0x34, 0x90, 0xf0, - 0x5d, 0x41, 0xf8, 0x16, 0xb9, 0x39, 0xc4, 0x83, 0xa6, 0x59, 0x35, 0x7d, 0x8c, 0xaa, 0xa0, 0xef, - 0xbd, 0x30, 0x45, 0x99, 0xf0, 0x3f, 0x97, 0xc4, 0x95, 0x89, 0x9e, 0xef, 0x2c, 0x71, 0x65, 0xa2, - 0xf7, 0xab, 0xcb, 0xa8, 0x65, 0xa2, 0xce, 0xf5, 0x38, 0x99, 0xed, 0x9d, 0xf7, 0x9f, 0x0a, 0xca, - 0x87, 0x4f, 0x05, 0xe5, 0x9f, 0x9f, 0x0a, 0xca, 0x2f, 0x3e, 0x17, 0x26, 0x3e, 0x7c, 0x2e, 0x4c, - 0xfc, 0xed, 0x73, 0x61, 0xe2, 0x47, 0x6a, 0xa0, 0xa3, 0x8d, 0x82, 0xbd, 0x8c, 0x7c, 0x80, 0xab, - 0x4d, 0x89, 0x0f, 0x69, 0x37, 0xfe, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xe2, 0x04, 0x6d, 0x86, 0xb2, - 0x1c, 0x00, 0x00, + // 1846 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0xcf, 0x6f, 0x1b, 0x5b, + 0x15, 0xce, 0xd8, 0x4e, 0xe2, 0x1c, 0x27, 0x69, 0x73, 0x5f, 0x1e, 0x75,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x04, 0xc0, 0x67, 0x4a, 0x9f, 0x7e, 0x01, 0x96, 0xe5, 0xce, 0x3f, + 0x39, 0x31, 0x2c, 0x27, 0xe2, 0x92, 0x9f, 0x64, 0xe1, 0xfd, 0x81, 0x85, 0xff, 0x67, 0x3f, 0x90, + 0x1a, 0x14, 0x04, 0x14, 0x33, 0x1b, 0x22, 0xce, 0x8a, 0xb9, 0x8b, 0xc3, 0x81, 0xd2, 0x7f, 0x68, + 0xf7, 0x78, 0x14, 0xcd, 0x64, 0x4e, 0x71, 0xfa, 0xf2, 0x68, 0x26, 0x73, 0xe8, 0x32, 0x10, 0x79, + 0x14, 0x87, 0x32, 0xe2, 0x83, 0x13, 0xaa, 0xc1, 0x7b, 0xb1, 0xb7, 0x78, 0x3c, 0x5f, 0x85, 0x19, + 0x95, 0x19, 0xf2, 0x7c, 0x0a, 0xd5, 0x6b, 0x95, 0x81, 0x52, 0x52, 0x51, 0x0a, 0xfb, 0x39, 0x41, + 0xa7, 0x8e, 0xc2, 0x54, 0x87, 0x2f, 0x4a, 0xb4, 0x87, 0x98, 0xb8, 0x07, 0x41, 0xde, 0xa2, 0x39, + 0xb2, 0x08, 0x19, 0xcb, 0x94, 0x98, 0xb9, 0x7a, 0xc6, 0x32, 0x69, 0x0f, 0xca, 0x69, 0x0a, 0xc8, + 0xe4, 0x3b, 0x40, 0x92, 0x65, 0x00, 0x59, 0xd1, 0x04, 0xab, 0x04, 0x0e, 0x12, 0x5c, 0x62, 0x83, + 0x0b, 0x54, 0xc7, 0x98, 0x15, 0x19, 0x7a, 0xe0, 0x1c, 0xbb, 0x01, 0xc5, 0x6b, 0x30, 0x2b, 0x82, + 0xa3, 0xd1, 0xe7, 0x39, 0x23, 0x1e, 0x0f, 0x4c, 0x7a, 0x84, 0xb1, 0x1c, 0x2a, 0x20, 0xc5, 0x8f, + 0x60, 0x4e, 0x69, 0x38, 0xc7, 0x2e, 0x32, 0x5b, 0x49, 0xfa, 0x0b, 0xb5, 0x90, 0x50,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 0x47, 0xb1, 0x5e, 0xfc, 0x79, 0x3f, 0xae, 0x7a, + 0x90, 0x93, 0x21, 0x95, 0x6e, 0xad, 0x1f, 0x4e, 0x74, 0x94, 0x08, 0x32, 0xba, 0x25, 0x19, 0x6d, + 0x10, 0x3a, 0x96, 0x11, 0x27, 0xbf, 0xd4, 0xe2, 0xcd, 0xd8, 0xe6, 0xb8, 0x4a, 0xca, 0xc7, 0x1c, + 0xd2, 0x90, 0x4b, 0x9e, 0x56, 0x25, 0xa1, 0x2d, 0x72, 0x6b, 0xe2, 0x82, 0xcb, 0xc9, 0x1f, 0x35, + 0x78, 0x6f, 0xc8, 0x27, 0x72, 0xb2, 0x93, 0xe2, 0x80, 0xd4, 0x2f, 0xee, 0xa5, 0xdd, 0x0b, 0x68, + 0x20, 0xe1, 0x8f, 0x24, 0xe1, 0x7b, 0xe4, 0xee, 0x18, 0x0f, 0xda, 0x76, 0xc3, 0x0e, 0x30, 0x1a, + 0x92, 0xbe, 0xff, 0xd4, 0x96, 0x65, 0x22, 0xf8, 0x94, 0x9d, 0x56, 0x26, 0x06, 0xbe, 0x81, 0xa7, + 0x95, 0x89, 0xc1, 0x2f, 0xe2, 0x93, 0x96, 0x89, 0x96, 0xd0, 0x13, 0x64, 0xf6, 0x0f, 0x5e, 0xbd, + 0x2d, 0x6b, 0xaf, 0xdf, 0x96, 0xb5, 0x7f, 0xbc, 0x2d, 0x6b, 0x3f, 0x7f, 0x57, 0x9e, 0x7a, 0xfd, + 0xae, 0x3c, 0xf5, 0xd7, 0x77, 0xe5, 0xa9, 0xef, 0xeb, 0x91, 0x8e, 0x36, 0x09, 0xf6, 0x79, 0xe2, + 0x9f, 0x23, 0xcd, 0x19, 0xf9, 0x4f, 0x8e, 0x3b, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0xdb, 0x2b, + 0x2c, 0x33, 0x4e, 0x1a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2194,6 +2277,7 @@ func _Query_ChainTVL_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.masterchef.Query", HandlerType: (*QueryServer)(nil), @@ -2929,16 +3013,13 @@ func (m *QueryStableStakeAprResponse) MarshalToSizedBuffer(dAtA []byte) (int, er _ = i var l int _ = l - { - size := m.Apr.Size() - i -= size - if _, err := m.Apr.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.Apr) > 0 { + i -= len(m.Apr) + copy(dAtA[i:], m.Apr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Apr))) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -3256,16 +3337,13 @@ func (m *QueryAprResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size := m.Apr.Size() - i -= size - if _, err := m.Apr.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.Apr) > 0 { + i -= len(m.Apr) + copy(dAtA[i:], m.Apr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Apr))) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -3312,106 +3390,76 @@ func (m *QueryAprsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size := m.EdenbAprElys.Size() - i -= size - if _, err := m.EdenbAprElys.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.EdenbAprElys) > 0 { + i -= len(m.EdenbAprElys) + copy(dAtA[i:], m.EdenbAprElys) + i = encodeVarintQuery(dAtA, i, uint64(len(m.EdenbAprElys))) + i-- + dAtA[i] = 0x52 } - i-- - dAtA[i] = 0x52 - { - size := m.EdenAprElys.Size() - i -= size - if _, err := m.EdenAprElys.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.EdenAprElys) > 0 { + i -= len(m.EdenAprElys) + copy(dAtA[i:], m.EdenAprElys) + i = encodeVarintQuery(dAtA, i, uint64(len(m.EdenAprElys))) + i-- + dAtA[i] = 0x4a } - i-- - dAtA[i] = 0x4a - { - size := m.UsdcAprElys.Size() - i -= size - if _, err := m.UsdcAprElys.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.UsdcAprElys) > 0 { + i -= len(m.UsdcAprElys) + copy(dAtA[i:], m.UsdcAprElys) + i = encodeVarintQuery(dAtA, i, uint64(len(m.UsdcAprElys))) + i-- + dAtA[i] = 0x42 } - i-- - dAtA[i] = 0x42 - { - size := m.EdenbAprEden.Size() - i -= size - if _, err := m.EdenbAprEden.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.EdenbAprEden) > 0 { + i -= len(m.EdenbAprEden) + copy(dAtA[i:], m.EdenbAprEden) + i = encodeVarintQuery(dAtA, i, uint64(len(m.EdenbAprEden))) + i-- + dAtA[i] = 0x3a } - i-- - dAtA[i] = 0x3a - { - size := m.EdenAprEden.Size() - i -= size - if _, err := m.EdenAprEden.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.EdenAprEden) > 0 { + i -= len(m.EdenAprEden) + copy(dAtA[i:], m.EdenAprEden) + i = encodeVarintQuery(dAtA, i, uint64(len(m.EdenAprEden))) + i-- + dAtA[i] = 0x32 } - i-- - dAtA[i] = 0x32 - { - size := m.UsdcAprEden.Size() - i -= size - if _, err := m.UsdcAprEden.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.UsdcAprEden) > 0 { + i -= len(m.UsdcAprEden) + copy(dAtA[i:], m.UsdcAprEden) + i = encodeVarintQuery(dAtA, i, uint64(len(m.UsdcAprEden))) + i-- + dAtA[i] = 0x2a } - i-- - dAtA[i] = 0x2a - { - size := m.EdenAprEdenb.Size() - i -= size - if _, err := m.EdenAprEdenb.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.EdenAprEdenb) > 0 { + i -= len(m.EdenAprEdenb) + copy(dAtA[i:], m.EdenAprEdenb) + i = encodeVarintQuery(dAtA, i, uint64(len(m.EdenAprEdenb))) + i-- + dAtA[i] = 0x22 } - i-- - dAtA[i] = 0x22 - { - size := m.UsdcAprEdenb.Size() - i -= size - if _, err := m.UsdcAprEdenb.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.UsdcAprEdenb) > 0 { + i -= len(m.UsdcAprEdenb) + copy(dAtA[i:], m.UsdcAprEdenb) + i = encodeVarintQuery(dAtA, i, uint64(len(m.UsdcAprEdenb))) + i-- + dAtA[i] = 0x1a } - i-- - dAtA[i] = 0x1a - { - size := m.EdenAprUsdc.Size() - i -= size - if _, err := m.EdenAprUsdc.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.EdenAprUsdc) > 0 { + i -= len(m.EdenAprUsdc) + copy(dAtA[i:], m.EdenAprUsdc) + i = encodeVarintQuery(dAtA, i, uint64(len(m.EdenAprUsdc))) + i-- + dAtA[i] = 0x12 } - i-- - dAtA[i] = 0x12 - { - size := m.UsdcAprUsdc.Size() - i -= size - if _, err := m.UsdcAprUsdc.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.UsdcAprUsdc) > 0 { + i -= len(m.UsdcAprUsdc) + copy(dAtA[i:], m.UsdcAprUsdc) + i = encodeVarintQuery(dAtA, i, uint64(len(m.UsdcAprUsdc))) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -3845,8 +3893,10 @@ func (m *QueryStableStakeAprResponse) Size() (n int) { } var l int _ = l - l = m.Apr.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.Apr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -3969,8 +4019,10 @@ func (m *QueryAprResponse) Size() (n int) { } var l int _ = l - l = m.Apr.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.Apr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -3989,26 +4041,46 @@ func (m *QueryAprsResponse) Size() (n int) { } var l int _ = l - l = m.UsdcAprUsdc.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.EdenAprUsdc.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.UsdcAprEdenb.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.EdenAprEdenb.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.UsdcAprEden.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.EdenAprEden.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.EdenbAprEden.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.UsdcAprElys.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.EdenAprElys.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.EdenbAprElys.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.UsdcAprUsdc) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.EdenAprUsdc) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.UsdcAprEdenb) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.EdenAprEdenb) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.UsdcAprEden) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.EdenAprEden) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.EdenbAprEden) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.UsdcAprElys) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.EdenAprElys) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.EdenbAprElys) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -5832,9 +5904,7 @@ func (m *QueryStableStakeAprResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Apr.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Apr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -6697,9 +6767,7 @@ func (m *QueryAprResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Apr.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Apr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -6831,9 +6899,7 @@ func (m *QueryAprsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.UsdcAprUsdc.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.UsdcAprUsdc = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -6865,9 +6931,7 @@ func (m *QueryAprsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.EdenAprUsdc.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.EdenAprUsdc = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { @@ -6899,9 +6963,7 @@ func (m *QueryAprsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.UsdcAprEdenb.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.UsdcAprEdenb = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { @@ -6933,9 +6995,7 @@ func (m *QueryAprsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.EdenAprEdenb.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.EdenAprEdenb = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 2 { @@ -6967,9 +7027,7 @@ func (m *QueryAprsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.UsdcAprEden.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.UsdcAprEden = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 6: if wireType != 2 { @@ -7001,9 +7059,7 @@ func (m *QueryAprsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.EdenAprEden.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.EdenAprEden = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 7: if wireType != 2 { @@ -7035,9 +7091,7 @@ func (m *QueryAprsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.EdenbAprEden.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.EdenbAprEden = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 8: if wireType != 2 { @@ -7069,9 +7123,7 @@ func (m *QueryAprsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.UsdcAprElys.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.UsdcAprElys = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 9: if wireType != 2 { @@ -7103,9 +7155,7 @@ func (m *QueryAprsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.EdenAprElys.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.EdenAprElys = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 10: if wireType != 2 { @@ -7137,9 +7187,7 @@ func (m *QueryAprsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.EdenbAprElys.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.EdenbAprElys = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/masterchef/types/tx.pb.go b/x/masterchef/types/tx.pb.go index ca3a9ae67..5912f2a37 100644 --- a/x/masterchef/types/tx.pb.go +++ b/x/masterchef/types/tx.pb.go @@ -952,6 +952,7 @@ func _Msg_TogglePoolEdenRewards_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.masterchef.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index 38e20e060..8b2c2f4fd 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -1280,6 +1280,7 @@ func _Query_PriceFeederAll_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.oracle.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/oracle/types/tx.pb.go b/x/oracle/types/tx.pb.go index d88ee7690..39fcfe945 100644 --- a/x/oracle/types/tx.pb.go +++ b/x/oracle/types/tx.pb.go @@ -1323,6 +1323,7 @@ func _Msg_CreateAssetInfo_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.oracle.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/parameter/types/query.pb.go b/x/parameter/types/query.pb.go index 1cfe0187a..5e460ad8c 100644 --- a/x/parameter/types/query.pb.go +++ b/x/parameter/types/query.pb.go @@ -209,6 +209,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.parameter.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/parameter/types/tx.pb.go b/x/parameter/types/tx.pb.go index bd1937d03..e5f597c2f 100644 --- a/x/parameter/types/tx.pb.go +++ b/x/parameter/types/tx.pb.go @@ -709,6 +709,7 @@ func _Msg_UpdateRewardsDataLifetime_Handler(srv interface{}, ctx context.Context return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.parameter.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/perpetual/types/expected_keepers.go b/x/perpetual/types/expected_keepers.go index a6e04e347..2667e3060 100644 --- a/x/perpetual/types/expected_keepers.go +++ b/x/perpetual/types/expected_keepers.go @@ -30,8 +30,8 @@ type AmmKeeper interface { GetAccountedPoolSnapshotOrSet(ctx sdk.Context, pool ammtypes.Pool) (val ammtypes.Pool) - SwapOutAmtGivenIn(ctx sdk.Context, poolId uint64, oracle ammtypes.OracleKeeper, snapshot *ammtypes.Pool, tokensIn sdk.Coins, tokenOutDenom string, swapFee math.LegacyDec, weightBreakingFeePerpetualFactor math.LegacyDec) (tokenOut sdk.Coin, slippage math.LegacyDec, slippageAmount math.LegacyDec, weightBalanceBonus, oracleOut math.LegacyDec, swapFeeFinal math.LegacyDec, err error) - SwapInAmtGivenOut(ctx sdk.Context, poolId uint64, oracle ammtypes.OracleKeeper, snapshot *ammtypes.Pool, tokensOut sdk.Coins, tokenInDenom string, swapFee math.LegacyDec, weightBreakingFeePerpetualFactor math.LegacyDec) (tokenIn sdk.Coin, slippage, slippageAmount math.LegacyDec, weightBalanceBonus, oracleIn math.LegacyDec, swapFeeFinal math.LegacyDec, err error) + SwapOutAmtGivenIn(ctx sdk.Context, poolId uint64, oracle ammtypes.OracleKeeper, snapshot *ammtypes.Pool, tokensIn sdk.Coins, tokenOutDenom string, swapFee math.LegacyDec, weightBreakingFeePerpetualFactor math.LegacyDec) (tokenOut sdk.Coin, slippage, slippageAmount, weightBalanceBonus, oracleOut elystypes.Dec34, swapFeeFinal math.LegacyDec, err error) + SwapInAmtGivenOut(ctx sdk.Context, poolId uint64, oracle ammtypes.OracleKeeper, snapshot *ammtypes.Pool, tokensOut sdk.Coins, tokenInDenom string, swapFee math.LegacyDec, weightBreakingFeePerpetualFactor math.LegacyDec) (tokenIn sdk.Coin, slippage, slippageAmount, weightBalanceBonus, oracleIn elystypes.Dec34, swapFeeFinal math.LegacyDec, err error) AddToPoolBalanceAndUpdateLiquidity(ctx sdk.Context, pool *ammtypes.Pool, addShares math.Int, coins sdk.Coins) error RemoveFromPoolBalanceAndUpdateLiquidity(ctx sdk.Context, pool *ammtypes.Pool, removeShares math.Int, coins sdk.Coins) error diff --git a/x/perpetual/types/query.pb.go b/x/perpetual/types/query.pb.go index 3df34fc5e..34b4069bc 100644 --- a/x/perpetual/types/query.pb.go +++ b/x/perpetual/types/query.pb.go @@ -2144,6 +2144,7 @@ func _Query_CloseEstimation_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.perpetual.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/perpetual/types/tx.pb.go b/x/perpetual/types/tx.pb.go index 7040487c5..4d7870da5 100644 --- a/x/perpetual/types/tx.pb.go +++ b/x/perpetual/types/tx.pb.go @@ -1443,6 +1443,7 @@ func _Msg_UpdateEnabledPools_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.perpetual.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/stablestake/keeper/tvl.go b/x/stablestake/keeper/tvl.go index 64be8d778..861c6dde3 100644 --- a/x/stablestake/keeper/tvl.go +++ b/x/stablestake/keeper/tvl.go @@ -1,21 +1,21 @@ package keeper import ( - "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/stablestake/types" ) -func (k Keeper) TVL(ctx sdk.Context, oracleKeeper types.OracleKeeper, baseCurrency string) math.LegacyDec { +func (k Keeper) TVL(ctx sdk.Context, oracleKeeper types.OracleKeeper, baseCurrency string) elystypes.Dec34 { params := k.GetParams(ctx) totalDeposit := params.TotalValue price := oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) return price.MulInt(totalDeposit) } -func (k Keeper) ShareDenomPrice(ctx sdk.Context, oracleKeeper types.OracleKeeper, baseCurrency string) math.LegacyDec { +func (k Keeper) ShareDenomPrice(ctx sdk.Context, oracleKeeper types.OracleKeeper, baseCurrency string) elystypes.Dec34 { params := k.GetParams(ctx) redemptionRate := params.RedemptionRate price := oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) - return price.Mul(redemptionRate) + return price.MulLegacyDec(redemptionRate) } diff --git a/x/stablestake/types/expected_keepers.go b/x/stablestake/types/expected_keepers.go index 41f434d4b..5332b426b 100644 --- a/x/stablestake/types/expected_keepers.go +++ b/x/stablestake/types/expected_keepers.go @@ -2,8 +2,9 @@ package types import ( "context" - sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" assetprofiletypes "github.com/elys-network/elys/x/assetprofile/types" oracletypes "github.com/elys-network/elys/x/oracle/types" ) @@ -37,6 +38,6 @@ type AssetProfileKeeper interface { // OracleKeeper defines the expected interface needed to retrieve price info type OracleKeeper interface { GetAssetPrice(ctx sdk.Context, asset string) (oracletypes.Price, bool) - GetAssetPriceFromDenom(ctx sdk.Context, denom string) sdkmath.LegacyDec + GetAssetPriceFromDenom(ctx sdk.Context, denom string) elystypes.Dec34 GetPriceFeeder(ctx sdk.Context, feeder sdk.AccAddress) (val oracletypes.PriceFeeder, found bool) } diff --git a/x/stablestake/types/query.pb.go b/x/stablestake/types/query.pb.go index a6a256c59..4c000b8f0 100644 --- a/x/stablestake/types/query.pb.go +++ b/x/stablestake/types/query.pb.go @@ -340,6 +340,7 @@ func _Query_BorrowRatio_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.stablestake.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/stablestake/types/tx.pb.go b/x/stablestake/types/tx.pb.go index 97f640998..8c9259238 100644 --- a/x/stablestake/types/tx.pb.go +++ b/x/stablestake/types/tx.pb.go @@ -463,6 +463,7 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.stablestake.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/tier/keeper/portfolio.go b/x/tier/keeper/portfolio.go index ee59dffdd..f53fd6d7d 100644 --- a/x/tier/keeper/portfolio.go +++ b/x/tier/keeper/portfolio.go @@ -21,6 +21,7 @@ import ( perpetualtypes "github.com/elys-network/elys/x/perpetual/types" tradeshieldtypes "github.com/elys-network/elys/x/tradeshield/types" + elystypes "github.com/elys-network/elys/types" ptypes "github.com/elys-network/elys/x/parameter/types" "github.com/elys-network/elys/x/tier/types" ) @@ -34,7 +35,7 @@ func (k Keeper) RetrieveAllPortfolio(ctx sdk.Context, user sdk.AccAddress) { return } - totalValue := sdkmath.LegacyNewDec(0) + totalValue := elystypes.ZeroDec34() // Liquid assets liq := k.RetrieveLiquidAssetsTotal(ctx, user) @@ -58,7 +59,7 @@ func (k Keeper) RetrieveAllPortfolio(ctx sdk.Context, user sdk.AccAddress) { baseCurrency, found := k.assetProfileKeeper.GetUsdcDenom(ctx) if found { edenDenomPrice := k.amm.GetEdenDenomPrice(ctx, baseCurrency) - totalVesting = totalVesting.Mul(edenDenomPrice) + totalVesting = totalVesting.Mul(elystypes.NewDec34FromLegacyDec(edenDenomPrice)) } totalValue = totalValue.Add(commit).Add(delegations).Add(unbondings).Add(totalVesting) @@ -70,11 +71,11 @@ func (k Keeper) RetrieveAllPortfolio(ctx sdk.Context, user sdk.AccAddress) { tradeshieldTotal := k.RetrieveTradeshieldTotal(ctx, user) totalValue = totalValue.Add(tradeshieldTotal) - k.SetPortfolio(ctx, types.NewPortfolioWithContextDate(todayDate, user, totalValue)) + k.SetPortfolio(ctx, types.NewPortfolioWithContextDate(todayDate, user, totalValue.ToLegacyDec())) } -func (k Keeper) RetrievePoolTotal(ctx sdk.Context, user sdk.AccAddress) sdkmath.LegacyDec { - totalValue := sdkmath.LegacyNewDec(0) +func (k Keeper) RetrievePoolTotal(ctx sdk.Context, user sdk.AccAddress) elystypes.Dec34 { + totalValue := elystypes.ZeroDec34() commitments := k.commitement.GetCommitments(ctx, user) for _, commitment := range commitments.CommittedTokens { // Pool balance @@ -88,21 +89,20 @@ func (k Keeper) RetrievePoolTotal(ctx sdk.Context, user sdk.AccAddress) sdkmath. continue } info := k.amm.PoolExtraInfo(ctx, pool) - amount := commitment.Amount.ToLegacyDec() - totalValue = totalValue.Add(amount.Mul(info.LpTokenPrice).QuoInt(ammtypes.OneShare)) + totalValue = totalValue.Add(elystypes.NewDec34FromLegacyDec(info.LpTokenPrice).MulInt(commitment.Amount).QuoInt(ammtypes.OneShare)) } } return totalValue } -func (k Keeper) RetrieveStaked(ctx sdk.Context, user sdk.AccAddress) (sdkmath.LegacyDec, sdkmath.LegacyDec, sdkmath.LegacyDec, sdkmath.LegacyDec) { - totalCommit := sdkmath.LegacyNewDec(0) +func (k Keeper) RetrieveStaked(ctx sdk.Context, user sdk.AccAddress) (elystypes.Dec34, elystypes.Dec34, elystypes.Dec34, elystypes.Dec34) { + totalCommit := elystypes.ZeroDec34() commitments := k.commitement.GetCommitments(ctx, user) - totalVested := sdkmath.LegacyNewDec(0) + totalVested := elystypes.ZeroDec34() vestingResp, vestErr := k.commitement.CommitmentVestingInfo(ctx, &commitmenttypes.QueryCommitmentVestingInfoRequest{Address: user.String()}) if vestErr == nil { - totalVested = vestingResp.Total.ToLegacyDec() + totalVested = elystypes.NewDec34FromInt(vestingResp.Total) } for _, commitment := range commitments.CommittedTokens { if !strings.HasPrefix(commitment.Denom, "amm/pool") { @@ -113,7 +113,7 @@ func (k Keeper) RetrieveStaked(ctx sdk.Context, user sdk.AccAddress) (sdkmath.Le } tokenPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, usdcDenom) params := k.stablestakeKeeper.GetParams(ctx) - usdValue := commitment.Amount.ToLegacyDec().Mul(params.RedemptionRate).Mul(tokenPrice) + usdValue := elystypes.NewDec34FromLegacyDec(params.RedemptionRate).MulInt(commitment.Amount).Mul(tokenPrice) totalCommit = totalCommit.Add(usdValue) continue } @@ -125,16 +125,15 @@ func (k Keeper) RetrieveStaked(ctx sdk.Context, user sdk.AccAddress) (sdkmath.Le if !found { continue } - if tokenPrice.Equal(sdkmath.LegacyZeroDec()) { + if tokenPrice.IsZero() { tokenPrice = k.amm.CalcAmmPrice(ctx, asset.Denom, asset.Decimals) } - amount := commitment.Amount.ToLegacyDec() - totalCommit = totalCommit.Add(amount.Mul(tokenPrice)) + totalCommit = totalCommit.Add(tokenPrice.MulInt(commitment.Amount)) } } // Delegations - totalDelegations := sdkmath.LegacyNewDec(0) + totalDelegations := elystypes.ZeroDec34() delegations, err := k.stakingKeeper.GetAllDelegatorDelegations(ctx, user) if err != nil { ctx.Logger().Error(err.Error()) @@ -146,18 +145,18 @@ func (k Keeper) RetrieveStaked(ctx sdk.Context, user sdk.AccAddress) (sdkmath.Le } tokenPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, bondDenom) asset, found := k.assetProfileKeeper.GetEntryByDenom(ctx, bondDenom) - if tokenPrice.Equal(sdkmath.LegacyZeroDec()) { + if tokenPrice.IsZero() { tokenPrice = k.amm.CalcAmmPrice(ctx, asset.Denom, asset.Decimals) } if found { for _, delegation := range delegations { - amount := delegation.Shares - totalDelegations = totalDelegations.Add(amount.Mul(tokenPrice)) + amount := elystypes.NewDec34FromLegacyDec(delegation.Shares) + totalDelegations = totalDelegations.Add(tokenPrice.Mul(amount)) } } // Max could be 7 for an account - totalUnbondings := sdkmath.LegacyNewDec(0) + totalUnbondings := elystypes.ZeroDec34() unbondingDelegations, err := k.stakingKeeper.GetUnbondingDelegations(ctx, user, 100) if err != nil { ctx.Logger().Error(err.Error()) @@ -166,16 +165,15 @@ func (k Keeper) RetrieveStaked(ctx sdk.Context, user sdk.AccAddress) (sdkmath.Le if found { for _, delegation := range unbondingDelegations { for _, entry := range delegation.Entries { - amount := entry.Balance.ToLegacyDec() - totalUnbondings = totalUnbondings.Add(amount.Mul(tokenPrice)) + totalUnbondings = totalUnbondings.Add(tokenPrice.MulInt(entry.Balance)) } } } return totalCommit, totalDelegations, totalUnbondings, totalVested } -func (k Keeper) RetrieveRewardsTotal(ctx sdk.Context, user sdk.AccAddress) sdkmath.LegacyDec { - totalValue := sdkmath.LegacyNewDec(0) +func (k Keeper) RetrieveRewardsTotal(ctx sdk.Context, user sdk.AccAddress) elystypes.Dec34 { + totalValue := elystypes.ZeroDec34() estaking, err1 := k.estaking.Rewards(ctx, &estakingtypes.QueryRewardsRequest{Address: user.String()}) masterchef, err2 := k.masterchef.UserPendingReward(ctx, &mastercheftypes.QueryUserPendingRewardRequest{User: user.String()}) @@ -189,11 +187,10 @@ func (k Keeper) RetrieveRewardsTotal(ctx sdk.Context, user sdk.AccAddress) sdkma if !found { continue } - if tokenPrice.Equal(sdkmath.LegacyZeroDec()) { + if tokenPrice.IsZero() { tokenPrice = k.amm.CalcAmmPrice(ctx, asset.Denom, asset.Decimals) } - amount := balance.Amount.ToLegacyDec() - totalValue = totalValue.Add(amount.Mul(tokenPrice)) + totalValue = totalValue.Add(tokenPrice.MulInt(balance.Amount)) } } @@ -207,45 +204,44 @@ func (k Keeper) RetrieveRewardsTotal(ctx sdk.Context, user sdk.AccAddress) sdkma if !found { continue } - if tokenPrice.Equal(sdkmath.LegacyZeroDec()) { + if tokenPrice.IsZero() { tokenPrice = k.amm.CalcAmmPrice(ctx, asset.Denom, asset.Decimals) } - amount := balance.Amount.ToLegacyDec() - totalValue = totalValue.Add(amount.Mul(tokenPrice)) + totalValue = totalValue.Add(tokenPrice.MulInt(balance.Amount)) } } return totalValue } -func (k Keeper) RetrievePerpetualTotal(ctx sdk.Context, user sdk.AccAddress) (sdkmath.LegacyDec, sdkmath.LegacyDec, sdkmath.LegacyDec) { - totalAssets := sdkmath.LegacyNewDec(0) - totalLiability := sdkmath.LegacyNewDec(0) - var netValue sdkmath.LegacyDec +func (k Keeper) RetrievePerpetualTotal(ctx sdk.Context, user sdk.AccAddress) (elystypes.Dec34, elystypes.Dec34, elystypes.Dec34) { + totalAssets := elystypes.ZeroDec34() + totalLiability := elystypes.ZeroDec34() + var netValue elystypes.Dec34 perpetuals, _, err := k.perpetual.GetMTPsForAddressWithPagination(ctx, user, nil) if err != nil { - return sdkmath.LegacyNewDec(0), sdkmath.LegacyNewDec(0), sdkmath.LegacyNewDec(0) + return elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34() } usdcDenom, found := k.assetProfileKeeper.GetUsdcDenom(ctx) if !found { - return sdkmath.LegacyNewDec(0), sdkmath.LegacyNewDec(0), sdkmath.LegacyNewDec(0) + return elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34() } for _, perpetual := range perpetuals { if perpetual.Mtp.Position == perpetualtypes.Position_LONG { - totalAssets = totalAssets.Add(k.amm.CalculateUSDValue(ctx, perpetual.Mtp.GetTradingAsset(), perpetual.Mtp.Custody)) - totalLiability = totalLiability.Add(k.amm.CalculateUSDValue(ctx, usdcDenom, perpetual.Mtp.Liabilities.Add(perpetual.Mtp.BorrowInterestUnpaidLiability))) + totalAssets = totalAssets.Add(elystypes.NewDec34FromLegacyDec(k.amm.CalculateUSDValue(ctx, perpetual.Mtp.GetTradingAsset(), perpetual.Mtp.Custody))) + totalLiability = totalLiability.Add(elystypes.NewDec34FromLegacyDec(k.amm.CalculateUSDValue(ctx, usdcDenom, perpetual.Mtp.Liabilities.Add(perpetual.Mtp.BorrowInterestUnpaidLiability)))) } else { - totalAssets = totalAssets.Add(k.amm.CalculateUSDValue(ctx, usdcDenom, perpetual.Mtp.Custody)) - totalLiability = totalLiability.Add(k.amm.CalculateUSDValue(ctx, perpetual.Mtp.LiabilitiesAsset, perpetual.Mtp.Liabilities.Add(perpetual.Mtp.BorrowInterestUnpaidLiability))) + totalAssets = totalAssets.Add(elystypes.NewDec34FromLegacyDec(k.amm.CalculateUSDValue(ctx, usdcDenom, perpetual.Mtp.Custody))) + totalLiability = totalLiability.Add(elystypes.NewDec34FromLegacyDec(k.amm.CalculateUSDValue(ctx, perpetual.Mtp.LiabilitiesAsset, perpetual.Mtp.Liabilities.Add(perpetual.Mtp.BorrowInterestUnpaidLiability)))) } } netValue = totalAssets.Sub(totalLiability) return totalAssets, totalLiability, netValue } -func (k Keeper) RetrieveLiquidAssetsTotal(ctx sdk.Context, user sdk.AccAddress) sdkmath.LegacyDec { +func (k Keeper) RetrieveLiquidAssetsTotal(ctx sdk.Context, user sdk.AccAddress) elystypes.Dec34 { balances := k.bankKeeper.GetAllBalances(ctx, user) - totalValue := sdkmath.LegacyNewDec(0) + totalValue := elystypes.ZeroDec34() // Get eden from AmmBalance edenBal, err := k.amm.Balance(ctx, &ammtypes.QueryBalanceRequest{Denom: ptypes.Eden, Address: user.String()}) if err == nil { @@ -260,20 +256,19 @@ func (k Keeper) RetrieveLiquidAssetsTotal(ctx sdk.Context, user sdk.AccAddress) if !found { continue } - if tokenPrice.Equal(sdkmath.LegacyZeroDec()) { + if tokenPrice.IsZero() { tokenPrice = k.amm.CalcAmmPrice(ctx, balance.Denom, asset.Decimals) } - amount := balance.Amount.ToLegacyDec() - totalValue = totalValue.Add(amount.Mul(tokenPrice)) + totalValue = totalValue.Add(tokenPrice.MulInt(balance.Amount)) } return totalValue } -func (k Keeper) RetrieveLeverageLpTotal(ctx sdk.Context, user sdk.AccAddress) (sdkmath.LegacyDec, sdkmath.LegacyDec, sdkmath.LegacyDec) { +func (k Keeper) RetrieveLeverageLpTotal(ctx sdk.Context, user sdk.AccAddress) (elystypes.Dec34, elystypes.Dec34, elystypes.Dec34) { positions, _, err := k.leveragelp.GetPositionsForAddress(ctx, user, &query.PageRequest{}) - totalValue := sdkmath.LegacyNewDec(0) - totalBorrow := sdkmath.LegacyNewDec(0) - netValue := sdkmath.LegacyNewDec(0) + totalValue := elystypes.ZeroDec34() + totalBorrow := elystypes.ZeroDec34() + netValue := elystypes.ZeroDec34() if err == nil { for _, position := range positions { pool, found := k.amm.GetPool(ctx, position.AmmPoolId) @@ -281,8 +276,7 @@ func (k Keeper) RetrieveLeverageLpTotal(ctx sdk.Context, user sdk.AccAddress) (s continue } info := k.amm.PoolExtraInfo(ctx, pool) - amount := position.LeveragedLpAmount.ToLegacyDec() - totalValue = totalValue.Add(amount.Mul(info.LpTokenPrice).QuoInt(ammtypes.OneShare)) + totalValue = totalValue.Add(elystypes.NewDec34FromLegacyDec(info.LpTokenPrice).MulInt(position.LeveragedLpAmount).QuoInt(ammtypes.OneShare)) // USD value of debt debt := k.stablestakeKeeper.GetDebt(ctx, position.GetPositionAddress()) usdcDenom, found := k.assetProfileKeeper.GetUsdcDenom(ctx) @@ -290,24 +284,24 @@ func (k Keeper) RetrieveLeverageLpTotal(ctx sdk.Context, user sdk.AccAddress) (s continue } usdcPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, usdcDenom) - liab := debt.GetTotalLiablities().ToLegacyDec() - totalBorrow = totalBorrow.Add(liab.Mul(usdcPrice)) + liab := debt.GetTotalLiablities() + totalBorrow = totalBorrow.Add(usdcPrice.MulInt(liab)) } netValue = totalValue.Sub(totalBorrow) } return totalValue, totalBorrow, netValue } -func (k Keeper) RetrieveTradeshieldTotal(ctx sdk.Context, user sdk.AccAddress) sdkmath.LegacyDec { +func (k Keeper) RetrieveTradeshieldTotal(ctx sdk.Context, user sdk.AccAddress) elystypes.Dec34 { pendingStatus := tradeshieldtypes.Status_PENDING // Perpetual orders total perpetualOrders, _, err := k.tradeshieldKeeper.GetPendingPerpetualOrdersForAddress(ctx, user.String(), &pendingStatus, &query.PageRequest{}) - totalValue := sdkmath.LegacyNewDec(0) + totalValue := elystypes.ZeroDec34() if err == nil { for _, order := range perpetualOrders { balances := k.bankKeeper.GetAllBalances(ctx, order.GetOrderAddress()) for _, balance := range balances { - totalValue = totalValue.Add(k.amm.CalculateUSDValue(ctx, balance.Denom, balance.Amount)) + totalValue = totalValue.Add(elystypes.NewDec34FromLegacyDec(k.amm.CalculateUSDValue(ctx, balance.Denom, balance.Amount))) } } } @@ -318,29 +312,29 @@ func (k Keeper) RetrieveTradeshieldTotal(ctx sdk.Context, user sdk.AccAddress) s for _, order := range spotOrders { balances := k.bankKeeper.GetAllBalances(ctx, order.GetOrderAddress()) for _, balance := range balances { - totalValue = totalValue.Add(k.amm.CalculateUSDValue(ctx, balance.Denom, balance.Amount)) + totalValue = totalValue.Add(elystypes.NewDec34FromLegacyDec(k.amm.CalculateUSDValue(ctx, balance.Denom, balance.Amount))) } } } return totalValue } -func (k Keeper) RetrieveConsolidatedPrice(ctx sdk.Context, denom string) (sdkmath.LegacyDec, sdkmath.LegacyDec, sdkmath.LegacyDec) { +func (k Keeper) RetrieveConsolidatedPrice(ctx sdk.Context, denom string) (elystypes.Dec34, elystypes.Dec34, elystypes.Dec34) { if denom == ptypes.Eden { denom = ptypes.Elys } tokenPriceOracle := k.oracleKeeper.GetAssetPriceFromDenom(ctx, denom) asset, found := k.assetProfileKeeper.GetEntryByDenom(ctx, denom) if !found { - tokenPriceOracle = sdkmath.LegacyNewDec(0) + tokenPriceOracle = elystypes.ZeroDec34() } tokenPriceAmm := k.amm.CalcAmmPrice(ctx, asset.Denom, asset.Decimals) info, found := k.oracleKeeper.GetAssetInfo(ctx, denom) - tokenPriceOracleDec := sdkmath.LegacyZeroDec() + tokenPriceOracleDec := elystypes.ZeroDec34() if found { tokenPriceOracleD, found := k.oracleKeeper.GetAssetPrice(ctx, info.Display) if found { - tokenPriceOracleDec = tokenPriceOracleD.Price + tokenPriceOracleDec = elystypes.NewDec34FromLegacyDec(tokenPriceOracleD.Price) } } diff --git a/x/tier/keeper/query_get_amm_price.go b/x/tier/keeper/query_get_amm_price.go index 635b81726..23c99b03b 100644 --- a/x/tier/keeper/query_get_amm_price.go +++ b/x/tier/keeper/query_get_amm_price.go @@ -19,7 +19,7 @@ func (k Keeper) GetAmmPrice(goCtx context.Context, req *types.QueryGetAmmPriceRe return &types.QueryGetAmmPriceResponse{ Result: &types.GetAmmPriceResponseResult{ - Total: resp, + Total: resp.String(), }, }, nil } diff --git a/x/tier/keeper/query_get_consolidated_price.go b/x/tier/keeper/query_get_consolidated_price.go index 761a72854..ead12e9d8 100644 --- a/x/tier/keeper/query_get_consolidated_price.go +++ b/x/tier/keeper/query_get_consolidated_price.go @@ -22,9 +22,9 @@ func (k Keeper) GetConsolidatedPrice(goCtx context.Context, req *types.QueryGetC oracle, amm, oracleDec := k.RetrieveConsolidatedPrice(ctx, req.Denom) return &types.QueryGetConsolidatedPriceResponse{ - AmmPrice: amm, - OraclePrice: oracle, - OraclePriceDec: oracleDec, + AmmPrice: amm.String(), + OraclePrice: oracle.String(), + OraclePriceDec: oracleDec.String(), }, nil } @@ -45,8 +45,8 @@ func (k Keeper) GetAllPrices(goCtx context.Context, req *types.QueryGetAllPrices if assetEntry.Denom == ptypes.Eden { denom = ptypes.Elys } - tokenPriceOracle := k.oracleKeeper.GetAssetPriceFromDenomAsDec34(ctx, denom).Mul(oracletypes.Pow10AsDec34(assetEntry.Decimals)) - tokenPriceAmm := k.amm.CalcAmmPriceAsDec34(ctx, denom, assetEntry.Decimals).Mul(oracletypes.Pow10AsDec34(assetEntry.Decimals)) + tokenPriceOracle := k.oracleKeeper.GetAssetPriceFromDenom(ctx, denom).Mul(oracletypes.Pow10(assetEntry.Decimals)) + tokenPriceAmm := k.amm.CalcAmmPrice(ctx, denom, assetEntry.Decimals).Mul(oracletypes.Pow10(assetEntry.Decimals)) prices = append(prices, &types.Price{ Denom: assetEntry.Denom, OraclePrice: tokenPriceOracle.String(), diff --git a/x/tier/keeper/query_get_users_pool_data.go b/x/tier/keeper/query_get_users_pool_data.go index 9fa5a36c4..4209b0793 100644 --- a/x/tier/keeper/query_get_users_pool_data.go +++ b/x/tier/keeper/query_get_users_pool_data.go @@ -56,7 +56,7 @@ func (k Keeper) GetUsersPoolData(goCtx context.Context, req *types.QueryGetUsers for _, commitment := range user.CommittedTokens { if strings.HasPrefix(commitment.Denom, "stablestake/share") { - fiatValue := commitment.Amount.ToLegacyDec().Mul(params.RedemptionRate).Mul(tokenPrice) + fiatValue := tokenPrice.MulLegacyDec(params.RedemptionRate).MulInt(commitment.Amount) u.Pools = append(u.Pools, &types.Pool{ Pool: "USDC", PoolId: commitment.Denom, diff --git a/x/tier/keeper/query_leverage_lp_total.go b/x/tier/keeper/query_leverage_lp_total.go index 56dab0163..26818109f 100644 --- a/x/tier/keeper/query_leverage_lp_total.go +++ b/x/tier/keeper/query_leverage_lp_total.go @@ -19,7 +19,7 @@ func (k Keeper) LeverageLpTotal(goCtx context.Context, req *types.QueryLeverageL totalValue, totalBorrow, _ := k.RetrieveLeverageLpTotal(ctx, sender) return &types.QueryLeverageLpTotalResponse{ - TotalValue: totalValue, - TotalBorrows: totalBorrow, + TotalValue: totalValue.String(), + TotalBorrows: totalBorrow.String(), }, nil } diff --git a/x/tier/keeper/query_liquid_total.go b/x/tier/keeper/query_liquid_total.go index e2e768267..21b8d0c26 100644 --- a/x/tier/keeper/query_liquid_total.go +++ b/x/tier/keeper/query_liquid_total.go @@ -19,6 +19,6 @@ func (k Keeper) LiquidTotal(goCtx context.Context, req *types.QueryLiquidTotalRe total := k.RetrieveLiquidAssetsTotal(ctx, sender) return &types.QueryLiquidTotalResponse{ - Total: total, + Total: total.String(), }, nil } diff --git a/x/tier/keeper/query_locked_order.go b/x/tier/keeper/query_locked_order.go index 7aff2bf5e..e87022d44 100644 --- a/x/tier/keeper/query_locked_order.go +++ b/x/tier/keeper/query_locked_order.go @@ -19,6 +19,6 @@ func (k Keeper) LockedOrder(goCtx context.Context, req *types.QueryLockedOrderRe total := k.RetrieveTradeshieldTotal(ctx, sender) return &types.QueryLockedOrderResponse{ - Total: total, + Total: total.String(), }, nil } diff --git a/x/tier/keeper/query_perpetual.go b/x/tier/keeper/query_perpetual.go index 0bcc7e0b4..e9f72f7f7 100644 --- a/x/tier/keeper/query_perpetual.go +++ b/x/tier/keeper/query_perpetual.go @@ -19,7 +19,7 @@ func (k Keeper) Perpetual(goCtx context.Context, req *types.QueryPerpetualReques total, borrow, _ := k.RetrievePerpetualTotal(ctx, sender) return &types.QueryPerpetualResponse{ - TotalValue: total, - TotalBorrows: borrow, + TotalValue: total.String(), + TotalBorrows: borrow.String(), }, nil } diff --git a/x/tier/keeper/query_rewards_total.go b/x/tier/keeper/query_rewards_total.go index b7302dd3c..c3c39ee3f 100644 --- a/x/tier/keeper/query_rewards_total.go +++ b/x/tier/keeper/query_rewards_total.go @@ -19,6 +19,6 @@ func (k Keeper) RewardsTotal(goCtx context.Context, req *types.QueryRewardsTotal total := k.RetrieveRewardsTotal(ctx, sender) return &types.QueryRewardsTotalResponse{ - Total: total, + Total: total.String(), }, nil } diff --git a/x/tier/keeper/query_staked.go b/x/tier/keeper/query_staked.go index 9d66ed120..7e5c7dede 100644 --- a/x/tier/keeper/query_staked.go +++ b/x/tier/keeper/query_staked.go @@ -20,9 +20,9 @@ func (k Keeper) Staked(goCtx context.Context, req *types.QueryStakedRequest) (*t com, del, unbon, totalVested := k.RetrieveStaked(ctx, sender) return &types.QueryStakedResponse{ - Commitments: com, - Delegations: del, - Unbondings: unbon, - TotalVested: totalVested, + Commitments: com.String(), + Delegations: del.String(), + Unbondings: unbon.String(), + TotalVested: totalVested.String(), }, nil } diff --git a/x/tier/keeper/query_staked_pool.go b/x/tier/keeper/query_staked_pool.go index e8d0c2594..f57d09479 100644 --- a/x/tier/keeper/query_staked_pool.go +++ b/x/tier/keeper/query_staked_pool.go @@ -19,6 +19,6 @@ func (k Keeper) StakedPool(goCtx context.Context, req *types.QueryStakedPoolRequ total := k.RetrievePoolTotal(ctx, sender) return &types.QueryStakedPoolResponse{ - Total: total, + Total: total.String(), }, nil } diff --git a/x/tier/types/expected_keepers.go b/x/tier/types/expected_keepers.go index f9616f88d..64067d82a 100644 --- a/x/tier/types/expected_keepers.go +++ b/x/tier/types/expected_keepers.go @@ -81,8 +81,7 @@ type AmmKeeper interface { Balance(goCtx context.Context, req *ammtypes.QueryBalanceRequest) (*ammtypes.QueryBalanceResponse, error) GetEdenDenomPrice(ctx sdk.Context, baseCurrency string) math.LegacyDec CalculateUSDValue(ctx sdk.Context, denom string, amount math.Int) math.LegacyDec - CalcAmmPrice(ctx sdk.Context, denom string, decimal uint64) math.LegacyDec - CalcAmmPriceAsDec34(ctx sdk.Context, denom string, decimal uint64) elystypes.Dec34 + CalcAmmPrice(ctx sdk.Context, denom string, decimal uint64) elystypes.Dec34 } type EstakingKeeper interface { diff --git a/x/tier/types/query.pb.go b/x/tier/types/query.pb.go index b91020624..39a59e989 100644 --- a/x/tier/types/query.pb.go +++ b/x/tier/types/query.pb.go @@ -5,7 +5,6 @@ package types import ( context "context" - cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" query "github.com/cosmos/cosmos-sdk/types/query" @@ -440,8 +439,8 @@ func (m *QueryLeverageLpTotalRequest) GetUser() string { } type QueryLeverageLpTotalResponse struct { - TotalValue cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=total_value,json=totalValue,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"total_value"` - TotalBorrows cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=total_borrows,json=totalBorrows,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"total_borrows"` + TotalValue string `protobuf:"bytes,1,opt,name=total_value,json=totalValue,proto3" json:"total_value,omitempty"` + TotalBorrows string `protobuf:"bytes,2,opt,name=total_borrows,json=totalBorrows,proto3" json:"total_borrows,omitempty"` } func (m *QueryLeverageLpTotalResponse) Reset() { *m = QueryLeverageLpTotalResponse{} } @@ -477,6 +476,20 @@ func (m *QueryLeverageLpTotalResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryLeverageLpTotalResponse proto.InternalMessageInfo +func (m *QueryLeverageLpTotalResponse) GetTotalValue() string { + if m != nil { + return m.TotalValue + } + return "" +} + +func (m *QueryLeverageLpTotalResponse) GetTotalBorrows() string { + if m != nil { + return m.TotalBorrows + } + return "" +} + type QueryRewardsTotalRequest struct { User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` } @@ -522,7 +535,7 @@ func (m *QueryRewardsTotalRequest) GetUser() string { } type QueryRewardsTotalResponse struct { - Total cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=total,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"total"` + Total string `protobuf:"bytes,1,opt,name=total,proto3" json:"total,omitempty"` } func (m *QueryRewardsTotalResponse) Reset() { *m = QueryRewardsTotalResponse{} } @@ -558,6 +571,13 @@ func (m *QueryRewardsTotalResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryRewardsTotalResponse proto.InternalMessageInfo +func (m *QueryRewardsTotalResponse) GetTotal() string { + if m != nil { + return m.Total + } + return "" +} + type QueryStakedPoolRequest struct { User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` } @@ -603,7 +623,7 @@ func (m *QueryStakedPoolRequest) GetUser() string { } type QueryStakedPoolResponse struct { - Total cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=total,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"total"` + Total string `protobuf:"bytes,1,opt,name=total,proto3" json:"total,omitempty"` } func (m *QueryStakedPoolResponse) Reset() { *m = QueryStakedPoolResponse{} } @@ -639,6 +659,13 @@ func (m *QueryStakedPoolResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryStakedPoolResponse proto.InternalMessageInfo +func (m *QueryStakedPoolResponse) GetTotal() string { + if m != nil { + return m.Total + } + return "" +} + type QueryPerpetualRequest struct { User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` } @@ -684,8 +711,8 @@ func (m *QueryPerpetualRequest) GetUser() string { } type QueryPerpetualResponse struct { - TotalValue cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=total_value,json=totalValue,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"total_value"` - TotalBorrows cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=total_borrows,json=totalBorrows,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"total_borrows"` + TotalValue string `protobuf:"bytes,1,opt,name=total_value,json=totalValue,proto3" json:"total_value,omitempty"` + TotalBorrows string `protobuf:"bytes,2,opt,name=total_borrows,json=totalBorrows,proto3" json:"total_borrows,omitempty"` } func (m *QueryPerpetualResponse) Reset() { *m = QueryPerpetualResponse{} } @@ -721,6 +748,20 @@ func (m *QueryPerpetualResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryPerpetualResponse proto.InternalMessageInfo +func (m *QueryPerpetualResponse) GetTotalValue() string { + if m != nil { + return m.TotalValue + } + return "" +} + +func (m *QueryPerpetualResponse) GetTotalBorrows() string { + if m != nil { + return m.TotalBorrows + } + return "" +} + type QueryLiquidTotalRequest struct { User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` } @@ -766,7 +807,7 @@ func (m *QueryLiquidTotalRequest) GetUser() string { } type QueryLiquidTotalResponse struct { - Total cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=total,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"total"` + Total string `protobuf:"bytes,1,opt,name=total,proto3" json:"total,omitempty"` } func (m *QueryLiquidTotalResponse) Reset() { *m = QueryLiquidTotalResponse{} } @@ -802,6 +843,13 @@ func (m *QueryLiquidTotalResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryLiquidTotalResponse proto.InternalMessageInfo +func (m *QueryLiquidTotalResponse) GetTotal() string { + if m != nil { + return m.Total + } + return "" +} + type QueryLockedOrderRequest struct { User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` } @@ -847,7 +895,7 @@ func (m *QueryLockedOrderRequest) GetUser() string { } type QueryLockedOrderResponse struct { - Total cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=total,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"total"` + Total string `protobuf:"bytes,1,opt,name=total,proto3" json:"total,omitempty"` } func (m *QueryLockedOrderResponse) Reset() { *m = QueryLockedOrderResponse{} } @@ -883,6 +931,13 @@ func (m *QueryLockedOrderResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryLockedOrderResponse proto.InternalMessageInfo +func (m *QueryLockedOrderResponse) GetTotal() string { + if m != nil { + return m.Total + } + return "" +} + type QueryGetAmmPriceRequest struct { Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` Decimal int32 `protobuf:"varint,2,opt,name=decimal,proto3" json:"decimal,omitempty"` @@ -938,7 +993,7 @@ func (m *QueryGetAmmPriceRequest) GetDecimal() int32 { // We use a submessage to avoid the issue with the gRPC codec // https://github.com/cosmos/cosmos-sdk/issues/18430 type GetAmmPriceResponseResult struct { - Total cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=total,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"total"` + Total string `protobuf:"bytes,1,opt,name=total,proto3" json:"total,omitempty"` } func (m *GetAmmPriceResponseResult) Reset() { *m = GetAmmPriceResponseResult{} } @@ -974,6 +1029,13 @@ func (m *GetAmmPriceResponseResult) XXX_DiscardUnknown() { var xxx_messageInfo_GetAmmPriceResponseResult proto.InternalMessageInfo +func (m *GetAmmPriceResponseResult) GetTotal() string { + if m != nil { + return m.Total + } + return "" +} + type QueryGetAmmPriceResponse struct { Result *GetAmmPriceResponseResult `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` } @@ -1063,9 +1125,9 @@ func (m *QueryGetConsolidatedPriceRequest) GetDenom() string { } type QueryGetConsolidatedPriceResponse struct { - AmmPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=amm_price,json=ammPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"amm_price"` - OraclePrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=oracle_price,json=oraclePrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"oracle_price"` - OraclePriceDec cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=oracle_price_dec,json=oraclePriceDec,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"oracle_price_dec"` + AmmPrice string `protobuf:"bytes,1,opt,name=amm_price,json=ammPrice,proto3" json:"amm_price,omitempty"` + OraclePrice string `protobuf:"bytes,2,opt,name=oracle_price,json=oraclePrice,proto3" json:"oracle_price,omitempty"` + OraclePriceDec string `protobuf:"bytes,3,opt,name=oracle_price_dec,json=oraclePriceDec,proto3" json:"oracle_price_dec,omitempty"` } func (m *QueryGetConsolidatedPriceResponse) Reset() { *m = QueryGetConsolidatedPriceResponse{} } @@ -1101,6 +1163,27 @@ func (m *QueryGetConsolidatedPriceResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryGetConsolidatedPriceResponse proto.InternalMessageInfo +func (m *QueryGetConsolidatedPriceResponse) GetAmmPrice() string { + if m != nil { + return m.AmmPrice + } + return "" +} + +func (m *QueryGetConsolidatedPriceResponse) GetOraclePrice() string { + if m != nil { + return m.OraclePrice + } + return "" +} + +func (m *QueryGetConsolidatedPriceResponse) GetOraclePriceDec() string { + if m != nil { + return m.OraclePriceDec + } + return "" +} + type QueryStakedRequest struct { User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` } @@ -1146,10 +1229,10 @@ func (m *QueryStakedRequest) GetUser() string { } type QueryStakedResponse struct { - Commitments cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=commitments,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"commitments"` - Delegations cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=delegations,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"delegations"` - Unbondings cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=unbondings,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"unbondings"` - TotalVested cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=total_vested,json=totalVested,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"total_vested"` + Commitments string `protobuf:"bytes,1,opt,name=commitments,proto3" json:"commitments,omitempty"` + Delegations string `protobuf:"bytes,2,opt,name=delegations,proto3" json:"delegations,omitempty"` + Unbondings string `protobuf:"bytes,3,opt,name=unbondings,proto3" json:"unbondings,omitempty"` + TotalVested string `protobuf:"bytes,4,opt,name=total_vested,json=totalVested,proto3" json:"total_vested,omitempty"` } func (m *QueryStakedResponse) Reset() { *m = QueryStakedResponse{} } @@ -1185,6 +1268,34 @@ func (m *QueryStakedResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryStakedResponse proto.InternalMessageInfo +func (m *QueryStakedResponse) GetCommitments() string { + if m != nil { + return m.Commitments + } + return "" +} + +func (m *QueryStakedResponse) GetDelegations() string { + if m != nil { + return m.Delegations + } + return "" +} + +func (m *QueryStakedResponse) GetUnbondings() string { + if m != nil { + return m.Unbondings + } + return "" +} + +func (m *QueryStakedResponse) GetTotalVested() string { + if m != nil { + return m.TotalVested + } + return "" +} + type QueryGetUsersPoolDataRequest struct { Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -1475,103 +1586,98 @@ func init() { func init() { proto.RegisterFile("elys/tier/query.proto", fileDescriptor_461504ebf74c9a97) } var fileDescriptor_461504ebf74c9a97 = []byte{ - // 1528 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x98, 0xcf, 0x6f, 0xdc, 0x44, - 0x14, 0xc7, 0xe3, 0xb4, 0x09, 0xe4, 0x6d, 0xe8, 0x8f, 0x69, 0x5a, 0xd2, 0x6d, 0xbb, 0x6d, 0xdc, - 0xd2, 0x6c, 0xdb, 0xc4, 0x6e, 0xd2, 0x0a, 0xc2, 0x6f, 0x35, 0x59, 0x35, 0x42, 0x0a, 0x90, 0x6e, - 0x4b, 0x85, 0x40, 0x68, 0x35, 0x6b, 0x4f, 0xb7, 0x56, 0x6c, 0xcf, 0xd6, 0x33, 0x9b, 0x12, 0x55, - 0xbd, 0xf4, 0x82, 0x10, 0x52, 0x41, 0xf4, 0x80, 0x84, 0x10, 0x17, 0x24, 0x6e, 0x1c, 0x90, 0xf8, - 0x13, 0x38, 0x54, 0x9c, 0x2a, 0xb8, 0x20, 0x0e, 0x15, 0x6a, 0x39, 0xf0, 0x67, 0x20, 0xcf, 0x8c, - 0x77, 0xed, 0xb5, 0xd7, 0xbb, 0x2c, 0x7b, 0xe1, 0x94, 0xf5, 0xf8, 0xbd, 0xef, 0xfb, 0xcc, 0x9b, - 0x1f, 0x7e, 0x2f, 0x70, 0x90, 0xb8, 0x3b, 0xcc, 0xe4, 0x0e, 0x09, 0xcc, 0x5b, 0x2d, 0x12, 0xec, - 0x18, 0xcd, 0x80, 0x72, 0x8a, 0xa6, 0xc2, 0x61, 0x23, 0x1c, 0x2e, 0xce, 0x34, 0x68, 0x83, 0x8a, - 0x51, 0x33, 0xfc, 0x25, 0x0d, 0x8a, 0x47, 0x1b, 0x94, 0x36, 0x5c, 0x62, 0xe2, 0xa6, 0x63, 0x62, - 0xdf, 0xa7, 0x1c, 0x73, 0x87, 0xfa, 0x4c, 0xbd, 0x3d, 0x6b, 0x51, 0xe6, 0x51, 0x66, 0xd6, 0x31, - 0x23, 0x52, 0xd7, 0xdc, 0x5e, 0xaa, 0x13, 0x8e, 0x97, 0xcc, 0x26, 0x6e, 0x38, 0xbe, 0x30, 0x56, - 0xb6, 0x87, 0x3a, 0x04, 0x4d, 0x1c, 0x60, 0x2f, 0xd2, 0x38, 0x1c, 0x1b, 0xa7, 0x01, 0xbf, 0x41, - 0x5d, 0x27, 0x0a, 0x3e, 0xdb, 0x79, 0xd5, 0x62, 0x24, 0xb0, 0x31, 0xc7, 0x91, 0x93, 0x0c, 0x5c, - 0x93, 0xbc, 0xf2, 0x41, 0xbe, 0xd2, 0x67, 0x00, 0x5d, 0x09, 0x49, 0x36, 0x45, 0x90, 0x2a, 0xb9, - 0xd5, 0x22, 0x8c, 0xeb, 0x97, 0xe1, 0x40, 0x62, 0x94, 0x35, 0xa9, 0xcf, 0x08, 0x32, 0x61, 0x52, - 0xc2, 0xcc, 0x6a, 0x27, 0xb4, 0x72, 0x61, 0x79, 0xbf, 0xd1, 0x4e, 0x88, 0x21, 0x4d, 0x57, 0x77, - 0x3f, 0x7c, 0x7c, 0x7c, 0xac, 0xaa, 0xcc, 0x74, 0x03, 0x66, 0x85, 0xce, 0x3a, 0xe1, 0x9b, 0x11, - 0xad, 0x8a, 0x81, 0x10, 0xec, 0x0e, 0x31, 0x85, 0xd4, 0x54, 0x55, 0xfc, 0xd6, 0x2b, 0x70, 0x38, - 0xc3, 0x5e, 0x45, 0x9f, 0x87, 0xbd, 0x9c, 0x72, 0xec, 0xd6, 0xda, 0x13, 0x57, 0xbe, 0x7b, 0xc4, - 0x70, 0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xab, 0xd8, 0x2b, 0x96, 0xfb, 0x1b, 0x0e, 0xba, 0xc5, 0xc2, 0xfc, - 0x88, 0x62, 0x4d, 0xdc, 0x02, 0x35, 0x3b, 0xe4, 0xf8, 0x54, 0x83, 0xe9, 0x78, 0x95, 0x92, 0xf9, - 0x5d, 0xee, 0x2e, 0x94, 0x32, 0xbf, 0xcb, 0xa9, 0x42, 0x47, 0x37, 0x04, 0x50, 0x19, 0x9d, 0xce, - 0xdd, 0x65, 0xae, 0x2b, 0xd7, 0x89, 0xad, 0xae, 0x3d, 0x7c, 0x52, 0xd2, 0x1e, 0x3d, 0x29, 0x69, - 0x7f, 0x3e, 0x29, 0x69, 0x5f, 0x3c, 0x2d, 0x8d, 0x3d, 0x7a, 0x5a, 0x1a, 0xfb, 0xfd, 0x69, 0x69, - 0xec, 0x83, 0x33, 0x0d, 0x87, 0xdf, 0x6c, 0xd5, 0x0d, 0x8b, 0x7a, 0x19, 0x5a, 0x1f, 0x4b, 0x35, - 0xbe, 0xd3, 0x24, 0xac, 0x3e, 0x29, 0xfe, 0x3b, 0x7c, 0xe1, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x58, 0x23, 0xca, 0x20, 0x09, 0x17, 0x00, 0x00, + // 1446 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x98, 0xcf, 0x6f, 0xdc, 0x44, + 0x14, 0xc7, 0xe3, 0xb6, 0x09, 0xe4, 0x6d, 0xe8, 0x8f, 0x69, 0x5a, 0xd2, 0x6d, 0xbb, 0x4d, 0x9c, + 0xd2, 0x6c, 0xdb, 0x64, 0xdd, 0x6c, 0x2b, 0x08, 0xbf, 0xd5, 0x24, 0x6a, 0x84, 0x54, 0x44, 0x58, + 0x0a, 0x42, 0x48, 0xb0, 0xf2, 0xda, 0xd3, 0xad, 0x55, 0xdb, 0xb3, 0xf5, 0xcc, 0xa6, 0x44, 0x55, +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38, 0xee, 0x11, 0x93, 0xfd, 0x51, + 0x62, 0x4d, 0x7d, 0x05, 0x9a, 0xae, 0xe4, 0xf8, 0xd6, 0x80, 0x99, 0xa4, 0x4a, 0xc9, 0xbd, 0x97, + 0x07, 0x85, 0x52, 0xee, 0xbd, 0x9c, 0x11, 0x3a, 0x66, 0x4d, 0x01, 0x55, 0xc9, 0x85, 0xc2, 0x53, + 0xe6, 0xfb, 0x7a, 0x9f, 0xf8, 0xfa, 0xc6, 0xb3, 0x17, 0x15, 0xe3, 0xf9, 0x8b, 0x8a, 0xf1, 0xcf, + 0x8b, 0x8a, 0xf1, 0xe3, 0x5e, 0x65, 0xe2, 0xf9, 0x5e, 0x65, 0xe2, 0xaf, 0xbd, 0xca, 0xc4, 0x17, + 0x17, 0xdb, 0x9e, 0xb8, 0xd3, 0x6d, 0xd5, 0x1c, 0x16, 0xe4, 0xe4, 0xfa, 0x5a, 0x67, 0x13, 0xbb, + 0x1d, 0xca, 0x5b, 0x53, 0xea, 0x7f, 0x5d, 0x57, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xaa, 0xee, + 0xe0, 0x4e, 0xd7, 0x13, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2509,26 +2615,20 @@ func (m *QueryLeverageLpTotalResponse) MarshalToSizedBuffer(dAtA []byte) (int, e _ = i var l int _ = l - { - size := m.TotalBorrows.Size() - i -= size - if _, err := m.TotalBorrows.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.TotalBorrows) > 0 { + i -= len(m.TotalBorrows) + copy(dAtA[i:], m.TotalBorrows) + i = encodeVarintQuery(dAtA, i, uint64(len(m.TotalBorrows))) + i-- + dAtA[i] = 0x12 } - i-- - dAtA[i] = 0x12 - { - size := m.TotalValue.Size() - i -= size - if _, err := m.TotalValue.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.TotalValue) > 0 { + i -= len(m.TotalValue) + copy(dAtA[i:], m.TotalValue) + i = encodeVarintQuery(dAtA, i, uint64(len(m.TotalValue))) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -2582,16 +2682,13 @@ func (m *QueryRewardsTotalResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro _ = i var l int _ = l - { - size := m.Total.Size() - i -= size - if _, err := m.Total.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.Total) > 0 { + i -= len(m.Total) + copy(dAtA[i:], m.Total) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Total))) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -2645,16 +2742,13 @@ func (m *QueryStakedPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l - { - size := m.Total.Size() - i -= size - if _, err := m.Total.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.Total) > 0 { + i -= len(m.Total) + copy(dAtA[i:], m.Total) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Total))) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -2708,26 +2802,20 @@ func (m *QueryPerpetualResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l - { - size := m.TotalBorrows.Size() - i -= size - if _, err := m.TotalBorrows.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.TotalBorrows) > 0 { + i -= len(m.TotalBorrows) + copy(dAtA[i:], m.TotalBorrows) + i = encodeVarintQuery(dAtA, i, uint64(len(m.TotalBorrows))) + i-- + dAtA[i] = 0x12 } - i-- - dAtA[i] = 0x12 - { - size := m.TotalValue.Size() - i -= size - if _, err := m.TotalValue.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.TotalValue) > 0 { + i -= len(m.TotalValue) + copy(dAtA[i:], m.TotalValue) + i = encodeVarintQuery(dAtA, i, uint64(len(m.TotalValue))) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -2781,16 +2869,13 @@ func (m *QueryLiquidTotalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error _ = i var l int _ = l - { - size := m.Total.Size() - i -= size - if _, err := m.Total.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.Total) > 0 { + i -= len(m.Total) + copy(dAtA[i:], m.Total) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Total))) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -2844,16 +2929,13 @@ func (m *QueryLockedOrderResponse) MarshalToSizedBuffer(dAtA []byte) (int, error _ = i var l int _ = l - { - size := m.Total.Size() - i -= size - if _, err := m.Total.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.Total) > 0 { + i -= len(m.Total) + copy(dAtA[i:], m.Total) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Total))) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -2912,16 +2994,13 @@ func (m *GetAmmPriceResponseResult) MarshalToSizedBuffer(dAtA []byte) (int, erro _ = i var l int _ = l - { - size := m.Total.Size() - i -= size - if _, err := m.Total.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.Total) > 0 { + i -= len(m.Total) + copy(dAtA[i:], m.Total) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Total))) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -3010,36 +3089,27 @@ func (m *QueryGetConsolidatedPriceResponse) MarshalToSizedBuffer(dAtA []byte) (i _ = i var l int _ = l - { - size := m.OraclePriceDec.Size() - i -= size - if _, err := m.OraclePriceDec.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.OraclePriceDec) > 0 { + i -= len(m.OraclePriceDec) + copy(dAtA[i:], m.OraclePriceDec) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OraclePriceDec))) + i-- + dAtA[i] = 0x1a } - i-- - dAtA[i] = 0x1a - { - size := m.OraclePrice.Size() - i -= size - if _, err := m.OraclePrice.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.OraclePrice) > 0 { + i -= len(m.OraclePrice) + copy(dAtA[i:], m.OraclePrice) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OraclePrice))) + i-- + dAtA[i] = 0x12 } - i-- - dAtA[i] = 0x12 - { - size := m.AmmPrice.Size() - i -= size - if _, err := m.AmmPrice.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.AmmPrice) > 0 { + i -= len(m.AmmPrice) + copy(dAtA[i:], m.AmmPrice) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AmmPrice))) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -3093,46 +3163,34 @@ func (m *QueryStakedResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size := m.TotalVested.Size() - i -= size - if _, err := m.TotalVested.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.TotalVested) > 0 { + i -= len(m.TotalVested) + copy(dAtA[i:], m.TotalVested) + i = encodeVarintQuery(dAtA, i, uint64(len(m.TotalVested))) + i-- + dAtA[i] = 0x22 } - i-- - dAtA[i] = 0x22 - { - size := m.Unbondings.Size() - i -= size - if _, err := m.Unbondings.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.Unbondings) > 0 { + i -= len(m.Unbondings) + copy(dAtA[i:], m.Unbondings) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Unbondings))) + i-- + dAtA[i] = 0x1a } - i-- - dAtA[i] = 0x1a - { - size := m.Delegations.Size() - i -= size - if _, err := m.Delegations.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.Delegations) > 0 { + i -= len(m.Delegations) + copy(dAtA[i:], m.Delegations) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Delegations))) + i-- + dAtA[i] = 0x12 } - i-- - dAtA[i] = 0x12 - { - size := m.Commitments.Size() - i -= size - if _, err := m.Commitments.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.Commitments) > 0 { + i -= len(m.Commitments) + copy(dAtA[i:], m.Commitments) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Commitments))) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -3486,10 +3544,14 @@ func (m *QueryLeverageLpTotalResponse) Size() (n int) { } var l int _ = l - l = m.TotalValue.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.TotalBorrows.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.TotalValue) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.TotalBorrows) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -3512,8 +3574,10 @@ func (m *QueryRewardsTotalResponse) Size() (n int) { } var l int _ = l - l = m.Total.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.Total) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -3536,8 +3600,10 @@ func (m *QueryStakedPoolResponse) Size() (n int) { } var l int _ = l - l = m.Total.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.Total) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -3560,10 +3626,14 @@ func (m *QueryPerpetualResponse) Size() (n int) { } var l int _ = l - l = m.TotalValue.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.TotalBorrows.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.TotalValue) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.TotalBorrows) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -3586,8 +3656,10 @@ func (m *QueryLiquidTotalResponse) Size() (n int) { } var l int _ = l - l = m.Total.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.Total) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -3610,8 +3682,10 @@ func (m *QueryLockedOrderResponse) Size() (n int) { } var l int _ = l - l = m.Total.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.Total) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -3637,8 +3711,10 @@ func (m *GetAmmPriceResponseResult) Size() (n int) { } var l int _ = l - l = m.Total.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.Total) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -3674,12 +3750,18 @@ func (m *QueryGetConsolidatedPriceResponse) Size() (n int) { } var l int _ = l - l = m.AmmPrice.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.OraclePrice.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.OraclePriceDec.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.AmmPrice) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.OraclePrice) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.OraclePriceDec) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -3702,14 +3784,22 @@ func (m *QueryStakedResponse) Size() (n int) { } var l int _ = l - l = m.Commitments.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.Delegations.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.Unbondings.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.TotalVested.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.Commitments) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Delegations) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Unbondings) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.TotalVested) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -4648,9 +4738,7 @@ func (m *QueryLeverageLpTotalResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.TotalValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.TotalValue = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -4682,9 +4770,7 @@ func (m *QueryLeverageLpTotalResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.TotalBorrows.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.TotalBorrows = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -4848,9 +4934,7 @@ func (m *QueryRewardsTotalResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Total.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Total = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -5014,9 +5098,7 @@ func (m *QueryStakedPoolResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Total.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Total = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -5180,9 +5262,7 @@ func (m *QueryPerpetualResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.TotalValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.TotalValue = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -5214,9 +5294,7 @@ func (m *QueryPerpetualResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.TotalBorrows.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.TotalBorrows = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -5380,9 +5458,7 @@ func (m *QueryLiquidTotalResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Total.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Total = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -5546,9 +5622,7 @@ func (m *QueryLockedOrderResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Total.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Total = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -5731,9 +5805,7 @@ func (m *GetAmmPriceResponseResult) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Total.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Total = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -5983,9 +6055,7 @@ func (m *QueryGetConsolidatedPriceResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.AmmPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.AmmPrice = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -6017,9 +6087,7 @@ func (m *QueryGetConsolidatedPriceResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.OraclePrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.OraclePrice = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { @@ -6051,9 +6119,7 @@ func (m *QueryGetConsolidatedPriceResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.OraclePriceDec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.OraclePriceDec = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -6217,9 +6283,7 @@ func (m *QueryStakedResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Commitments.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Commitments = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -6251,9 +6315,7 @@ func (m *QueryStakedResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Delegations.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Delegations = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { @@ -6285,9 +6347,7 @@ func (m *QueryStakedResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Unbondings.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Unbondings = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { @@ -6319,9 +6379,7 @@ func (m *QueryStakedResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.TotalVested.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.TotalVested = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/tier/types/tx.pb.go b/x/tier/types/tx.pb.go index 36df4574e..3f8f67e92 100644 --- a/x/tier/types/tx.pb.go +++ b/x/tier/types/tx.pb.go @@ -216,6 +216,7 @@ func _Msg_SetPortfolio_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.tier.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/tokenomics/types/query.pb.go b/x/tokenomics/types/query.pb.go index 0c048722d..90d2fe161 100644 --- a/x/tokenomics/types/query.pb.go +++ b/x/tokenomics/types/query.pb.go @@ -874,6 +874,7 @@ func _Query_TimeBasedInflationAll_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.tokenomics.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/tokenomics/types/tx.pb.go b/x/tokenomics/types/tx.pb.go index 0667a4462..441b60fa1 100644 --- a/x/tokenomics/types/tx.pb.go +++ b/x/tokenomics/types/tx.pb.go @@ -1198,6 +1198,7 @@ func _Msg_DeleteTimeBasedInflation_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.tokenomics.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/tradeshield/types/events.go b/x/tradeshield/types/events.go index 2c4308e6d..f19e61399 100644 --- a/x/tradeshield/types/events.go +++ b/x/tradeshield/types/events.go @@ -77,7 +77,7 @@ func NewExecuteLimitBuySpotOrderEvt(order SpotOrder, res *ammtypes.MsgSwapByDeno sdk.NewAttribute("order_target_denom", order.OrderTargetDenom), sdk.NewAttribute("date", order.Date.String()), sdk.NewAttribute("amount", res.Amount.String()), - sdk.NewAttribute("spot_price", res.SpotPrice.String()), + sdk.NewAttribute("spot_price", res.SpotPrice), sdk.NewAttribute("swap_fee", res.SwapFee.String()), sdk.NewAttribute("discount", res.Discount.String()), sdk.NewAttribute("recipient", res.Recipient), @@ -100,7 +100,7 @@ func NewExecuteLimitSellSpotOrderEvt(order SpotOrder, res *ammtypes.MsgSwapByDen sdk.NewAttribute("order_target_denom", order.OrderTargetDenom), sdk.NewAttribute("date", order.Date.String()), sdk.NewAttribute("amount", res.Amount.String()), - sdk.NewAttribute("spot_price", res.SpotPrice.String()), + sdk.NewAttribute("spot_price", res.SpotPrice), sdk.NewAttribute("swap_fee", res.SwapFee.String()), sdk.NewAttribute("discount", res.Discount.String()), sdk.NewAttribute("recipient", res.Recipient), @@ -123,7 +123,7 @@ func NewExecuteStopLossSpotOrderEvt(order SpotOrder, res *ammtypes.MsgSwapByDeno sdk.NewAttribute("order_target_denom", order.OrderTargetDenom), sdk.NewAttribute("date", order.Date.String()), sdk.NewAttribute("amount", res.Amount.String()), - sdk.NewAttribute("spot_price", res.SpotPrice.String()), + sdk.NewAttribute("spot_price", res.SpotPrice), sdk.NewAttribute("swap_fee", res.SwapFee.String()), sdk.NewAttribute("discount", res.Discount.String()), sdk.NewAttribute("recipient", res.Recipient), @@ -146,7 +146,7 @@ func NewExecuteMarketBuySpotOrderEvt(order SpotOrder, res *ammtypes.MsgSwapByDen sdk.NewAttribute("order_target_denom", order.OrderTargetDenom), sdk.NewAttribute("date", order.Date.String()), sdk.NewAttribute("amount", res.Amount.String()), - sdk.NewAttribute("spot_price", res.SpotPrice.String()), + sdk.NewAttribute("spot_price", res.SpotPrice), sdk.NewAttribute("swap_fee", res.SwapFee.String()), sdk.NewAttribute("discount", res.Discount.String()), sdk.NewAttribute("recipient", res.Recipient), diff --git a/x/tradeshield/types/query.pb.go b/x/tradeshield/types/query.pb.go index 3483d627f..9ee0bd345 100644 --- a/x/tradeshield/types/query.pb.go +++ b/x/tradeshield/types/query.pb.go @@ -1029,6 +1029,7 @@ func _Query_PendingSpotOrderForAddress_Handler(srv interface{}, ctx context.Cont return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.tradeshield.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/tradeshield/types/tx.pb.go b/x/tradeshield/types/tx.pb.go index 17a04d6ab..ff87d15d5 100644 --- a/x/tradeshield/types/tx.pb.go +++ b/x/tradeshield/types/tx.pb.go @@ -1633,6 +1633,7 @@ func _Msg_ExecuteOrders_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.tradeshield.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/transferhook/types/query.pb.go b/x/transferhook/types/query.pb.go index 38afb9ad9..f15e496a5 100644 --- a/x/transferhook/types/query.pb.go +++ b/x/transferhook/types/query.pb.go @@ -210,6 +210,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.transferhook.Query", HandlerType: (*QueryServer)(nil), From cb44e75a7076b13f3dc6d37b0b907ad08fe840b2 Mon Sep 17 00:00:00 2001 From: Cosmic Vagabond <121588426+cosmic-vagabond@users.noreply.github.com> Date: Wed, 8 Jan 2025 16:33:43 +0100 Subject: [PATCH 03/18] refactor: remaining module updated to support dec64 and updated ToLegacyDec to work with decimal places less than -18 --- api/elys/leveragelp/query.pulsar.go | 466 +++++++-------- api/elys/perpetual/query.pulsar.go | 595 +++++++++---------- proto/elys/leveragelp/query.proto | 12 +- proto/elys/perpetual/query.proto | 24 +- types/dec34.go | 23 +- types/dec34_test.go | 20 + x/leveragelp/keeper/query_estimation.go | 4 +- x/leveragelp/types/expected_keepers.go | 6 +- x/leveragelp/types/query.pb.go | 298 +++++----- x/perpetual/keeper/estimate_and_repay.go | 7 +- x/perpetual/keeper/estimate_swap.go | 21 +- x/perpetual/keeper/query_close_estimation.go | 4 +- x/perpetual/keeper/query_open_estimation.go | 9 +- x/perpetual/types/query.pb.go | 430 +++++++------- x/tier/keeper/portfolio.go | 14 +- x/tier/types/expected_keepers.go | 6 +- x/tradeshield/keeper/keeper.go | 5 +- x/tradeshield/keeper/pending_spot_order.go | 7 +- x/tradeshield/types/expected_keepers.go | 5 +- 19 files changed, 992 insertions(+), 964 deletions(-) diff --git a/api/elys/leveragelp/query.pulsar.go b/api/elys/leveragelp/query.pulsar.go index 2786183e1..6fcea2ba3 100644 --- a/api/elys/leveragelp/query.pulsar.go +++ b/api/elys/leveragelp/query.pulsar.go @@ -16405,260 +16405,254 @@ var file_elys_leveragelp_query_proto_rawDesc = []byte{ 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x08, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, - 0x65, 0x22, 0x9f, 0x02, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x70, 0x65, 0x6e, 0x45, + 0x65, 0x22, 0xec, 0x01, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x70, 0x65, 0x6e, 0x45, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0c, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x63, 0x0a, 0x14, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, - 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, - 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, - 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x12, 0x77, - 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x61, 0x74, 0x69, - 0x6f, 0x12, 0x50, 0x0a, 0x0a, 0x62, 0x6f, 0x72, 0x72, 0x6f, 0x77, 0x5f, 0x66, 0x65, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, - 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, 0x62, 0x6f, 0x72, 0x72, 0x6f, 0x77, - 0x46, 0x65, 0x65, 0x22, 0x86, 0x01, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6c, 0x6f, - 0x73, 0x65, 0x45, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, - 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, - 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x48, 0x0a, 0x09, 0x6c, 0x70, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, - 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, - 0x6e, 0x74, 0x52, 0x08, 0x6c, 0x70, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x41, 0x0a, 0x13, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, - 0x03, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, - 0x92, 0x01, 0x0a, 0x0a, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1f, - 0x0a, 0x0b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, - 0x63, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, - 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, - 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x06, 0x72, 0x65, - 0x77, 0x61, 0x72, 0x64, 0x22, 0xbf, 0x01, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, - 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, - 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, - 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, - 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x72, 0x65, 0x77, - 0x61, 0x72, 0x64, 0x73, 0x12, 0x70, 0x0a, 0x0d, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x72, 0x65, - 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x52, - 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x22, 0x9d, 0x02, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x45, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x49, 0x0a, 0x09, 0x6c, 0x69, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, + 0x61, 0x74, 0x69, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x77, 0x65, 0x69, 0x67, + 0x68, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x50, + 0x0a, 0x0a, 0x62, 0x6f, 0x72, 0x72, 0x6f, 0x77, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, + 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, 0x62, 0x6f, 0x72, 0x72, 0x6f, 0x77, 0x46, 0x65, 0x65, + 0x22, 0x86, 0x01, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x45, + 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x48, 0x0a, 0x09, 0x6c, 0x70, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, + 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, + 0x08, 0x6c, 0x70, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x41, 0x0a, 0x13, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0x92, 0x01, 0x0a, + 0x0a, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1f, 0x0a, 0x0b, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x0a, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x63, 0x0a, 0x06, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, + 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x22, 0xbf, 0x01, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x07, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x6c, + 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x73, 0x12, 0x70, 0x0a, 0x0d, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, + 0x6f, 0x69, 0x6e, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x73, 0x22, 0xea, 0x01, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6c, 0x6f, + 0x73, 0x65, 0x45, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, + 0x09, 0x6c, 0x69, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, + 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x09, 0x6c, + 0x69, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x30, 0x0a, 0x14, 0x77, 0x65, 0x69, 0x67, + 0x68, 0x74, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0x61, + 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x54, 0x0a, 0x0f, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, - 0x52, 0x09, 0x6c, 0x69, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x63, 0x0a, 0x14, 0x77, - 0x65, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, - 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, - 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, - 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x12, 0x77, 0x65, - 0x69, 0x67, 0x68, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x61, 0x74, 0x69, 0x6f, - 0x12, 0x54, 0x0a, 0x0f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x74, 0x75, 0x72, - 0x6e, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, - 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, - 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0e, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, - 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x22, 0x3d, 0x0a, 0x21, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x4c, 0x6f, - 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xac, 0x02, 0x0a, 0x22, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x4c, 0x6f, - 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x76, 0x0a, 0x10, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, - 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x30, 0xc8, 0xde, 0x1f, - 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, - 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x0f, 0x6c, - 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x12, 0x74, - 0x0a, 0x0f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, - 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, - 0x69, 0x6e, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, - 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x0e, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x74, 0x65, 0x64, 0x32, 0xc9, 0x12, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x77, - 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1e, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, - 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, - 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x26, 0x12, 0x24, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, - 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, - 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x99, 0x01, 0x0a, 0x0e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x21, 0x2e, 0x65, 0x6c, 0x79, - 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x50, 0x6f, 0x73, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, - 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, - 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x40, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x12, 0x38, 0x2f, 0x65, 0x6c, 0x79, 0x73, - 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, - 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x2f, 0x7b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6b, - 0x65, 0x79, 0x7d, 0x12, 0xc1, 0x01, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x73, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x27, 0x2e, 0x65, - 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x50, - 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, - 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x42, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x56, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x50, 0x12, 0x4e, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, - 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2d, 0x62, 0x79, 0x2d, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x7b, 0x61, 0x6d, 0x6d, 0x5f, 0x70, 0x6f, - 0x6f, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x7b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x6b, 0x65, 0x79, 0x7d, 0x12, 0x7a, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, - 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, - 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, - 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, - 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0xcd, 0x01, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x73, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x46, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x12, 0x2b, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, - 0x6c, 0x70, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x46, 0x6f, 0x72, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, - 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, - 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x46, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x56, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x50, 0x12, 0x4e, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, - 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, - 0x6c, 0x70, 0x2f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2d, 0x66, 0x6f, 0x72, - 0x2d, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x7d, 0x2f, 0x7b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6b, - 0x65, 0x79, 0x7d, 0x12, 0x97, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x57, 0x68, 0x69, 0x74, 0x65, - 0x6c, 0x69, 0x73, 0x74, 0x12, 0x21, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, - 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, + 0x52, 0x0e, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, + 0x22, 0x3d, 0x0a, 0x21, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, + 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, + 0xac, 0x02, 0x0a, 0x22, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, + 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x76, 0x0a, 0x10, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x0f, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x43, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x12, 0x74, 0x0a, 0x0f, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x30, 0xc8, 0xde, + 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, + 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x0e, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x32, 0xc9, + 0x12, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x77, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x1e, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, + 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, + 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x65, 0x6c, + 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, + 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x12, 0x99, 0x01, 0x0a, 0x0e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x73, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x21, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, + 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, - 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, - 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0x82, 0xd3, 0xe4, + 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x12, 0x38, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, - 0x6c, 0x70, 0x2f, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x2f, 0x7b, 0x70, 0x61, - 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6b, 0x65, 0x79, 0x7d, 0x12, 0x94, 0x01, - 0x0a, 0x0d, 0x49, 0x73, 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x12, - 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, - 0x70, 0x2e, 0x49, 0x73, 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, - 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x49, 0x73, 0x57, 0x68, 0x69, 0x74, 0x65, - 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, - 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, - 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x69, 0x73, 0x2d, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, - 0x73, 0x74, 0x65, 0x64, 0x12, 0x87, 0x01, 0x0a, 0x04, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x24, 0x2e, - 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, - 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x50, 0x6f, - 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x2c, 0x12, 0x2a, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, - 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, - 0x70, 0x2f, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x7b, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x7d, 0x12, 0x91, - 0x01, 0x0a, 0x05, 0x50, 0x6f, 0x6f, 0x6c, 0x73, 0x12, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, - 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x41, 0x6c, 0x6c, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, + 0x6c, 0x70, 0x2f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6b, 0x65, 0x79, 0x7d, 0x12, 0xc1, 0x01, + 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x42, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x27, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, + 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x42, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x28, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, + 0x70, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x50, 0x6f, 0x6f, + 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x56, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x50, 0x12, 0x4e, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, + 0x2f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2d, 0x62, 0x79, 0x2d, 0x70, 0x6f, + 0x6f, 0x6c, 0x2f, 0x7b, 0x61, 0x6d, 0x6d, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x64, 0x7d, + 0x2f, 0x7b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6b, 0x65, 0x79, + 0x7d, 0x12, 0x7a, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, + 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, + 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, + 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, + 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, + 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0xcd, 0x01, + 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x46, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2b, 0x2e, 0x65, 0x6c, 0x79, + 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x50, 0x6f, 0x73, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x46, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, + 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x46, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x56, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x50, 0x12, 0x4e, 0x2f, + 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, + 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2d, 0x66, 0x6f, 0x72, 0x2d, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x2f, 0x7b, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6b, 0x65, 0x79, 0x7d, 0x12, 0x97, 0x01, + 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x21, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x12, 0x33, 0x2f, + 0x2e, 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x22, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, + 0x65, 0x6c, 0x70, 0x2e, 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x12, 0x38, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, - 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x70, 0x6f, 0x6f, - 0x6c, 0x2f, 0x7b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6b, 0x65, - 0x79, 0x7d, 0x12, 0x8e, 0x01, 0x0a, 0x08, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x20, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, - 0x70, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x21, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, - 0x65, 0x6c, 0x70, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x37, 0x12, 0x35, 0x2f, 0x65, + 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x77, 0x68, 0x69, + 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x2f, 0x7b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x6b, 0x65, 0x79, 0x7d, 0x12, 0x94, 0x01, 0x0a, 0x0d, 0x49, 0x73, 0x57, 0x68, + 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x12, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, + 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x49, 0x73, 0x57, 0x68, + 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x26, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, + 0x6c, 0x70, 0x2e, 0x49, 0x73, 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, + 0x12, 0x2c, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, + 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, + 0x69, 0x73, 0x2d, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x12, 0x87, + 0x01, 0x0a, 0x04, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, + 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, + 0x65, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, + 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x12, 0x2a, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, - 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x2f, 0x7b, - 0x69, 0x64, 0x7d, 0x12, 0xb8, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x2d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, + 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x70, 0x6f, 0x6f, 0x6c, + 0x2f, 0x7b, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x7d, 0x12, 0x91, 0x01, 0x0a, 0x05, 0x50, 0x6f, 0x6f, + 0x6c, 0x73, 0x12, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, + 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x50, 0x6f, 0x6f, + 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, - 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, - 0x69, 0x71, 0x75, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x45, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3f, 0x12, - 0x3d, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, - 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x6c, - 0x69, 0x71, 0x75, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, - 0x2f, 0x7b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x8d, - 0x01, 0x0a, 0x07, 0x4f, 0x70, 0x65, 0x6e, 0x45, 0x73, 0x74, 0x12, 0x24, 0x2e, 0x65, 0x6c, 0x79, + 0x41, 0x6c, 0x6c, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x3b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x12, 0x33, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, + 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x7b, 0x70, 0x61, 0x67, + 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6b, 0x65, 0x79, 0x7d, 0x12, 0x8e, 0x01, 0x0a, + 0x08, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x2e, 0x65, 0x6c, 0x79, 0x73, + 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x50, 0x6f, 0x73, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x65, 0x6c, + 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x50, 0x6f, + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x37, 0x12, 0x35, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, + 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0xb8, 0x01, + 0x0a, 0x10, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x69, + 0x63, 0x65, 0x12, 0x2d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, + 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2e, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, + 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x45, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3f, 0x12, 0x3d, 0x2f, 0x65, 0x6c, 0x79, 0x73, + 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, + 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x6c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x2f, 0x7b, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x8d, 0x01, 0x0a, 0x07, 0x4f, 0x70, 0x65, + 0x6e, 0x45, 0x73, 0x74, 0x12, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, + 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x70, 0x65, 0x6e, + 0x45, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x4f, 0x70, 0x65, 0x6e, 0x45, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, - 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x70, 0x65, 0x6e, 0x45, 0x73, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x12, - 0x2d, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, - 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x6f, - 0x70, 0x65, 0x6e, 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x91, - 0x01, 0x0a, 0x08, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x45, 0x73, 0x74, 0x12, 0x25, 0x2e, 0x65, 0x6c, - 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x45, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, - 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x45, - 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, - 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, - 0x70, 0x2f, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x8f, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x24, - 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, - 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x77, 0x61, - 0x72, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x31, 0x12, 0x2f, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, - 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, - 0x6c, 0x70, 0x2f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x7d, 0x12, 0xc9, 0x01, 0x0a, 0x15, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, - 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x32, + 0x72, 0x79, 0x4f, 0x70, 0x65, 0x6e, 0x45, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x12, 0x2d, 0x2f, 0x65, 0x6c, 0x79, 0x73, + 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, + 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x65, 0x73, + 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x91, 0x01, 0x0a, 0x08, 0x43, 0x6c, 0x6f, + 0x73, 0x65, 0x45, 0x73, 0x74, 0x12, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, + 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6c, 0x6f, + 0x73, 0x65, 0x45, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x65, + 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x45, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x65, + 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, + 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x63, 0x6c, 0x6f, 0x73, + 0x65, 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x8f, 0x01, 0x0a, + 0x07, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, + 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, - 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x74, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x47, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x41, 0x12, - 0x3f, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, - 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x63, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x5f, - 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, - 0x42, 0xb0, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, - 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, - 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, - 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0xa2, 0x02, 0x03, 0x45, 0x4c, 0x58, 0xaa, 0x02, - 0x0f, 0x45, 0x6c, 0x79, 0x73, 0x2e, 0x4c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, - 0xca, 0x02, 0x0f, 0x45, 0x6c, 0x79, 0x73, 0x5c, 0x4c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, - 0x6c, 0x70, 0xe2, 0x02, 0x1b, 0x45, 0x6c, 0x79, 0x73, 0x5c, 0x4c, 0x65, 0x76, 0x65, 0x72, 0x61, - 0x67, 0x65, 0x6c, 0x70, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x10, 0x45, 0x6c, 0x79, 0x73, 0x3a, 0x3a, 0x4c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, - 0x65, 0x6c, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x12, 0x2f, 0x2f, + 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, + 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x73, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0xc9, + 0x01, 0x0a, 0x15, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x73, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x32, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, + 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x4c, + 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x65, + 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x73, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x47, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x41, 0x12, 0x3f, 0x2f, 0x65, 0x6c, 0x79, 0x73, + 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, + 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, + 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x5f, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, + 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x42, 0xb0, 0x01, 0x0a, 0x13, 0x63, + 0x6f, 0x6d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, + 0x6c, 0x70, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x79, + 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, + 0x6c, 0x70, 0xa2, 0x02, 0x03, 0x45, 0x4c, 0x58, 0xaa, 0x02, 0x0f, 0x45, 0x6c, 0x79, 0x73, 0x2e, + 0x4c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0xca, 0x02, 0x0f, 0x45, 0x6c, 0x79, + 0x73, 0x5c, 0x4c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0xe2, 0x02, 0x1b, 0x45, + 0x6c, 0x79, 0x73, 0x5c, 0x4c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x45, 0x6c, 0x79, + 0x73, 0x3a, 0x3a, 0x4c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x6c, 0x70, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/elys/perpetual/query.pulsar.go b/api/elys/perpetual/query.pulsar.go index ad186abfc..c812ac3cd 100644 --- a/api/elys/perpetual/query.pulsar.go +++ b/api/elys/perpetual/query.pulsar.go @@ -18365,7 +18365,7 @@ var file_elys_perpetual_query_proto_rawDesc = []byte{ 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0a, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x22, - 0x84, 0x0c, 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x70, 0x65, 0x6e, 0x45, 0x73, 0x74, + 0x9e, 0x0b, 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x70, 0x65, 0x6e, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, @@ -18420,329 +18420,316 @@ var file_elys_perpetual_query_proto_rawDesc = []byte{ 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x12, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, - 0x79, 0x12, 0x4d, 0x0a, 0x08, 0x73, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x18, 0x0c, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, - 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x08, 0x73, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, - 0x12, 0x63, 0x0a, 0x14, 0x62, 0x6f, 0x72, 0x72, 0x6f, 0x77, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x65, 0x73, 0x74, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, + 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x12, 0x63, 0x0a, + 0x14, 0x62, 0x6f, 0x72, 0x72, 0x6f, 0x77, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, + 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, + 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, + 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x12, + 0x62, 0x6f, 0x72, 0x72, 0x6f, 0x77, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x52, 0x61, + 0x74, 0x65, 0x12, 0x54, 0x0a, 0x0c, 0x66, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x61, + 0x74, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, + 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, + 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, + 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0b, 0x66, 0x75, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x74, 0x65, 0x12, 0x54, 0x0a, 0x0c, 0x70, 0x72, 0x69, 0x63, + 0x65, 0x5f, 0x69, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, - 0x63, 0x52, 0x12, 0x62, 0x6f, 0x72, 0x72, 0x6f, 0x77, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, - 0x74, 0x52, 0x61, 0x74, 0x65, 0x12, 0x54, 0x0a, 0x0c, 0x66, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, - 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, - 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, - 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0b, - 0x66, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x74, 0x65, 0x12, 0x54, 0x0a, 0x0c, 0x70, - 0x72, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, + 0x63, 0x52, 0x0b, 0x70, 0x72, 0x69, 0x63, 0x65, 0x49, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x12, 0x39, + 0x0a, 0x07, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x64, 0x79, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, + 0x52, 0x07, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x64, 0x79, 0x12, 0x41, 0x0a, 0x0b, 0x6c, 0x69, 0x61, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, + 0x0b, 0x6c, 0x69, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x52, 0x0a, 0x0b, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0b, 0x70, 0x72, 0x69, 0x63, 0x65, 0x49, 0x6d, 0x70, 0x61, 0x63, - 0x74, 0x12, 0x39, 0x0a, 0x07, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x64, 0x79, 0x18, 0x10, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, - 0xde, 0x1f, 0x00, 0x52, 0x07, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x64, 0x79, 0x12, 0x41, 0x0a, 0x0b, - 0x6c, 0x69, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, - 0x1f, 0x00, 0x52, 0x0b, 0x6c, 0x69, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, - 0x52, 0x0a, 0x0b, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x12, + 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0a, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, + 0x12, 0x2e, 0x0a, 0x13, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x62, 0x72, 0x65, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x77, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0x72, 0x65, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x46, 0x65, 0x65, + 0x22, 0x92, 0x09, 0x0a, 0x0c, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x1e, 0x0a, 0x0b, 0x61, 0x6d, 0x6d, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x61, 0x6d, 0x6d, 0x50, 0x6f, 0x6f, 0x6c, 0x49, + 0x64, 0x12, 0x49, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, + 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x12, 0x63, 0x0a, 0x14, + 0x62, 0x6f, 0x72, 0x72, 0x6f, 0x77, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x5f, + 0x72, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, + 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, + 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x12, 0x62, + 0x6f, 0x72, 0x72, 0x6f, 0x77, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x52, 0x61, 0x74, + 0x65, 0x12, 0x49, 0x0a, 0x10, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, + 0x5f, 0x6c, 0x6f, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x65, 0x6c, + 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x50, 0x6f, 0x6f, + 0x6c, 0x41, 0x73, 0x73, 0x65, 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0e, 0x70, 0x6f, + 0x6f, 0x6c, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x4c, 0x6f, 0x6e, 0x67, 0x12, 0x4b, 0x0a, 0x11, + 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x5f, 0x73, 0x68, 0x6f, 0x72, + 0x74, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, + 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x50, 0x6f, 0x6f, 0x6c, 0x41, 0x73, 0x73, + 0x65, 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0f, 0x70, 0x6f, 0x6f, 0x6c, 0x41, 0x73, + 0x73, 0x65, 0x74, 0x73, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x12, 0x57, 0x0a, 0x29, 0x6c, 0x61, 0x73, + 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x62, 0x6f, 0x72, 0x72, 0x6f, 0x77, 0x5f, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x6f, + 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x24, 0x6c, 0x61, + 0x73, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0x6f, 0x72, 0x72, 0x6f, 0x77, 0x49, 0x6e, + 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x52, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, + 0x65, 0x64, 0x12, 0x54, 0x0a, 0x0c, 0x66, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x61, + 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, + 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, + 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, + 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0b, 0x66, 0x75, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x74, 0x65, 0x12, 0x57, 0x0a, 0x11, 0x6e, 0x65, 0x74, 0x5f, + 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, + 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, + 0x52, 0x0f, 0x6e, 0x65, 0x74, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, + 0x74, 0x12, 0x4e, 0x0a, 0x09, 0x6c, 0x6f, 0x6e, 0x67, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0a, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x50, 0x72, - 0x69, 0x63, 0x65, 0x12, 0x61, 0x0a, 0x13, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x62, 0x72, - 0x65, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, - 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x44, 0x65, 0x63, 0x52, 0x11, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0x72, 0x65, 0x61, 0x6b, - 0x69, 0x6e, 0x67, 0x46, 0x65, 0x65, 0x22, 0x92, 0x09, 0x0a, 0x0c, 0x50, 0x6f, 0x6f, 0x6c, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0b, 0x61, 0x6d, 0x6d, 0x5f, 0x70, - 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x61, 0x6d, - 0x6d, 0x50, 0x6f, 0x6f, 0x6c, 0x49, 0x64, 0x12, 0x49, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x6c, 0x74, - 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, - 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, - 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x68, 0x65, 0x61, 0x6c, - 0x74, 0x68, 0x12, 0x63, 0x0a, 0x14, 0x62, 0x6f, 0x72, 0x72, 0x6f, 0x77, 0x5f, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x65, 0x73, 0x74, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, - 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x44, 0x65, 0x63, 0x52, 0x12, 0x62, 0x6f, 0x72, 0x72, 0x6f, 0x77, 0x49, 0x6e, 0x74, 0x65, 0x72, - 0x65, 0x73, 0x74, 0x52, 0x61, 0x74, 0x65, 0x12, 0x49, 0x0a, 0x10, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, - 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x5f, 0x6c, 0x6f, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, - 0x61, 0x6c, 0x2e, 0x50, 0x6f, 0x6f, 0x6c, 0x41, 0x73, 0x73, 0x65, 0x74, 0x42, 0x04, 0xc8, 0xde, - 0x1f, 0x00, 0x52, 0x0e, 0x70, 0x6f, 0x6f, 0x6c, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x4c, 0x6f, - 0x6e, 0x67, 0x12, 0x4b, 0x0a, 0x11, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x61, 0x73, 0x73, 0x65, 0x74, - 0x73, 0x5f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x50, - 0x6f, 0x6f, 0x6c, 0x41, 0x73, 0x73, 0x65, 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0f, - 0x70, 0x6f, 0x6f, 0x6c, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x12, - 0x57, 0x0a, 0x29, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x62, - 0x6f, 0x72, 0x72, 0x6f, 0x77, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x5f, 0x72, - 0x61, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x24, 0x6c, 0x61, 0x73, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0x6f, - 0x72, 0x72, 0x6f, 0x77, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x52, 0x61, 0x74, 0x65, - 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x12, 0x54, 0x0a, 0x0c, 0x66, 0x75, 0x6e, 0x64, - 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, - 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, - 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, - 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, - 0x63, 0x52, 0x0b, 0x66, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x74, 0x65, 0x12, 0x57, - 0x0a, 0x11, 0x6e, 0x65, 0x74, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x65, 0x73, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, - 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, - 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0f, 0x6e, 0x65, 0x74, 0x4f, 0x70, 0x65, 0x6e, 0x49, - 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x12, 0x4e, 0x0a, 0x09, 0x6c, 0x6f, 0x6e, 0x67, 0x5f, - 0x72, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, - 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, - 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, - 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x08, 0x6c, - 0x6f, 0x6e, 0x67, 0x52, 0x61, 0x74, 0x65, 0x12, 0x50, 0x0a, 0x0a, 0x73, 0x68, 0x6f, 0x72, 0x74, - 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, - 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, - 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, - 0x73, 0x68, 0x6f, 0x72, 0x74, 0x52, 0x61, 0x74, 0x65, 0x12, 0x4c, 0x0a, 0x11, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x5f, 0x6c, 0x69, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, - 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x10, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4c, 0x69, 0x61, 0x62, - 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x64, 0x0a, 0x18, 0x74, 0x6f, 0x74, 0x61, 0x6c, - 0x5f, 0x6c, 0x6f, 0x6e, 0x67, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x65, 0x73, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, - 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, - 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x15, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4c, 0x6f, 0x6e, - 0x67, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x12, 0x66, 0x0a, - 0x19, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x5f, 0x6f, 0x70, 0x65, - 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, - 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x16, 0x74, - 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x6e, 0x74, - 0x65, 0x72, 0x65, 0x73, 0x74, 0x12, 0x54, 0x0a, 0x0c, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, - 0x65, 0x5f, 0x6d, 0x61, 0x78, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, - 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, - 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0b, - 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x4d, 0x61, 0x78, 0x22, 0xa8, 0x01, 0x0a, 0x1b, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x0c, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x5f, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, - 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0b, 0x63, 0x6c, 0x6f, 0x73, 0x65, - 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xf6, 0x08, 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x65, 0x6c, 0x79, 0x73, - 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x44, 0x0a, - 0x0d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, - 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0c, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, - 0x69, 0x7a, 0x65, 0x12, 0x41, 0x0a, 0x0b, 0x6c, 0x69, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, - 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, - 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0b, 0x6c, 0x69, 0x61, 0x62, 0x69, - 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x54, 0x0a, 0x0c, 0x70, 0x72, 0x69, 0x63, 0x65, 0x5f, - 0x69, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, - 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, - 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, - 0x0b, 0x70, 0x72, 0x69, 0x63, 0x65, 0x49, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x12, 0x5e, 0x0a, 0x11, - 0x6c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x69, 0x63, - 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, - 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, - 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x10, 0x6c, 0x69, 0x71, 0x75, - 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x55, 0x0a, 0x10, - 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, + 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x08, 0x6c, 0x6f, 0x6e, 0x67, 0x52, 0x61, 0x74, + 0x65, 0x12, 0x50, 0x0a, 0x0a, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, + 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x52, + 0x61, 0x74, 0x65, 0x12, 0x4c, 0x0a, 0x11, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x6c, 0x69, 0x61, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, + 0x10, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4c, 0x69, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, + 0x73, 0x12, 0x64, 0x0a, 0x18, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x6c, 0x6f, 0x6e, 0x67, 0x5f, + 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, + 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, + 0x52, 0x15, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4c, 0x6f, 0x6e, 0x67, 0x4f, 0x70, 0x65, 0x6e, 0x49, + 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x12, 0x66, 0x0a, 0x19, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x5f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x65, 0x73, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, + 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x16, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x68, + 0x6f, 0x72, 0x74, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x12, + 0x54, 0x0a, 0x0c, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x6d, 0x61, 0x78, 0x18, + 0x0e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, + 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0b, 0x6c, 0x65, 0x76, 0x65, 0x72, 0x61, + 0x67, 0x65, 0x4d, 0x61, 0x78, 0x22, 0xa8, 0x01, 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, + 0x6c, 0x6f, 0x73, 0x65, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x1f, 0x0a, 0x0b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, + 0x12, 0x4e, 0x0a, 0x0c, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x49, 0x6e, 0x74, 0x52, 0x0e, 0x6d, 0x61, 0x78, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x41, 0x6d, 0x6f, - 0x75, 0x6e, 0x74, 0x12, 0x68, 0x0a, 0x20, 0x62, 0x6f, 0x72, 0x72, 0x6f, 0x77, 0x5f, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x5f, 0x75, 0x6e, 0x70, 0x61, 0x69, 0x64, 0x5f, 0x6c, 0x69, - 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x1d, - 0x62, 0x6f, 0x72, 0x72, 0x6f, 0x77, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x55, 0x6e, - 0x70, 0x61, 0x69, 0x64, 0x4c, 0x69, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x4a, 0x0a, - 0x10, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, - 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, - 0x69, 0x6e, 0x67, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x4e, 0x0a, 0x12, 0x70, 0x61, 0x79, - 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x69, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, - 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, - 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x11, 0x70, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x4c, 0x69, - 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x56, 0x0a, 0x0d, 0x63, 0x6c, 0x6f, - 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, - 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x44, 0x65, 0x63, 0x52, 0x0c, 0x63, 0x6c, 0x6f, 0x73, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x69, 0x63, - 0x65, 0x12, 0x39, 0x0a, 0x07, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x64, 0x79, 0x18, 0x0b, 0x20, 0x01, + 0x49, 0x6e, 0x74, 0x52, 0x0b, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x22, 0x90, 0x08, 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x45, + 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x34, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, + 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x44, 0x0a, 0x0d, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, + 0x0c, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x41, 0x0a, + 0x0b, 0x6c, 0x69, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, - 0xde, 0x1f, 0x00, 0x52, 0x07, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x64, 0x79, 0x12, 0x3f, 0x0a, 0x0a, - 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, - 0x00, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x12, 0x61, 0x0a, - 0x13, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x69, 0x6e, 0x67, - 0x5f, 0x66, 0x65, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, + 0xde, 0x1f, 0x00, 0x52, 0x0b, 0x6c, 0x69, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, + 0x12, 0x54, 0x0a, 0x0c, 0x70, 0x72, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x6d, 0x70, 0x61, 0x63, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, + 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0b, 0x70, 0x72, 0x69, 0x63, 0x65, + 0x49, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x12, 0x5e, 0x0a, 0x11, 0x6c, 0x69, 0x71, 0x75, 0x69, 0x64, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, + 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x44, 0x65, 0x63, 0x52, 0x10, 0x6c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x55, 0x0a, 0x10, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x6c, + 0x6f, 0x73, 0x65, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, + 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0e, 0x6d, + 0x61, 0x78, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x68, 0x0a, + 0x20, 0x62, 0x6f, 0x72, 0x72, 0x6f, 0x77, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, + 0x5f, 0x75, 0x6e, 0x70, 0x61, 0x69, 0x64, 0x5f, 0x6c, 0x69, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, + 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, + 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x1d, 0x62, 0x6f, 0x72, 0x72, 0x6f, 0x77, + 0x49, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x55, 0x6e, 0x70, 0x61, 0x69, 0x64, 0x4c, 0x69, + 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x4a, 0x0a, 0x10, 0x72, 0x65, 0x74, 0x75, 0x72, + 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, + 0x1f, 0x00, 0x52, 0x0f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x41, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x4e, 0x0a, 0x12, 0x70, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x69, + 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, + 0x52, 0x11, 0x70, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, + 0x69, 0x65, 0x73, 0x12, 0x56, 0x0a, 0x0d, 0x63, 0x6c, 0x6f, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x70, + 0x72, 0x69, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, - 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x11, 0x77, - 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0x72, 0x65, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x46, 0x65, 0x65, - 0x12, 0x4d, 0x0a, 0x08, 0x73, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x18, 0x0e, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, - 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x08, 0x73, 0x6c, 0x69, 0x70, 0x70, 0x61, 0x67, 0x65, 0x32, - 0x9f, 0x0e, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x74, 0x0a, 0x06, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x12, 0x1d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, - 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, - 0x75, 0x61, 0x6c, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x12, 0x23, 0x2f, 0x65, 0x6c, 0x79, + 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0c, 0x63, + 0x6c, 0x6f, 0x73, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x39, 0x0a, 0x07, 0x63, + 0x75, 0x73, 0x74, 0x6f, 0x64, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x07, 0x63, + 0x75, 0x73, 0x74, 0x6f, 0x64, 0x79, 0x12, 0x3f, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, + 0x65, 0x72, 0x61, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0a, 0x63, 0x6f, 0x6c, + 0x6c, 0x61, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x12, 0x2e, 0x0a, 0x13, 0x77, 0x65, 0x69, 0x67, 0x68, + 0x74, 0x5f, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0x72, 0x65, 0x61, + 0x6b, 0x69, 0x6e, 0x67, 0x46, 0x65, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x6c, 0x69, 0x70, 0x70, + 0x61, 0x67, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x6c, 0x69, 0x70, 0x70, + 0x61, 0x67, 0x65, 0x32, 0x9f, 0x0e, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x74, 0x0a, + 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, + 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, + 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x12, 0x23, + 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, + 0x79, 0x73, 0x2f, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x12, 0x94, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x73, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x20, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, + 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, + 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3f, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x39, 0x12, 0x37, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2f, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x70, 0x61, 0x67, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6b, 0x65, 0x79, 0x7d, 0x12, 0xb7, 0x01, 0x0a, 0x12, 0x47, + 0x65, 0x74, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x50, 0x6f, 0x6f, + 0x6c, 0x12, 0x26, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, + 0x61, 0x6c, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x50, 0x6f, + 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x65, 0x6c, 0x79, 0x73, + 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x50, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x4a, 0x12, 0x48, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x70, - 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, - 0x94, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x20, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, - 0x6c, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, - 0x75, 0x61, 0x6c, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x39, 0x12, 0x37, 0x2f, - 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, - 0x73, 0x2f, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2f, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x6b, 0x65, 0x79, 0x7d, 0x12, 0xb7, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x50, 0x6f, - 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x26, 0x2e, - 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x50, - 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, - 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x42, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x50, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x4a, 0x12, 0x48, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, - 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x70, 0x65, 0x72, 0x70, 0x65, - 0x74, 0x75, 0x61, 0x6c, 0x2f, 0x6d, 0x74, 0x70, 0x73, 0x2d, 0x62, 0x79, 0x2d, 0x70, 0x6f, 0x6f, - 0x6c, 0x2f, 0x7b, 0x61, 0x6d, 0x6d, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x2f, - 0x7b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6b, 0x65, 0x79, 0x7d, - 0x12, 0x77, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1d, 0x2e, - 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x65, - 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x25, 0x12, 0x23, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, - 0x61, 0x6c, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0xc3, 0x01, 0x0a, 0x16, 0x47, 0x65, - 0x74, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x46, 0x6f, 0x72, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x12, 0x2a, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, + 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2f, 0x6d, 0x74, 0x70, 0x73, 0x2d, 0x62, 0x79, + 0x2d, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x7b, 0x61, 0x6d, 0x6d, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, + 0x69, 0x64, 0x7d, 0x2f, 0x7b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x6b, 0x65, 0x79, 0x7d, 0x12, 0x77, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x1d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, + 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1e, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, + 0x6c, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x12, 0x23, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, + 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x70, 0x65, 0x72, + 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0xc3, 0x01, + 0x0a, 0x16, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x46, 0x6f, + 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2a, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, + 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x46, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x46, - 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2b, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, - 0x6c, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x46, 0x6f, 0x72, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x50, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x4a, 0x12, 0x48, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, - 0x75, 0x61, 0x6c, 0x2f, 0x6d, 0x74, 0x70, 0x73, 0x2d, 0x66, 0x6f, 0x72, 0x2d, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x2f, 0x7b, - 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6b, 0x65, 0x79, 0x7d, 0x12, - 0x94, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, - 0x12, 0x20, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, - 0x6c, 0x2e, 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, - 0x75, 0x61, 0x6c, 0x2e, 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x39, 0x12, 0x37, 0x2f, - 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, - 0x73, 0x2f, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2f, 0x77, 0x68, 0x69, 0x74, - 0x65, 0x6c, 0x69, 0x73, 0x74, 0x2f, 0x7b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x6b, 0x65, 0x79, 0x7d, 0x12, 0x91, 0x01, 0x0a, 0x0d, 0x49, 0x73, 0x57, 0x68, 0x69, - 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x12, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, - 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x49, 0x73, 0x57, 0x68, 0x69, 0x74, - 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, - 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, - 0x49, 0x73, 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, - 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, - 0x73, 0x2f, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2f, 0x69, 0x73, 0x2d, 0x77, - 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x12, 0x84, 0x01, 0x0a, 0x04, 0x50, - 0x6f, 0x6f, 0x6c, 0x12, 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, - 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6f, - 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, - 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, - 0x65, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, - 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x70, 0x65, 0x72, 0x70, 0x65, - 0x74, 0x75, 0x61, 0x6c, 0x2f, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x7b, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x7d, 0x12, 0x8e, 0x01, 0x0a, 0x05, 0x50, 0x6f, 0x6f, 0x6c, 0x73, 0x12, 0x23, 0x2e, 0x65, 0x6c, - 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, - 0x6c, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x12, 0x32, - 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, - 0x79, 0x73, 0x2f, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2f, 0x70, 0x6f, 0x6f, - 0x6c, 0x2f, 0x7b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6b, 0x65, - 0x79, 0x7d, 0x12, 0x77, 0x0a, 0x03, 0x4d, 0x54, 0x50, 0x12, 0x1a, 0x2e, 0x65, 0x6c, 0x79, 0x73, - 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x4d, 0x54, 0x50, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, - 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x4d, 0x54, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x37, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x12, 0x2f, 0x2f, 0x65, 0x6c, 0x79, + 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x50, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x4a, 0x12, 0x48, 0x2f, 0x65, 0x6c, 0x79, 0x73, + 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x70, 0x65, + 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2f, 0x6d, 0x74, 0x70, 0x73, 0x2d, 0x66, 0x6f, 0x72, + 0x2d, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x7d, 0x2f, 0x7b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6b, + 0x65, 0x79, 0x7d, 0x12, 0x94, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x57, 0x68, 0x69, 0x74, 0x65, + 0x6c, 0x69, 0x73, 0x74, 0x12, 0x20, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, + 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, + 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3f, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x39, 0x12, 0x37, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2f, + 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x2f, 0x7b, 0x70, 0x61, 0x67, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6b, 0x65, 0x79, 0x7d, 0x12, 0x91, 0x01, 0x0a, 0x0d, 0x49, + 0x73, 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x12, 0x24, 0x2e, 0x65, + 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x49, 0x73, + 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, + 0x75, 0x61, 0x6c, 0x2e, 0x49, 0x73, 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, + 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x2d, 0x12, 0x2b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2f, + 0x69, 0x73, 0x2d, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x12, 0x84, + 0x01, 0x0a, 0x04, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, + 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, + 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x65, + 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x70, - 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2f, 0x6d, 0x74, 0x70, 0x2f, 0x7b, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x9f, 0x01, 0x0a, 0x0e, - 0x4f, 0x70, 0x65, 0x6e, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, + 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2f, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x7b, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x7d, 0x12, 0x8e, 0x01, 0x0a, 0x05, 0x50, 0x6f, 0x6f, 0x6c, 0x73, 0x12, + 0x23, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, + 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x50, 0x6f, + 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x34, 0x12, 0x32, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, + 0x2f, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x7b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x6b, 0x65, 0x79, 0x7d, 0x12, 0x77, 0x0a, 0x03, 0x4d, 0x54, 0x50, 0x12, 0x1a, 0x2e, + 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x4d, + 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x65, 0x6c, 0x79, 0x73, + 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x4d, 0x54, 0x50, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x12, 0x2f, + 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, + 0x79, 0x73, 0x2f, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2f, 0x6d, 0x74, 0x70, + 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, + 0x9f, 0x01, 0x0a, 0x0e, 0x4f, 0x70, 0x65, 0x6e, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x2a, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, + 0x75, 0x61, 0x6c, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x70, 0x65, 0x6e, 0x45, 0x73, 0x74, + 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x70, 0x65, 0x6e, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x65, 0x6c, 0x79, - 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x4f, 0x70, 0x65, 0x6e, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, - 0x2c, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, - 0x6c, 0x79, 0x73, 0x2f, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2f, 0x6f, 0x70, - 0x65, 0x6e, 0x2d, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0xb1, 0x01, - 0x0a, 0x0f, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x2b, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, - 0x61, 0x6c, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x45, 0x73, 0x74, - 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, - 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x3d, 0x12, 0x3b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, - 0x61, 0x6c, 0x2f, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x2d, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, - 0x7d, 0x42, 0xaa, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, - 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, - 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x70, 0x65, - 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0xa2, 0x02, 0x03, 0x45, 0x50, 0x58, 0xaa, 0x02, 0x0e, - 0x45, 0x6c, 0x79, 0x73, 0x2e, 0x50, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0xca, 0x02, - 0x0e, 0x45, 0x6c, 0x79, 0x73, 0x5c, 0x50, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0xe2, - 0x02, 0x1a, 0x45, 0x6c, 0x79, 0x73, 0x5c, 0x50, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x45, - 0x6c, 0x79, 0x73, 0x3a, 0x3a, 0x50, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, + 0x6c, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x2d, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0xb1, 0x01, 0x0a, 0x0f, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x45, 0x73, 0x74, 0x69, 0x6d, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, + 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6c, 0x6f, 0x73, + 0x65, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x65, 0x6c, 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, + 0x75, 0x61, 0x6c, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x45, 0x73, + 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x43, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3d, 0x12, 0x3b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, + 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x70, 0x65, 0x72, + 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x2f, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x2d, 0x65, 0x73, 0x74, + 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x42, 0xaa, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x65, 0x6c, + 0x79, 0x73, 0x2e, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0x42, 0x0a, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2d, 0x6e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x2f, 0x65, 0x6c, 0x79, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x6c, 0x79, + 0x73, 0x2f, 0x70, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, 0x61, 0x6c, 0xa2, 0x02, 0x03, 0x45, 0x50, + 0x58, 0xaa, 0x02, 0x0e, 0x45, 0x6c, 0x79, 0x73, 0x2e, 0x50, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, + 0x61, 0x6c, 0xca, 0x02, 0x0e, 0x45, 0x6c, 0x79, 0x73, 0x5c, 0x50, 0x65, 0x72, 0x70, 0x65, 0x74, + 0x75, 0x61, 0x6c, 0xe2, 0x02, 0x1a, 0x45, 0x6c, 0x79, 0x73, 0x5c, 0x50, 0x65, 0x72, 0x70, 0x65, + 0x74, 0x75, 0x61, 0x6c, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x0f, 0x45, 0x6c, 0x79, 0x73, 0x3a, 0x3a, 0x50, 0x65, 0x72, 0x70, 0x65, 0x74, 0x75, + 0x61, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/elys/leveragelp/query.proto b/proto/elys/leveragelp/query.proto index f4bde672f..d41934b92 100644 --- a/proto/elys/leveragelp/query.proto +++ b/proto/elys/leveragelp/query.proto @@ -219,11 +219,7 @@ message QueryOpenEstResponse { (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; - string weight_balance_ratio = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; + string weight_balance_ratio = 2; string borrow_fee = 3 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", @@ -268,11 +264,7 @@ message QueryCloseEstResponse { (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; - string weight_balance_ratio = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; + string weight_balance_ratio = 2; string amount_returned = 3 [ (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "cosmossdk.io/math.Int", diff --git a/proto/elys/perpetual/query.proto b/proto/elys/perpetual/query.proto index abf770654..da0e03d24 100644 --- a/proto/elys/perpetual/query.proto +++ b/proto/elys/perpetual/query.proto @@ -280,11 +280,7 @@ message QueryOpenEstimationResponse { cosmos.base.v1beta1.Coin estimated_pnl = 10 [ (gogoproto.nullable) = false ]; cosmos.base.v1beta1.Coin available_liquidity = 11 [ (gogoproto.nullable) = false ]; - string slippage = 12 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; + string slippage = 12; string borrow_interest_rate = 13 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", @@ -307,11 +303,7 @@ message QueryOpenEstimationResponse { (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; - string weight_breaking_fee = 19 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; + string weight_breaking_fee = 19; } message PoolResponse { @@ -414,14 +406,6 @@ message QueryCloseEstimationResponse { ]; cosmos.base.v1beta1.Coin custody = 11 [ (gogoproto.nullable) = false ]; cosmos.base.v1beta1.Coin collateral = 12 [ (gogoproto.nullable) = false ]; - string weight_breaking_fee = 13 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; - string slippage = 14 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; + string weight_breaking_fee = 13; + string slippage = 14; } \ No newline at end of file diff --git a/types/dec34.go b/types/dec34.go index 0627d6995..841780959 100644 --- a/types/dec34.go +++ b/types/dec34.go @@ -1,6 +1,8 @@ package types import ( + "math/big" + "cosmossdk.io/math" "github.com/cockroachdb/apd/v2" regenmath "github.com/regen-network/regen-ledger/types/v2/math" @@ -173,8 +175,27 @@ func (d Dec34) Neg() Dec34 { } func (d Dec34) ToLegacyDec() math.LegacyDec { + // remove all trailing zeros y, _ := regenmath.Dec(d).Reduce() - return math.LegacyMustNewDecFromStr(y.String()) + // if d is zero, return zero legacy dec + if y.IsZero() { + return math.LegacyZeroDec() + } + // convert to apd.Decimal + z, _, err := apd.NewFromString(y.String()) + if err != nil { + panic(err) + } + // override exponent and coefficient if exponent is less than -18 to fit into 18 decimal places + if z.Exponent < -18 { + delta := -18 - z.Exponent + decs := big.NewInt(10) + decs.Exp(decs, big.NewInt(int64(delta)), nil) + z.Coeff.Quo(&z.Coeff, decs) + z.Exponent = -18 + } + // construct legacy dec from apd.Decimal + return math.LegacyMustNewDecFromStr(z.String()) } func (d Dec34) ToInt() math.Int { diff --git a/types/dec34_test.go b/types/dec34_test.go index 1255f347b..da8b9d831 100644 --- a/types/dec34_test.go +++ b/types/dec34_test.go @@ -93,6 +93,26 @@ func TestDec34(t *testing.T) { // Test ToLegacyDec legacyResult := three.ToLegacyDec() require.Equal(t, math.LegacyNewDec(3), legacyResult) + require.Equal(t, + NewDec34FromString("1000000000000000000000000000000000000123456789.000000000000000000").ToLegacyDec().String(), + math.LegacyMustNewDecFromStr("1000000000000000000000000000000000000123456789.000000000000000000").String(), + ) + require.Equal(t, + NewDec34FromString("1.000000000000000000000").ToLegacyDec().String(), + math.LegacyMustNewDecFromStr("1.000000000000000000").String(), + ) + require.Equal(t, + NewDec34FromString("123.456000000000000000000").ToLegacyDec().String(), + math.LegacyMustNewDecFromStr("123.456000000000000000").String(), + ) + require.Equal(t, + NewDec34FromString("0.000000000000000000000").ToLegacyDec().String(), + math.LegacyMustNewDecFromStr("0").String(), + ) + require.Equal(t, + NewDec34FromString("96346.39698847304510148894982122764").ToLegacyDec().String(), + math.LegacyMustNewDecFromStr("96346.396988473045101488").String(), + ) // Test ToInt intResult := three.ToInt() diff --git a/x/leveragelp/keeper/query_estimation.go b/x/leveragelp/keeper/query_estimation.go index 60f4785f0..c89ebded3 100644 --- a/x/leveragelp/keeper/query_estimation.go +++ b/x/leveragelp/keeper/query_estimation.go @@ -25,7 +25,7 @@ func (k Keeper) OpenEst(goCtx context.Context, req *types.QueryOpenEstRequest) ( return &types.QueryOpenEstResponse{ PositionSize: shares, - WeightBalanceRatio: weightBalanceBonus, + WeightBalanceRatio: weightBalanceBonus.String(), BorrowFee: params.InterestRate, }, nil } @@ -60,7 +60,7 @@ func (k Keeper) CloseEst(goCtx context.Context, req *types.QueryCloseEstRequest) return &types.QueryCloseEstResponse{ Liability: repayAmount, - WeightBalanceRatio: weightBalanceBonus, + WeightBalanceRatio: weightBalanceBonus.String(), AmountReturned: userAmount, }, nil } diff --git a/x/leveragelp/types/expected_keepers.go b/x/leveragelp/types/expected_keepers.go index f5037e0f1..c66db025a 100644 --- a/x/leveragelp/types/expected_keepers.go +++ b/x/leveragelp/types/expected_keepers.go @@ -24,8 +24,8 @@ type AmmKeeper interface { GetPool(sdk.Context, uint64) (ammtypes.Pool, bool) // Get all pools GetAllPool(sdk.Context) []ammtypes.Pool - ExitPoolEst(ctx sdk.Context, poolId uint64, shareInAmount sdkmath.Int, tokenOutDenom string) (exitCoins sdk.Coins, weightBalanceBonus sdkmath.LegacyDec, err error) - JoinPoolEst(ctx sdk.Context, poolId uint64, tokenInMaxs sdk.Coins) (tokensIn sdk.Coins, sharesOut sdkmath.Int, slippage sdkmath.LegacyDec, weightBalanceBonus sdkmath.LegacyDec, err error) + ExitPoolEst(ctx sdk.Context, poolId uint64, shareInAmount sdkmath.Int, tokenOutDenom string) (exitCoins sdk.Coins, weightBalanceBonus elystypes.Dec34, err error) + JoinPoolEst(ctx sdk.Context, poolId uint64, tokenInMaxs sdk.Coins) (tokensIn sdk.Coins, sharesOut sdkmath.Int, slippage, weightBalanceBonus elystypes.Dec34, err error) // IterateCommitments iterates over all Commitments and performs a callback. IterateLiquidityPools(sdk.Context, func(ammtypes.Pool) bool) GetAccountedPoolSnapshotOrSet(ctx sdk.Context, pool ammtypes.Pool) (val ammtypes.Pool) @@ -62,7 +62,7 @@ type StableStakeKeeper interface { UpdateInterestAndGetDebt(ctx sdk.Context, addr sdk.AccAddress) stablestaketypes.Debt Borrow(ctx sdk.Context, addr sdk.AccAddress, amount sdk.Coin) error Repay(ctx sdk.Context, addr sdk.AccAddress, amount sdk.Coin) error - TVL(ctx sdk.Context, oracleKeeper stablestaketypes.OracleKeeper, baseCurrency string) sdkmath.LegacyDec + TVL(ctx sdk.Context, oracleKeeper stablestaketypes.OracleKeeper, baseCurrency string) elystypes.Dec34 GetInterest(ctx sdk.Context, startBlock uint64, startTime uint64, borrowed sdkmath.LegacyDec) sdkmath.Int } diff --git a/x/leveragelp/types/query.pb.go b/x/leveragelp/types/query.pb.go index bca21b57c..cb56ba3ca 100644 --- a/x/leveragelp/types/query.pb.go +++ b/x/leveragelp/types/query.pb.go @@ -1082,7 +1082,7 @@ func (m *QueryOpenEstRequest) GetAmmPoolId() uint64 { type QueryOpenEstResponse struct { PositionSize cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=position_size,json=positionSize,proto3,customtype=cosmossdk.io/math.Int" json:"position_size"` - WeightBalanceRatio cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=weight_balance_ratio,json=weightBalanceRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"weight_balance_ratio"` + WeightBalanceRatio string `protobuf:"bytes,2,opt,name=weight_balance_ratio,json=weightBalanceRatio,proto3" json:"weight_balance_ratio,omitempty"` BorrowFee cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=borrow_fee,json=borrowFee,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"borrow_fee"` } @@ -1119,6 +1119,13 @@ func (m *QueryOpenEstResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryOpenEstResponse proto.InternalMessageInfo +func (m *QueryOpenEstResponse) GetWeightBalanceRatio() string { + if m != nil { + return m.WeightBalanceRatio + } + return "" +} + type QueryCloseEstRequest struct { Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` @@ -1329,9 +1336,9 @@ func (m *QueryRewardsResponse) GetTotalRewards() github_com_cosmos_cosmos_sdk_ty } type QueryCloseEstResponse struct { - Liability cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=liability,proto3,customtype=cosmossdk.io/math.Int" json:"liability"` - WeightBalanceRatio cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=weight_balance_ratio,json=weightBalanceRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"weight_balance_ratio"` - AmountReturned cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=amount_returned,json=amountReturned,proto3,customtype=cosmossdk.io/math.Int" json:"amount_returned"` + Liability cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=liability,proto3,customtype=cosmossdk.io/math.Int" json:"liability"` + WeightBalanceRatio string `protobuf:"bytes,2,opt,name=weight_balance_ratio,json=weightBalanceRatio,proto3" json:"weight_balance_ratio,omitempty"` + AmountReturned cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=amount_returned,json=amountReturned,proto3,customtype=cosmossdk.io/math.Int" json:"amount_returned"` } func (m *QueryCloseEstResponse) Reset() { *m = QueryCloseEstResponse{} } @@ -1367,6 +1374,13 @@ func (m *QueryCloseEstResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryCloseEstResponse proto.InternalMessageInfo +func (m *QueryCloseEstResponse) GetWeightBalanceRatio() string { + if m != nil { + return m.WeightBalanceRatio + } + return "" +} + type QueryCommittedTokensLockedRequest struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } @@ -1507,119 +1521,119 @@ func init() { func init() { proto.RegisterFile("elys/leveragelp/query.proto", fileDescriptor_76659893e638cc9b) } var fileDescriptor_76659893e638cc9b = []byte{ - // 1780 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x59, 0xcd, 0x6f, 0x23, 0x49, - 0x15, 0x4f, 0x3b, 0x9f, 0x7e, 0x99, 0x7c, 0xd5, 0x26, 0x4c, 0xd6, 0x19, 0x9c, 0x4c, 0x6b, 0x66, - 0x36, 0xec, 0xc4, 0xee, 0x49, 0x86, 0xec, 0xa2, 0x85, 0xd1, 0x92, 0xcc, 0xee, 0x04, 0x4b, 0x01, - 0x4c, 0xcf, 0x0a, 0x96, 0x91, 0x50, 0xab, 0xed, 0xae, 0x38, 0xa5, 0xb4, 0xbb, 0x7a, 0xba, 0x2b, - 0xe3, 0x71, 0xa2, 0x20, 0xc4, 0x01, 0xc4, 0x01, 0x58, 0x3e, 0x24, 0x04, 0x12, 0x02, 0x89, 0xdb, - 0x8a, 0x23, 0x07, 0x6e, 0x88, 0xdb, 0xee, 0x01, 0x69, 0x05, 0x17, 0xc4, 0x61, 0x40, 0x33, 0xfc, - 0x21, 0xa8, 0xab, 0xab, 0xda, 0xed, 0x6e, 0xb7, 0xed, 0x44, 0x19, 0xb4, 0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0xf2, 0x48, 0x8b, 0xf5, 0x67, 0x69, 0x27, 0x4f, 0x53, 0xff, 0xe7, 0xa8, - 0x4d, 0xf0, 0xff, 0x58, 0xdc, 0xfd, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc2, 0x13, 0x70, 0xba, - 0xd3, 0x19, 0x00, 0x00, + // 1777 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x59, 0xcd, 0x6f, 0x1c, 0x49, + 0x15, 0x4f, 0x8f, 0xed, 0xc4, 0xf3, 0x1c, 0x7f, 0xa4, 0xd6, 0x26, 0xde, 0x49, 0x18, 0x27, 0xad, + 0x24, 0x6b, 0x36, 0x99, 0xe9, 0xd8, 0xc1, 0xbb, 0x68, 0x21, 0x5a, 0xec, 0xec, 0xc6, 0x8c, 0x64, + 0x60, 0xe8, 0xac, 0x60, 0x89, 0x84, 0x5a, 0x3d, 0xd3, 0xe5, 0x71, 0xc9, 0x3d, 0x5d, 0x9d, 0xee, + 0x72, 0x26, 0x63, 0xcb, 0x08, 0x71, 0x00, 0x71, 0x00, 0x96, 0x0f, 0x09, 0xc1, 0x09, 0x89, 0xdb, + 0x8a, 0x23, 0x07, 0x6e, 0x88, 0xdb, 0xee, 0x01, 0x69, 0x05, 0x17, 0xc4, 0x61, 0x41, 0x09, 0x27, + 0xc4, 0x1f, 0x81, 0xba, 0x3e, 0x7a, 0x7a, 0xba, 0xa7, 0x67, 0xc6, 0x96, 0x23, 0x71, 0xf2, 0x4c, + 0xd5, 0xfb, 0xf8, 0xbd, 0xdf, 0x7b, 0x55, 0xf5, 0xde, 0x18, 0xae, 0x60, 0xb7, 0x1b, 0x1a, 0x2e, + 0x7e, 0x8a, 0x03, 0xbb, 0x85, 0x5d, 0xdf, 0x78, 0x72, 0x80, 0x83, 0x6e, 0xd5, 0x0f, 0x28, 0xa3, + 0x68, 0x3e, 0xda, 0xac, 0xf6, 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0x9c, 0x1a, 0x3b, 0xf4, 0x0d, 0x8e, 0xcf, 0x40, 0x95, 0xe1, 0xf8, 0xf8, 0x0f, 0x6b, + 0x38, 0x64, 0xa4, 0xcd, 0x31, 0x46, 0xf5, 0x36, 0xad, 0xfa, 0x35, 0x94, 0xe3, 0x2a, 0xd5, 0xf2, + 0x0f, 0x38, 0x8b, 0x03, 0xdb, 0x3e, 0xfd, 0x0d, 0x0e, 0xe9, 0x2e, 0xaa, 0x0e, 0x87, 0xd4, 0x8c, + 0xf4, 0x92, 0x98, 0x7e, 0xaa, 0xc1, 0x05, 0xd9, 0x54, 0xe6, 0x71, 0xd4, 0xdf, 0xfd, 0xe7, 0x71, + 0x94, 0x6a, 0xa5, 0xf5, 0x37, 0x39, 0xa0, 0x35, 0x64, 0x0c, 0x07, 0x24, 0x3b, 0xe6, 0x5e, 0xd5, + 0xa1, 0x8f, 0x35, 0x58, 0x1a, 0xd8, 0xa9, 0xa1, 0xf5, 0x1c, 0x2e, 0x86, 0xb4, 0x85, 0xa5, 0x7b, + 0x27, 0xd2, 0x91, 0xd8, 0xb7, 0x39, 0xf6, 0x4d, 0xf4, 0xf6, 0x08, 0x32, 0x95, 0x11, 0xf1, 0x33, + 0x44, 0x68, 0x89, 0x06, 0xae, 0x17, 0xcb, 0x56, 0xed, 0xa3, 0xe7, 0x65, 0xed, 0x93, 0xe7, 0x65, + 0xed, 0x5f, 0xcf, 0xcb, 0xda, 0x07, 0x2f, 0xca, 0xe7, 0x3e, 0x79, 0x51, 0x3e, 0xf7, 0xf7, 0x17, + 0xe5, 0x73, 0x8f, 0x8d, 0x44, 0x7f, 0x96, 0x75, 0xf2, 0x2c, 0xf3, 0x1f, 0x88, 0xc6, 0x79, 0xfe, + 0xbf, 0x84, 0x7b, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xe6, 0x23, 0x01, 0xc9, 0x6d, 0x19, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -3100,16 +3114,13 @@ func (m *QueryOpenEstResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x1a - { - size := m.WeightBalanceRatio.Size() - i -= size - if _, err := m.WeightBalanceRatio.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.WeightBalanceRatio) > 0 { + i -= len(m.WeightBalanceRatio) + copy(dAtA[i:], m.WeightBalanceRatio) + i = encodeVarintQuery(dAtA, i, uint64(len(m.WeightBalanceRatio))) + i-- + dAtA[i] = 0x12 } - i-- - dAtA[i] = 0x12 { size := m.PositionSize.Size() i -= size @@ -3339,16 +3350,13 @@ func (m *QueryCloseEstResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x1a - { - size := m.WeightBalanceRatio.Size() - i -= size - if _, err := m.WeightBalanceRatio.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.WeightBalanceRatio) > 0 { + i -= len(m.WeightBalanceRatio) + copy(dAtA[i:], m.WeightBalanceRatio) + i = encodeVarintQuery(dAtA, i, uint64(len(m.WeightBalanceRatio))) + i-- + dAtA[i] = 0x12 } - i-- - dAtA[i] = 0x12 { size := m.Liability.Size() i -= size @@ -3796,8 +3804,10 @@ func (m *QueryOpenEstResponse) Size() (n int) { _ = l l = m.PositionSize.Size() n += 1 + l + sovQuery(uint64(l)) - l = m.WeightBalanceRatio.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.WeightBalanceRatio) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } l = m.BorrowFee.Size() n += 1 + l + sovQuery(uint64(l)) return n @@ -3888,8 +3898,10 @@ func (m *QueryCloseEstResponse) Size() (n int) { _ = l l = m.Liability.Size() n += 1 + l + sovQuery(uint64(l)) - l = m.WeightBalanceRatio.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.WeightBalanceRatio) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } l = m.AmountReturned.Size() n += 1 + l + sovQuery(uint64(l)) return n @@ -6190,9 +6202,7 @@ func (m *QueryOpenEstResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.WeightBalanceRatio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.WeightBalanceRatio = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { @@ -6856,9 +6866,7 @@ func (m *QueryCloseEstResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.WeightBalanceRatio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.WeightBalanceRatio = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { diff --git a/x/perpetual/keeper/estimate_and_repay.go b/x/perpetual/keeper/estimate_and_repay.go index 01696114f..4ee6f8175 100644 --- a/x/perpetual/keeper/estimate_and_repay.go +++ b/x/perpetual/keeper/estimate_and_repay.go @@ -5,6 +5,7 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" ammtypes "github.com/elys-network/elys/x/amm/types" "github.com/elys-network/elys/x/perpetual/types" ) @@ -35,7 +36,7 @@ func (k Keeper) EstimateAndRepay(ctx sdk.Context, mtp *types.MTP, pool *types.Po } // CalcRepayAmount repay amount is in custody asset for liabilities with closing ratio -func (k Keeper) CalcRepayAmount(ctx sdk.Context, mtp *types.MTP, ammPool *ammtypes.Pool, closingRatio math.LegacyDec) (repayAmount, payingLiabilities math.Int, slippage, weightBreakingFee math.LegacyDec, err error) { +func (k Keeper) CalcRepayAmount(ctx sdk.Context, mtp *types.MTP, ammPool *ammtypes.Pool, closingRatio math.LegacyDec) (repayAmount, payingLiabilities math.Int, slippage, weightBreakingFee elystypes.Dec34, err error) { // init repay amount // For long this will be in trading asset (custody asset is trading asset) // For short this will be in USDC (custody asset is USDC) @@ -50,7 +51,7 @@ func (k Keeper) CalcRepayAmount(ctx sdk.Context, mtp *types.MTP, ammPool *ammtyp liabilitiesWithClosingRatio := sdk.NewCoin(mtp.LiabilitiesAsset, payingLiabilities) repayAmount, slippage, weightBreakingFee, err = k.EstimateSwapGivenOut(ctx, liabilitiesWithClosingRatio, mtp.CustodyAsset, *ammPool, mtp.Address) if err != nil { - return math.ZeroInt(), math.ZeroInt(), math.LegacyZeroDec(), math.LegacyZeroDec(), err + return math.ZeroInt(), math.ZeroInt(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), err } } if mtp.Position == types.Position_SHORT { @@ -58,7 +59,7 @@ func (k Keeper) CalcRepayAmount(ctx sdk.Context, mtp *types.MTP, ammPool *ammtyp liabilitiesWithClosingRatio := sdk.NewCoin(mtp.LiabilitiesAsset, payingLiabilities) repayAmount, slippage, weightBreakingFee, err = k.EstimateSwapGivenOut(ctx, liabilitiesWithClosingRatio, mtp.CustodyAsset, *ammPool, mtp.Address) if err != nil { - return math.ZeroInt(), math.ZeroInt(), math.LegacyZeroDec(), math.LegacyZeroDec(), err + return math.ZeroInt(), math.ZeroInt(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), err } } diff --git a/x/perpetual/keeper/estimate_swap.go b/x/perpetual/keeper/estimate_swap.go index ba66fe2e3..e095d9cfd 100644 --- a/x/perpetual/keeper/estimate_swap.go +++ b/x/perpetual/keeper/estimate_swap.go @@ -6,25 +6,26 @@ import ( errorsmod "cosmossdk.io/errors" "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" ammtypes "github.com/elys-network/elys/x/amm/types" "github.com/elys-network/elys/x/perpetual/types" ) -func getWeightBreakingFee(weightBalanceBonus math.LegacyDec) math.LegacyDec { +func getWeightBreakingFee(weightBalanceBonus elystypes.Dec34) elystypes.Dec34 { // when weightBalanceBonus is 0, then breaking fee is also 0 // when it's > 0, then breaking fee is still 0 // when it's < 0, breaking fee is it's negative if weightBalanceBonus.IsNegative() { return weightBalanceBonus.Neg() } else { - return math.LegacyZeroDec() + return elystypes.ZeroDec34() } } // Swap estimation using amm CalcOutAmtGivenIn function -func (k Keeper) EstimateSwapGivenIn(ctx sdk.Context, tokenInAmount sdk.Coin, tokenOutDenom string, ammPool ammtypes.Pool, owner string) (math.Int, math.LegacyDec, math.LegacyDec, error) { +func (k Keeper) EstimateSwapGivenIn(ctx sdk.Context, tokenInAmount sdk.Coin, tokenOutDenom string, ammPool ammtypes.Pool, owner string) (math.Int, elystypes.Dec34, elystypes.Dec34, error) { if tokenInAmount.IsZero() { - return math.Int{}, math.LegacyDec{}, math.LegacyDec{}, fmt.Errorf("tokenInAmount is zero for EstimateSwapGivenIn") + return math.Int{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), fmt.Errorf("tokenInAmount is zero for EstimateSwapGivenIn") } params := k.GetParams(ctx) @@ -39,19 +40,19 @@ func (k Keeper) EstimateSwapGivenIn(ctx sdk.Context, tokenInAmount sdk.Coin, tok tokensIn := sdk.Coins{tokenInAmount} tokenOut, slippage, _, weightBalanceBonus, _, _, err := k.amm.SwapOutAmtGivenIn(ctx, ammPool.PoolId, k.oracleKeeper, &snapshot, tokensIn, tokenOutDenom, perpetualFees, params.WeightBreakingFeeFactor) if err != nil { - return math.ZeroInt(), math.LegacyZeroDec(), math.LegacyZeroDec(), errorsmod.Wrapf(err, "unable to swap (EstimateSwapGivenIn) for in %s and out denom %s", tokenInAmount.String(), tokenOutDenom) + return math.ZeroInt(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), errorsmod.Wrapf(err, "unable to swap (EstimateSwapGivenIn) for in %s and out denom %s", tokenInAmount.String(), tokenOutDenom) } if tokenOut.IsZero() { - return math.ZeroInt(), math.LegacyZeroDec(), math.LegacyZeroDec(), errorsmod.Wrapf(types.ErrAmountTooLow, "tokenOut is zero for swap (EstimateSwapGivenIn) for in %s and out denom %s", tokenInAmount.String(), tokenOutDenom) + return math.ZeroInt(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), errorsmod.Wrapf(types.ErrAmountTooLow, "tokenOut is zero for swap (EstimateSwapGivenIn) for in %s and out denom %s", tokenInAmount.String(), tokenOutDenom) } return tokenOut.Amount, slippage, getWeightBreakingFee(weightBalanceBonus), nil } // Swap estimation using amm CalcInAmtGivenOut function -func (k Keeper) EstimateSwapGivenOut(ctx sdk.Context, tokenOutAmount sdk.Coin, tokenInDenom string, ammPool ammtypes.Pool, owner string) (math.Int, math.LegacyDec, math.LegacyDec, error) { +func (k Keeper) EstimateSwapGivenOut(ctx sdk.Context, tokenOutAmount sdk.Coin, tokenInDenom string, ammPool ammtypes.Pool, owner string) (math.Int, elystypes.Dec34, elystypes.Dec34, error) { if tokenOutAmount.IsZero() { - return math.Int{}, math.LegacyDec{}, math.LegacyDec{}, fmt.Errorf("tokenOutAmount is zero for EstimateSwapGivenOut") + return math.Int{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), fmt.Errorf("tokenOutAmount is zero for EstimateSwapGivenOut") } params := k.GetParams(ctx) tokensOut := sdk.Coins{tokenOutAmount} @@ -67,11 +68,11 @@ func (k Keeper) EstimateSwapGivenOut(ctx sdk.Context, tokenOutAmount sdk.Coin, t snapshot := k.amm.GetAccountedPoolSnapshotOrSet(ctx, ammPool) tokenIn, slippage, _, weightBalanceBonus, _, _, err := k.amm.SwapInAmtGivenOut(ctx, ammPool.PoolId, k.oracleKeeper, &snapshot, tokensOut, tokenInDenom, perpetualFees, params.WeightBreakingFeeFactor) if err != nil { - return math.ZeroInt(), math.LegacyZeroDec(), math.LegacyZeroDec(), errorsmod.Wrapf(err, "unable to swap (EstimateSwapGivenOut) for out %s and in denom %s", tokenOutAmount.String(), tokenInDenom) + return math.ZeroInt(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), errorsmod.Wrapf(err, "unable to swap (EstimateSwapGivenOut) for out %s and in denom %s", tokenOutAmount.String(), tokenInDenom) } if tokenIn.IsZero() { - return math.ZeroInt(), math.LegacyZeroDec(), math.LegacyZeroDec(), errorsmod.Wrapf(types.ErrAmountTooLow, "tokenIn is zero for swap (EstimateSwapGivenOut) for out %s and in denom %s", tokenOutAmount.String(), tokenInDenom) + return math.ZeroInt(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), errorsmod.Wrapf(types.ErrAmountTooLow, "tokenIn is zero for swap (EstimateSwapGivenOut) for out %s and in denom %s", tokenOutAmount.String(), tokenInDenom) } return tokenIn.Amount, slippage, getWeightBreakingFee(weightBalanceBonus), nil } diff --git a/x/perpetual/keeper/query_close_estimation.go b/x/perpetual/keeper/query_close_estimation.go index 31cd8f185..9955da8cc 100644 --- a/x/perpetual/keeper/query_close_estimation.go +++ b/x/perpetual/keeper/query_close_estimation.go @@ -120,7 +120,7 @@ func (k Keeper) HandleCloseEstimation(ctx sdk.Context, req *types.QueryCloseEsti BorrowInterestUnpaidLiability: sdk.NewCoin(mtp.LiabilitiesAsset, unpaidInterestLiability), ReturningAmount: sdk.NewCoin(mtp.CustodyAsset, returnAmount), PayingLiabilities: sdk.NewCoin(mtp.LiabilitiesAsset, payingLiabilities), - WeightBreakingFee: weightBreakingFee, - Slippage: slippage, + WeightBreakingFee: weightBreakingFee.String(), + Slippage: slippage.String(), }, nil } diff --git a/x/perpetual/keeper/query_open_estimation.go b/x/perpetual/keeper/query_open_estimation.go index 3fc46ae4d..d529677e4 100644 --- a/x/perpetual/keeper/query_open_estimation.go +++ b/x/perpetual/keeper/query_open_estimation.go @@ -6,6 +6,7 @@ import ( errorsmod "cosmossdk.io/errors" "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" assetprofiletypes "github.com/elys-network/elys/x/assetprofile/types" ptypes "github.com/elys-network/elys/x/parameter/types" "github.com/elys-network/elys/x/perpetual/types" @@ -106,11 +107,11 @@ func (k Keeper) HandleOpenEstimation(ctx sdk.Context, req *types.QueryOpenEstima // LONG: if collateral asset is trading asset then custodyAmount = leveragedAmount else if it collateral asset is usdc, we swap it to trading asset below // SHORT: collateralAsset is always usdc, and custody has to be in usdc, so custodyAmount = leveragedAmount custodyAmount := leveragedAmount - slippage := math.LegacyZeroDec() + slippage := elystypes.ZeroDec34() mtp.Collateral = req.Collateral.Amount eta := proxyLeverage.Sub(math.LegacyOneDec()) liabilities := req.Collateral.Amount.ToLegacyDec().Mul(eta).TruncateInt() - weightBreakingFee := math.LegacyZeroDec() + weightBreakingFee := elystypes.ZeroDec34() if req.Position == types.Position_LONG { //getting custody if mtp.CollateralAsset == baseCurrency { @@ -214,13 +215,13 @@ func (k Keeper) HandleOpenEstimation(ctx sdk.Context, req *types.QueryOpenEstima LiquidationPrice: liquidationPrice, EstimatedPnl: sdk.Coin{Denom: baseCurrency, Amount: estimatedPnLAmount}, AvailableLiquidity: availableLiquidity, - Slippage: slippage, + Slippage: slippage.String(), PriceImpact: priceImpact, BorrowInterestRate: borrowInterestRate, FundingRate: fundingRate, Custody: sdk.NewCoin(mtp.CustodyAsset, mtp.Custody), Liabilities: sdk.NewCoin(mtp.LiabilitiesAsset, mtp.Liabilities), LimitPrice: req.LimitPrice, - WeightBreakingFee: weightBreakingFee, + WeightBreakingFee: weightBreakingFee.String(), }, nil } diff --git a/x/perpetual/types/query.pb.go b/x/perpetual/types/query.pb.go index 34b4069bc..9ab6acd9f 100644 --- a/x/perpetual/types/query.pb.go +++ b/x/perpetual/types/query.pb.go @@ -1175,14 +1175,14 @@ type QueryOpenEstimationResponse struct { LiquidationPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,9,opt,name=liquidation_price,json=liquidationPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"liquidation_price"` EstimatedPnl types.Coin `protobuf:"bytes,10,opt,name=estimated_pnl,json=estimatedPnl,proto3" json:"estimated_pnl"` AvailableLiquidity types.Coin `protobuf:"bytes,11,opt,name=available_liquidity,json=availableLiquidity,proto3" json:"available_liquidity"` - Slippage cosmossdk_io_math.LegacyDec `protobuf:"bytes,12,opt,name=slippage,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"slippage"` + Slippage string `protobuf:"bytes,12,opt,name=slippage,proto3" json:"slippage,omitempty"` BorrowInterestRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,13,opt,name=borrow_interest_rate,json=borrowInterestRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"borrow_interest_rate"` FundingRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,14,opt,name=funding_rate,json=fundingRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"funding_rate"` PriceImpact cosmossdk_io_math.LegacyDec `protobuf:"bytes,15,opt,name=price_impact,json=priceImpact,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"price_impact"` Custody types.Coin `protobuf:"bytes,16,opt,name=custody,proto3" json:"custody"` Liabilities types.Coin `protobuf:"bytes,17,opt,name=liabilities,proto3" json:"liabilities"` LimitPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,18,opt,name=limit_price,json=limitPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"limit_price"` - WeightBreakingFee cosmossdk_io_math.LegacyDec `protobuf:"bytes,19,opt,name=weight_breaking_fee,json=weightBreakingFee,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"weight_breaking_fee"` + WeightBreakingFee string `protobuf:"bytes,19,opt,name=weight_breaking_fee,json=weightBreakingFee,proto3" json:"weight_breaking_fee,omitempty"` } func (m *QueryOpenEstimationResponse) Reset() { *m = QueryOpenEstimationResponse{} } @@ -1260,6 +1260,13 @@ func (m *QueryOpenEstimationResponse) GetAvailableLiquidity() types.Coin { return types.Coin{} } +func (m *QueryOpenEstimationResponse) GetSlippage() string { + if m != nil { + return m.Slippage + } + return "" +} + func (m *QueryOpenEstimationResponse) GetCustody() types.Coin { if m != nil { return m.Custody @@ -1274,6 +1281,13 @@ func (m *QueryOpenEstimationResponse) GetLiabilities() types.Coin { return types.Coin{} } +func (m *QueryOpenEstimationResponse) GetWeightBreakingFee() string { + if m != nil { + return m.WeightBreakingFee + } + return "" +} + type PoolResponse struct { AmmPoolId uint64 `protobuf:"varint,1,opt,name=amm_pool_id,json=ammPoolId,proto3" json:"amm_pool_id,omitempty"` Health cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=health,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"health"` @@ -1428,8 +1442,8 @@ type QueryCloseEstimationResponse struct { ClosingPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,10,opt,name=closing_price,json=closingPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"closing_price"` Custody types.Coin `protobuf:"bytes,11,opt,name=custody,proto3" json:"custody"` Collateral types.Coin `protobuf:"bytes,12,opt,name=collateral,proto3" json:"collateral"` - WeightBreakingFee cosmossdk_io_math.LegacyDec `protobuf:"bytes,13,opt,name=weight_breaking_fee,json=weightBreakingFee,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"weight_breaking_fee"` - Slippage cosmossdk_io_math.LegacyDec `protobuf:"bytes,14,opt,name=slippage,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"slippage"` + WeightBreakingFee string `protobuf:"bytes,13,opt,name=weight_breaking_fee,json=weightBreakingFee,proto3" json:"weight_breaking_fee,omitempty"` + Slippage string `protobuf:"bytes,14,opt,name=slippage,proto3" json:"slippage,omitempty"` } func (m *QueryCloseEstimationResponse) Reset() { *m = QueryCloseEstimationResponse{} } @@ -1521,6 +1535,20 @@ func (m *QueryCloseEstimationResponse) GetCollateral() types.Coin { return types.Coin{} } +func (m *QueryCloseEstimationResponse) GetWeightBreakingFee() string { + if m != nil { + return m.WeightBreakingFee + } + return "" +} + +func (m *QueryCloseEstimationResponse) GetSlippage() string { + if m != nil { + return m.Slippage + } + return "" +} + func init() { proto.RegisterType((*Fees)(nil), "elys.perpetual.Fees") proto.RegisterType((*MtpAndPrice)(nil), "elys.perpetual.MtpAndPrice") @@ -1554,151 +1582,151 @@ func init() { func init() { proto.RegisterFile("elys/perpetual/query.proto", fileDescriptor_9a2c961615c1b7fe) } var fileDescriptor_9a2c961615c1b7fe = []byte{ - // 2293 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x5a, 0x4d, 0x6c, 0x1b, 0xc7, - 0xf5, 0x37, 0x45, 0x4a, 0x16, 0x1f, 0x3f, 0x24, 0x8e, 0x64, 0x87, 0xa2, 0x1c, 0xda, 0xff, 0xb5, - 0x9d, 0x38, 0x91, 0x45, 0xfe, 0xa5, 0x18, 0x09, 0xd2, 0x0f, 0x04, 0x92, 0x5c, 0xd9, 0x4a, 0x25, - 0x97, 0xa5, 0x9d, 0xba, 0x30, 0x90, 0x6e, 0x47, 0xe4, 0x88, 0x5c, 0x68, 0xbf, 0xbc, 0x3b, 0xb4, - 0x44, 0x0b, 0x2a, 0x8a, 0x22, 0xd7, 0x16, 0x6d, 0x53, 0x20, 0xc7, 0x5c, 0x7b, 0x2d, 0x50, 0xb4, - 0x40, 0xaf, 0xbd, 0xe4, 0x18, 0xb4, 0x97, 0xa2, 0x87, 0xa0, 0xb0, 0x7b, 0xec, 0xb9, 0xe7, 0x62, - 0x3e, 0x76, 0xb9, 0xcb, 0x25, 0x25, 0x72, 0xcd, 0x36, 0x37, 0x71, 0xe7, 0xcd, 0xef, 0xfd, 0xde, - 0xbc, 0x37, 0x6f, 0xde, 0xbc, 0x11, 0x94, 0x88, 0xde, 0x75, 0xab, 0x36, 0x71, 0x6c, 0x42, 0x3b, - 0x58, 0xaf, 0x3e, 0xed, 0x10, 0xa7, 0x5b, 0xb1, 0x1d, 0x8b, 0x5a, 0x28, 0xcf, 0xc6, 0x2a, 0xfe, - 0x58, 0x69, 0xb1, 0x65, 0xb5, 0x2c, 0x3e, 0x54, 0x65, 0x7f, 0x09, 0xa9, 0xd2, 0x95, 0x96, 0x65, - 0xb5, 0x74, 0x52, 0xc5, 0xb6, 0x56, 0xc5, 0xa6, 0x69, 0x51, 0x4c, 0x35, 0x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 0x7d, 0x5d, - 0xe5, 0x0e, 0x27, 0x59, 0x41, 0xb7, 0xcf, 0x24, 0xc9, 0x2e, 0x0c, 0xab, 0xa4, 0x47, 0xe7, 0x77, - 0x09, 0x98, 0xeb, 0xab, 0x70, 0xd1, 0x60, 0xb5, 0x83, 0x4b, 0xf6, 0xd2, 0xed, 0xd1, 0x84, 0x25, - 0xc9, 0x2d, 0x4e, 0xf2, 0xdb, 0xe8, 0x9b, 0x67, 0x92, 0xe4, 0xe5, 0x5d, 0x80, 0x65, 0xf5, 0x24, - 0x50, 0xfb, 0x9f, 0x6e, 0xde, 0xff, 0xe2, 0x45, 0x39, 0xf1, 0xe5, 0x8b, 0x72, 0xe2, 0x1f, 0x2f, - 0xca, 0x89, 0x5f, 0xbe, 0x2c, 0x5f, 0xf8, 0xf2, 0x65, 0xf9, 0xc2, 0xdf, 0x5e, 0x96, 0x2f, 0x3c, - 0xa9, 0xb4, 0x34, 0xda, 0xee, 0xec, 0x57, 0x1a, 0x96, 0x31, 0x40, 0xc1, 0x71, 0xff, 0xff, 0x2a, - 0xed, 0xcf, 0xf0, 0x7f, 0x2b, 0x7a, 0xe7, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x5a, 0xa0, 0xc2, - 0xa0, 0x73, 0x25, 0x00, 0x00, + // 2289 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x5a, 0xcb, 0x6f, 0x1b, 0xd7, + 0xd5, 0x37, 0x45, 0xea, 0xc1, 0xc3, 0x87, 0xc4, 0x2b, 0x59, 0xa1, 0x28, 0x85, 0xf6, 0x37, 0x96, + 0x13, 0x27, 0xb2, 0xc8, 0x4f, 0x8a, 0x91, 0x20, 0x7d, 0x20, 0x90, 0xe4, 0xca, 0x56, 0x2a, 0xb9, + 0x2c, 0xed, 0xd4, 0x85, 0x81, 0x74, 0x7a, 0x45, 0x5e, 0x91, 0x03, 0xc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x12, 0xca, 0x7a, 0x01, 0x8f, + 0x3a, 0x7a, 0x00, 0x49, 0x16, 0x13, 0xc1, 0x35, 0x39, 0x7a, 0xf3, 0x66, 0x49, 0xa2, 0x15, 0x00, + 0x1e, 0x18, 0x01, 0x08, 0x23, 0xbf, 0xa8, 0x38, 0x08, 0x47, 0xdc, 0x87, 0x9c, 0x18, 0xef, 0x06, + 0xcf, 0xfb, 0x80, 0x15, 0x7a, 0x8e, 0xef, 0xdc, 0x0f, 0x1c, 0x7a, 0x7f, 0x58, 0xcc, 0xad, 0x0e, + 0xfb, 0x33, 0x3d, 0xea, 0xb0, 0x98, 0xa5, 0x67, 0xc8, 0xab, 0x47, 0xb0, 0x24, 0xb4, 0x08, 0x5f, + 0x84, 0xd5, 0x64, 0x86, 0x57, 0xb3, 0xc8, 0xd1, 0x78, 0xe6, 0x86, 0xf4, 0x3c, 0x82, 0xb4, 0xd7, + 0x7f, 0xa9, 0x06, 0x3e, 0x7d, 0x85, 0x62, 0xef, 0xc1, 0x1c, 0xe0, 0x53, 0xe5, 0x77, 0x31, 0xd9, + 0x35, 0xee, 0xe8, 0x96, 0x4b, 0xa2, 0xb7, 0x84, 0xfe, 0x97, 0x95, 0x6b, 0x90, 0xf2, 0x9b, 0x1d, + 0xff, 0xd6, 0x02, 0xde, 0xa3, 0xbd, 0x3a, 0x7a, 0x00, 0xe9, 0x1a, 0x03, 0x55, 0xb1, 0xc1, 0x27, + 0x22, 0x23, 0x8c, 0xac, 0x53, 0x1c, 0x60, 0x8b, 0xef, 0x57, 0x3e, 0x99, 0x81, 0x95, 0xde, 0x54, + 0x5f, 0xa9, 0xc3, 0x8d, 0x34, 0x6d, 0x13, 0xa3, 0x34, 0x6d, 0x5d, 0xef, 0xa8, 0xf8, 0x08, 0xef, + 0xa8, 0xee, 0xf7, 0x6e, 0x62, 0x2c, 0xef, 0xdd, 0xff, 0xf6, 0x38, 0xf7, 0x23, 0x98, 0x33, 0xf0, + 0xa9, 0x1a, 0x8a, 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2, 0x95, 0xbf, 0xbf, 0x2c, 0x5e, 0x79, 0x52, 0x6a, 0x68, 0xb4, + 0xd9, 0x3a, 0x2c, 0xd5, 0x2c, 0xa3, 0x87, 0x82, 0xd3, 0xee, 0xff, 0xef, 0x39, 0x9c, 0xe2, 0xff, + 0x8a, 0xf3, 0xce, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xa5, 0x47, 0xe4, 0x7c, 0xa7, 0x24, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -3209,18 +3237,15 @@ func (m *QueryOpenEstimationResponse) MarshalToSizedBuffer(dAtA []byte) (int, er _ = i var l int _ = l - { - size := m.WeightBreakingFee.Size() - i -= size - if _, err := m.WeightBreakingFee.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.WeightBreakingFee) > 0 { + i -= len(m.WeightBreakingFee) + copy(dAtA[i:], m.WeightBreakingFee) + i = encodeVarintQuery(dAtA, i, uint64(len(m.WeightBreakingFee))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x9a { size := m.LimitPrice.Size() i -= size @@ -3287,16 +3312,13 @@ func (m *QueryOpenEstimationResponse) MarshalToSizedBuffer(dAtA []byte) (int, er } i-- dAtA[i] = 0x6a - { - size := m.Slippage.Size() - i -= size - if _, err := m.Slippage.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.Slippage) > 0 { + i -= len(m.Slippage) + copy(dAtA[i:], m.Slippage) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Slippage))) + i-- + dAtA[i] = 0x62 } - i-- - dAtA[i] = 0x62 { size, err := m.AvailableLiquidity.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -3628,26 +3650,20 @@ func (m *QueryCloseEstimationResponse) MarshalToSizedBuffer(dAtA []byte) (int, e _ = i var l int _ = l - { - size := m.Slippage.Size() - i -= size - if _, err := m.Slippage.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.Slippage) > 0 { + i -= len(m.Slippage) + copy(dAtA[i:], m.Slippage) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Slippage))) + i-- + dAtA[i] = 0x72 } - i-- - dAtA[i] = 0x72 - { - size := m.WeightBreakingFee.Size() - i -= size - if _, err := m.WeightBreakingFee.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.WeightBreakingFee) > 0 { + i -= len(m.WeightBreakingFee) + copy(dAtA[i:], m.WeightBreakingFee) + i = encodeVarintQuery(dAtA, i, uint64(len(m.WeightBreakingFee))) + i-- + dAtA[i] = 0x6a } - i-- - dAtA[i] = 0x6a { size, err := m.Collateral.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -4175,8 +4191,10 @@ func (m *QueryOpenEstimationResponse) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) l = m.AvailableLiquidity.Size() n += 1 + l + sovQuery(uint64(l)) - l = m.Slippage.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.Slippage) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } l = m.BorrowInterestRate.Size() n += 1 + l + sovQuery(uint64(l)) l = m.FundingRate.Size() @@ -4189,8 +4207,10 @@ func (m *QueryOpenEstimationResponse) Size() (n int) { n += 2 + l + sovQuery(uint64(l)) l = m.LimitPrice.Size() n += 2 + l + sovQuery(uint64(l)) - l = m.WeightBreakingFee.Size() - n += 2 + l + sovQuery(uint64(l)) + l = len(m.WeightBreakingFee) + if l > 0 { + n += 2 + l + sovQuery(uint64(l)) + } return n } @@ -4290,10 +4310,14 @@ func (m *QueryCloseEstimationResponse) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) l = m.Collateral.Size() n += 1 + l + sovQuery(uint64(l)) - l = m.WeightBreakingFee.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.Slippage.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.WeightBreakingFee) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Slippage) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -7352,9 +7376,7 @@ func (m *QueryOpenEstimationResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Slippage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Slippage = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 13: if wireType != 2 { @@ -7588,9 +7610,7 @@ func (m *QueryOpenEstimationResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.WeightBreakingFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.WeightBreakingFee = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -8688,9 +8708,7 @@ func (m *QueryCloseEstimationResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.WeightBreakingFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.WeightBreakingFee = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 14: if wireType != 2 { @@ -8722,9 +8740,7 @@ func (m *QueryCloseEstimationResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Slippage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Slippage = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/tier/keeper/portfolio.go b/x/tier/keeper/portfolio.go index f53fd6d7d..c95cf4947 100644 --- a/x/tier/keeper/portfolio.go +++ b/x/tier/keeper/portfolio.go @@ -59,7 +59,7 @@ func (k Keeper) RetrieveAllPortfolio(ctx sdk.Context, user sdk.AccAddress) { baseCurrency, found := k.assetProfileKeeper.GetUsdcDenom(ctx) if found { edenDenomPrice := k.amm.GetEdenDenomPrice(ctx, baseCurrency) - totalVesting = totalVesting.Mul(elystypes.NewDec34FromLegacyDec(edenDenomPrice)) + totalVesting = totalVesting.Mul(edenDenomPrice) } totalValue = totalValue.Add(commit).Add(delegations).Add(unbondings).Add(totalVesting) @@ -228,11 +228,11 @@ func (k Keeper) RetrievePerpetualTotal(ctx sdk.Context, user sdk.AccAddress) (el for _, perpetual := range perpetuals { if perpetual.Mtp.Position == perpetualtypes.Position_LONG { - totalAssets = totalAssets.Add(elystypes.NewDec34FromLegacyDec(k.amm.CalculateUSDValue(ctx, perpetual.Mtp.GetTradingAsset(), perpetual.Mtp.Custody))) - totalLiability = totalLiability.Add(elystypes.NewDec34FromLegacyDec(k.amm.CalculateUSDValue(ctx, usdcDenom, perpetual.Mtp.Liabilities.Add(perpetual.Mtp.BorrowInterestUnpaidLiability)))) + totalAssets = totalAssets.Add(k.amm.CalculateUSDValue(ctx, perpetual.Mtp.GetTradingAsset(), perpetual.Mtp.Custody)) + totalLiability = totalLiability.Add(k.amm.CalculateUSDValue(ctx, usdcDenom, perpetual.Mtp.Liabilities.Add(perpetual.Mtp.BorrowInterestUnpaidLiability))) } else { - totalAssets = totalAssets.Add(elystypes.NewDec34FromLegacyDec(k.amm.CalculateUSDValue(ctx, usdcDenom, perpetual.Mtp.Custody))) - totalLiability = totalLiability.Add(elystypes.NewDec34FromLegacyDec(k.amm.CalculateUSDValue(ctx, perpetual.Mtp.LiabilitiesAsset, perpetual.Mtp.Liabilities.Add(perpetual.Mtp.BorrowInterestUnpaidLiability)))) + totalAssets = totalAssets.Add(k.amm.CalculateUSDValue(ctx, usdcDenom, perpetual.Mtp.Custody)) + totalLiability = totalLiability.Add(k.amm.CalculateUSDValue(ctx, perpetual.Mtp.LiabilitiesAsset, perpetual.Mtp.Liabilities.Add(perpetual.Mtp.BorrowInterestUnpaidLiability))) } } netValue = totalAssets.Sub(totalLiability) @@ -301,7 +301,7 @@ func (k Keeper) RetrieveTradeshieldTotal(ctx sdk.Context, user sdk.AccAddress) e for _, order := range perpetualOrders { balances := k.bankKeeper.GetAllBalances(ctx, order.GetOrderAddress()) for _, balance := range balances { - totalValue = totalValue.Add(elystypes.NewDec34FromLegacyDec(k.amm.CalculateUSDValue(ctx, balance.Denom, balance.Amount))) + totalValue = totalValue.Add(k.amm.CalculateUSDValue(ctx, balance.Denom, balance.Amount)) } } } @@ -312,7 +312,7 @@ func (k Keeper) RetrieveTradeshieldTotal(ctx sdk.Context, user sdk.AccAddress) e for _, order := range spotOrders { balances := k.bankKeeper.GetAllBalances(ctx, order.GetOrderAddress()) for _, balance := range balances { - totalValue = totalValue.Add(elystypes.NewDec34FromLegacyDec(k.amm.CalculateUSDValue(ctx, balance.Denom, balance.Amount))) + totalValue = totalValue.Add(k.amm.CalculateUSDValue(ctx, balance.Denom, balance.Amount)) } } } diff --git a/x/tier/types/expected_keepers.go b/x/tier/types/expected_keepers.go index 64067d82a..2ccea2608 100644 --- a/x/tier/types/expected_keepers.go +++ b/x/tier/types/expected_keepers.go @@ -77,10 +77,10 @@ type AmmKeeper interface { routes []*ammtypes.SwapAmountInRoute, discount math.LegacyDec, overrideSwapFee math.LegacyDec, - ) (math.LegacyDec, math.LegacyDec, sdk.Coin, math.LegacyDec, math.LegacyDec, sdk.Coin, math.LegacyDec, math.LegacyDec, error) + ) (elystypes.Dec34, elystypes.Dec34, sdk.Coin, math.LegacyDec, math.LegacyDec, sdk.Coin, elystypes.Dec34, elystypes.Dec34, error) Balance(goCtx context.Context, req *ammtypes.QueryBalanceRequest) (*ammtypes.QueryBalanceResponse, error) - GetEdenDenomPrice(ctx sdk.Context, baseCurrency string) math.LegacyDec - CalculateUSDValue(ctx sdk.Context, denom string, amount math.Int) math.LegacyDec + GetEdenDenomPrice(ctx sdk.Context, baseCurrency string) elystypes.Dec34 + CalculateUSDValue(ctx sdk.Context, denom string, amount math.Int) elystypes.Dec34 CalcAmmPrice(ctx sdk.Context, denom string, decimal uint64) elystypes.Dec34 } diff --git a/x/tradeshield/keeper/keeper.go b/x/tradeshield/keeper/keeper.go index 593be7d11..db24ab27b 100644 --- a/x/tradeshield/keeper/keeper.go +++ b/x/tradeshield/keeper/keeper.go @@ -9,6 +9,7 @@ import ( sdkmath "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/tradeshield/types" ) @@ -46,13 +47,13 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { } // GetAssetPriceFromDenomInToDenomOut returns the price of an asset from a denom to another denom -func (k Keeper) GetAssetPriceFromDenomInToDenomOut(ctx sdk.Context, denomIn, denomOut string) (sdkmath.LegacyDec, error) { +func (k Keeper) GetAssetPriceFromDenomInToDenomOut(ctx sdk.Context, denomIn, denomOut string) (elystypes.Dec34, error) { priceIn := k.amm.CalculateUSDValue(ctx, denomIn, sdkmath.NewInt(1)) priceOut := k.amm.CalculateUSDValue(ctx, denomOut, sdkmath.NewInt(1)) // If the price of the asset is 0, return an error if priceIn.IsZero() || priceOut.IsZero() { - return sdkmath.LegacyZeroDec(), types.ErrPriceNotFound + return elystypes.ZeroDec34(), types.ErrPriceNotFound } // Calculate the price of the asset from denomIn to denomOut diff --git a/x/tradeshield/keeper/pending_spot_order.go b/x/tradeshield/keeper/pending_spot_order.go index d56cc09bf..a52a97ae8 100644 --- a/x/tradeshield/keeper/pending_spot_order.go +++ b/x/tradeshield/keeper/pending_spot_order.go @@ -12,6 +12,7 @@ import ( "cosmossdk.io/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" + elystypes "github.com/elys-network/elys/types" ammtypes "github.com/elys-network/elys/x/amm/types" "github.com/elys-network/elys/x/tradeshield/types" ) @@ -192,7 +193,7 @@ func (k Keeper) ExecuteStopLossOrder(ctx sdk.Context, order types.SpotOrder) (*a return nil, errorsmod.Wrapf(types.ErrZeroMarketPrice, "Base denom: %s, Quote denom: %s", order.OrderPrice.BaseDenom, order.OrderPrice.QuoteDenom) } - if marketPrice.GT(order.OrderPrice.Rate) { + if marketPrice.GT(elystypes.NewDec34FromLegacyDec(order.OrderPrice.Rate)) { // skip the order return nil, nil } @@ -237,7 +238,7 @@ func (k Keeper) ExecuteLimitSellOrder(ctx sdk.Context, order types.SpotOrder) (* return nil, errorsmod.Wrapf(types.ErrZeroMarketPrice, "Base denom: %s, Quote denom: %s", order.OrderPrice.BaseDenom, order.OrderPrice.QuoteDenom) } - if marketPrice.LT(order.OrderPrice.Rate) { + if marketPrice.LT(elystypes.NewDec34FromLegacyDec(order.OrderPrice.Rate)) { // skip the order return nil, nil } @@ -282,7 +283,7 @@ func (k Keeper) ExecuteLimitBuyOrder(ctx sdk.Context, order types.SpotOrder) (*a return nil, errorsmod.Wrapf(types.ErrZeroMarketPrice, "Base denom: %s, Quote denom: %s", order.OrderPrice.BaseDenom, order.OrderPrice.QuoteDenom) } - if marketPrice.GT(order.OrderPrice.Rate) { + if marketPrice.GT(elystypes.NewDec34FromLegacyDec(order.OrderPrice.Rate)) { // skip the order return nil, nil } diff --git a/x/tradeshield/types/expected_keepers.go b/x/tradeshield/types/expected_keepers.go index 0b0413935..ba86ec2b6 100644 --- a/x/tradeshield/types/expected_keepers.go +++ b/x/tradeshield/types/expected_keepers.go @@ -6,6 +6,7 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" + elystypes "github.com/elys-network/elys/types" ammtypes "github.com/elys-network/elys/x/amm/types" perpetualtypes "github.com/elys-network/elys/x/perpetual/types" ) @@ -32,8 +33,8 @@ type BankKeeper interface { //go:generate mockery --srcpkg . --name AmmKeeper --structname AmmKeeper --filename amm_keeper.go --with-expecter type AmmKeeper interface { SwapByDenom(ctx sdk.Context, msg *ammtypes.MsgSwapByDenom) (*ammtypes.MsgSwapByDenomResponse, error) - CalculateUSDValue(ctx sdk.Context, denom string, amount sdkmath.Int) sdkmath.LegacyDec - CalcAmmPrice(ctx sdk.Context, denom string, decimal uint64) sdkmath.LegacyDec + CalculateUSDValue(ctx sdk.Context, denom string, amount sdkmath.Int) elystypes.Dec34 + CalcAmmPrice(ctx sdk.Context, denom string, decimal uint64) elystypes.Dec34 } // PerpetualKeeper defines the expected interface needed to open and close perpetual positions From 6b2e2aa8cecc70647bdfcb959b253e64988e87ce Mon Sep 17 00:00:00 2001 From: Cosmic Vagabond <121588426+cosmic-vagabond@users.noreply.github.com> Date: Wed, 8 Jan 2025 16:51:06 +0100 Subject: [PATCH 04/18] test: fix tests --- x/accountedpool/types/mocks/amm_keeper.go | 2 +- x/accountedpool/types/mocks/bank_keeper.go | 2 +- .../types/mocks/perpetual_keeper.go | 2 +- .../apply_join_pool_state_change_test.go | 9 +- x/amm/keeper/fee_test.go | 7 +- x/amm/keeper/msg_server_join_pool_test.go | 3 +- x/amm/keeper/update_pool_for_swap_test.go | 15 +- x/amm/types/mocks/accounted_pool_keeper.go | 2 +- x/amm/types/mocks/oracle_keeper.go | 19 +- x/amm/types/swap_out_amt_given_in_test.go | 19 +- x/burner/types/mocks/bank_keeper.go | 2 +- x/leveragelp/types/mocks/bank_keeper.go | 2 +- x/masterchef/client/cli/query_aprs_test.go | 18 +- x/masterchef/client/cli/tx.go | 5 - x/masterchef/keeper/query_test.go | 23 +- .../keeper/query_open_estimation_test.go | 19 +- x/tier/keeper/query_staked_pool_test.go | 2 +- x/tier/keeper/query_staked_test.go | 2 +- x/tradeshield/types/mocks/amm_keeper.go | 196 ++++++ x/tradeshield/types/mocks/bank_keeper.go | 185 ++++++ x/tradeshield/types/mocks/perpetual_keeper.go | 563 ++++++++++++++++++ 21 files changed, 1021 insertions(+), 76 deletions(-) create mode 100644 x/tradeshield/types/mocks/amm_keeper.go create mode 100644 x/tradeshield/types/mocks/bank_keeper.go create mode 100644 x/tradeshield/types/mocks/perpetual_keeper.go diff --git a/x/accountedpool/types/mocks/amm_keeper.go b/x/accountedpool/types/mocks/amm_keeper.go index 63283c77f..75fdbf9ac 100644 --- a/x/accountedpool/types/mocks/amm_keeper.go +++ b/x/accountedpool/types/mocks/amm_keeper.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/x/accountedpool/types/mocks/bank_keeper.go b/x/accountedpool/types/mocks/bank_keeper.go index 3a4a73eed..8ebb8dc64 100644 --- a/x/accountedpool/types/mocks/bank_keeper.go +++ b/x/accountedpool/types/mocks/bank_keeper.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/x/accountedpool/types/mocks/perpetual_keeper.go b/x/accountedpool/types/mocks/perpetual_keeper.go index 7b0ba0edb..6742b34f5 100644 --- a/x/accountedpool/types/mocks/perpetual_keeper.go +++ b/x/accountedpool/types/mocks/perpetual_keeper.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/x/amm/keeper/apply_join_pool_state_change_test.go b/x/amm/keeper/apply_join_pool_state_change_test.go index ba5b87a5a..28fe9dc7f 100644 --- a/x/amm/keeper/apply_join_pool_state_change_test.go +++ b/x/amm/keeper/apply_join_pool_state_change_test.go @@ -6,6 +6,7 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" simapp "github.com/elys-network/elys/app" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/amm/types" ptypes "github.com/elys-network/elys/x/parameter/types" ) @@ -73,7 +74,7 @@ func (suite *AmmKeeperTestSuite) TestApplyJoinPoolStateChange() { joinCoins := sdk.NewCoins(sdk.NewCoin(ptypes.BaseCurrency, sdkmath.NewInt(100000)), sdk.NewCoin(ptypes.ATOM, sdkmath.NewInt(100000))) ctx = ctx.WithBlockTime(ctx.BlockTime().Add(time.Hour)) - err = app.AmmKeeper.ApplyJoinPoolStateChange(ctx, pool, addr, pool.TotalShares.Amount, joinCoins, sdkmath.LegacyZeroDec()) + err = app.AmmKeeper.ApplyJoinPoolStateChange(ctx, pool, addr, pool.TotalShares.Amount, joinCoins, elystypes.ZeroDec34()) suite.Require().NoError(err) }, }, @@ -137,7 +138,7 @@ func (suite *AmmKeeperTestSuite) TestApplyJoinPoolStateChange() { ) ctx = ctx.WithBlockTime(ctx.BlockTime().Add(time.Hour)) - err = app.AmmKeeper.ApplyJoinPoolStateChange(ctx, pool, addr, pool.TotalShares.Amount, joinCoins, sdkmath.LegacyZeroDec()) + err = app.AmmKeeper.ApplyJoinPoolStateChange(ctx, pool, addr, pool.TotalShares.Amount, joinCoins, elystypes.ZeroDec34()) suite.Require().Error(err) }, }, @@ -204,7 +205,7 @@ func (suite *AmmKeeperTestSuite) TestApplyJoinPoolStateChange() { // must panic suite.Require().Panics(func() { - err = app.AmmKeeper.ApplyJoinPoolStateChange(ctx, pool, addr, sdkmath.NewInt(-1000), joinCoins, sdkmath.LegacyZeroDec()) + err = app.AmmKeeper.ApplyJoinPoolStateChange(ctx, pool, addr, sdkmath.NewInt(-1000), joinCoins, elystypes.ZeroDec34()) suite.Require().Error(err) }) }, @@ -282,7 +283,7 @@ func (suite *AmmKeeperTestSuite) TestApplyJoinPoolStateChange() { ) ctx = ctx.WithBlockTime(ctx.BlockTime().Add(time.Hour)) - err = app.AmmKeeper.ApplyJoinPoolStateChange(ctx, pool, addr, pool.TotalShares.Amount, joinCoins, sdkmath.LegacyNewDecWithPrec(10, 2)) + err = app.AmmKeeper.ApplyJoinPoolStateChange(ctx, pool, addr, pool.TotalShares.Amount, joinCoins, elystypes.NewDec34WithPrec(10, 2)) suite.Require().NoError(err) }, }, diff --git a/x/amm/keeper/fee_test.go b/x/amm/keeper/fee_test.go index b99ba9cdd..a72d3cb9f 100644 --- a/x/amm/keeper/fee_test.go +++ b/x/amm/keeper/fee_test.go @@ -8,6 +8,7 @@ import ( "github.com/cometbft/cometbft/crypto/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/amm/keeper" "github.com/elys-network/elys/x/amm/types" ptypes "github.com/elys-network/elys/x/parameter/types" @@ -16,13 +17,13 @@ import ( func TestPortionCoins(t *testing.T) { coins := sdk.Coins{sdk.NewInt64Coin(ptypes.Eden, 1000), sdk.NewInt64Coin(ptypes.Elys, 10000)} - portion := keeper.PortionCoins(coins, sdkmath.LegacyZeroDec()) + portion := keeper.PortionCoins(coins, elystypes.ZeroDec34()) require.Equal(t, portion, sdk.Coins{}) - portion = keeper.PortionCoins(coins, sdkmath.LegacyNewDecWithPrec(1, 1)) + portion = keeper.PortionCoins(coins, elystypes.NewDec34WithPrec(1, 1)) require.Equal(t, portion, sdk.Coins{sdk.NewInt64Coin(ptypes.Eden, 100), sdk.NewInt64Coin(ptypes.Elys, 1000)}) - portion = keeper.PortionCoins(coins, sdkmath.LegacyNewDec(1)) + portion = keeper.PortionCoins(coins, elystypes.OneDec34()) require.Equal(t, portion, coins) } diff --git a/x/amm/keeper/msg_server_join_pool_test.go b/x/amm/keeper/msg_server_join_pool_test.go index 3ffe38667..8992d8056 100644 --- a/x/amm/keeper/msg_server_join_pool_test.go +++ b/x/amm/keeper/msg_server_join_pool_test.go @@ -285,8 +285,7 @@ func (suite *AmmKeeperTestSuite) TestMsgServerJoinPoolExploitScenario() { totalShares := pool.TotalShares.Amount joinValueWithoutSlippage, _ := pool.CalcJoinValueWithoutSlippage(suite.ctx, suite.app.OracleKeeper, suite.app.AccountedPoolKeeper, tc.senderInitBalance) tvl, _ := pool.TVL(suite.ctx, suite.app.OracleKeeper, suite.app.AccountedPoolKeeper) - expectedNumShares := totalShares.ToLegacyDec(). - Mul(joinValueWithoutSlippage).Quo(tvl).RoundInt() + expectedNumShares := joinValueWithoutSlippage.MulInt(totalShares).Quo(tvl).ToInt() // Number of shares must be lesser or equal to expected suite.Require().GreaterOrEqual(expectedNumShares.String(), resp.ShareAmountOut.String(), "Exploit detected: Sender received more shares than expected") diff --git a/x/amm/keeper/update_pool_for_swap_test.go b/x/amm/keeper/update_pool_for_swap_test.go index 22fd8eb32..ed1efef45 100644 --- a/x/amm/keeper/update_pool_for_swap_test.go +++ b/x/amm/keeper/update_pool_for_swap_test.go @@ -5,6 +5,7 @@ import ( "github.com/cometbft/cometbft/crypto/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/amm/types" ptypes "github.com/elys-network/elys/x/parameter/types" ) @@ -18,7 +19,7 @@ func (suite *AmmKeeperTestSuite) TestUpdatePoolForSwap() { swapFee sdkmath.LegacyDec tokenIn sdk.Coin tokenOut sdk.Coin - weightBalanceBonus sdkmath.LegacyDec + weightBalanceBonus elystypes.Dec34 expSenderBalance sdk.Coins expPoolBalance sdk.Coins expTreasuryBalance sdk.Coins @@ -32,7 +33,7 @@ func (suite *AmmKeeperTestSuite) TestUpdatePoolForSwap() { swapFee: sdkmath.LegacyZeroDec(), tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), - weightBalanceBonus: sdkmath.LegacyZeroDec(), + weightBalanceBonus: elystypes.ZeroDec34(), expSenderBalance: sdk.Coins{}, expPoolBalance: sdk.Coins{}, expTreasuryBalance: sdk.Coins{}, @@ -46,7 +47,7 @@ func (suite *AmmKeeperTestSuite) TestUpdatePoolForSwap() { swapFee: sdkmath.LegacyZeroDec(), tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), - weightBalanceBonus: sdkmath.LegacyZeroDec(), + weightBalanceBonus: elystypes.ZeroDec34(), expSenderBalance: sdk.Coins{}, expPoolBalance: sdk.Coins{}, expTreasuryBalance: sdk.Coins{}, @@ -60,7 +61,7 @@ func (suite *AmmKeeperTestSuite) TestUpdatePoolForSwap() { swapFee: sdkmath.LegacyNewDecWithPrec(1, 2), // 1% tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), - weightBalanceBonus: sdkmath.LegacyZeroDec(), + weightBalanceBonus: elystypes.ZeroDec34(), expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 990000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, expPoolBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010000), sdk.NewInt64Coin(ptypes.BaseCurrency, 989902)}, expTreasuryBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, @@ -74,7 +75,7 @@ func (suite *AmmKeeperTestSuite) TestUpdatePoolForSwap() { swapFee: sdkmath.LegacyZeroDec(), tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), - weightBalanceBonus: sdkmath.LegacyZeroDec(), + weightBalanceBonus: elystypes.ZeroDec34(), expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 990000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, expPoolBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010000), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, expTreasuryBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, @@ -88,7 +89,7 @@ func (suite *AmmKeeperTestSuite) TestUpdatePoolForSwap() { swapFee: sdkmath.LegacyZeroDec(), tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), - weightBalanceBonus: sdkmath.LegacyNewDecWithPrec(3, 1), // 30% bonus + weightBalanceBonus: elystypes.NewDec34WithPrec(3, 1), // 30% bonus expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 990000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, expPoolBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010000), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, expTreasuryBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, @@ -102,7 +103,7 @@ func (suite *AmmKeeperTestSuite) TestUpdatePoolForSwap() { swapFee: sdkmath.LegacyZeroDec(), tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), - weightBalanceBonus: sdkmath.LegacyNewDecWithPrec(3, 1), // 30% bonus + weightBalanceBonus: elystypes.NewDec34WithPrec(3, 1), // 30% bonus expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 990000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, expPoolBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010000), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, expTreasuryBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 100)}, diff --git a/x/amm/types/mocks/accounted_pool_keeper.go b/x/amm/types/mocks/accounted_pool_keeper.go index 968f9e13d..40b34b893 100644 --- a/x/amm/types/mocks/accounted_pool_keeper.go +++ b/x/amm/types/mocks/accounted_pool_keeper.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/x/amm/types/mocks/oracle_keeper.go b/x/amm/types/mocks/oracle_keeper.go index e16ca9845..90edda7ec 100644 --- a/x/amm/types/mocks/oracle_keeper.go +++ b/x/amm/types/mocks/oracle_keeper.go @@ -1,12 +1,13 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks import ( - math "cosmossdk.io/math" - oracletypes "github.com/elys-network/elys/x/oracle/types" + elystypes "github.com/elys-network/elys/types" mock "github.com/stretchr/testify/mock" + oracletypes "github.com/elys-network/elys/x/oracle/types" + types "github.com/cosmos/cosmos-sdk/types" ) @@ -81,18 +82,18 @@ func (_c *OracleKeeper_GetAssetPrice_Call) RunAndReturn(run func(types.Context, } // GetAssetPriceFromDenom provides a mock function with given fields: ctx, denom -func (_m *OracleKeeper) GetAssetPriceFromDenom(ctx types.Context, denom string) math.LegacyDec { +func (_m *OracleKeeper) GetAssetPriceFromDenom(ctx types.Context, denom string) elystypes.Dec34 { ret := _m.Called(ctx, denom) if len(ret) == 0 { panic("no return value specified for GetAssetPriceFromDenom") } - var r0 math.LegacyDec - if rf, ok := ret.Get(0).(func(types.Context, string) math.LegacyDec); ok { + var r0 elystypes.Dec34 + if rf, ok := ret.Get(0).(func(types.Context, string) elystypes.Dec34); ok { r0 = rf(ctx, denom) } else { - r0 = ret.Get(0).(math.LegacyDec) + r0 = ret.Get(0).(elystypes.Dec34) } return r0 @@ -117,12 +118,12 @@ func (_c *OracleKeeper_GetAssetPriceFromDenom_Call) Run(run func(ctx types.Conte return _c } -func (_c *OracleKeeper_GetAssetPriceFromDenom_Call) Return(_a0 math.LegacyDec) *OracleKeeper_GetAssetPriceFromDenom_Call { +func (_c *OracleKeeper_GetAssetPriceFromDenom_Call) Return(_a0 elystypes.Dec34) *OracleKeeper_GetAssetPriceFromDenom_Call { _c.Call.Return(_a0) return _c } -func (_c *OracleKeeper_GetAssetPriceFromDenom_Call) RunAndReturn(run func(types.Context, string) math.LegacyDec) *OracleKeeper_GetAssetPriceFromDenom_Call { +func (_c *OracleKeeper_GetAssetPriceFromDenom_Call) RunAndReturn(run func(types.Context, string) elystypes.Dec34) *OracleKeeper_GetAssetPriceFromDenom_Call { _c.Call.Return(run) return _c } diff --git a/x/amm/types/swap_out_amt_given_in_test.go b/x/amm/types/swap_out_amt_given_in_test.go index 8ad6f7596..c7a9c5b78 100644 --- a/x/amm/types/swap_out_amt_given_in_test.go +++ b/x/amm/types/swap_out_amt_given_in_test.go @@ -8,6 +8,7 @@ import ( "github.com/cometbft/cometbft/crypto/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/amm/types" ptypes "github.com/elys-network/elys/x/parameter/types" "github.com/stretchr/testify/require" @@ -35,7 +36,7 @@ func TestNormalizedWeights(t *testing.T) { poolWeights: []types.AssetWeight{ { Asset: ptypes.Elys, - Weight: sdkmath.LegacyZeroDec(), + Weight: elystypes.ZeroDec34(), }, }, }, @@ -54,11 +55,11 @@ func TestNormalizedWeights(t *testing.T) { poolWeights: []types.AssetWeight{ { Asset: ptypes.Elys, - Weight: sdkmath.LegacyZeroDec(), + Weight: elystypes.ZeroDec34(), }, { Asset: ptypes.Eden, - Weight: sdkmath.LegacyOneDec(), + Weight: elystypes.OneDec34(), }, }, }, @@ -77,11 +78,11 @@ func TestNormalizedWeights(t *testing.T) { poolWeights: []types.AssetWeight{ { Asset: ptypes.Elys, - Weight: sdkmath.LegacyNewDecWithPrec(5, 1), + Weight: elystypes.NewDec34WithPrec(5, 1), }, { Asset: ptypes.Eden, - Weight: sdkmath.LegacyNewDecWithPrec(5, 1), + Weight: elystypes.NewDec34WithPrec(5, 1), }, }, }, @@ -114,11 +115,11 @@ func (suite *TestSuite) TestOraclePoolNormalizedWeights() { poolWeights: []types.AssetWeight{ { Asset: ptypes.BaseCurrency, - Weight: sdkmath.LegacyNewDecWithPrec(5, 1), + Weight: elystypes.NewDec34WithPrec(5, 1), }, { Asset: "uusdt", - Weight: sdkmath.LegacyNewDecWithPrec(5, 1), + Weight: elystypes.NewDec34WithPrec(5, 1), }, }, expError: false, @@ -138,11 +139,11 @@ func (suite *TestSuite) TestOraclePoolNormalizedWeights() { poolWeights: []types.AssetWeight{ { Asset: ptypes.BaseCurrency, - Weight: sdkmath.LegacyZeroDec(), + Weight: elystypes.ZeroDec34(), }, { Asset: "uusdt", - Weight: sdkmath.LegacyZeroDec(), + Weight: elystypes.ZeroDec34(), }, }, expError: false, diff --git a/x/burner/types/mocks/bank_keeper.go b/x/burner/types/mocks/bank_keeper.go index 331892f47..541e9160f 100644 --- a/x/burner/types/mocks/bank_keeper.go +++ b/x/burner/types/mocks/bank_keeper.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/x/leveragelp/types/mocks/bank_keeper.go b/x/leveragelp/types/mocks/bank_keeper.go index f07549695..9a247b1b1 100644 --- a/x/leveragelp/types/mocks/bank_keeper.go +++ b/x/leveragelp/types/mocks/bank_keeper.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/x/masterchef/client/cli/query_aprs_test.go b/x/masterchef/client/cli/query_aprs_test.go index e9bf150c8..51a9b6745 100644 --- a/x/masterchef/client/cli/query_aprs_test.go +++ b/x/masterchef/client/cli/query_aprs_test.go @@ -6,13 +6,13 @@ import ( "fmt" "io" - sdkmath "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/cosmos/gogoproto/proto" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/masterchef/client/cli" "github.com/elys-network/elys/x/masterchef/types" ) @@ -32,10 +32,10 @@ func (s *CLITestSuite) TestAprs() { "valid query", func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&types.QueryAprsResponse{ - UsdcAprUsdc: sdkmath.LegacyOneDec(), - EdenAprUsdc: sdkmath.LegacyOneDec(), - UsdcAprEdenb: sdkmath.LegacyOneDec(), - EdenAprEdenb: sdkmath.LegacyOneDec(), + UsdcAprUsdc: elystypes.OneDec34().String(), + EdenAprUsdc: elystypes.OneDec34().String(), + UsdcAprEdenb: elystypes.OneDec34().String(), + EdenAprEdenb: elystypes.OneDec34().String(), }) c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ Value: bz, @@ -46,10 +46,10 @@ func (s *CLITestSuite) TestAprs() { fmt.Sprintf("--%s=json", flags.FlagOutput), }, &types.QueryAprsResponse{ - UsdcAprUsdc: sdkmath.LegacyOneDec(), - EdenAprUsdc: sdkmath.LegacyOneDec(), - UsdcAprEdenb: sdkmath.LegacyOneDec(), - EdenAprEdenb: sdkmath.LegacyOneDec(), + UsdcAprUsdc: elystypes.OneDec34().String(), + EdenAprUsdc: elystypes.OneDec34().String(), + UsdcAprEdenb: elystypes.OneDec34().String(), + EdenAprEdenb: elystypes.OneDec34().String(), }, false, }, diff --git a/x/masterchef/client/cli/tx.go b/x/masterchef/client/cli/tx.go index b494c06e3..80dc5a464 100644 --- a/x/masterchef/client/cli/tx.go +++ b/x/masterchef/client/cli/tx.go @@ -15,11 +15,6 @@ var ( DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) ) -const ( - flagPacketTimeoutTimestamp = "packet-timeout-timestamp" - listSeparator = "," -) - var ( FlagPoolIds = "pool-ids" ) diff --git a/x/masterchef/keeper/query_test.go b/x/masterchef/keeper/query_test.go index c320937a4..1bbadad4a 100644 --- a/x/masterchef/keeper/query_test.go +++ b/x/masterchef/keeper/query_test.go @@ -6,6 +6,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" simapp "github.com/elys-network/elys/app" + elystypes "github.com/elys-network/elys/types" ammtypes "github.com/elys-network/elys/x/amm/types" estakingtypes "github.com/elys-network/elys/x/estaking/types" "github.com/elys-network/elys/x/masterchef/types" @@ -86,7 +87,7 @@ func (suite *MasterchefKeeperTestSuite) TestApr() { Denom: "ueden", }, response: &types.QueryAprResponse{ - Apr: sdkmath.LegacyMustNewDecFromStr("0.299999999999999995"), + Apr: elystypes.NewDec34FromString("0.299999999999999995").String(), }, err: nil, }, @@ -123,16 +124,16 @@ func (suite *MasterchefKeeperTestSuite) TestAprs() { desc: "valid request", request: &types.QueryAprsRequest{}, response: &types.QueryAprsResponse{ - UsdcAprUsdc: sdkmath.LegacyZeroDec(), - EdenAprUsdc: sdkmath.LegacyZeroDec(), - UsdcAprEdenb: sdkmath.LegacyZeroDec(), - EdenAprEdenb: sdkmath.LegacyMustNewDecFromStr("0.299999999999999995"), - UsdcAprEden: sdkmath.LegacyZeroDec(), - EdenAprEden: sdkmath.LegacyMustNewDecFromStr("0.299999999999999995"), - EdenbAprEden: sdkmath.LegacyOneDec(), - UsdcAprElys: sdkmath.LegacyZeroDec(), - EdenAprElys: sdkmath.LegacyMustNewDecFromStr("0.299999999999999995"), - EdenbAprElys: sdkmath.LegacyOneDec(), + UsdcAprUsdc: elystypes.ZeroDec34().String(), + EdenAprUsdc: elystypes.ZeroDec34().String(), + UsdcAprEdenb: elystypes.ZeroDec34().String(), + EdenAprEdenb: elystypes.NewDec34FromString("0.299999999999999995").String(), + UsdcAprEden: elystypes.ZeroDec34().String(), + EdenAprEden: elystypes.NewDec34FromString("0.299999999999999995").String(), + EdenbAprEden: elystypes.OneDec34().String(), + UsdcAprElys: elystypes.ZeroDec34().String(), + EdenAprElys: elystypes.NewDec34FromString("0.299999999999999995").String(), + EdenbAprElys: elystypes.OneDec34().String(), }, err: nil, }, diff --git a/x/perpetual/keeper/query_open_estimation_test.go b/x/perpetual/keeper/query_open_estimation_test.go index c99a14e13..7e7df7b41 100644 --- a/x/perpetual/keeper/query_open_estimation_test.go +++ b/x/perpetual/keeper/query_open_estimation_test.go @@ -17,6 +17,7 @@ import ( "github.com/cometbft/cometbft/crypto/ed25519" simapp "github.com/elys-network/elys/app" + elystypes "github.com/elys-network/elys/types" ptypes "github.com/elys-network/elys/x/parameter/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -125,13 +126,13 @@ func TestOpenEstimation_Long5XAtom100Usdc(t *testing.T) { LiquidationPrice: math.LegacyMustNewDecFromStr("4.109403218632940267"), EstimatedPnl: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(996_567_670)), AvailableLiquidity: sdk.NewCoin(ptypes.ATOM, math.NewInt(600000000000)), - Slippage: math.LegacyMustNewDecFromStr("0.001289500000000000"), + Slippage: elystypes.NewDec34FromString("0.001289500000000000").String(), BorrowInterestRate: math.LegacyMustNewDecFromStr("0.000000000000000000"), FundingRate: math.LegacyMustNewDecFromStr("0.000000000000000000"), PriceImpact: math.LegacyMustNewDecFromStr("-0.002293467959253724"), Custody: sdk.NewCoin(ptypes.ATOM, math.NewInt(99_771_178)), Liabilities: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(400_000_000)), - WeightBreakingFee: math.LegacyZeroDec(), + WeightBreakingFee: elystypes.ZeroDec34().String(), }, res) } @@ -248,13 +249,13 @@ func TestOpenEstimation_Long5XAtom10Atom(t *testing.T) { EstimatedPnl: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(399210740)), HourlyInterestRate: math.LegacyZeroDec(), AvailableLiquidity: sdk.NewCoin(ptypes.ATOM, math.NewInt(10000000000)), - Slippage: math.LegacyMustNewDecFromStr("0.001502510000000000"), + Slippage: elystypes.NewDec34FromString("0.001502510000000000").String(), BorrowInterestRate: math.LegacyMustNewDecFromStr("0.000000000000000000"), FundingRate: math.LegacyMustNewDecFromStr("0.000000000000000000"), PriceImpact: math.LegacyMustNewDecFromStr("-0.003946300000000000"), Custody: sdk.NewCoin(ptypes.ATOM, math.NewInt(50_000_000)), Liabilities: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(200789260)), - WeightBreakingFee: math.LegacyMustNewDecFromStr("0.001435619047211834"), + WeightBreakingFee: elystypes.NewDec34FromString("0.001435619047211834").String(), }, res) } @@ -373,13 +374,13 @@ func TestOpenEstimation_Long10XAtom1000Usdc(t *testing.T) { HourlyInterestRate: math.LegacyZeroDec(), EstimatedPnl: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(19217754574)), AvailableLiquidity: sdk.NewCoin(ptypes.ATOM, math.NewInt(600_000_000000)), - Slippage: math.LegacyMustNewDecFromStr("0.025099947050000000"), + Slippage: elystypes.NewDec34FromString("0.025099947050000000").String(), BorrowInterestRate: math.LegacyMustNewDecFromStr("0.000000000000000000"), FundingRate: math.LegacyMustNewDecFromStr("0.000000000000000000"), PriceImpact: math.LegacyMustNewDecFromStr("-0.026772948058280545"), Custody: sdk.NewCoin(ptypes.ATOM, math.NewInt(2218508320)), Liabilities: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(9000000000)), - WeightBreakingFee: math.LegacyZeroDec(), + WeightBreakingFee: elystypes.ZeroDec34().String(), }, res) } @@ -509,16 +510,16 @@ func TestOpenEstimation_Short5XAtom10Usdc(t *testing.T) { OpenPrice: math.LegacyMustNewDecFromStr("4.980019973117105182"), TakeProfitPrice: tradingAssetPrice.QuoInt64(3), LiquidationPrice: math.LegacyMustNewDecFromStr("6.073195089167201442"), - EstimatedPnl: sdk.Coin{ptypes.BaseCurrency, math.NewInt(266131729)}, + EstimatedPnl: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(266131729)), HourlyInterestRate: math.LegacyZeroDec(), AvailableLiquidity: sdk.NewCoin(ptypes.ATOM, math.NewInt(10000000000)), - Slippage: math.LegacyMustNewDecFromStr("0.003008025000000000"), + Slippage: elystypes.NewDec34FromString("0.003008025000000000").String(), BorrowInterestRate: math.LegacyMustNewDecFromStr("0.000000000000000000"), FundingRate: math.LegacyMustNewDecFromStr("0.000000000000000000"), PriceImpact: math.LegacyMustNewDecFromStr("0.003996005376578964"), Custody: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(500000000)), Liabilities: sdk.NewCoin(ptypes.ATOM, math.NewInt(80320963)), - WeightBreakingFee: math.LegacyZeroDec(), + WeightBreakingFee: elystypes.ZeroDec34().String(), } require.Equal(t, expectedRes, res) } diff --git a/x/tier/keeper/query_staked_pool_test.go b/x/tier/keeper/query_staked_pool_test.go index a428a3774..a07b84f55 100644 --- a/x/tier/keeper/query_staked_pool_test.go +++ b/x/tier/keeper/query_staked_pool_test.go @@ -54,6 +54,6 @@ func (suite *TierKeeperTestSuite) TestQueryStakedPoolSuccessful() { }) suite.Require().NoError(err) - suite.Require().Equal("59.999999999997483295", stakedPoolResponse.Total.String()) + suite.Require().Equal("59.999999999997483295", stakedPoolResponse.Total) } diff --git a/x/tier/keeper/query_staked_test.go b/x/tier/keeper/query_staked_test.go index 142b70984..35b1ee960 100644 --- a/x/tier/keeper/query_staked_test.go +++ b/x/tier/keeper/query_staked_test.go @@ -37,5 +37,5 @@ func (suite *TierKeeperTestSuite) TestQueryStaked() { User: sender.String(), }) suite.Require().NoError(err) - suite.Require().Equal(r.Commitments.TruncateInt(), math.NewInt(100)) + suite.Require().Equal(r.Commitments, math.NewInt(100)) } diff --git a/x/tradeshield/types/mocks/amm_keeper.go b/x/tradeshield/types/mocks/amm_keeper.go new file mode 100644 index 000000000..d1c4ab136 --- /dev/null +++ b/x/tradeshield/types/mocks/amm_keeper.go @@ -0,0 +1,196 @@ +// Code generated by mockery v2.46.1. DO NOT EDIT. + +package mocks + +import ( + elystypes "github.com/elys-network/elys/types" + ammtypes "github.com/elys-network/elys/x/amm/types" + + math "cosmossdk.io/math" + + mock "github.com/stretchr/testify/mock" + + types "github.com/cosmos/cosmos-sdk/types" +) + +// AmmKeeper is an autogenerated mock type for the AmmKeeper type +type AmmKeeper struct { + mock.Mock +} + +type AmmKeeper_Expecter struct { + mock *mock.Mock +} + +func (_m *AmmKeeper) EXPECT() *AmmKeeper_Expecter { + return &AmmKeeper_Expecter{mock: &_m.Mock} +} + +// CalcAmmPrice provides a mock function with given fields: ctx, denom, decimal +func (_m *AmmKeeper) CalcAmmPrice(ctx types.Context, denom string, decimal uint64) elystypes.Dec34 { + ret := _m.Called(ctx, denom, decimal) + + if len(ret) == 0 { + panic("no return value specified for CalcAmmPrice") + } + + var r0 elystypes.Dec34 + if rf, ok := ret.Get(0).(func(types.Context, string, uint64) elystypes.Dec34); ok { + r0 = rf(ctx, denom, decimal) + } else { + r0 = ret.Get(0).(elystypes.Dec34) + } + + return r0 +} + +// AmmKeeper_CalcAmmPrice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CalcAmmPrice' +type AmmKeeper_CalcAmmPrice_Call struct { + *mock.Call +} + +// CalcAmmPrice is a helper method to define mock.On call +// - ctx types.Context +// - denom string +// - decimal uint64 +func (_e *AmmKeeper_Expecter) CalcAmmPrice(ctx interface{}, denom interface{}, decimal interface{}) *AmmKeeper_CalcAmmPrice_Call { + return &AmmKeeper_CalcAmmPrice_Call{Call: _e.mock.On("CalcAmmPrice", ctx, denom, decimal)} +} + +func (_c *AmmKeeper_CalcAmmPrice_Call) Run(run func(ctx types.Context, denom string, decimal uint64)) *AmmKeeper_CalcAmmPrice_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Context), args[1].(string), args[2].(uint64)) + }) + return _c +} + +func (_c *AmmKeeper_CalcAmmPrice_Call) Return(_a0 elystypes.Dec34) *AmmKeeper_CalcAmmPrice_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *AmmKeeper_CalcAmmPrice_Call) RunAndReturn(run func(types.Context, string, uint64) elystypes.Dec34) *AmmKeeper_CalcAmmPrice_Call { + _c.Call.Return(run) + return _c +} + +// CalculateUSDValue provides a mock function with given fields: ctx, denom, amount +func (_m *AmmKeeper) CalculateUSDValue(ctx types.Context, denom string, amount math.Int) elystypes.Dec34 { + ret := _m.Called(ctx, denom, amount) + + if len(ret) == 0 { + panic("no return value specified for CalculateUSDValue") + } + + var r0 elystypes.Dec34 + if rf, ok := ret.Get(0).(func(types.Context, string, math.Int) elystypes.Dec34); ok { + r0 = rf(ctx, denom, amount) + } else { + r0 = ret.Get(0).(elystypes.Dec34) + } + + return r0 +} + +// AmmKeeper_CalculateUSDValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CalculateUSDValue' +type AmmKeeper_CalculateUSDValue_Call struct { + *mock.Call +} + +// CalculateUSDValue is a helper method to define mock.On call +// - ctx types.Context +// - denom string +// - amount math.Int +func (_e *AmmKeeper_Expecter) CalculateUSDValue(ctx interface{}, denom interface{}, amount interface{}) *AmmKeeper_CalculateUSDValue_Call { + return &AmmKeeper_CalculateUSDValue_Call{Call: _e.mock.On("CalculateUSDValue", ctx, denom, amount)} +} + +func (_c *AmmKeeper_CalculateUSDValue_Call) Run(run func(ctx types.Context, denom string, amount math.Int)) *AmmKeeper_CalculateUSDValue_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Context), args[1].(string), args[2].(math.Int)) + }) + return _c +} + +func (_c *AmmKeeper_CalculateUSDValue_Call) Return(_a0 elystypes.Dec34) *AmmKeeper_CalculateUSDValue_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *AmmKeeper_CalculateUSDValue_Call) RunAndReturn(run func(types.Context, string, math.Int) elystypes.Dec34) *AmmKeeper_CalculateUSDValue_Call { + _c.Call.Return(run) + return _c +} + +// SwapByDenom provides a mock function with given fields: ctx, msg +func (_m *AmmKeeper) SwapByDenom(ctx types.Context, msg *ammtypes.MsgSwapByDenom) (*ammtypes.MsgSwapByDenomResponse, error) { + ret := _m.Called(ctx, msg) + + if len(ret) == 0 { + panic("no return value specified for SwapByDenom") + } + + var r0 *ammtypes.MsgSwapByDenomResponse + var r1 error + if rf, ok := ret.Get(0).(func(types.Context, *ammtypes.MsgSwapByDenom) (*ammtypes.MsgSwapByDenomResponse, error)); ok { + return rf(ctx, msg) + } + if rf, ok := ret.Get(0).(func(types.Context, *ammtypes.MsgSwapByDenom) *ammtypes.MsgSwapByDenomResponse); ok { + r0 = rf(ctx, msg) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ammtypes.MsgSwapByDenomResponse) + } + } + + if rf, ok := ret.Get(1).(func(types.Context, *ammtypes.MsgSwapByDenom) error); ok { + r1 = rf(ctx, msg) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// AmmKeeper_SwapByDenom_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SwapByDenom' +type AmmKeeper_SwapByDenom_Call struct { + *mock.Call +} + +// SwapByDenom is a helper method to define mock.On call +// - ctx types.Context +// - msg *ammtypes.MsgSwapByDenom +func (_e *AmmKeeper_Expecter) SwapByDenom(ctx interface{}, msg interface{}) *AmmKeeper_SwapByDenom_Call { + return &AmmKeeper_SwapByDenom_Call{Call: _e.mock.On("SwapByDenom", ctx, msg)} +} + +func (_c *AmmKeeper_SwapByDenom_Call) Run(run func(ctx types.Context, msg *ammtypes.MsgSwapByDenom)) *AmmKeeper_SwapByDenom_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Context), args[1].(*ammtypes.MsgSwapByDenom)) + }) + return _c +} + +func (_c *AmmKeeper_SwapByDenom_Call) Return(_a0 *ammtypes.MsgSwapByDenomResponse, _a1 error) *AmmKeeper_SwapByDenom_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *AmmKeeper_SwapByDenom_Call) RunAndReturn(run func(types.Context, *ammtypes.MsgSwapByDenom) (*ammtypes.MsgSwapByDenomResponse, error)) *AmmKeeper_SwapByDenom_Call { + _c.Call.Return(run) + return _c +} + +// NewAmmKeeper creates a new instance of AmmKeeper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewAmmKeeper(t interface { + mock.TestingT + Cleanup(func()) +}) *AmmKeeper { + mock := &AmmKeeper{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/x/tradeshield/types/mocks/bank_keeper.go b/x/tradeshield/types/mocks/bank_keeper.go new file mode 100644 index 000000000..c423b0ef2 --- /dev/null +++ b/x/tradeshield/types/mocks/bank_keeper.go @@ -0,0 +1,185 @@ +// Code generated by mockery v2.46.1. DO NOT EDIT. + +package mocks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" + + types "github.com/cosmos/cosmos-sdk/types" +) + +// BankKeeper is an autogenerated mock type for the BankKeeper type +type BankKeeper struct { + mock.Mock +} + +type BankKeeper_Expecter struct { + mock *mock.Mock +} + +func (_m *BankKeeper) EXPECT() *BankKeeper_Expecter { + return &BankKeeper_Expecter{mock: &_m.Mock} +} + +// GetAllBalances provides a mock function with given fields: goCtx, addr +func (_m *BankKeeper) GetAllBalances(goCtx context.Context, addr types.AccAddress) types.Coins { + ret := _m.Called(goCtx, addr) + + if len(ret) == 0 { + panic("no return value specified for GetAllBalances") + } + + var r0 types.Coins + if rf, ok := ret.Get(0).(func(context.Context, types.AccAddress) types.Coins); ok { + r0 = rf(goCtx, addr) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(types.Coins) + } + } + + return r0 +} + +// BankKeeper_GetAllBalances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllBalances' +type BankKeeper_GetAllBalances_Call struct { + *mock.Call +} + +// GetAllBalances is a helper method to define mock.On call +// - goCtx context.Context +// - addr types.AccAddress +func (_e *BankKeeper_Expecter) GetAllBalances(goCtx interface{}, addr interface{}) *BankKeeper_GetAllBalances_Call { + return &BankKeeper_GetAllBalances_Call{Call: _e.mock.On("GetAllBalances", goCtx, addr)} +} + +func (_c *BankKeeper_GetAllBalances_Call) Run(run func(goCtx context.Context, addr types.AccAddress)) *BankKeeper_GetAllBalances_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(types.AccAddress)) + }) + return _c +} + +func (_c *BankKeeper_GetAllBalances_Call) Return(_a0 types.Coins) *BankKeeper_GetAllBalances_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BankKeeper_GetAllBalances_Call) RunAndReturn(run func(context.Context, types.AccAddress) types.Coins) *BankKeeper_GetAllBalances_Call { + _c.Call.Return(run) + return _c +} + +// SendCoins provides a mock function with given fields: goCtx, fromAddr, toAddr, amt +func (_m *BankKeeper) SendCoins(goCtx context.Context, fromAddr types.AccAddress, toAddr types.AccAddress, amt types.Coins) error { + ret := _m.Called(goCtx, fromAddr, toAddr, amt) + + if len(ret) == 0 { + panic("no return value specified for SendCoins") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, types.AccAddress, types.AccAddress, types.Coins) error); ok { + r0 = rf(goCtx, fromAddr, toAddr, amt) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BankKeeper_SendCoins_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendCoins' +type BankKeeper_SendCoins_Call struct { + *mock.Call +} + +// SendCoins is a helper method to define mock.On call +// - goCtx context.Context +// - fromAddr types.AccAddress +// - toAddr types.AccAddress +// - amt types.Coins +func (_e *BankKeeper_Expecter) SendCoins(goCtx interface{}, fromAddr interface{}, toAddr interface{}, amt interface{}) *BankKeeper_SendCoins_Call { + return &BankKeeper_SendCoins_Call{Call: _e.mock.On("SendCoins", goCtx, fromAddr, toAddr, amt)} +} + +func (_c *BankKeeper_SendCoins_Call) Run(run func(goCtx context.Context, fromAddr types.AccAddress, toAddr types.AccAddress, amt types.Coins)) *BankKeeper_SendCoins_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(types.AccAddress), args[2].(types.AccAddress), args[3].(types.Coins)) + }) + return _c +} + +func (_c *BankKeeper_SendCoins_Call) Return(_a0 error) *BankKeeper_SendCoins_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BankKeeper_SendCoins_Call) RunAndReturn(run func(context.Context, types.AccAddress, types.AccAddress, types.Coins) error) *BankKeeper_SendCoins_Call { + _c.Call.Return(run) + return _c +} + +// SpendableCoins provides a mock function with given fields: ctx, addr +func (_m *BankKeeper) SpendableCoins(ctx context.Context, addr types.AccAddress) types.Coins { + ret := _m.Called(ctx, addr) + + if len(ret) == 0 { + panic("no return value specified for SpendableCoins") + } + + var r0 types.Coins + if rf, ok := ret.Get(0).(func(context.Context, types.AccAddress) types.Coins); ok { + r0 = rf(ctx, addr) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(types.Coins) + } + } + + return r0 +} + +// BankKeeper_SpendableCoins_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SpendableCoins' +type BankKeeper_SpendableCoins_Call struct { + *mock.Call +} + +// SpendableCoins is a helper method to define mock.On call +// - ctx context.Context +// - addr types.AccAddress +func (_e *BankKeeper_Expecter) SpendableCoins(ctx interface{}, addr interface{}) *BankKeeper_SpendableCoins_Call { + return &BankKeeper_SpendableCoins_Call{Call: _e.mock.On("SpendableCoins", ctx, addr)} +} + +func (_c *BankKeeper_SpendableCoins_Call) Run(run func(ctx context.Context, addr types.AccAddress)) *BankKeeper_SpendableCoins_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(types.AccAddress)) + }) + return _c +} + +func (_c *BankKeeper_SpendableCoins_Call) Return(_a0 types.Coins) *BankKeeper_SpendableCoins_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BankKeeper_SpendableCoins_Call) RunAndReturn(run func(context.Context, types.AccAddress) types.Coins) *BankKeeper_SpendableCoins_Call { + _c.Call.Return(run) + return _c +} + +// NewBankKeeper creates a new instance of BankKeeper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewBankKeeper(t interface { + mock.TestingT + Cleanup(func()) +}) *BankKeeper { + mock := &BankKeeper{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/x/tradeshield/types/mocks/perpetual_keeper.go b/x/tradeshield/types/mocks/perpetual_keeper.go new file mode 100644 index 000000000..2d026510e --- /dev/null +++ b/x/tradeshield/types/mocks/perpetual_keeper.go @@ -0,0 +1,563 @@ +// Code generated by mockery v2.46.1. DO NOT EDIT. + +package mocks + +import ( + math "cosmossdk.io/math" + perpetualtypes "github.com/elys-network/elys/x/perpetual/types" + mock "github.com/stretchr/testify/mock" + + query "github.com/cosmos/cosmos-sdk/types/query" + + types "github.com/cosmos/cosmos-sdk/types" +) + +// PerpetualKeeper is an autogenerated mock type for the PerpetualKeeper type +type PerpetualKeeper struct { + mock.Mock +} + +type PerpetualKeeper_Expecter struct { + mock *mock.Mock +} + +func (_m *PerpetualKeeper) EXPECT() *PerpetualKeeper_Expecter { + return &PerpetualKeeper_Expecter{mock: &_m.Mock} +} + +// Close provides a mock function with given fields: ctx, msg +func (_m *PerpetualKeeper) Close(ctx types.Context, msg *perpetualtypes.MsgClose) (*perpetualtypes.MsgCloseResponse, error) { + ret := _m.Called(ctx, msg) + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 *perpetualtypes.MsgCloseResponse + var r1 error + if rf, ok := ret.Get(0).(func(types.Context, *perpetualtypes.MsgClose) (*perpetualtypes.MsgCloseResponse, error)); ok { + return rf(ctx, msg) + } + if rf, ok := ret.Get(0).(func(types.Context, *perpetualtypes.MsgClose) *perpetualtypes.MsgCloseResponse); ok { + r0 = rf(ctx, msg) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*perpetualtypes.MsgCloseResponse) + } + } + + if rf, ok := ret.Get(1).(func(types.Context, *perpetualtypes.MsgClose) error); ok { + r1 = rf(ctx, msg) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// PerpetualKeeper_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type PerpetualKeeper_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +// - ctx types.Context +// - msg *perpetualtypes.MsgClose +func (_e *PerpetualKeeper_Expecter) Close(ctx interface{}, msg interface{}) *PerpetualKeeper_Close_Call { + return &PerpetualKeeper_Close_Call{Call: _e.mock.On("Close", ctx, msg)} +} + +func (_c *PerpetualKeeper_Close_Call) Run(run func(ctx types.Context, msg *perpetualtypes.MsgClose)) *PerpetualKeeper_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Context), args[1].(*perpetualtypes.MsgClose)) + }) + return _c +} + +func (_c *PerpetualKeeper_Close_Call) Return(_a0 *perpetualtypes.MsgCloseResponse, _a1 error) *PerpetualKeeper_Close_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PerpetualKeeper_Close_Call) RunAndReturn(run func(types.Context, *perpetualtypes.MsgClose) (*perpetualtypes.MsgCloseResponse, error)) *PerpetualKeeper_Close_Call { + _c.Call.Return(run) + return _c +} + +// GetAssetPrice provides a mock function with given fields: ctx, asset +func (_m *PerpetualKeeper) GetAssetPrice(ctx types.Context, asset string) (math.LegacyDec, error) { + ret := _m.Called(ctx, asset) + + if len(ret) == 0 { + panic("no return value specified for GetAssetPrice") + } + + var r0 math.LegacyDec + var r1 error + if rf, ok := ret.Get(0).(func(types.Context, string) (math.LegacyDec, error)); ok { + return rf(ctx, asset) + } + if rf, ok := ret.Get(0).(func(types.Context, string) math.LegacyDec); ok { + r0 = rf(ctx, asset) + } else { + r0 = ret.Get(0).(math.LegacyDec) + } + + if rf, ok := ret.Get(1).(func(types.Context, string) error); ok { + r1 = rf(ctx, asset) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// PerpetualKeeper_GetAssetPrice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAssetPrice' +type PerpetualKeeper_GetAssetPrice_Call struct { + *mock.Call +} + +// GetAssetPrice is a helper method to define mock.On call +// - ctx types.Context +// - asset string +func (_e *PerpetualKeeper_Expecter) GetAssetPrice(ctx interface{}, asset interface{}) *PerpetualKeeper_GetAssetPrice_Call { + return &PerpetualKeeper_GetAssetPrice_Call{Call: _e.mock.On("GetAssetPrice", ctx, asset)} +} + +func (_c *PerpetualKeeper_GetAssetPrice_Call) Run(run func(ctx types.Context, asset string)) *PerpetualKeeper_GetAssetPrice_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Context), args[1].(string)) + }) + return _c +} + +func (_c *PerpetualKeeper_GetAssetPrice_Call) Return(_a0 math.LegacyDec, _a1 error) *PerpetualKeeper_GetAssetPrice_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PerpetualKeeper_GetAssetPrice_Call) RunAndReturn(run func(types.Context, string) (math.LegacyDec, error)) *PerpetualKeeper_GetAssetPrice_Call { + _c.Call.Return(run) + return _c +} + +// GetMTP provides a mock function with given fields: ctx, mtpAddress, id +func (_m *PerpetualKeeper) GetMTP(ctx types.Context, mtpAddress types.AccAddress, id uint64) (perpetualtypes.MTP, error) { + ret := _m.Called(ctx, mtpAddress, id) + + if len(ret) == 0 { + panic("no return value specified for GetMTP") + } + + var r0 perpetualtypes.MTP + var r1 error + if rf, ok := ret.Get(0).(func(types.Context, types.AccAddress, uint64) (perpetualtypes.MTP, error)); ok { + return rf(ctx, mtpAddress, id) + } + if rf, ok := ret.Get(0).(func(types.Context, types.AccAddress, uint64) perpetualtypes.MTP); ok { + r0 = rf(ctx, mtpAddress, id) + } else { + r0 = ret.Get(0).(perpetualtypes.MTP) + } + + if rf, ok := ret.Get(1).(func(types.Context, types.AccAddress, uint64) error); ok { + r1 = rf(ctx, mtpAddress, id) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// PerpetualKeeper_GetMTP_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMTP' +type PerpetualKeeper_GetMTP_Call struct { + *mock.Call +} + +// GetMTP is a helper method to define mock.On call +// - ctx types.Context +// - mtpAddress types.AccAddress +// - id uint64 +func (_e *PerpetualKeeper_Expecter) GetMTP(ctx interface{}, mtpAddress interface{}, id interface{}) *PerpetualKeeper_GetMTP_Call { + return &PerpetualKeeper_GetMTP_Call{Call: _e.mock.On("GetMTP", ctx, mtpAddress, id)} +} + +func (_c *PerpetualKeeper_GetMTP_Call) Run(run func(ctx types.Context, mtpAddress types.AccAddress, id uint64)) *PerpetualKeeper_GetMTP_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Context), args[1].(types.AccAddress), args[2].(uint64)) + }) + return _c +} + +func (_c *PerpetualKeeper_GetMTP_Call) Return(_a0 perpetualtypes.MTP, _a1 error) *PerpetualKeeper_GetMTP_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PerpetualKeeper_GetMTP_Call) RunAndReturn(run func(types.Context, types.AccAddress, uint64) (perpetualtypes.MTP, error)) *PerpetualKeeper_GetMTP_Call { + _c.Call.Return(run) + return _c +} + +// GetMTPsForAddressWithPagination provides a mock function with given fields: ctx, mtpAddress, pagination +func (_m *PerpetualKeeper) GetMTPsForAddressWithPagination(ctx types.Context, mtpAddress types.AccAddress, pagination *query.PageRequest) ([]*perpetualtypes.MtpAndPrice, *query.PageResponse, error) { + ret := _m.Called(ctx, mtpAddress, pagination) + + if len(ret) == 0 { + panic("no return value specified for GetMTPsForAddressWithPagination") + } + + var r0 []*perpetualtypes.MtpAndPrice + var r1 *query.PageResponse + var r2 error + if rf, ok := ret.Get(0).(func(types.Context, types.AccAddress, *query.PageRequest) ([]*perpetualtypes.MtpAndPrice, *query.PageResponse, error)); ok { + return rf(ctx, mtpAddress, pagination) + } + if rf, ok := ret.Get(0).(func(types.Context, types.AccAddress, *query.PageRequest) []*perpetualtypes.MtpAndPrice); ok { + r0 = rf(ctx, mtpAddress, pagination) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*perpetualtypes.MtpAndPrice) + } + } + + if rf, ok := ret.Get(1).(func(types.Context, types.AccAddress, *query.PageRequest) *query.PageResponse); ok { + r1 = rf(ctx, mtpAddress, pagination) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*query.PageResponse) + } + } + + if rf, ok := ret.Get(2).(func(types.Context, types.AccAddress, *query.PageRequest) error); ok { + r2 = rf(ctx, mtpAddress, pagination) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// PerpetualKeeper_GetMTPsForAddressWithPagination_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMTPsForAddressWithPagination' +type PerpetualKeeper_GetMTPsForAddressWithPagination_Call struct { + *mock.Call +} + +// GetMTPsForAddressWithPagination is a helper method to define mock.On call +// - ctx types.Context +// - mtpAddress types.AccAddress +// - pagination *query.PageRequest +func (_e *PerpetualKeeper_Expecter) GetMTPsForAddressWithPagination(ctx interface{}, mtpAddress interface{}, pagination interface{}) *PerpetualKeeper_GetMTPsForAddressWithPagination_Call { + return &PerpetualKeeper_GetMTPsForAddressWithPagination_Call{Call: _e.mock.On("GetMTPsForAddressWithPagination", ctx, mtpAddress, pagination)} +} + +func (_c *PerpetualKeeper_GetMTPsForAddressWithPagination_Call) Run(run func(ctx types.Context, mtpAddress types.AccAddress, pagination *query.PageRequest)) *PerpetualKeeper_GetMTPsForAddressWithPagination_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Context), args[1].(types.AccAddress), args[2].(*query.PageRequest)) + }) + return _c +} + +func (_c *PerpetualKeeper_GetMTPsForAddressWithPagination_Call) Return(_a0 []*perpetualtypes.MtpAndPrice, _a1 *query.PageResponse, _a2 error) *PerpetualKeeper_GetMTPsForAddressWithPagination_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *PerpetualKeeper_GetMTPsForAddressWithPagination_Call) RunAndReturn(run func(types.Context, types.AccAddress, *query.PageRequest) ([]*perpetualtypes.MtpAndPrice, *query.PageResponse, error)) *PerpetualKeeper_GetMTPsForAddressWithPagination_Call { + _c.Call.Return(run) + return _c +} + +// GetParams provides a mock function with given fields: ctx +func (_m *PerpetualKeeper) GetParams(ctx types.Context) perpetualtypes.Params { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for GetParams") + } + + var r0 perpetualtypes.Params + if rf, ok := ret.Get(0).(func(types.Context) perpetualtypes.Params); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(perpetualtypes.Params) + } + + return r0 +} + +// PerpetualKeeper_GetParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetParams' +type PerpetualKeeper_GetParams_Call struct { + *mock.Call +} + +// GetParams is a helper method to define mock.On call +// - ctx types.Context +func (_e *PerpetualKeeper_Expecter) GetParams(ctx interface{}) *PerpetualKeeper_GetParams_Call { + return &PerpetualKeeper_GetParams_Call{Call: _e.mock.On("GetParams", ctx)} +} + +func (_c *PerpetualKeeper_GetParams_Call) Run(run func(ctx types.Context)) *PerpetualKeeper_GetParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Context)) + }) + return _c +} + +func (_c *PerpetualKeeper_GetParams_Call) Return(_a0 perpetualtypes.Params) *PerpetualKeeper_GetParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PerpetualKeeper_GetParams_Call) RunAndReturn(run func(types.Context) perpetualtypes.Params) *PerpetualKeeper_GetParams_Call { + _c.Call.Return(run) + return _c +} + +// GetPool provides a mock function with given fields: ctx, poolId +func (_m *PerpetualKeeper) GetPool(ctx types.Context, poolId uint64) (perpetualtypes.Pool, bool) { + ret := _m.Called(ctx, poolId) + + if len(ret) == 0 { + panic("no return value specified for GetPool") + } + + var r0 perpetualtypes.Pool + var r1 bool + if rf, ok := ret.Get(0).(func(types.Context, uint64) (perpetualtypes.Pool, bool)); ok { + return rf(ctx, poolId) + } + if rf, ok := ret.Get(0).(func(types.Context, uint64) perpetualtypes.Pool); ok { + r0 = rf(ctx, poolId) + } else { + r0 = ret.Get(0).(perpetualtypes.Pool) + } + + if rf, ok := ret.Get(1).(func(types.Context, uint64) bool); ok { + r1 = rf(ctx, poolId) + } else { + r1 = ret.Get(1).(bool) + } + + return r0, r1 +} + +// PerpetualKeeper_GetPool_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPool' +type PerpetualKeeper_GetPool_Call struct { + *mock.Call +} + +// GetPool is a helper method to define mock.On call +// - ctx types.Context +// - poolId uint64 +func (_e *PerpetualKeeper_Expecter) GetPool(ctx interface{}, poolId interface{}) *PerpetualKeeper_GetPool_Call { + return &PerpetualKeeper_GetPool_Call{Call: _e.mock.On("GetPool", ctx, poolId)} +} + +func (_c *PerpetualKeeper_GetPool_Call) Run(run func(ctx types.Context, poolId uint64)) *PerpetualKeeper_GetPool_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Context), args[1].(uint64)) + }) + return _c +} + +func (_c *PerpetualKeeper_GetPool_Call) Return(val perpetualtypes.Pool, found bool) *PerpetualKeeper_GetPool_Call { + _c.Call.Return(val, found) + return _c +} + +func (_c *PerpetualKeeper_GetPool_Call) RunAndReturn(run func(types.Context, uint64) (perpetualtypes.Pool, bool)) *PerpetualKeeper_GetPool_Call { + _c.Call.Return(run) + return _c +} + +// HandleCloseEstimation provides a mock function with given fields: ctx, req +func (_m *PerpetualKeeper) HandleCloseEstimation(ctx types.Context, req *perpetualtypes.QueryCloseEstimationRequest) (*perpetualtypes.QueryCloseEstimationResponse, error) { + ret := _m.Called(ctx, req) + + if len(ret) == 0 { + panic("no return value specified for HandleCloseEstimation") + } + + var r0 *perpetualtypes.QueryCloseEstimationResponse + var r1 error + if rf, ok := ret.Get(0).(func(types.Context, *perpetualtypes.QueryCloseEstimationRequest) (*perpetualtypes.QueryCloseEstimationResponse, error)); ok { + return rf(ctx, req) + } + if rf, ok := ret.Get(0).(func(types.Context, *perpetualtypes.QueryCloseEstimationRequest) *perpetualtypes.QueryCloseEstimationResponse); ok { + r0 = rf(ctx, req) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*perpetualtypes.QueryCloseEstimationResponse) + } + } + + if rf, ok := ret.Get(1).(func(types.Context, *perpetualtypes.QueryCloseEstimationRequest) error); ok { + r1 = rf(ctx, req) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// PerpetualKeeper_HandleCloseEstimation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandleCloseEstimation' +type PerpetualKeeper_HandleCloseEstimation_Call struct { + *mock.Call +} + +// HandleCloseEstimation is a helper method to define mock.On call +// - ctx types.Context +// - req *perpetualtypes.QueryCloseEstimationRequest +func (_e *PerpetualKeeper_Expecter) HandleCloseEstimation(ctx interface{}, req interface{}) *PerpetualKeeper_HandleCloseEstimation_Call { + return &PerpetualKeeper_HandleCloseEstimation_Call{Call: _e.mock.On("HandleCloseEstimation", ctx, req)} +} + +func (_c *PerpetualKeeper_HandleCloseEstimation_Call) Run(run func(ctx types.Context, req *perpetualtypes.QueryCloseEstimationRequest)) *PerpetualKeeper_HandleCloseEstimation_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Context), args[1].(*perpetualtypes.QueryCloseEstimationRequest)) + }) + return _c +} + +func (_c *PerpetualKeeper_HandleCloseEstimation_Call) Return(res *perpetualtypes.QueryCloseEstimationResponse, err error) *PerpetualKeeper_HandleCloseEstimation_Call { + _c.Call.Return(res, err) + return _c +} + +func (_c *PerpetualKeeper_HandleCloseEstimation_Call) RunAndReturn(run func(types.Context, *perpetualtypes.QueryCloseEstimationRequest) (*perpetualtypes.QueryCloseEstimationResponse, error)) *PerpetualKeeper_HandleCloseEstimation_Call { + _c.Call.Return(run) + return _c +} + +// HandleOpenEstimation provides a mock function with given fields: ctx, req +func (_m *PerpetualKeeper) HandleOpenEstimation(ctx types.Context, req *perpetualtypes.QueryOpenEstimationRequest) (*perpetualtypes.QueryOpenEstimationResponse, error) { + ret := _m.Called(ctx, req) + + if len(ret) == 0 { + panic("no return value specified for HandleOpenEstimation") + } + + var r0 *perpetualtypes.QueryOpenEstimationResponse + var r1 error + if rf, ok := ret.Get(0).(func(types.Context, *perpetualtypes.QueryOpenEstimationRequest) (*perpetualtypes.QueryOpenEstimationResponse, error)); ok { + return rf(ctx, req) + } + if rf, ok := ret.Get(0).(func(types.Context, *perpetualtypes.QueryOpenEstimationRequest) *perpetualtypes.QueryOpenEstimationResponse); ok { + r0 = rf(ctx, req) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*perpetualtypes.QueryOpenEstimationResponse) + } + } + + if rf, ok := ret.Get(1).(func(types.Context, *perpetualtypes.QueryOpenEstimationRequest) error); ok { + r1 = rf(ctx, req) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// PerpetualKeeper_HandleOpenEstimation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandleOpenEstimation' +type PerpetualKeeper_HandleOpenEstimation_Call struct { + *mock.Call +} + +// HandleOpenEstimation is a helper method to define mock.On call +// - ctx types.Context +// - req *perpetualtypes.QueryOpenEstimationRequest +func (_e *PerpetualKeeper_Expecter) HandleOpenEstimation(ctx interface{}, req interface{}) *PerpetualKeeper_HandleOpenEstimation_Call { + return &PerpetualKeeper_HandleOpenEstimation_Call{Call: _e.mock.On("HandleOpenEstimation", ctx, req)} +} + +func (_c *PerpetualKeeper_HandleOpenEstimation_Call) Run(run func(ctx types.Context, req *perpetualtypes.QueryOpenEstimationRequest)) *PerpetualKeeper_HandleOpenEstimation_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Context), args[1].(*perpetualtypes.QueryOpenEstimationRequest)) + }) + return _c +} + +func (_c *PerpetualKeeper_HandleOpenEstimation_Call) Return(_a0 *perpetualtypes.QueryOpenEstimationResponse, _a1 error) *PerpetualKeeper_HandleOpenEstimation_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PerpetualKeeper_HandleOpenEstimation_Call) RunAndReturn(run func(types.Context, *perpetualtypes.QueryOpenEstimationRequest) (*perpetualtypes.QueryOpenEstimationResponse, error)) *PerpetualKeeper_HandleOpenEstimation_Call { + _c.Call.Return(run) + return _c +} + +// Open provides a mock function with given fields: ctx, msg +func (_m *PerpetualKeeper) Open(ctx types.Context, msg *perpetualtypes.MsgOpen) (*perpetualtypes.MsgOpenResponse, error) { + ret := _m.Called(ctx, msg) + + if len(ret) == 0 { + panic("no return value specified for Open") + } + + var r0 *perpetualtypes.MsgOpenResponse + var r1 error + if rf, ok := ret.Get(0).(func(types.Context, *perpetualtypes.MsgOpen) (*perpetualtypes.MsgOpenResponse, error)); ok { + return rf(ctx, msg) + } + if rf, ok := ret.Get(0).(func(types.Context, *perpetualtypes.MsgOpen) *perpetualtypes.MsgOpenResponse); ok { + r0 = rf(ctx, msg) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*perpetualtypes.MsgOpenResponse) + } + } + + if rf, ok := ret.Get(1).(func(types.Context, *perpetualtypes.MsgOpen) error); ok { + r1 = rf(ctx, msg) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// PerpetualKeeper_Open_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Open' +type PerpetualKeeper_Open_Call struct { + *mock.Call +} + +// Open is a helper method to define mock.On call +// - ctx types.Context +// - msg *perpetualtypes.MsgOpen +func (_e *PerpetualKeeper_Expecter) Open(ctx interface{}, msg interface{}) *PerpetualKeeper_Open_Call { + return &PerpetualKeeper_Open_Call{Call: _e.mock.On("Open", ctx, msg)} +} + +func (_c *PerpetualKeeper_Open_Call) Run(run func(ctx types.Context, msg *perpetualtypes.MsgOpen)) *PerpetualKeeper_Open_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Context), args[1].(*perpetualtypes.MsgOpen)) + }) + return _c +} + +func (_c *PerpetualKeeper_Open_Call) Return(_a0 *perpetualtypes.MsgOpenResponse, _a1 error) *PerpetualKeeper_Open_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PerpetualKeeper_Open_Call) RunAndReturn(run func(types.Context, *perpetualtypes.MsgOpen) (*perpetualtypes.MsgOpenResponse, error)) *PerpetualKeeper_Open_Call { + _c.Call.Return(run) + return _c +} + +// NewPerpetualKeeper creates a new instance of PerpetualKeeper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewPerpetualKeeper(t interface { + mock.TestingT + Cleanup(func()) +}) *PerpetualKeeper { + mock := &PerpetualKeeper{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} From 341f82e40525b5e6ee9d027070f1725a1bf34aee Mon Sep 17 00:00:00 2001 From: Cosmic Vagabond <121588426+cosmic-vagabond@users.noreply.github.com> Date: Wed, 8 Jan 2025 18:56:45 +0100 Subject: [PATCH 05/18] test: fix tests --- types/dec34.go | 9 +++- types/dec34_test.go | 25 ++++++----- x/amm/keeper/calc_in_route_spot_price_test.go | 2 +- x/amm/types/amm_price_test.go | 41 ++++++++++--------- x/amm/types/calc_exit_pool_test.go | 17 ++++---- 5 files changed, 52 insertions(+), 42 deletions(-) diff --git a/types/dec34.go b/types/dec34.go index 841780959..74baf4f25 100644 --- a/types/dec34.go +++ b/types/dec34.go @@ -1,6 +1,7 @@ package types import ( + "fmt" "math/big" "cosmossdk.io/math" @@ -39,7 +40,7 @@ func NewDec34FromInt64(i int64) Dec34 { } func NewDec34WithPrec(i int64, prec int32) Dec34 { - return Dec34(regenmath.NewDecFinite(i, prec)) + return Dec34(regenmath.NewDecFinite(i, -prec)) } func ZeroDec34() Dec34 { return NewDec34FromInt64(0) } @@ -186,6 +187,10 @@ func (d Dec34) ToLegacyDec() math.LegacyDec { if err != nil { panic(err) } + // print coefficient and exponent + fmt.Println("original:", z.Text('f')) + fmt.Println("coefficient:", z.Coeff.String()) + fmt.Println("exponent:", z.Exponent) // override exponent and coefficient if exponent is less than -18 to fit into 18 decimal places if z.Exponent < -18 { delta := -18 - z.Exponent @@ -195,7 +200,7 @@ func (d Dec34) ToLegacyDec() math.LegacyDec { z.Exponent = -18 } // construct legacy dec from apd.Decimal - return math.LegacyMustNewDecFromStr(z.String()) + return math.LegacyMustNewDecFromStr(z.Text('f')) } func (d Dec34) ToInt() math.Int { diff --git a/types/dec34_test.go b/types/dec34_test.go index da8b9d831..b1e6ac0e3 100644 --- a/types/dec34_test.go +++ b/types/dec34_test.go @@ -64,26 +64,25 @@ func TestDec34(t *testing.T) { require.Equal(t, NewDec34FromInt64(6), prod) // Test MulInt - require.Equal(t, NewDec34FromInt64(10000).String(), NewDec34WithPrec(1, 2).MulInt(math.NewInt(100)).String()) + require.Equal(t, NewDec34FromInt64(10000).String(), OneDec34().MulInt(math.NewInt(10000)).String()) // Test MulInt64 - require.Equal(t, NewDec34FromInt64(10000).String(), NewDec34WithPrec(1, 2).MulInt64(100).String()) + require.Equal(t, NewDec34FromInt64(10000).String(), OneDec34().MulInt64(10000).String()) // Test MulLegacyDec - require.Equal(t, NewDec34FromString("10000.0000000000000000").String(), NewDec34WithPrec(1, 2).MulLegacyDec(math.LegacyNewDec(100)).String()) + require.Equal(t, NewDec34FromString("10000.000000000000000000").String(), OneDec34().MulLegacyDec(math.LegacyNewDec(10000)).String()) // Test Quo - quot := three.Quo(two) - require.Equal(t, "1.5", quot.String()) + require.Equal(t, "1.5", three.Quo(two).String()) // Test QuoInt - require.Equal(t, NewDec34FromInt64(1).String(), NewDec34WithPrec(1, 2).QuoInt(math.NewInt(100)).String()) + require.Equal(t, OneDec34().String(), NewDec34FromInt64(100).QuoInt(math.NewInt(100)).String()) // Test QuoInt64 - require.Equal(t, NewDec34FromInt64(1).String(), NewDec34WithPrec(1, 2).QuoInt64(100).String()) + require.Equal(t, OneDec34().String(), NewDec34FromInt64(100).QuoInt64(100).String()) // Test QuoLegacyDec - require.Equal(t, OneDec34().String(), NewDec34WithPrec(1, 2).QuoLegacyDec(math.LegacyNewDec(100)).String()) + require.Equal(t, OneDec34().String(), NewDec34FromInt64(100).QuoLegacyDec(math.LegacyNewDec(100)).String()) // Test division by zero panic require.Panics(t, func() { @@ -91,8 +90,7 @@ func TestDec34(t *testing.T) { }) // Test ToLegacyDec - legacyResult := three.ToLegacyDec() - require.Equal(t, math.LegacyNewDec(3), legacyResult) + require.Equal(t, math.LegacyNewDec(3), three.ToLegacyDec()) require.Equal(t, NewDec34FromString("1000000000000000000000000000000000000123456789.000000000000000000").ToLegacyDec().String(), math.LegacyMustNewDecFromStr("1000000000000000000000000000000000000123456789.000000000000000000").String(), @@ -113,6 +111,10 @@ func TestDec34(t *testing.T) { NewDec34FromString("96346.39698847304510148894982122764").ToLegacyDec().String(), math.LegacyMustNewDecFromStr("96346.396988473045101488").String(), ) + require.Equal(t, + NewDec34FromString("0.0000002").ToLegacyDec().String(), + math.LegacyMustNewDecFromStr("0.0000002").String(), + ) // Test ToInt intResult := three.ToInt() @@ -142,7 +144,8 @@ func TestDec34(t *testing.T) { // Test NewDec34WithPrec require.Equal(t, NewDec34WithPrec(1, 2).String(), NewDec34WithPrec(1, 2).String()) - require.Equal(t, NewDec34FromInt64(100).String(), NewDec34WithPrec(1, 2).Mul(NewDec34WithPrec(1, 0)).String()) + require.Equal(t, NewDec34FromInt64(100).String(), OneDec34().Mul(NewDec34WithPrec(100, 0)).String()) + require.Equal(t, NewDec34FromString("0.010000000000000000").String(), math.LegacyNewDecWithPrec(1, 2).String()) // Test NewDec34FromString require.Equal(t, NewDec34FromString("1.234567890123456789").String(), NewDec34FromString("1.234567890123456789").String()) diff --git a/x/amm/keeper/calc_in_route_spot_price_test.go b/x/amm/keeper/calc_in_route_spot_price_test.go index 0966ac816..033f8a358 100644 --- a/x/amm/keeper/calc_in_route_spot_price_test.go +++ b/x/amm/keeper/calc_in_route_spot_price_test.go @@ -99,7 +99,7 @@ func (suite *AmmKeeperTestSuite) TestCalcInRouteSpotPrice() { } spotPrice, _, _, _, _, _, _, _, err = suite.app.AmmKeeper.CalcInRouteSpotPrice(suite.ctx, tokenIn, routes, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec()) suite.Require().NoError(err) - suite.Require().Equal(spotPrice.String(), sdkmath.LegacyOneDec().String()) + suite.Require().Equal(spotPrice.ToLegacyDec().String(), sdkmath.LegacyOneDec().String()) // Test no routes _, _, _, _, _, _, _, _, err = suite.app.AmmKeeper.CalcInRouteSpotPrice(suite.ctx, tokenIn, nil, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec()) diff --git a/x/amm/types/amm_price_test.go b/x/amm/types/amm_price_test.go index 5dd07477c..9750cdca5 100644 --- a/x/amm/types/amm_price_test.go +++ b/x/amm/types/amm_price_test.go @@ -5,6 +5,7 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/amm/types" "github.com/elys-network/elys/x/amm/types/mocks" "github.com/stretchr/testify/mock" @@ -22,7 +23,7 @@ func TestGetTokenARate(t *testing.T) { pool *types.Pool tokenA string tokenB string - expectedRate sdkmath.LegacyDec + expectedRate elystypes.Dec34 expectedErrMsg string }{ { @@ -37,91 +38,91 @@ func TestGetTokenARate(t *testing.T) { }, "tokenA", "tokenB", - sdkmath.LegacyNewDec(4).Quo(sdkmath.LegacyNewDec(3)), + elystypes.FourDec34().Quo(elystypes.ThreeDec34()), "", }, { "oracle pricing", func(oracleKeeper *mocks.OracleKeeper) { - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(sdkmath.LegacyNewDec(10)) - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(sdkmath.LegacyNewDec(5)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromInt64(10)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(elystypes.NewDec34FromInt64(5)) }, &types.Pool{ PoolParams: types.PoolParams{UseOracle: true}, }, "tokenA", "tokenB", - sdkmath.LegacyNewDec(2), + elystypes.TwoDec34(), "", }, { "token price not set for tokenA", func(oracleKeeper *mocks.OracleKeeper) { - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "unknownToken").Return(sdkmath.LegacyZeroDec()) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "unknownToken").Return(elystypes.ZeroDec34()) }, &types.Pool{ PoolParams: types.PoolParams{UseOracle: true}, }, "unknownToken", "tokenB", - sdkmath.LegacyZeroDec(), + elystypes.ZeroDec34(), "token price not set: unknownToken", }, { "token price not set for tokenB", func(oracleKeeper *mocks.OracleKeeper) { - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(sdkmath.LegacyNewDec(5)) - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "unknownToken").Return(sdkmath.LegacyZeroDec()) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromInt64(5)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "unknownToken").Return(elystypes.ZeroDec34()) }, &types.Pool{ PoolParams: types.PoolParams{UseOracle: true}, }, "tokenA", "unknownToken", - sdkmath.LegacyZeroDec(), + elystypes.ZeroDec34(), "token price not set: unknownToken", }, { "Success with oracle pricing", func(oracleKeeper *mocks.OracleKeeper) { - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(sdkmath.LegacyNewDec(5)) - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(sdkmath.LegacyNewDec(2)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromInt64(5)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(elystypes.NewDec34FromInt64(2)) }, &types.Pool{ PoolParams: types.PoolParams{UseOracle: true}, }, "tokenA", "tokenB", - sdkmath.LegacyNewDec(5).Quo(sdkmath.LegacyNewDec(2)), + elystypes.FiveDec34().Quo(elystypes.TwoDec34()), "", }, { "Success with oracle pricing", func(oracleKeeper *mocks.OracleKeeper) { - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(sdkmath.LegacyNewDec(5)) - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(sdkmath.LegacyNewDec(2)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromInt64(5)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(elystypes.NewDec34FromInt64(2)) }, &types.Pool{ PoolParams: types.PoolParams{UseOracle: true}, }, "tokenA", "tokenB", - sdkmath.LegacyNewDec(5).Quo(sdkmath.LegacyNewDec(2)), + elystypes.FiveDec34().Quo(elystypes.TwoDec34()), "", }, { "Success with oracle pricing with price less than 1", func(oracleKeeper *mocks.OracleKeeper) { // for 6 decimal tokens - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(sdkmath.LegacyMustNewDecFromStr("0.0000002")) - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(sdkmath.LegacyNewDec(1)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromString("0.0000002")) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(elystypes.OneDec34()) }, &types.Pool{ PoolParams: types.PoolParams{UseOracle: true}, }, "tokenA", "tokenB", - sdkmath.LegacyMustNewDecFromStr("0.0000002"), + elystypes.NewDec34FromString("0.0000002"), "", }, } @@ -137,7 +138,7 @@ func TestGetTokenARate(t *testing.T) { require.Contains(t, err.Error(), tc.expectedErrMsg) } else { require.NoError(t, err) - require.Equal(t, tc.expectedRate, rate) + require.Equal(t, tc.expectedRate.ToLegacyDec().String(), rate.ToLegacyDec().String()) } }) } diff --git a/x/amm/types/calc_exit_pool_test.go b/x/amm/types/calc_exit_pool_test.go index 67c2e67f6..ef4c0407a 100644 --- a/x/amm/types/calc_exit_pool_test.go +++ b/x/amm/types/calc_exit_pool_test.go @@ -5,6 +5,7 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/amm/types" "github.com/elys-network/elys/x/amm/types/mocks" "github.com/stretchr/testify/mock" @@ -27,8 +28,8 @@ func TestCalcExitValueWithoutSlippage(t *testing.T) { { "successful exit value calculation", func(oracleKeeper *mocks.OracleKeeper, accKeeper *mocks.AccountedPoolKeeper) { - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(sdkmath.LegacyNewDec(10)) - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(sdkmath.LegacyNewDec(5)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromInt64(10)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(elystypes.NewDec34FromInt64(5)) accKeeper.On("GetAccountedBalance", mock.Anything, mock.Anything, "tokenA").Return(sdkmath.NewInt(1000)) accKeeper.On("GetAccountedBalance", mock.Anything, mock.Anything, "tokenB").Return(sdkmath.NewInt(2000)) }, @@ -48,8 +49,8 @@ func TestCalcExitValueWithoutSlippage(t *testing.T) { { "total shares is zero", func(oracleKeeper *mocks.OracleKeeper, accKeeper *mocks.AccountedPoolKeeper) { - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(sdkmath.LegacyNewDec(10)) - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(sdkmath.LegacyNewDec(5)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromInt64(10)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(elystypes.NewDec34FromInt64(5)) accKeeper.On("GetAccountedBalance", mock.Anything, mock.Anything, "tokenA").Return(sdkmath.NewInt(1000)) accKeeper.On("GetAccountedBalance", mock.Anything, mock.Anything, "tokenB").Return(sdkmath.NewInt(2000)) }, @@ -69,8 +70,8 @@ func TestCalcExitValueWithoutSlippage(t *testing.T) { { "exiting shares greater than total shares", func(oracleKeeper *mocks.OracleKeeper, accKeeper *mocks.AccountedPoolKeeper) { - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(sdkmath.LegacyNewDec(10)) - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(sdkmath.LegacyNewDec(5)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromInt64(10)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(elystypes.NewDec34FromInt64(5)) accKeeper.On("GetAccountedBalance", mock.Anything, mock.Anything, "tokenA").Return(sdkmath.NewInt(1000)) accKeeper.On("GetAccountedBalance", mock.Anything, mock.Anything, "tokenB").Return(sdkmath.NewInt(2000)) }, @@ -127,7 +128,7 @@ func TestCalcExitPool(t *testing.T) { { "successful exit with oracle pricing", func(oracleKeeper *mocks.OracleKeeper, accKeeper *mocks.AccountedPoolKeeper) { - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(sdkmath.LegacyMustNewDecFromStr("0.00001")) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromString("0.00001")) accKeeper.On("GetAccountedBalance", mock.Anything, mock.Anything, "tokenA").Return(sdkmath.NewInt(1000)) }, types.Pool{ @@ -163,7 +164,7 @@ func TestCalcExitPool(t *testing.T) { { "exiting shares greater than total shares", func(oracleKeeper *mocks.OracleKeeper, accKeeper *mocks.AccountedPoolKeeper) { - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(sdkmath.LegacyNewDec(0)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.ZeroDec34()) }, types.Pool{ PoolParams: types.PoolParams{UseOracle: true}, From 8c11b8b16455b666cc8d96c2c1e09e5af259a649 Mon Sep 17 00:00:00 2001 From: Cosmic Vagabond <121588426+cosmic-vagabond@users.noreply.github.com> Date: Wed, 8 Jan 2025 19:42:35 +0100 Subject: [PATCH 06/18] test: fix tests --- types/dec34.go | 5 ----- x/amm/keeper/estimate_price_test.go | 5 +++-- x/amm/types/calc_exit_pool_test.go | 18 +++++++++--------- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/types/dec34.go b/types/dec34.go index 74baf4f25..68ed196be 100644 --- a/types/dec34.go +++ b/types/dec34.go @@ -1,7 +1,6 @@ package types import ( - "fmt" "math/big" "cosmossdk.io/math" @@ -187,10 +186,6 @@ func (d Dec34) ToLegacyDec() math.LegacyDec { if err != nil { panic(err) } - // print coefficient and exponent - fmt.Println("original:", z.Text('f')) - fmt.Println("coefficient:", z.Coeff.String()) - fmt.Println("exponent:", z.Exponent) // override exponent and coefficient if exponent is less than -18 to fit into 18 decimal places if z.Exponent < -18 { delta := -18 - z.Exponent diff --git a/x/amm/keeper/estimate_price_test.go b/x/amm/keeper/estimate_price_test.go index 93df0ed3f..2ec2a2a5d 100644 --- a/x/amm/keeper/estimate_price_test.go +++ b/x/amm/keeper/estimate_price_test.go @@ -2,6 +2,7 @@ package keeper_test import ( "cosmossdk.io/math" + elystypes "github.com/elys-network/elys/types" ptypes "github.com/elys-network/elys/x/parameter/types" ) @@ -68,7 +69,7 @@ func (suite *AmmKeeperTestSuite) TestCalculateUSDValue() { }, func() { value := suite.app.AmmKeeper.CalculateUSDValue(suite.ctx, ptypes.ATOM, math.NewInt(1000)) - suite.Require().Equal(value, math.LegacyMustNewDecFromStr("0.001")) + suite.Require().Equal(value.String(), elystypes.NewDec34FromString("0.001").String()) }, }, { @@ -79,7 +80,7 @@ func (suite *AmmKeeperTestSuite) TestCalculateUSDValue() { }, func() { value := suite.app.AmmKeeper.CalculateUSDValue(suite.ctx, "dummy", math.NewInt(1000)) - suite.Require().Equal(value.String(), math.LegacyZeroDec().String()) + suite.Require().Equal(value.String(), elystypes.ZeroDec34().String()) }, }, } diff --git a/x/amm/types/calc_exit_pool_test.go b/x/amm/types/calc_exit_pool_test.go index ef4c0407a..f34f3db14 100644 --- a/x/amm/types/calc_exit_pool_test.go +++ b/x/amm/types/calc_exit_pool_test.go @@ -22,7 +22,7 @@ func TestCalcExitValueWithoutSlippage(t *testing.T) { pool types.Pool exitingShares sdkmath.Int tokenOutDenom string - expectedValue sdkmath.LegacyDec + expectedValue elystypes.Dec34 expectedErrMsg string }{ { @@ -43,7 +43,7 @@ func TestCalcExitValueWithoutSlippage(t *testing.T) { }, sdkmath.NewInt(10), "tokenA", - sdkmath.LegacyNewDec(2000), + elystypes.NewDec34FromInt64(2000), "", }, { @@ -64,7 +64,7 @@ func TestCalcExitValueWithoutSlippage(t *testing.T) { }, sdkmath.NewInt(10), "tokenA", - sdkmath.LegacyZeroDec(), + elystypes.ZeroDec34(), "amount too low", }, { @@ -85,7 +85,7 @@ func TestCalcExitValueWithoutSlippage(t *testing.T) { }, sdkmath.NewInt(100), "tokenA", - sdkmath.LegacyZeroDec(), + elystypes.ZeroDec34(), "shares is larger than the max amount", }, } @@ -122,7 +122,7 @@ func TestCalcExitPool(t *testing.T) { tokenOutDenom string params types.Params expectedCoins sdk.Coins - expectedBonus sdkmath.LegacyDec + expectedBonus elystypes.Dec34 expectedErrMsg string }{ { @@ -144,7 +144,7 @@ func TestCalcExitPool(t *testing.T) { WeightBreakingFeeMultiplier: sdkmath.LegacyMustNewDecFromStr("0.0005"), }, sdk.Coins{sdk.NewCoin("tokenA", sdkmath.NewInt(100))}, - sdkmath.LegacyZeroDec(), + elystypes.ZeroDec34(), "", }, { @@ -158,7 +158,7 @@ func TestCalcExitPool(t *testing.T) { "tokenA", types.Params{}, sdk.Coins{}, - sdkmath.LegacyZeroDec(), + elystypes.ZeroDec34(), "shares is larger than the max amount", }, { @@ -174,7 +174,7 @@ func TestCalcExitPool(t *testing.T) { "tokenA", types.Params{}, sdk.Coins{}, - sdkmath.LegacyZeroDec(), + elystypes.ZeroDec34(), "amount too low", }, { @@ -191,7 +191,7 @@ func TestCalcExitPool(t *testing.T) { "", types.Params{}, sdk.Coins{sdk.NewCoin("tokenA", sdkmath.NewInt(100))}, - sdkmath.LegacyZeroDec(), + elystypes.ZeroDec34(), "", }, } From b039becbcf56533f51afc396a83d189ff8550276 Mon Sep 17 00:00:00 2001 From: Cosmic Vagabond <121588426+cosmic-vagabond@users.noreply.github.com> Date: Wed, 8 Jan 2025 19:59:01 +0100 Subject: [PATCH 07/18] test: fix tests --- x/amm/keeper/estimate_price_test.go | 10 +++++----- x/amm/keeper/msg_server_exit_pool_test.go | 8 ++++---- x/amm/types/pool_test.go | 14 ++++++++------ x/amm/types/swap_out_amt_given_in_test.go | 4 ++-- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/x/amm/keeper/estimate_price_test.go b/x/amm/keeper/estimate_price_test.go index 2ec2a2a5d..ba7beedc8 100644 --- a/x/amm/keeper/estimate_price_test.go +++ b/x/amm/keeper/estimate_price_test.go @@ -19,7 +19,7 @@ func (suite *AmmKeeperTestSuite) TestEstimatePrice() { }, func() { price := suite.app.AmmKeeper.GetTokenPrice(suite.ctx, ptypes.BaseCurrency, ptypes.BaseCurrency) - suite.Require().Equal(math.LegacyZeroDec(), price) + suite.Require().Equal(elystypes.ZeroDec34().String(), price.String()) }, }, { @@ -30,7 +30,7 @@ func (suite *AmmKeeperTestSuite) TestEstimatePrice() { }, func() { price := suite.app.AmmKeeper.GetTokenPrice(suite.ctx, ptypes.BaseCurrency, ptypes.BaseCurrency) - suite.Require().Equal(math.LegacyMustNewDecFromStr("0.000001000000000000"), price) + suite.Require().Equal(elystypes.NewDec34FromString("0.000001000000000000").String(), price.String()) }, }, { @@ -42,7 +42,7 @@ func (suite *AmmKeeperTestSuite) TestEstimatePrice() { func() { suite.app.OracleKeeper.RemoveAssetInfo(suite.ctx, ptypes.BaseCurrency) price := suite.app.AmmKeeper.GetTokenPrice(suite.ctx, ptypes.BaseCurrency, ptypes.BaseCurrency) - suite.Require().Equal(math.LegacyMustNewDecFromStr("0.000000000000000000"), price) + suite.Require().Equal(elystypes.ZeroDec34().String(), price.String()) }, }, } @@ -68,8 +68,8 @@ func (suite *AmmKeeperTestSuite) TestCalculateUSDValue() { suite.SetupCoinPrices() }, func() { - value := suite.app.AmmKeeper.CalculateUSDValue(suite.ctx, ptypes.ATOM, math.NewInt(1000)) - suite.Require().Equal(value.String(), elystypes.NewDec34FromString("0.001").String()) + value := suite.app.AmmKeeper.CalculateUSDValue(suite.ctx, ptypes.BaseCurrency, math.NewInt(1000)) + suite.Require().Equal(value.String(), elystypes.NewDec34FromString("0.001000000000000000").String()) }, }, { diff --git a/x/amm/keeper/msg_server_exit_pool_test.go b/x/amm/keeper/msg_server_exit_pool_test.go index 58b3aa3bf..5b08b6b7d 100644 --- a/x/amm/keeper/msg_server_exit_pool_test.go +++ b/x/amm/keeper/msg_server_exit_pool_test.go @@ -64,9 +64,9 @@ func (suite *AmmKeeperTestSuite) TestMsgServerExitPool() { }, shareInAmount: types.OneShare.Quo(sdkmath.NewInt(10)), tokenOutDenom: "uusdt", - minAmountsOut: sdk.Coins{sdk.NewInt64Coin("uusdt", 99935)}, + minAmountsOut: sdk.Coins{sdk.NewInt64Coin("uusdt", 99950)}, // expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusdt", 95114)}, // slippage enabled - expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusdt", 99935)}, // slippage disabled + expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusdt", 99950)}, // slippage disabled expPass: true, }, { @@ -79,9 +79,9 @@ func (suite *AmmKeeperTestSuite) TestMsgServerExitPool() { }, shareInAmount: types.OneShare.Quo(sdkmath.NewInt(10)), tokenOutDenom: ptypes.BaseCurrency, - minAmountsOut: sdk.Coins{sdk.NewInt64Coin(ptypes.BaseCurrency, 99221)}, + minAmountsOut: sdk.Coins{sdk.NewInt64Coin(ptypes.BaseCurrency, 99220)}, // expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.BaseCurrency, 99197)}, // slippage enabled - expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.BaseCurrency, 99221)}, // slippage disabled + expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.BaseCurrency, 99220)}, // slippage disabled expPass: true, }, } { diff --git a/x/amm/types/pool_test.go b/x/amm/types/pool_test.go index fa9b3c879..db2d35c85 100644 --- a/x/amm/types/pool_test.go +++ b/x/amm/types/pool_test.go @@ -1,14 +1,16 @@ package types_test import ( - sdkmath "cosmossdk.io/math" "fmt" "testing" "time" + sdkmath "cosmossdk.io/math" + errorsmod "cosmossdk.io/errors" "github.com/cometbft/cometbft/crypto/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/amm/types" ptypes "github.com/elys-network/elys/x/parameter/types" "github.com/stretchr/testify/require" @@ -19,7 +21,7 @@ func (suite *TestSuite) TestPoolTVL() { desc string poolAssets []types.PoolAsset useOracle bool - expTVL sdkmath.LegacyDec + expTVL elystypes.Dec34 expError bool }{ { @@ -35,7 +37,7 @@ func (suite *TestSuite) TestPoolTVL() { }, }, useOracle: true, - expTVL: sdkmath.LegacyNewDec(2000), + expTVL: elystypes.NewDec34FromString("2000.000000000000000000"), expError: false, }, { @@ -51,7 +53,7 @@ func (suite *TestSuite) TestPoolTVL() { }, }, useOracle: true, - expTVL: sdkmath.LegacyNewDec(0), + expTVL: elystypes.ZeroDec34(), expError: true, }, { @@ -67,7 +69,7 @@ func (suite *TestSuite) TestPoolTVL() { }, }, useOracle: false, - expTVL: sdkmath.LegacyNewDec(0), + expTVL: elystypes.ZeroDec34(), expError: false, }, { @@ -83,7 +85,7 @@ func (suite *TestSuite) TestPoolTVL() { }, }, useOracle: false, - expTVL: sdkmath.LegacyNewDec(2000), + expTVL: elystypes.NewDec34FromString("2000.000000000000000000"), expError: false, }, } { diff --git a/x/amm/types/swap_out_amt_given_in_test.go b/x/amm/types/swap_out_amt_given_in_test.go index c7a9c5b78..9f95646b0 100644 --- a/x/amm/types/swap_out_amt_given_in_test.go +++ b/x/amm/types/swap_out_amt_given_in_test.go @@ -139,11 +139,11 @@ func (suite *TestSuite) TestOraclePoolNormalizedWeights() { poolWeights: []types.AssetWeight{ { Asset: ptypes.BaseCurrency, - Weight: elystypes.ZeroDec34(), + Weight: elystypes.NewDec34FromString("0.000000000000000000"), }, { Asset: "uusdt", - Weight: elystypes.ZeroDec34(), + Weight: elystypes.NewDec34FromString("0.000000000000000000"), }, }, expError: false, From 0bd8b4c478c2874658b6b79cd2977a0fc26170b7 Mon Sep 17 00:00:00 2001 From: Cosmic Vagabond <121588426+cosmic-vagabond@users.noreply.github.com> Date: Wed, 8 Jan 2025 20:11:12 +0100 Subject: [PATCH 08/18] fix(types): quoint64 operation --- types/dec34.go | 2 +- types/dec34_test.go | 2 ++ x/masterchef/keeper/query_test.go | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/types/dec34.go b/types/dec34.go index 68ed196be..3d666497a 100644 --- a/types/dec34.go +++ b/types/dec34.go @@ -97,7 +97,7 @@ func (d Dec34) Quo(other Dec34) Dec34 { } func (d Dec34) QuoInt(i math.Int) Dec34 { - y, err := regenmath.Dec(d).QuoInteger(regenmath.Dec(NewDec34FromInt(i))) + y, err := regenmath.Dec(d).Quo(regenmath.Dec(NewDec34FromInt(i))) if err != nil { panic(err) } diff --git a/types/dec34_test.go b/types/dec34_test.go index b1e6ac0e3..365d77d8d 100644 --- a/types/dec34_test.go +++ b/types/dec34_test.go @@ -80,6 +80,8 @@ func TestDec34(t *testing.T) { // Test QuoInt64 require.Equal(t, OneDec34().String(), NewDec34FromInt64(100).QuoInt64(100).String()) + require.Equal(t, NewDec34FromString("0.1585489599188229325215626585489599").String(), NewDec34FromInt64(1000000).Quo(NewDec34FromString("6307200")).String()) + require.Equal(t, NewDec34FromString("0.1585489599188229325215626585489599").String(), NewDec34FromInt64(1000000).QuoInt(math.NewInt(6307200)).String()) // Test QuoLegacyDec require.Equal(t, OneDec34().String(), NewDec34FromInt64(100).QuoLegacyDec(math.LegacyNewDec(100)).String()) diff --git a/x/masterchef/keeper/query_test.go b/x/masterchef/keeper/query_test.go index 1bbadad4a..9d222f0ad 100644 --- a/x/masterchef/keeper/query_test.go +++ b/x/masterchef/keeper/query_test.go @@ -87,7 +87,7 @@ func (suite *MasterchefKeeperTestSuite) TestApr() { Denom: "ueden", }, response: &types.QueryAprResponse{ - Apr: elystypes.NewDec34FromString("0.299999999999999995").String(), + Apr: elystypes.NewDec34FromString("0.3000000000000000000000000000").String(), }, err: nil, }, From b85187b07c4a992918af2b2542acb66f478e8cab Mon Sep 17 00:00:00 2001 From: Cosmic Vagabond <121588426+cosmic-vagabond@users.noreply.github.com> Date: Thu, 9 Jan 2025 08:26:23 +0100 Subject: [PATCH 09/18] feat: add pow function to dec34 interface --- types/dec34.go | 47 +++++++++--------- types/dec34_test.go | 39 +++++++++++++-- x/amm/keeper/calc_in_route_spot_price_test.go | 3 +- .../keeper_swap_exact_amount_in_test.go | 4 +- .../keeper_swap_exact_amount_out_test.go | 38 +++++++-------- x/amm/keeper/msg_server_exit_pool_test.go | 4 +- x/amm/keeper/msg_server_join_pool_test.go | 2 +- x/amm/keeper/msg_server_swap_by_denom_test.go | 8 ++-- .../msg_server_swap_exact_amount_out_test.go | 12 ++--- .../keeper/query_join_pool_estimation_test.go | 2 +- x/amm/keeper/route_exact_amount_out_test.go | 24 +++++----- x/amm/types/pow.go | 5 -- .../solve_constant_function_invariant.go | 2 +- x/amm/types/swap_in_amt_given_out_test.go | 21 ++++---- x/amm/types/swap_out_amt_given_in_test.go | 24 +++++----- x/amm/types/utils.go | 4 +- x/masterchef/keeper/abci_test.go | 3 +- x/masterchef/keeper/query_test.go | 8 ++-- x/perpetual/keeper/close_test.go | 12 ++--- x/perpetual/keeper/open_consolidate_test.go | 4 +- x/perpetual/keeper/open_short_test.go | 4 +- .../keeper/query_open_estimation_test.go | 48 +++++++++---------- x/tier/keeper/query_staked_pool_test.go | 2 +- x/tier/keeper/query_staked_test.go | 2 +- 24 files changed, 177 insertions(+), 145 deletions(-) diff --git a/types/dec34.go b/types/dec34.go index 3d666497a..7de61069f 100644 --- a/types/dec34.go +++ b/types/dec34.go @@ -1,8 +1,6 @@ package types import ( - "math/big" - "cosmossdk.io/math" "github.com/cockroachdb/apd/v2" regenmath "github.com/regen-network/regen-ledger/types/v2/math" @@ -64,8 +62,24 @@ func MaxDec34(a, b Dec34) Dec34 { return b } +func PowDec34(base, exp Dec34) Dec34 { + b, _, _ := apd.NewFromString(base.String()) + e, _, _ := apd.NewFromString(exp.String()) + d := new(apd.Decimal) + + // add enough precision to handle big decimal values + c := apd.BaseContext.WithPrecision(100) + _, err := c.Pow(d, b, e) + if err != nil { + panic(err) + } + + return NewDec34FromString(d.Text('f')) +} + func (d Dec34) String() string { - return regenmath.Dec(d).String() + x, _ := regenmath.Dec(d).Reduce() + return x.String() } func (d Dec34) Mul(other Dec34) Dec34 { @@ -175,26 +189,13 @@ func (d Dec34) Neg() Dec34 { } func (d Dec34) ToLegacyDec() math.LegacyDec { - // remove all trailing zeros - y, _ := regenmath.Dec(d).Reduce() - // if d is zero, return zero legacy dec - if y.IsZero() { - return math.LegacyZeroDec() - } - // convert to apd.Decimal - z, _, err := apd.NewFromString(y.String()) - if err != nil { - panic(err) - } - // override exponent and coefficient if exponent is less than -18 to fit into 18 decimal places - if z.Exponent < -18 { - delta := -18 - z.Exponent - decs := big.NewInt(10) - decs.Exp(decs, big.NewInt(int64(delta)), nil) - z.Coeff.Quo(&z.Coeff, decs) - z.Exponent = -18 - } - // construct legacy dec from apd.Decimal + y, _, _ := apd.NewFromString(d.String()) + z := new(apd.Decimal) + + // add enough precision to handle big decimal values + c := apd.BaseContext.WithPrecision(100) + c.Quantize(z, y, -18) + return math.LegacyMustNewDecFromStr(z.Text('f')) } diff --git a/types/dec34_test.go b/types/dec34_test.go index 365d77d8d..e54733f14 100644 --- a/types/dec34_test.go +++ b/types/dec34_test.go @@ -4,6 +4,7 @@ import ( "testing" "cosmossdk.io/math" + "github.com/cockroachdb/apd/v2" "github.com/stretchr/testify/require" ) @@ -21,7 +22,7 @@ func TestDec34(t *testing.T) { // Test NewDec34FromLegacyDec legacyDec := math.LegacyNewDec(123) dec34FromLegacy := NewDec34FromLegacyDec(legacyDec) - require.Equal(t, "123.000000000000000000", dec34FromLegacy.String()) + require.Equal(t, "123", dec34FromLegacy.String()) // Test NewDec34FromInt intVal := math.NewInt(456) @@ -86,6 +87,11 @@ func TestDec34(t *testing.T) { // Test QuoLegacyDec require.Equal(t, OneDec34().String(), NewDec34FromInt64(100).QuoLegacyDec(math.LegacyNewDec(100)).String()) + require.Equal(t, + NewDec34FromString("100000123456.789000000000000000").String(), + NewDec34FromString("100000123456789.000000000000000000").Quo(NewDec34FromInt64(1000)).String(), + ) + // Test division by zero panic require.Panics(t, func() { three.Quo(ZeroDec34()) @@ -111,12 +117,20 @@ func TestDec34(t *testing.T) { ) require.Equal(t, NewDec34FromString("96346.39698847304510148894982122764").ToLegacyDec().String(), - math.LegacyMustNewDecFromStr("96346.396988473045101488").String(), + math.LegacyMustNewDecFromStr("96346.396988473045101489").String(), ) require.Equal(t, NewDec34FromString("0.0000002").ToLegacyDec().String(), math.LegacyMustNewDecFromStr("0.0000002").String(), ) + input, _, _ := apd.NewFromString("96346.39698847304510148894982122764") + output := new(apd.Decimal) + c := apd.BaseContext.WithPrecision(34) + c.Quantize(output, input, -18) + require.Equal(t, + "96346.396988473045101489", + output.Text('f'), + ) // Test ToInt intResult := three.ToInt() @@ -147,7 +161,8 @@ func TestDec34(t *testing.T) { // Test NewDec34WithPrec require.Equal(t, NewDec34WithPrec(1, 2).String(), NewDec34WithPrec(1, 2).String()) require.Equal(t, NewDec34FromInt64(100).String(), OneDec34().Mul(NewDec34WithPrec(100, 0)).String()) - require.Equal(t, NewDec34FromString("0.010000000000000000").String(), math.LegacyNewDecWithPrec(1, 2).String()) + require.Equal(t, NewDec34WithPrec(1, 2).String()+"0000000000000000", math.LegacyNewDecWithPrec(1, 2).String()) + require.Equal(t, NewDec34WithPrec(1, 2).String(), "0.01") // Test NewDec34FromString require.Equal(t, NewDec34FromString("1.234567890123456789").String(), NewDec34FromString("1.234567890123456789").String()) @@ -197,4 +212,22 @@ func TestDec34(t *testing.T) { // Test MaxDec34 require.Equal(t, NewDec34FromInt64(2), MaxDec34(NewDec34FromInt64(1), NewDec34FromInt64(2))) require.Equal(t, NewDec34FromInt64(2), MaxDec34(NewDec34FromInt64(2), NewDec34FromInt64(1))) + + // Test integer powers + require.Equal(t, "8", Pow(NewDec34FromInt64(2), NewDec34FromInt64(3)).String()) + require.Equal(t, "16", Pow(NewDec34FromInt64(2), NewDec34FromInt64(4)).String()) + require.Equal(t, "27", Pow(NewDec34FromInt64(3), NewDec34FromInt64(3)).String()) + + // Test decimal powers + require.Equal(t, "1.414213562373095048801688724209698078569671875376948073176679737990732478462107038850387534327641573", + Pow(NewDec34FromInt64(2), NewDec34FromString("0.5")).String()) + require.Equal(t, "3.162277660168379331998893544432718533719555139325216826857504852792594438639238221344248108379300295", + Pow(NewDec34FromInt64(10), NewDec34FromString("0.5")).String()) + + // Test powers with decimal base + require.Equal(t, "3.375", Pow(NewDec34FromString("1.5"), NewDec34FromInt64(3)).String()) + + // Test power of 1 and 0 + require.Equal(t, "1", Pow(NewDec34FromInt64(5), NewDec34FromInt64(0)).String()) + require.Equal(t, "5", Pow(NewDec34FromInt64(5), NewDec34FromInt64(1)).String()) } diff --git a/x/amm/keeper/calc_in_route_spot_price_test.go b/x/amm/keeper/calc_in_route_spot_price_test.go index 033f8a358..bedd04f85 100644 --- a/x/amm/keeper/calc_in_route_spot_price_test.go +++ b/x/amm/keeper/calc_in_route_spot_price_test.go @@ -5,6 +5,7 @@ import ( "github.com/cometbft/cometbft/crypto/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/amm/types" ptypes "github.com/elys-network/elys/x/parameter/types" ) @@ -90,7 +91,7 @@ func (suite *AmmKeeperTestSuite) TestCalcInRouteSpotPrice() { routes := []*types.SwapAmountInRoute{{PoolId: 1, TokenOutDenom: ptypes.BaseCurrency}} spotPrice, _, _, totalDiscountedSwapFee, _, _, _, _, err := suite.app.AmmKeeper.CalcInRouteSpotPrice(suite.ctx, tokenIn, routes, sdkmath.LegacyZeroDec(), sdkmath.LegacyMustNewDecFromStr("0.1")) suite.Require().NoError(err) - suite.Require().Equal(spotPrice.String(), sdkmath.LegacyOneDec().String()) + suite.Require().Equal(spotPrice.String(), elystypes.OneDec34().String()) suite.Require().Equal(sdkmath.LegacyMustNewDecFromStr("0.1"), totalDiscountedSwapFee) routes = []*types.SwapAmountInRoute{ diff --git a/x/amm/keeper/keeper_swap_exact_amount_in_test.go b/x/amm/keeper/keeper_swap_exact_amount_in_test.go index cadfad8cd..032d517bc 100644 --- a/x/amm/keeper/keeper_swap_exact_amount_in_test.go +++ b/x/amm/keeper/keeper_swap_exact_amount_in_test.go @@ -185,8 +185,8 @@ func (suite *AmmKeeperTestSuite) TestSwapExactAmountIn() { useNewRecipient: false, expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 990000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1009944)}, expRecipientBalance: sdk.Coins{}, - expPoolBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1009997), sdk.NewInt64Coin(ptypes.BaseCurrency, 990056)}, - expTreasuryBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000003), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, + expPoolBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1009998), sdk.NewInt64Coin(ptypes.BaseCurrency, 990056)}, + expTreasuryBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000002), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, expPass: true, errMsg: "", }, diff --git a/x/amm/keeper/keeper_swap_exact_amount_out_test.go b/x/amm/keeper/keeper_swap_exact_amount_out_test.go index e71fcf186..850e315eb 100644 --- a/x/amm/keeper/keeper_swap_exact_amount_out_test.go +++ b/x/amm/keeper/keeper_swap_exact_amount_out_test.go @@ -128,15 +128,15 @@ func (suite *AmmKeeperTestSuite) TestSwapExactAmountOut() { poolInitBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, treasuryInitBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, swapFeeOut: sdkmath.LegacyNewDecWithPrec(1, 2), // 1% - tokenIn: sdk.NewInt64Coin("uusda", 10204), + tokenIn: sdk.NewInt64Coin("uusda", 10203), tokenInMax: sdkmath.NewInt(10000000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), weightBalanceBonus: sdkmath.LegacyZeroDec(), isOraclePool: false, useNewRecipient: false, - expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 989796), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 989797), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, expRecipientBalance: sdk.Coins{}, - expPoolBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1010204), sdk.NewInt64Coin(ptypes.BaseCurrency, 989901)}, + expPoolBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1010203), sdk.NewInt64Coin(ptypes.BaseCurrency, 989901)}, expTreasuryBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, expPass: true, }, @@ -146,15 +146,15 @@ func (suite *AmmKeeperTestSuite) TestSwapExactAmountOut() { poolInitBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, treasuryInitBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, swapFeeOut: sdkmath.LegacyZeroDec(), - tokenIn: sdk.NewInt64Coin("uusda", 10102), + tokenIn: sdk.NewInt64Coin("uusda", 10101), tokenInMax: sdkmath.NewInt(10000000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), weightBalanceBonus: sdkmath.LegacyZeroDec(), isOraclePool: false, useNewRecipient: false, - expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 989898), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 989899), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, expRecipientBalance: sdk.Coins{}, - expPoolBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1010102), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, + expPoolBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1010101), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, expTreasuryBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, expPass: true, }, @@ -164,15 +164,15 @@ func (suite *AmmKeeperTestSuite) TestSwapExactAmountOut() { poolInitBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, treasuryInitBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, swapFeeOut: sdkmath.LegacyZeroDec(), - tokenIn: sdk.NewInt64Coin("uusda", 222546), + tokenIn: sdk.NewInt64Coin("uusda", 222543), tokenInMax: sdkmath.NewInt(10000000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 200000), weightBalanceBonus: sdkmath.LegacyZeroDec(), isOraclePool: true, useNewRecipient: false, - expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 777454), sdk.NewInt64Coin(ptypes.BaseCurrency, 1200000)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 777457), sdk.NewInt64Coin(ptypes.BaseCurrency, 1200000)}, expRecipientBalance: sdk.Coins{}, - expPoolBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1222402), sdk.NewInt64Coin(ptypes.BaseCurrency, 800000)}, + expPoolBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1222399), sdk.NewInt64Coin(ptypes.BaseCurrency, 800000)}, expTreasuryBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000144), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, expPass: true, }, @@ -182,15 +182,15 @@ func (suite *AmmKeeperTestSuite) TestSwapExactAmountOut() { poolInitBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, treasuryInitBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, swapFeeOut: sdkmath.LegacyZeroDec(), - tokenIn: sdk.NewInt64Coin("uusda", 10102), + tokenIn: sdk.NewInt64Coin("uusda", 10101), tokenInMax: sdkmath.NewInt(10000000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), isOraclePool: false, useNewRecipient: false, weightBalanceBonus: sdkmath.LegacyNewDecWithPrec(3, 1), // 30% bonus - expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 989898), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 989899), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, expRecipientBalance: sdk.Coins{}, - expPoolBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1010102), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, + expPoolBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1010101), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, expTreasuryBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, expPass: true, }, @@ -200,15 +200,15 @@ func (suite *AmmKeeperTestSuite) TestSwapExactAmountOut() { poolInitBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, treasuryInitBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 100)}, swapFeeOut: sdkmath.LegacyZeroDec(), - tokenIn: sdk.NewInt64Coin("uusda", 10102), + tokenIn: sdk.NewInt64Coin("uusda", 10101), tokenInMax: sdkmath.NewInt(10000000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), weightBalanceBonus: sdkmath.LegacyNewDecWithPrec(3, 1), // 30% bonus isOraclePool: false, useNewRecipient: false, - expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 989898), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 989899), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, expRecipientBalance: sdk.Coins{}, - expPoolBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1010102), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, + expPoolBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1010101), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, expTreasuryBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 100)}, expPass: true, }, @@ -218,15 +218,15 @@ func (suite *AmmKeeperTestSuite) TestSwapExactAmountOut() { poolInitBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, treasuryInitBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 100)}, swapFeeOut: sdkmath.LegacyZeroDec(), - tokenIn: sdk.NewInt64Coin("uusda", 10102), + tokenIn: sdk.NewInt64Coin("uusda", 10101), tokenInMax: sdkmath.NewInt(10000000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), weightBalanceBonus: sdkmath.LegacyNewDecWithPrec(3, 1), // 30% bonus isOraclePool: false, useNewRecipient: true, - expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 989898), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 989899), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, expRecipientBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.BaseCurrency, 10000)}, - expPoolBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1010102), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, + expPoolBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1010101), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, expTreasuryBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 100)}, expPass: true, }, @@ -333,7 +333,7 @@ func (suite *AmmKeeperTestSuite) TestSwapExactAmountOut() { track := suite.app.AmmKeeper.GetSlippageTrack(suite.ctx, 1, uint64(suite.ctx.BlockTime().Unix())) if tc.isOraclePool { - suite.Require().Equal(track.Tracked.String(), "22224uusda") + suite.Require().Equal(track.Tracked.String(), "22222uusda") } else { suite.Require().Equal(track.Tracked.String(), "") } diff --git a/x/amm/keeper/msg_server_exit_pool_test.go b/x/amm/keeper/msg_server_exit_pool_test.go index 5b08b6b7d..6af8fb96d 100644 --- a/x/amm/keeper/msg_server_exit_pool_test.go +++ b/x/amm/keeper/msg_server_exit_pool_test.go @@ -64,9 +64,9 @@ func (suite *AmmKeeperTestSuite) TestMsgServerExitPool() { }, shareInAmount: types.OneShare.Quo(sdkmath.NewInt(10)), tokenOutDenom: "uusdt", - minAmountsOut: sdk.Coins{sdk.NewInt64Coin("uusdt", 99950)}, + minAmountsOut: sdk.Coins{sdk.NewInt64Coin("uusdt", 99934)}, // expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusdt", 95114)}, // slippage enabled - expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusdt", 99950)}, // slippage disabled + expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusdt", 99934)}, // slippage disabled expPass: true, }, { diff --git a/x/amm/keeper/msg_server_join_pool_test.go b/x/amm/keeper/msg_server_join_pool_test.go index 8992d8056..05fbefc86 100644 --- a/x/amm/keeper/msg_server_join_pool_test.go +++ b/x/amm/keeper/msg_server_join_pool_test.go @@ -60,7 +60,7 @@ func (suite *AmmKeeperTestSuite) TestMsgServerJoinPool() { FeeDenom: ptypes.BaseCurrency, }, // shareOutAmount: math.NewInt(694444166666666666), // weight breaking fee - slippage enable - shareOutAmount: math.NewInt(999057190958417937), // weight breaking fee - slippage disable + shareOutAmount: math.NewInt(999057190958417936), // weight breaking fee - slippage disable expSenderBalance: sdk.Coins{}, expTokenIn: sdk.Coins{sdk.NewInt64Coin("uusdt", 1000000)}, expPass: true, diff --git a/x/amm/keeper/msg_server_swap_by_denom_test.go b/x/amm/keeper/msg_server_swap_by_denom_test.go index 2c6c2812e..7b2fd2463 100644 --- a/x/amm/keeper/msg_server_swap_by_denom_test.go +++ b/x/amm/keeper/msg_server_swap_by_denom_test.go @@ -200,10 +200,10 @@ func (suite *AmmKeeperTestSuite) TestMsgServerSwapByDenomWithOutRoute() { senderInitBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, swapFee: sdkmath.LegacyNewDecWithPrec(1, 2), // 1% tokenOut: sdk.NewInt64Coin(ptypes.Elys, 10000), - expTokenIn: sdk.NewInt64Coin(ptypes.BaseCurrency, 10204), + expTokenIn: sdk.NewInt64Coin(ptypes.BaseCurrency, 10203), tokenOutMax: sdkmath.NewInt(1000000), tokenDenomIn: ptypes.BaseCurrency, - expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010000), sdk.NewInt64Coin(ptypes.BaseCurrency, 989796)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010000), sdk.NewInt64Coin(ptypes.BaseCurrency, 989797)}, expPass: true, }, { @@ -211,10 +211,10 @@ func (suite *AmmKeeperTestSuite) TestMsgServerSwapByDenomWithOutRoute() { senderInitBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, swapFee: sdkmath.LegacyZeroDec(), tokenOut: sdk.NewInt64Coin(ptypes.Elys, 10000), - expTokenIn: sdk.NewInt64Coin(ptypes.BaseCurrency, 10102), + expTokenIn: sdk.NewInt64Coin(ptypes.BaseCurrency, 10101), tokenOutMax: sdkmath.NewInt(1000000), tokenDenomIn: ptypes.BaseCurrency, - expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010000), sdk.NewInt64Coin(ptypes.BaseCurrency, 989898)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010000), sdk.NewInt64Coin(ptypes.BaseCurrency, 989899)}, expPass: true, }, } { diff --git a/x/amm/keeper/msg_server_swap_exact_amount_out_test.go b/x/amm/keeper/msg_server_swap_exact_amount_out_test.go index a0edfca9b..56e2ca730 100644 --- a/x/amm/keeper/msg_server_swap_exact_amount_out_test.go +++ b/x/amm/keeper/msg_server_swap_exact_amount_out_test.go @@ -26,7 +26,7 @@ func (suite *AmmKeeperTestSuite) TestMsgServerSwapExactAmountOut() { desc: "successful execution with positive swap fee", senderInitBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, swapFee: sdkmath.LegacyNewDecWithPrec(1, 2), // 1% - tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10204), + tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10203), tokenInMax: sdkmath.NewInt(10000000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), swapRoutes: []types.SwapAmountOutRoute{ @@ -35,14 +35,14 @@ func (suite *AmmKeeperTestSuite) TestMsgServerSwapExactAmountOut() { TokenInDenom: ptypes.Elys, }, }, - expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 989796), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 989797), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, expPass: true, }, { desc: "successful execution with zero swap fee", senderInitBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, swapFee: sdkmath.LegacyZeroDec(), - tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10102), + tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10101), tokenInMax: sdkmath.NewInt(10000000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), swapRoutes: []types.SwapAmountOutRoute{ @@ -51,7 +51,7 @@ func (suite *AmmKeeperTestSuite) TestMsgServerSwapExactAmountOut() { TokenInDenom: ptypes.Elys, }, }, - expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 989898), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 989899), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, expPass: true, }, { @@ -74,7 +74,7 @@ func (suite *AmmKeeperTestSuite) TestMsgServerSwapExactAmountOut() { desc: "multiple routes", senderInitBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, swapFee: sdkmath.LegacyZeroDec(), - tokenIn: sdk.NewInt64Coin(ptypes.BaseCurrency, 10206), + tokenIn: sdk.NewInt64Coin(ptypes.BaseCurrency, 10204), tokenInMax: sdkmath.NewInt(10000000), tokenOut: sdk.NewInt64Coin("uusdt", 10000), swapRoutes: []types.SwapAmountOutRoute{ @@ -87,7 +87,7 @@ func (suite *AmmKeeperTestSuite) TestMsgServerSwapExactAmountOut() { TokenInDenom: ptypes.Elys, }, }, - expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 989794), sdk.NewInt64Coin("uusdt", 10000)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 989796), sdk.NewInt64Coin("uusdt", 10000)}, expPass: true, }, } { diff --git a/x/amm/keeper/query_join_pool_estimation_test.go b/x/amm/keeper/query_join_pool_estimation_test.go index 23268d92b..75fbdc2e7 100644 --- a/x/amm/keeper/query_join_pool_estimation_test.go +++ b/x/amm/keeper/query_join_pool_estimation_test.go @@ -24,7 +24,7 @@ func TestJoinPoolEstimation(t *testing.T) { }) require.NoError(t, err) require.Equal(t, sdk.Coins(resp.AmountsIn).String(), "200denom1") - require.Equal(t, resp.ShareAmountOut.String(), "95445115010332227amm/pool/1") + require.Equal(t, resp.ShareAmountOut.String(), "95445115010332226amm/pool/1") // Test multiple coins join pool resp, err = k.JoinPoolEstimation(ctx, &types.QueryJoinPoolEstimationRequest{ diff --git a/x/amm/keeper/route_exact_amount_out_test.go b/x/amm/keeper/route_exact_amount_out_test.go index 14dd878e9..4334c35f4 100644 --- a/x/amm/keeper/route_exact_amount_out_test.go +++ b/x/amm/keeper/route_exact_amount_out_test.go @@ -65,12 +65,12 @@ func (suite *AmmKeeperTestSuite) TestRouteExactAmountOut() { treasuryInitBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, swapFeeIn: math.LegacyNewDecWithPrec(1, 2), // 1% swapFeeOut: math.LegacyZeroDec(), - tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10102), + tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10101), tokenInMax: math.NewInt(10000000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), weightBalanceBonus: math.LegacyZeroDec(), - expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 989898), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, - expPoolBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010102), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 989899), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, + expPoolBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010101), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, expTreasuryBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, expPass: true, }, @@ -81,12 +81,12 @@ func (suite *AmmKeeperTestSuite) TestRouteExactAmountOut() { treasuryInitBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, swapFeeIn: math.LegacyZeroDec(), swapFeeOut: math.LegacyZeroDec(), - tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10102), + tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10101), tokenInMax: math.NewInt(10000000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), weightBalanceBonus: math.LegacyZeroDec(), - expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 989898), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, - expPoolBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010102), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 989899), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, + expPoolBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010101), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, expTreasuryBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, expPass: true, }, @@ -97,12 +97,12 @@ func (suite *AmmKeeperTestSuite) TestRouteExactAmountOut() { treasuryInitBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, swapFeeIn: math.LegacyZeroDec(), swapFeeOut: math.LegacyZeroDec(), - tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10102), + tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10101), tokenInMax: math.NewInt(10000000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), weightBalanceBonus: math.LegacyNewDecWithPrec(3, 1), // 30% bonus - expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 989898), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, - expPoolBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010102), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 989899), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, + expPoolBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010101), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, expTreasuryBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, expPass: true, }, @@ -113,12 +113,12 @@ func (suite *AmmKeeperTestSuite) TestRouteExactAmountOut() { treasuryInitBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 100)}, swapFeeIn: math.LegacyZeroDec(), swapFeeOut: math.LegacyZeroDec(), - tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10102), + tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10101), tokenInMax: math.NewInt(10000000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), weightBalanceBonus: math.LegacyNewDecWithPrec(3, 1), // 30% bonus - expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 989898), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, - expPoolBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010102), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 989899), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, + expPoolBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010101), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, expTreasuryBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 100)}, expPass: true, }, diff --git a/x/amm/types/pow.go b/x/amm/types/pow.go index 88cd50bb8..11a16deaf 100644 --- a/x/amm/types/pow.go +++ b/x/amm/types/pow.go @@ -4,7 +4,6 @@ import ( "fmt" sdkmath "cosmossdk.io/math" - elystypes "github.com/elys-network/elys/types" ) // Pow computes base^(exp) @@ -39,7 +38,3 @@ func Pow(base sdkmath.LegacyDec, exp sdkmath.LegacyDec) sdkmath.LegacyDec { return integerPow.Mul(fractionalPow) } - -func PowDec34(base elystypes.Dec34, exp elystypes.Dec34) elystypes.Dec34 { - return elystypes.NewDec34FromLegacyDec(Pow(base.ToLegacyDec(), exp.ToLegacyDec())) -} diff --git a/x/amm/types/solve_constant_function_invariant.go b/x/amm/types/solve_constant_function_invariant.go index 29b8bd9ec..ea0c3773c 100644 --- a/x/amm/types/solve_constant_function_invariant.go +++ b/x/amm/types/solve_constant_function_invariant.go @@ -39,7 +39,7 @@ func solveConstantFunctionInvariant( y := tokenBalanceFixedBefore.Quo(tokenBalanceFixedAfter) // amountY = balanceY * (1 - (y ^ weightRatio)) - yToWeightRatio := PowDec34(y, weightRatio) + yToWeightRatio := elystypes.PowDec34(y, weightRatio) paranthetical := elystypes.OneDec34().Sub(yToWeightRatio) amountY := tokenBalanceUnknownBefore.Mul(paranthetical) return amountY, nil diff --git a/x/amm/types/swap_in_amt_given_out_test.go b/x/amm/types/swap_in_amt_given_out_test.go index ff914d609..cc06e2219 100644 --- a/x/amm/types/swap_in_amt_given_out_test.go +++ b/x/amm/types/swap_in_amt_given_out_test.go @@ -7,6 +7,7 @@ import ( "github.com/cometbft/cometbft/crypto/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" + elystypes "github.com/elys-network/elys/types" "github.com/elys-network/elys/x/amm/types" ptypes "github.com/elys-network/elys/x/parameter/types" ) @@ -21,7 +22,7 @@ func (suite *TestSuite) TestSwapInAmtGivenOut() { tokenOut sdk.Coin inTokenDenom string swapFee sdkmath.LegacyDec - expRecoveryBonus sdkmath.LegacyDec + expRecoveryBonus elystypes.Dec34 expTokenIn sdk.Coin expErr bool }{ @@ -57,8 +58,8 @@ func (suite *TestSuite) TestSwapInAmtGivenOut() { tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 100_000_000), // 100 USDC inTokenDenom: "uusdt", swapFee: sdkmath.LegacyZeroDec(), - expRecoveryBonus: sdkmath.LegacyMustNewDecFromStr("-0.000331056400904022"), - expTokenIn: sdk.NewInt64Coin("uusdt", 101043562), + expRecoveryBonus: elystypes.NewDec34FromString("-0.0003310563933869157211503902584191568"), + expTokenIn: sdk.NewInt64Coin("uusdt", 101043551), expErr: false, }, // scenario2 - oracle based @@ -93,8 +94,8 @@ func (suite *TestSuite) TestSwapInAmtGivenOut() { tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 100_000_000), // 100 USDC inTokenDenom: "uusdt", swapFee: sdkmath.LegacyZeroDec(), - expRecoveryBonus: sdkmath.LegacyMustNewDecFromStr("-0.006413552900341021"), - expTokenIn: sdk.NewInt64Coin("uusdt", 102008668), + expRecoveryBonus: elystypes.NewDec34FromString("-0.006413552800214017166854821505321781"), + expTokenIn: sdk.NewInt64Coin("uusdt", 102008657), expErr: false, }, // scenario3 - oracle based @@ -129,8 +130,8 @@ func (suite *TestSuite) TestSwapInAmtGivenOut() { tokenOut: sdk.NewInt64Coin("uusdt", 100_000_000), // 100 USDC inTokenDenom: ptypes.BaseCurrency, swapFee: sdkmath.LegacyZeroDec(), - expRecoveryBonus: sdkmath.LegacyMustNewDecFromStr("0.001558845726811990"), - expTokenIn: sdk.NewInt64Coin(ptypes.BaseCurrency, 101348300), + expRecoveryBonus: elystypes.NewDec34FromString("0.001558845726811989564174701707355285"), + expTokenIn: sdk.NewInt64Coin(ptypes.BaseCurrency, 101348290), expErr: false, }, // scenario1 - non-oracle based @@ -165,8 +166,8 @@ func (suite *TestSuite) TestSwapInAmtGivenOut() { tokenOut: sdk.NewInt64Coin("uusdt", 100_000_000), // 100 USDC inTokenDenom: ptypes.BaseCurrency, swapFee: sdkmath.LegacyNewDecWithPrec(1, 2), // 1% - expRecoveryBonus: sdkmath.LegacyZeroDec(), - expTokenIn: sdk.NewInt64Coin(ptypes.BaseCurrency, 36075037), + expRecoveryBonus: elystypes.ZeroDec34(), + expTokenIn: sdk.NewInt64Coin(ptypes.BaseCurrency, 36075036), expErr: false, }, @@ -188,7 +189,7 @@ func (suite *TestSuite) TestSwapInAmtGivenOut() { tokenOut: sdk.NewInt64Coin("uusdt", 0), inTokenDenom: ptypes.BaseCurrency, swapFee: sdkmath.LegacyNewDecWithPrec(1, 2), - expRecoveryBonus: sdkmath.LegacyZeroDec(), + expRecoveryBonus: elystypes.ZeroDec34(), expTokenIn: sdk.NewInt64Coin(ptypes.BaseCurrency, 0), expErr: true, }, diff --git a/x/amm/types/swap_out_amt_given_in_test.go b/x/amm/types/swap_out_amt_given_in_test.go index 9f95646b0..623155356 100644 --- a/x/amm/types/swap_out_amt_given_in_test.go +++ b/x/amm/types/swap_out_amt_given_in_test.go @@ -331,7 +331,7 @@ func (suite *TestSuite) TestWeightDistanceFromTarget() { for _, tc := range []struct { desc string poolAssets []types.PoolAsset - expDistance sdkmath.LegacyDec + expDistance elystypes.Dec34 }{ { desc: "zero balance for one asset", @@ -345,7 +345,7 @@ func (suite *TestSuite) TestWeightDistanceFromTarget() { Weight: sdkmath.NewInt(50), }, }, - expDistance: sdkmath.LegacyNewDecWithPrec(5, 1), + expDistance: elystypes.NewDec34WithPrec(5, 1), }, { desc: "zero for all assets", @@ -359,7 +359,7 @@ func (suite *TestSuite) TestWeightDistanceFromTarget() { Weight: sdkmath.NewInt(50), }, }, - expDistance: sdkmath.LegacyNewDecWithPrec(5, 1), + expDistance: elystypes.NewDec34WithPrec(5, 1), }, { desc: "all positive", @@ -373,7 +373,7 @@ func (suite *TestSuite) TestWeightDistanceFromTarget() { Weight: sdkmath.NewInt(50), }, }, - expDistance: sdkmath.LegacyNewDecWithPrec(25, 2), + expDistance: elystypes.NewDec34WithPrec(25, 2), }, { desc: "zero distance", @@ -387,7 +387,7 @@ func (suite *TestSuite) TestWeightDistanceFromTarget() { Weight: sdkmath.NewInt(50), }, }, - expDistance: sdkmath.LegacyZeroDec(), + expDistance: elystypes.ZeroDec34(), }, } { suite.Run(tc.desc, func() { @@ -417,7 +417,7 @@ func (suite *TestSuite) TestWeightDistanceFromTarget() { TotalWeight: sdkmath.ZeroInt(), } distance := pool.WeightDistanceFromTarget(suite.ctx, suite.app.OracleKeeper, tc.poolAssets) - suite.Require().Equal(distance, tc.expDistance) + suite.Require().Equal(distance.String(), tc.expDistance.String()) }) } } @@ -432,7 +432,7 @@ func (suite *TestSuite) TestSwapOutAmtGivenIn() { tokenIn sdk.Coin outTokenDenom string swapFee sdkmath.LegacyDec - expRecoveryBonus sdkmath.LegacyDec + expRecoveryBonus elystypes.Dec34 expTokenOut sdk.Coin expErr bool }{ @@ -468,7 +468,7 @@ func (suite *TestSuite) TestSwapOutAmtGivenIn() { tokenIn: sdk.NewInt64Coin("uusdt", 100_000_000), // 100 USDC outTokenDenom: ptypes.BaseCurrency, swapFee: sdkmath.LegacyZeroDec(), - expRecoveryBonus: sdkmath.LegacyMustNewDecFromStr("-0.000329390948666628"), + expRecoveryBonus: elystypes.NewDec34FromString("-0.0003293909486666284880839937742529153"), expTokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 98977287), expErr: false, }, @@ -504,7 +504,7 @@ func (suite *TestSuite) TestSwapOutAmtGivenIn() { tokenIn: sdk.NewInt64Coin("uusdt", 100_000_000), // 100 USDC outTokenDenom: ptypes.BaseCurrency, swapFee: sdkmath.LegacyZeroDec(), - expRecoveryBonus: sdkmath.LegacyMustNewDecFromStr("-0.006347556007845348"), + expRecoveryBonus: elystypes.NewDec34FromString("-0.006347556007845347576004236722241547"), expTokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 98054944), expErr: false, }, @@ -540,7 +540,7 @@ func (suite *TestSuite) TestSwapOutAmtGivenIn() { tokenIn: sdk.NewInt64Coin(ptypes.BaseCurrency, 100_000_000), // 100 USDC outTokenDenom: "uusdt", swapFee: sdkmath.LegacyZeroDec(), - expRecoveryBonus: sdkmath.LegacyMustNewDecFromStr("0.001558845726811990"), + expRecoveryBonus: elystypes.NewDec34FromString("0.001558845726811989564174701707355285"), expTokenOut: sdk.NewInt64Coin("uusdt", 98687060), expErr: false, }, @@ -576,7 +576,7 @@ func (suite *TestSuite) TestSwapOutAmtGivenIn() { tokenIn: sdk.NewInt64Coin(ptypes.BaseCurrency, 100_000_000), // 100 USDC outTokenDenom: "uusdt", swapFee: sdkmath.LegacyNewDecWithPrec(1, 2), // 1% - expRecoveryBonus: sdkmath.LegacyZeroDec(), + expRecoveryBonus: elystypes.ZeroDec34(), expTokenOut: sdk.NewInt64Coin("uusdt", 247913188), expErr: false, }, @@ -601,7 +601,7 @@ func (suite *TestSuite) TestSwapOutAmtGivenIn() { tokenIn: sdk.NewInt64Coin(ptypes.BaseCurrency, 0), outTokenDenom: "uusdt", swapFee: sdkmath.LegacyNewDecWithPrec(1, 2), - expRecoveryBonus: sdkmath.LegacyZeroDec(), + expRecoveryBonus: elystypes.ZeroDec34(), expTokenOut: sdk.NewInt64Coin("uusdt", 0), expErr: true, }, diff --git a/x/amm/types/utils.go b/x/amm/types/utils.go index 476fda918..742b3e766 100644 --- a/x/amm/types/utils.go +++ b/x/amm/types/utils.go @@ -73,12 +73,12 @@ func GetWeightBreakingFee(finalWeightIn, finalWeightOut, targetWeightIn, targetW if distanceDiff.IsPositive() { if !finalWeightOut.IsZero() && !finalWeightIn.IsZero() && !targetWeightOut.IsZero() && !targetWeightIn.IsZero() { weightBreakingFee = elystypes.NewDec34FromLegacyDec(params.WeightBreakingFeeMultiplier). - Mul(PowDec34(finalWeightIn.Mul(targetWeightOut).Quo(finalWeightOut).Quo(targetWeightIn), elystypes.NewDec34FromLegacyDec(params.WeightBreakingFeeExponent))) + Mul(elystypes.PowDec34(finalWeightIn.Mul(targetWeightOut).Quo(finalWeightOut).Quo(targetWeightIn), elystypes.NewDec34FromLegacyDec(params.WeightBreakingFeeExponent))) } } else { if !initialWeightOut.IsZero() && !initialWeightIn.IsZero() && !targetWeightOut.IsZero() && !targetWeightIn.IsZero() { weightBreakingFee = elystypes.NewDec34FromLegacyDec(params.WeightBreakingFeeMultiplier). - Mul(PowDec34(initialWeightOut.Mul(targetWeightIn).Quo(initialWeightIn).Quo(targetWeightOut), elystypes.NewDec34FromLegacyDec(params.WeightBreakingFeeExponent))) + Mul(elystypes.PowDec34(initialWeightOut.Mul(targetWeightIn).Quo(initialWeightIn).Quo(targetWeightOut), elystypes.NewDec34FromLegacyDec(params.WeightBreakingFeeExponent))) } } diff --git a/x/masterchef/keeper/abci_test.go b/x/masterchef/keeper/abci_test.go index 5219b2c8d..71b3d5f77 100644 --- a/x/masterchef/keeper/abci_test.go +++ b/x/masterchef/keeper/abci_test.go @@ -9,6 +9,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" simapp "github.com/elys-network/elys/app" + elystypes "github.com/elys-network/elys/types" ammtypes "github.com/elys-network/elys/x/amm/types" "github.com/elys-network/elys/x/masterchef/types" ptypes "github.com/elys-network/elys/x/parameter/types" @@ -359,7 +360,7 @@ func (suite *MasterchefKeeperTestSuite) TestExternalRewardsDistribution() { // Get Tvl for non-existent pool res := suite.app.MasterchefKeeper.GetPoolTVL(suite.ctx, 1000) - suite.Require().Equal(res, sdkmath.LegacyZeroDec()) + suite.Require().Equal(res, elystypes.ZeroDec34()) // increase timestamp suite.ctx = suite.ctx.WithBlockTime(suite.ctx.BlockTime().Add(time.Hour)) diff --git a/x/masterchef/keeper/query_test.go b/x/masterchef/keeper/query_test.go index 9d222f0ad..94e4f17ea 100644 --- a/x/masterchef/keeper/query_test.go +++ b/x/masterchef/keeper/query_test.go @@ -87,7 +87,7 @@ func (suite *MasterchefKeeperTestSuite) TestApr() { Denom: "ueden", }, response: &types.QueryAprResponse{ - Apr: elystypes.NewDec34FromString("0.3000000000000000000000000000").String(), + Apr: elystypes.NewDec34FromString("0.3").String(), }, err: nil, }, @@ -127,12 +127,12 @@ func (suite *MasterchefKeeperTestSuite) TestAprs() { UsdcAprUsdc: elystypes.ZeroDec34().String(), EdenAprUsdc: elystypes.ZeroDec34().String(), UsdcAprEdenb: elystypes.ZeroDec34().String(), - EdenAprEdenb: elystypes.NewDec34FromString("0.299999999999999995").String(), + EdenAprEdenb: elystypes.NewDec34FromString("0.3").String(), UsdcAprEden: elystypes.ZeroDec34().String(), - EdenAprEden: elystypes.NewDec34FromString("0.299999999999999995").String(), + EdenAprEden: elystypes.NewDec34FromString("0.3").String(), EdenbAprEden: elystypes.OneDec34().String(), UsdcAprElys: elystypes.ZeroDec34().String(), - EdenAprElys: elystypes.NewDec34FromString("0.299999999999999995").String(), + EdenAprElys: elystypes.NewDec34FromString("0.3").String(), EdenbAprElys: elystypes.OneDec34().String(), }, err: nil, diff --git a/x/perpetual/keeper/close_test.go b/x/perpetual/keeper/close_test.go index 74aafb067..7f9282bc0 100644 --- a/x/perpetual/keeper/close_test.go +++ b/x/perpetual/keeper/close_test.go @@ -93,7 +93,7 @@ func (suite *PerpetualKeeperTestSuite) TestClose() { } }, "", - math.NewInt(203), + math.NewInt(202), }, { "Close with price greater than open price and less than take profit price", @@ -134,7 +134,7 @@ func (suite *PerpetualKeeperTestSuite) TestClose() { } }, "", - math.NewInt(31), // less than at the same price + math.NewInt(29), // less than at the same price }, { "Close at take profit price", @@ -175,7 +175,7 @@ func (suite *PerpetualKeeperTestSuite) TestClose() { } }, "", - math.NewInt(91), + math.NewInt(90), }, { "Close at stopLoss price", @@ -216,7 +216,7 @@ func (suite *PerpetualKeeperTestSuite) TestClose() { } }, "", - math.NewInt(502), + math.NewInt(501), }, { "Sucess: close long position,at same price as open price", @@ -247,7 +247,7 @@ func (suite *PerpetualKeeperTestSuite) TestClose() { } }, "", - math.NewInt(203), + math.NewInt(202), }, { "Success: close short position at same price as open price", @@ -276,7 +276,7 @@ func (suite *PerpetualKeeperTestSuite) TestClose() { } }, "", - math.NewInt(4501), + math.NewInt(4503), }, { "Close with too much unpaid Liability to make custody amount 0", diff --git a/x/perpetual/keeper/open_consolidate_test.go b/x/perpetual/keeper/open_consolidate_test.go index fa8a01f25..064c09cbe 100644 --- a/x/perpetual/keeper/open_consolidate_test.go +++ b/x/perpetual/keeper/open_consolidate_test.go @@ -172,7 +172,7 @@ func (suite *PerpetualKeeperTestSuite) TestOpenConsolidateUsingOpen() { "", &types.MTP{ Collateral: math.NewInt(800), - Liabilities: math.NewInt(653), + Liabilities: math.NewInt(649), Custody: math.NewInt(4000), TakeProfitPrice: math.LegacyMustNewDecFromStr("0.692857142857142857"), }, @@ -211,7 +211,7 @@ func (suite *PerpetualKeeperTestSuite) TestOpenConsolidateUsingOpen() { "", &types.MTP{ Collateral: math.NewInt(800), - Liabilities: math.NewInt(407), + Liabilities: math.NewInt(406), Custody: math.NewInt(2800), TakeProfitPrice: math.LegacyMustNewDecFromStr("0.95"), }, diff --git a/x/perpetual/keeper/open_short_test.go b/x/perpetual/keeper/open_short_test.go index 654f1fffa..0da2804d1 100644 --- a/x/perpetual/keeper/open_short_test.go +++ b/x/perpetual/keeper/open_short_test.go @@ -58,8 +58,8 @@ func (suite *PerpetualKeeperTestSuite) TestOpenShort() { enablePoolMsg := leveragelpmoduletypes.MsgAddPool{ Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), Pool: leveragelpmoduletypes.AddPool{ - poolId, - math.LegacyMustNewDecFromStr("10"), + AmmPoolId: poolId, + LeverageMax: math.LegacyMustNewDecFromStr("10"), }, } _, err := leveragelpmodulekeeper.NewMsgServerImpl(*suite.app.LeveragelpKeeper).AddPool(suite.ctx, &enablePoolMsg) diff --git a/x/perpetual/keeper/query_open_estimation_test.go b/x/perpetual/keeper/query_open_estimation_test.go index 7e7df7b41..6330978b4 100644 --- a/x/perpetual/keeper/query_open_estimation_test.go +++ b/x/perpetual/keeper/query_open_estimation_test.go @@ -239,23 +239,23 @@ func TestOpenEstimation_Long5XAtom10Atom(t *testing.T) { require.NoError(t, err) require.Equal(t, &types.QueryOpenEstimationResponse{ Position: types.Position_LONG, - EffectiveLeverage: math.LegacyMustNewDecFromStr("5.080191844300654694"), + EffectiveLeverage: math.LegacyMustNewDecFromStr("5.080191534600483476"), TradingAsset: ptypes.ATOM, Collateral: sdk.NewCoin(ptypes.ATOM, math.NewInt(10_000_000)), PositionSize: sdk.NewCoin(ptypes.ATOM, math.NewInt(50_000_000)), - OpenPrice: math.LegacyMustNewDecFromStr("5.019731500000000000"), + OpenPrice: math.LegacyMustNewDecFromStr("5.019731425000000000"), TakeProfitPrice: tradingAssetPrice.MulInt64(3), - LiquidationPrice: math.LegacyMustNewDecFromStr("4.116179830000000000"), - EstimatedPnl: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(399210740)), + LiquidationPrice: math.LegacyMustNewDecFromStr("4.116179768500000000"), + EstimatedPnl: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(399210743)), HourlyInterestRate: math.LegacyZeroDec(), AvailableLiquidity: sdk.NewCoin(ptypes.ATOM, math.NewInt(10000000000)), - Slippage: elystypes.NewDec34FromString("0.001502510000000000").String(), + Slippage: elystypes.NewDec34FromString("0.0015025").String(), BorrowInterestRate: math.LegacyMustNewDecFromStr("0.000000000000000000"), FundingRate: math.LegacyMustNewDecFromStr("0.000000000000000000"), - PriceImpact: math.LegacyMustNewDecFromStr("-0.003946300000000000"), + PriceImpact: math.LegacyMustNewDecFromStr("-0.003946285000000000"), Custody: sdk.NewCoin(ptypes.ATOM, math.NewInt(50_000_000)), - Liabilities: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(200789260)), - WeightBreakingFee: elystypes.NewDec34FromString("0.001435619047211834").String(), + Liabilities: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(200789257)), + WeightBreakingFee: elystypes.NewDec34FromString("0.001435619047140196033471334892443643").String(), }, res) } @@ -364,21 +364,21 @@ func TestOpenEstimation_Long10XAtom1000Usdc(t *testing.T) { require.NoError(t, err) require.Equal(t, &types.QueryOpenEstimationResponse{ Position: types.Position_LONG, - EffectiveLeverage: math.LegacyMustNewDecFromStr("13.174476072179756700"), + EffectiveLeverage: math.LegacyMustNewDecFromStr("13.174469999202689631"), TradingAsset: ptypes.ATOM, Collateral: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(1_000_000_000)), - PositionSize: sdk.NewCoin(ptypes.ATOM, math.NewInt(2218508320)), - OpenPrice: math.LegacyMustNewDecFromStr("4.507533241975851594"), + PositionSize: sdk.NewCoin(ptypes.ATOM, math.NewInt(2218508404)), + OpenPrice: math.LegacyMustNewDecFromStr("4.507533071305868265"), TakeProfitPrice: tradingAssetPrice.MulInt64(3), - LiquidationPrice: math.LegacyMustNewDecFromStr("4.158199415722723095"), + LiquidationPrice: math.LegacyMustNewDecFromStr("4.158199258279663474"), HourlyInterestRate: math.LegacyZeroDec(), - EstimatedPnl: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(19217754574)), + EstimatedPnl: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(19217755680)), AvailableLiquidity: sdk.NewCoin(ptypes.ATOM, math.NewInt(600_000_000000)), - Slippage: elystypes.NewDec34FromString("0.025099947050000000").String(), + Slippage: elystypes.NewDec34FromString("0.02509991017400000000000000000000037").String(), BorrowInterestRate: math.LegacyMustNewDecFromStr("0.000000000000000000"), FundingRate: math.LegacyMustNewDecFromStr("0.000000000000000000"), - PriceImpact: math.LegacyMustNewDecFromStr("-0.026772948058280545"), - Custody: sdk.NewCoin(ptypes.ATOM, math.NewInt(2218508320)), + PriceImpact: math.LegacyMustNewDecFromStr("-0.026772909181291177"), + Custody: sdk.NewCoin(ptypes.ATOM, math.NewInt(2218508404)), Liabilities: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(9000000000)), WeightBreakingFee: elystypes.ZeroDec34().String(), }, res) @@ -503,22 +503,22 @@ func TestOpenEstimation_Short5XAtom10Usdc(t *testing.T) { require.NoError(t, err) expectedRes := &types.QueryOpenEstimationResponse{ Position: types.Position_SHORT, - EffectiveLeverage: math.LegacyMustNewDecFromStr("4.081549468096431751"), + EffectiveLeverage: math.LegacyMustNewDecFromStr("4.081548693432199945"), TradingAsset: ptypes.ATOM, Collateral: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(100_000_000)), - PositionSize: sdk.NewCoin(ptypes.ATOM, math.NewInt(80320963)), - OpenPrice: math.LegacyMustNewDecFromStr("4.980019973117105182"), + PositionSize: sdk.NewCoin(ptypes.ATOM, math.NewInt(80320960)), + OpenPrice: math.LegacyMustNewDecFromStr("4.980020159121604124"), TakeProfitPrice: tradingAssetPrice.QuoInt64(3), - LiquidationPrice: math.LegacyMustNewDecFromStr("6.073195089167201442"), - EstimatedPnl: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(266131729)), + LiquidationPrice: math.LegacyMustNewDecFromStr("6.073195316001956249"), + EstimatedPnl: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(266131734)), HourlyInterestRate: math.LegacyZeroDec(), AvailableLiquidity: sdk.NewCoin(ptypes.ATOM, math.NewInt(10000000000)), - Slippage: elystypes.NewDec34FromString("0.003008025000000000").String(), + Slippage: elystypes.NewDec34FromString("0.003008").String(), BorrowInterestRate: math.LegacyMustNewDecFromStr("0.000000000000000000"), FundingRate: math.LegacyMustNewDecFromStr("0.000000000000000000"), - PriceImpact: math.LegacyMustNewDecFromStr("0.003996005376578964"), + PriceImpact: math.LegacyMustNewDecFromStr("0.003995968175679175"), Custody: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(500000000)), - Liabilities: sdk.NewCoin(ptypes.ATOM, math.NewInt(80320963)), + Liabilities: sdk.NewCoin(ptypes.ATOM, math.NewInt(80320960)), WeightBreakingFee: elystypes.ZeroDec34().String(), } require.Equal(t, expectedRes, res) diff --git a/x/tier/keeper/query_staked_pool_test.go b/x/tier/keeper/query_staked_pool_test.go index a07b84f55..123b742aa 100644 --- a/x/tier/keeper/query_staked_pool_test.go +++ b/x/tier/keeper/query_staked_pool_test.go @@ -54,6 +54,6 @@ func (suite *TierKeeperTestSuite) TestQueryStakedPoolSuccessful() { }) suite.Require().NoError(err) - suite.Require().Equal("59.999999999997483295", stakedPoolResponse.Total) + suite.Require().Equal("59.99999999999748335499999999999748", stakedPoolResponse.Total) } diff --git a/x/tier/keeper/query_staked_test.go b/x/tier/keeper/query_staked_test.go index 35b1ee960..8c8a15e12 100644 --- a/x/tier/keeper/query_staked_test.go +++ b/x/tier/keeper/query_staked_test.go @@ -37,5 +37,5 @@ func (suite *TierKeeperTestSuite) TestQueryStaked() { User: sender.String(), }) suite.Require().NoError(err) - suite.Require().Equal(r.Commitments, math.NewInt(100)) + suite.Require().Equal(r.Commitments, math.NewInt(100).String()) } From 58c9688c2595d25d820d5d4a00e6cc8c218a1641 Mon Sep 17 00:00:00 2001 From: Cosmic Vagabond <121588426+cosmic-vagabond@users.noreply.github.com> Date: Thu, 9 Jan 2025 15:57:45 +0100 Subject: [PATCH 10/18] refactor: pow --- types/dec34.go | 8 ++++++ types/dec34_test.go | 26 +++++++++++++------ .../solve_constant_function_invariant.go | 2 +- x/amm/types/utils.go | 4 +-- 4 files changed, 29 insertions(+), 11 deletions(-) diff --git a/types/dec34.go b/types/dec34.go index 7de61069f..a2abfced8 100644 --- a/types/dec34.go +++ b/types/dec34.go @@ -77,6 +77,14 @@ func PowDec34(base, exp Dec34) Dec34 { return NewDec34FromString(d.Text('f')) } +func (d Dec34) Pow(exp Dec34) Dec34 { + return PowDec34(d, exp) +} + +func (d Dec34) PowLegacyDec(exp math.LegacyDec) Dec34 { + return PowDec34(d, NewDec34FromLegacyDec(exp)) +} + func (d Dec34) String() string { x, _ := regenmath.Dec(d).Reduce() return x.String() diff --git a/types/dec34_test.go b/types/dec34_test.go index e54733f14..000d32f5e 100644 --- a/types/dec34_test.go +++ b/types/dec34_test.go @@ -214,20 +214,30 @@ func TestDec34(t *testing.T) { require.Equal(t, NewDec34FromInt64(2), MaxDec34(NewDec34FromInt64(2), NewDec34FromInt64(1))) // Test integer powers - require.Equal(t, "8", Pow(NewDec34FromInt64(2), NewDec34FromInt64(3)).String()) - require.Equal(t, "16", Pow(NewDec34FromInt64(2), NewDec34FromInt64(4)).String()) - require.Equal(t, "27", Pow(NewDec34FromInt64(3), NewDec34FromInt64(3)).String()) + require.Equal(t, "8", PowDec34(NewDec34FromInt64(2), NewDec34FromInt64(3)).String()) + require.Equal(t, "16", PowDec34(NewDec34FromInt64(2), NewDec34FromInt64(4)).String()) + require.Equal(t, "27", PowDec34(NewDec34FromInt64(3), NewDec34FromInt64(3)).String()) // Test decimal powers require.Equal(t, "1.414213562373095048801688724209698078569671875376948073176679737990732478462107038850387534327641573", - Pow(NewDec34FromInt64(2), NewDec34FromString("0.5")).String()) + PowDec34(NewDec34FromInt64(2), NewDec34FromString("0.5")).String()) require.Equal(t, "3.162277660168379331998893544432718533719555139325216826857504852792594438639238221344248108379300295", - Pow(NewDec34FromInt64(10), NewDec34FromString("0.5")).String()) + PowDec34(NewDec34FromInt64(10), NewDec34FromString("0.5")).String()) // Test powers with decimal base - require.Equal(t, "3.375", Pow(NewDec34FromString("1.5"), NewDec34FromInt64(3)).String()) + require.Equal(t, "3.375", PowDec34(NewDec34FromString("1.5"), NewDec34FromInt64(3)).String()) // Test power of 1 and 0 - require.Equal(t, "1", Pow(NewDec34FromInt64(5), NewDec34FromInt64(0)).String()) - require.Equal(t, "5", Pow(NewDec34FromInt64(5), NewDec34FromInt64(1)).String()) + require.Equal(t, "1", PowDec34(NewDec34FromInt64(5), NewDec34FromInt64(0)).String()) + require.Equal(t, "5", PowDec34(NewDec34FromInt64(5), NewDec34FromInt64(1)).String()) + + // Test Pow method + require.Equal(t, "8", NewDec34FromInt64(2).Pow(NewDec34FromInt64(3)).String()) + require.Equal(t, "16", NewDec34FromInt64(2).Pow(NewDec34FromInt64(4)).String()) + require.Equal(t, "27", NewDec34FromInt64(3).Pow(NewDec34FromInt64(3)).String()) + + // Test PowLegacyDec method + require.Equal(t, "8", NewDec34FromInt64(2).PowLegacyDec(math.LegacyNewDec(3)).String()) + require.Equal(t, "16", NewDec34FromInt64(2).PowLegacyDec(math.LegacyNewDec(4)).String()) + require.Equal(t, "27", NewDec34FromInt64(3).PowLegacyDec(math.LegacyNewDec(3)).String()) } diff --git a/x/amm/types/solve_constant_function_invariant.go b/x/amm/types/solve_constant_function_invariant.go index ea0c3773c..6baf973b3 100644 --- a/x/amm/types/solve_constant_function_invariant.go +++ b/x/amm/types/solve_constant_function_invariant.go @@ -39,7 +39,7 @@ func solveConstantFunctionInvariant( y := tokenBalanceFixedBefore.Quo(tokenBalanceFixedAfter) // amountY = balanceY * (1 - (y ^ weightRatio)) - yToWeightRatio := elystypes.PowDec34(y, weightRatio) + yToWeightRatio := y.Pow(weightRatio) paranthetical := elystypes.OneDec34().Sub(yToWeightRatio) amountY := tokenBalanceUnknownBefore.Mul(paranthetical) return amountY, nil diff --git a/x/amm/types/utils.go b/x/amm/types/utils.go index 742b3e766..45c59c6da 100644 --- a/x/amm/types/utils.go +++ b/x/amm/types/utils.go @@ -73,12 +73,12 @@ func GetWeightBreakingFee(finalWeightIn, finalWeightOut, targetWeightIn, targetW if distanceDiff.IsPositive() { if !finalWeightOut.IsZero() && !finalWeightIn.IsZero() && !targetWeightOut.IsZero() && !targetWeightIn.IsZero() { weightBreakingFee = elystypes.NewDec34FromLegacyDec(params.WeightBreakingFeeMultiplier). - Mul(elystypes.PowDec34(finalWeightIn.Mul(targetWeightOut).Quo(finalWeightOut).Quo(targetWeightIn), elystypes.NewDec34FromLegacyDec(params.WeightBreakingFeeExponent))) + Mul(finalWeightIn.Mul(targetWeightOut).Quo(finalWeightOut).Quo(targetWeightIn).PowLegacyDec(params.WeightBreakingFeeExponent)) } } else { if !initialWeightOut.IsZero() && !initialWeightIn.IsZero() && !targetWeightOut.IsZero() && !targetWeightIn.IsZero() { weightBreakingFee = elystypes.NewDec34FromLegacyDec(params.WeightBreakingFeeMultiplier). - Mul(elystypes.PowDec34(initialWeightOut.Mul(targetWeightIn).Quo(initialWeightIn).Quo(targetWeightOut), elystypes.NewDec34FromLegacyDec(params.WeightBreakingFeeExponent))) + Mul(initialWeightOut.Mul(targetWeightIn).Quo(initialWeightIn).Quo(targetWeightOut).PowLegacyDec(params.WeightBreakingFeeExponent)) } } From 19ecfdce8a9a5da182a4f78574d842a2bfd1ff0c Mon Sep 17 00:00:00 2001 From: Cosmic Vagabond <121588426+cosmic-vagabond@users.noreply.github.com> Date: Thu, 9 Jan 2025 16:29:13 +0100 Subject: [PATCH 11/18] test: fix tests --- x/amm/keeper/estimate_price.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/x/amm/keeper/estimate_price.go b/x/amm/keeper/estimate_price.go index 5eef8e294..e149c64f3 100644 --- a/x/amm/keeper/estimate_price.go +++ b/x/amm/keeper/estimate_price.go @@ -67,12 +67,12 @@ func (k Keeper) GetTokenPrice(ctx sdk.Context, tokenInDenom, baseCurrency string } func (k Keeper) CalculateUSDValue(ctx sdk.Context, denom string, amount sdkmath.Int) elystypes.Dec34 { - asset, found := k.assetProfileKeeper.GetEntryByDenom(ctx, denom) - if !found { - return elystypes.ZeroDec34() - } tokenPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, denom) if tokenPrice.IsZero() { + asset, found := k.assetProfileKeeper.GetEntryByDenom(ctx, denom) + if !found { + return elystypes.ZeroDec34() + } tokenPrice = k.CalcAmmPrice(ctx, asset.Denom, asset.Decimals) } return tokenPrice.MulInt(amount) From 4333e09720c1e4bbbb5e5e77f6e2ba47d1aa8710 Mon Sep 17 00:00:00 2001 From: Cosmic Vagabond <121588426+cosmic-vagabond@users.noreply.github.com> Date: Fri, 10 Jan 2025 07:21:29 +0100 Subject: [PATCH 12/18] refactor: move decimal normalization away from price functions --- x/amm/keeper/estimate_price.go | 46 ++++++------------- x/amm/keeper/estimate_price_test.go | 10 ++-- x/amm/keeper/msg_server_create_pool_test.go | 1 + x/amm/keeper/pool.go | 10 ++-- .../keeper/track_weight_breaking_slippage.go | 4 +- x/amm/types/amm_price.go | 4 +- x/amm/types/amm_price_test.go | 22 ++++----- x/amm/types/calc_exit_pool.go | 7 ++- x/amm/types/calc_exit_pool_test.go | 16 +++---- x/amm/types/expected_keepers.go | 2 +- x/amm/types/mocks/oracle_keeper.go | 20 ++++++-- x/amm/types/one_token_unit.go | 9 ++++ x/amm/types/pool.go | 6 +-- x/amm/types/pool_join_pool.go | 4 +- x/amm/types/pool_test.go | 4 +- x/amm/types/swap_in_amt_given_out.go | 19 +++++--- x/amm/types/swap_out_amt_given_in.go | 20 ++++---- x/leveragelp/keeper/hooks_amm.go | 4 +- x/leveragelp/keeper/query_position.go | 5 +- x/leveragelp/keeper/utils.go | 4 +- x/masterchef/keeper/abci.go | 22 ++++++--- x/masterchef/keeper/apr_denom.go | 23 ++++------ x/masterchef/keeper/apr_stable_stake.go | 6 ++- x/masterchef/keeper/query_chain_tvl.go | 5 +- x/masterchef/keeper/query_pool_rewards.go | 6 +-- x/masterchef/types/expected_keepers.go | 6 +-- x/oracle/keeper/price.go | 15 +++--- x/oracle/types/pow.go | 13 ------ x/perpetual/types/expected_keepers.go | 2 +- x/stablestake/keeper/tvl.go | 4 +- x/stablestake/types/expected_keepers.go | 2 +- x/tier/keeper/portfolio.go | 37 ++++++++------- x/tier/keeper/query_get_consolidated_price.go | 5 +- x/tier/keeper/query_get_users_pool_data.go | 4 +- x/tier/types/expected_keepers.go | 4 +- 35 files changed, 189 insertions(+), 182 deletions(-) create mode 100644 x/amm/types/one_token_unit.go delete mode 100644 x/oracle/types/pow.go diff --git a/x/amm/keeper/estimate_price.go b/x/amm/keeper/estimate_price.go index e149c64f3..17ffae89a 100644 --- a/x/amm/keeper/estimate_price.go +++ b/x/amm/keeper/estimate_price.go @@ -28,46 +28,36 @@ func (k Keeper) EstimatePrice(ctx sdk.Context, tokenInDenom, baseCurrency string return rate } -func (k Keeper) GetEdenDenomPrice(ctx sdk.Context, baseCurrency string) elystypes.Dec34 { +func (k Keeper) GetEdenDenomPrice(ctx sdk.Context, baseCurrency string) (elystypes.Dec34, uint64) { // Calc ueden / uusdc rate edenUsdcRate := k.EstimatePrice(ctx, ptypes.Elys, baseCurrency) if edenUsdcRate.IsZero() { edenUsdcRate = elystypes.OneDec34() } - usdcDenomPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) + usdcDenomPrice, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) if usdcDenomPrice.IsZero() { - usdcDecimal := int32(6) - usdcEntry, found := k.assetProfileKeeper.GetEntry(ctx, ptypes.BaseCurrency) - if found { - usdcDecimal = int32(usdcEntry.Decimals) - } - usdcDenomPrice = elystypes.NewDec34WithPrec(1, usdcDecimal) + usdcDenomPrice = elystypes.OneDec34() } - return edenUsdcRate.Mul(usdcDenomPrice) + return edenUsdcRate.Mul(usdcDenomPrice), decimals } -func (k Keeper) GetTokenPrice(ctx sdk.Context, tokenInDenom, baseCurrency string) elystypes.Dec34 { - oraclePrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, tokenInDenom) - if !oraclePrice.IsZero() { - return oraclePrice +func (k Keeper) GetTokenPrice(ctx sdk.Context, tokenInDenom, baseCurrency string) (elystypes.Dec34, uint64) { + oraclePrice, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, tokenInDenom) + if oraclePrice.IsPositive() { + return oraclePrice, decimals } // Calc tokenIn / uusdc rate tokenUsdcRate := k.EstimatePrice(ctx, tokenInDenom, baseCurrency) - usdcDenomPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) + usdcDenomPrice, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) if usdcDenomPrice.IsZero() { - usdcDecimal := int32(6) - usdcEntry, found := k.assetProfileKeeper.GetEntry(ctx, ptypes.BaseCurrency) - if found { - usdcDecimal = int32(usdcEntry.Decimals) - } - usdcDenomPrice = elystypes.NewDec34WithPrec(1, usdcDecimal) + usdcDenomPrice = elystypes.OneDec34() } - return tokenUsdcRate.Mul(usdcDenomPrice) + return tokenUsdcRate.Mul(usdcDenomPrice), decimals } func (k Keeper) CalculateUSDValue(ctx sdk.Context, denom string, amount sdkmath.Int) elystypes.Dec34 { - tokenPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, denom) + tokenPrice, _ := k.oracleKeeper.GetAssetPriceFromDenom(ctx, denom) if tokenPrice.IsZero() { asset, found := k.assetProfileKeeper.GetEntryByDenom(ctx, denom) if !found { @@ -83,14 +73,14 @@ func (k Keeper) CalcAmmPrice(ctx sdk.Context, denom string, decimal uint64) elys if !found || denom == usdcDenom { return elystypes.ZeroDec34() } - usdcPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, usdcDenom) + usdcPrice, _ := k.oracleKeeper.GetAssetPriceFromDenom(ctx, usdcDenom) resp, err := k.InRouteByDenom(ctx, &types.QueryInRouteByDenomRequest{DenomIn: denom, DenomOut: usdcDenom}) if err != nil { return elystypes.ZeroDec34() } routes := resp.InRoute - tokenIn := sdk.NewCoin(denom, sdkmath.NewInt(Pow10AsLegacyDec(decimal).TruncateInt64())) + tokenIn := sdk.NewCoin(denom, types.OneTokenUnit(decimal)) discount := sdkmath.LegacyNewDec(1) spotPrice, _, _, _, _, _, _, _, err := k.CalcInRouteSpotPrice(ctx, tokenIn, routes, discount, sdkmath.LegacyZeroDec()) if err != nil { @@ -98,11 +88,3 @@ func (k Keeper) CalcAmmPrice(ctx sdk.Context, denom string, decimal uint64) elys } return spotPrice.Mul(usdcPrice) } - -func Pow10AsLegacyDec(decimal uint64) (value sdkmath.LegacyDec) { - value = sdkmath.LegacyNewDec(1) - for i := 0; i < int(decimal); i++ { - value = value.Mul(sdkmath.LegacyNewDec(10)) - } - return -} diff --git a/x/amm/keeper/estimate_price_test.go b/x/amm/keeper/estimate_price_test.go index ba7beedc8..e75037c7c 100644 --- a/x/amm/keeper/estimate_price_test.go +++ b/x/amm/keeper/estimate_price_test.go @@ -18,7 +18,7 @@ func (suite *AmmKeeperTestSuite) TestEstimatePrice() { suite.ResetSuite() }, func() { - price := suite.app.AmmKeeper.GetTokenPrice(suite.ctx, ptypes.BaseCurrency, ptypes.BaseCurrency) + price, _ := suite.app.AmmKeeper.GetTokenPrice(suite.ctx, ptypes.BaseCurrency, ptypes.BaseCurrency) suite.Require().Equal(elystypes.ZeroDec34().String(), price.String()) }, }, @@ -29,8 +29,8 @@ func (suite *AmmKeeperTestSuite) TestEstimatePrice() { suite.SetupCoinPrices() }, func() { - price := suite.app.AmmKeeper.GetTokenPrice(suite.ctx, ptypes.BaseCurrency, ptypes.BaseCurrency) - suite.Require().Equal(elystypes.NewDec34FromString("0.000001000000000000").String(), price.String()) + price, _ := suite.app.AmmKeeper.GetTokenPrice(suite.ctx, ptypes.BaseCurrency, ptypes.BaseCurrency) + suite.Require().Equal(elystypes.OneDec34().String(), price.String()) }, }, { @@ -41,7 +41,7 @@ func (suite *AmmKeeperTestSuite) TestEstimatePrice() { }, func() { suite.app.OracleKeeper.RemoveAssetInfo(suite.ctx, ptypes.BaseCurrency) - price := suite.app.AmmKeeper.GetTokenPrice(suite.ctx, ptypes.BaseCurrency, ptypes.BaseCurrency) + price, _ := suite.app.AmmKeeper.GetTokenPrice(suite.ctx, ptypes.BaseCurrency, ptypes.BaseCurrency) suite.Require().Equal(elystypes.ZeroDec34().String(), price.String()) }, }, @@ -69,7 +69,7 @@ func (suite *AmmKeeperTestSuite) TestCalculateUSDValue() { }, func() { value := suite.app.AmmKeeper.CalculateUSDValue(suite.ctx, ptypes.BaseCurrency, math.NewInt(1000)) - suite.Require().Equal(value.String(), elystypes.NewDec34FromString("0.001000000000000000").String()) + suite.Require().Equal(value.String(), elystypes.NewDec34FromInt64(1000).String()) }, }, { diff --git a/x/amm/keeper/msg_server_create_pool_test.go b/x/amm/keeper/msg_server_create_pool_test.go index 4ff9f33c0..ed7e84d95 100644 --- a/x/amm/keeper/msg_server_create_pool_test.go +++ b/x/amm/keeper/msg_server_create_pool_test.go @@ -213,6 +213,7 @@ func (suite *AmmKeeperTestSuite) TestMsgServerCreatePool() { } { suite.Run(tc.desc, func() { suite.SetupTest() + suite.SetupAssetProfile() suite.SetupStableCoinPrices() a := suite.app.OracleKeeper.GetAllAssetInfo(suite.ctx) diff --git a/x/amm/keeper/pool.go b/x/amm/keeper/pool.go index 8b52b21bc..3755e0237 100644 --- a/x/amm/keeper/pool.go +++ b/x/amm/keeper/pool.go @@ -47,35 +47,37 @@ func (k Keeper) RemovePool(ctx sdk.Context, poolId uint64) { } // GetAllPool returns all pool -func (k Keeper) GetAllPool(ctx sdk.Context) (list []types.Pool) { +func (k Keeper) GetAllPool(ctx sdk.Context) []types.Pool { store := prefix.NewStore(runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)), types.KeyPrefix(types.PoolKeyPrefix)) iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() + list := []types.Pool{} for ; iterator.Valid(); iterator.Next() { var val types.Pool k.cdc.MustUnmarshal(iterator.Value(), &val) list = append(list, val) } - return + return list } // GetAllLegacyPool returns all legacy pool -func (k Keeper) GetAllLegacyPool(ctx sdk.Context) (list []types.LegacyPool) { +func (k Keeper) GetAllLegacyPool(ctx sdk.Context) []types.LegacyPool { store := prefix.NewStore(runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)), types.KeyPrefix(types.PoolKeyPrefix)) iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() + list := []types.LegacyPool{} for ; iterator.Valid(); iterator.Next() { var val types.LegacyPool k.cdc.MustUnmarshal(iterator.Value(), &val) list = append(list, val) } - return + return list } // GetLatestPool retrieves the latest pool item from the list of pools diff --git a/x/amm/keeper/track_weight_breaking_slippage.go b/x/amm/keeper/track_weight_breaking_slippage.go index e1b128db1..dadcb69b6 100644 --- a/x/amm/keeper/track_weight_breaking_slippage.go +++ b/x/amm/keeper/track_weight_breaking_slippage.go @@ -53,11 +53,11 @@ func (k Keeper) AddWeightAndSlippageFee(ctx sdk.Context, track types.WeightBreak } func (k Keeper) TrackWeightBreakingSlippage(ctx sdk.Context, poolId uint64, token sdk.Coin) { - price := k.oracleKeeper.GetAssetPriceFromDenom(ctx, token.Denom) + price, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, token.Denom) track := types.WeightBreakingSlippage{ PoolId: poolId, Date: ctx.BlockTime().Format("2006-01-02"), - Amount: price.MulInt(token.Amount).ToLegacyDec(), + Amount: price.MulInt(token.Amount).QuoInt(types.OneTokenUnit(decimals)).ToLegacyDec(), } k.AddWeightAndSlippageFee(ctx, track) } diff --git a/x/amm/types/amm_price.go b/x/amm/types/amm_price.go index f7a5951b1..2b4030083 100644 --- a/x/amm/types/amm_price.go +++ b/x/amm/types/amm_price.go @@ -28,11 +28,11 @@ func (p *Pool) GetTokenARate( )), nil } - priceA := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenA) + priceA, _ := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenA) if priceA.IsZero() { return elystypes.ZeroDec34(), fmt.Errorf("token price not set: %s", tokenA) } - priceB := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenB) + priceB, _ := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenB) if priceB.IsZero() { return elystypes.ZeroDec34(), fmt.Errorf("token price not set: %s", tokenB) } diff --git a/x/amm/types/amm_price_test.go b/x/amm/types/amm_price_test.go index 9750cdca5..70da37f27 100644 --- a/x/amm/types/amm_price_test.go +++ b/x/amm/types/amm_price_test.go @@ -44,8 +44,8 @@ func TestGetTokenARate(t *testing.T) { { "oracle pricing", func(oracleKeeper *mocks.OracleKeeper) { - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromInt64(10)) - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(elystypes.NewDec34FromInt64(5)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromInt64(10), uint64(0)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(elystypes.NewDec34FromInt64(5), uint64(0)) }, &types.Pool{ PoolParams: types.PoolParams{UseOracle: true}, @@ -58,7 +58,7 @@ func TestGetTokenARate(t *testing.T) { { "token price not set for tokenA", func(oracleKeeper *mocks.OracleKeeper) { - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "unknownToken").Return(elystypes.ZeroDec34()) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "unknownToken").Return(elystypes.ZeroDec34(), uint64(0)) }, &types.Pool{ PoolParams: types.PoolParams{UseOracle: true}, @@ -71,8 +71,8 @@ func TestGetTokenARate(t *testing.T) { { "token price not set for tokenB", func(oracleKeeper *mocks.OracleKeeper) { - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromInt64(5)) - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "unknownToken").Return(elystypes.ZeroDec34()) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromInt64(5), uint64(0)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "unknownToken").Return(elystypes.ZeroDec34(), uint64(0)) }, &types.Pool{ PoolParams: types.PoolParams{UseOracle: true}, @@ -85,8 +85,8 @@ func TestGetTokenARate(t *testing.T) { { "Success with oracle pricing", func(oracleKeeper *mocks.OracleKeeper) { - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromInt64(5)) - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(elystypes.NewDec34FromInt64(2)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromInt64(5), uint64(0)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(elystypes.NewDec34FromInt64(2), uint64(0)) }, &types.Pool{ PoolParams: types.PoolParams{UseOracle: true}, @@ -99,8 +99,8 @@ func TestGetTokenARate(t *testing.T) { { "Success with oracle pricing", func(oracleKeeper *mocks.OracleKeeper) { - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromInt64(5)) - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(elystypes.NewDec34FromInt64(2)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromInt64(5), uint64(0)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(elystypes.NewDec34FromInt64(2), uint64(0)) }, &types.Pool{ PoolParams: types.PoolParams{UseOracle: true}, @@ -114,8 +114,8 @@ func TestGetTokenARate(t *testing.T) { "Success with oracle pricing with price less than 1", func(oracleKeeper *mocks.OracleKeeper) { // for 6 decimal tokens - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromString("0.0000002")) - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(elystypes.OneDec34()) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromString("0.0000002"), uint64(0)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(elystypes.OneDec34(), uint64(0)) }, &types.Pool{ PoolParams: types.PoolParams{UseOracle: true}, diff --git a/x/amm/types/calc_exit_pool.go b/x/amm/types/calc_exit_pool.go index b7ad930f3..bd465e03f 100644 --- a/x/amm/types/calc_exit_pool.go +++ b/x/amm/types/calc_exit_pool.go @@ -60,7 +60,7 @@ func CalcExitPool( accountedAssets := pool.GetAccountedBalance(ctx, accountedPoolKeeper, pool.PoolAssets) initialWeightDistance := pool.WeightDistanceFromTarget(ctx, oracleKeeper, accountedAssets) - tokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenOutDenom) + tokenPrice, decimals := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenOutDenom) exitValueWithoutSlippage, err := CalcExitValueWithoutSlippage(ctx, oracleKeeper, accountedPoolKeeper, pool, exitingShares, tokenOutDenom) if err != nil { return sdk.Coins{}, elystypes.ZeroDec34(), err @@ -71,7 +71,7 @@ func CalcExitPool( return sdk.Coins{}, elystypes.ZeroDec34(), ErrAmountTooLow } - oracleOutAmount := exitValueWithoutSlippage.Quo(tokenPrice) + oracleOutAmount := exitValueWithoutSlippage.Quo(tokenPrice.QuoInt(OneTokenUnit(decimals))) newAssetPools, err := pool.NewPoolAssetsAfterSwap(ctx, sdk.Coins{}, @@ -100,6 +100,9 @@ func CalcExitPool( sdk.NewCoins(), sdk.NewCoins(), accountedAssets, ) + if err != nil { + return sdk.Coins{}, elystypes.ZeroDec34(), err + } initialWeightOut := GetDenomOracleAssetWeight(ctx, pool.PoolId, oracleKeeper, initialAssetPools, tokenOutDenom) initialWeightIn := elystypes.OneDec34().Sub(initialWeightOut) weightBreakingFee := GetWeightBreakingFee(finalWeightIn, finalWeightOut, targetWeightIn, targetWeightOut, initialWeightIn, initialWeightOut, distanceDiff, params) diff --git a/x/amm/types/calc_exit_pool_test.go b/x/amm/types/calc_exit_pool_test.go index f34f3db14..e26e09fc9 100644 --- a/x/amm/types/calc_exit_pool_test.go +++ b/x/amm/types/calc_exit_pool_test.go @@ -28,8 +28,8 @@ func TestCalcExitValueWithoutSlippage(t *testing.T) { { "successful exit value calculation", func(oracleKeeper *mocks.OracleKeeper, accKeeper *mocks.AccountedPoolKeeper) { - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromInt64(10)) - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(elystypes.NewDec34FromInt64(5)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromInt64(10), uint64(0)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(elystypes.NewDec34FromInt64(5), uint64(0)) accKeeper.On("GetAccountedBalance", mock.Anything, mock.Anything, "tokenA").Return(sdkmath.NewInt(1000)) accKeeper.On("GetAccountedBalance", mock.Anything, mock.Anything, "tokenB").Return(sdkmath.NewInt(2000)) }, @@ -49,8 +49,8 @@ func TestCalcExitValueWithoutSlippage(t *testing.T) { { "total shares is zero", func(oracleKeeper *mocks.OracleKeeper, accKeeper *mocks.AccountedPoolKeeper) { - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromInt64(10)) - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(elystypes.NewDec34FromInt64(5)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromInt64(10), uint64(0)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(elystypes.NewDec34FromInt64(5), uint64(0)) accKeeper.On("GetAccountedBalance", mock.Anything, mock.Anything, "tokenA").Return(sdkmath.NewInt(1000)) accKeeper.On("GetAccountedBalance", mock.Anything, mock.Anything, "tokenB").Return(sdkmath.NewInt(2000)) }, @@ -70,8 +70,8 @@ func TestCalcExitValueWithoutSlippage(t *testing.T) { { "exiting shares greater than total shares", func(oracleKeeper *mocks.OracleKeeper, accKeeper *mocks.AccountedPoolKeeper) { - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromInt64(10)) - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(elystypes.NewDec34FromInt64(5)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromInt64(10), uint64(0)) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenB").Return(elystypes.NewDec34FromInt64(5), uint64(0)) accKeeper.On("GetAccountedBalance", mock.Anything, mock.Anything, "tokenA").Return(sdkmath.NewInt(1000)) accKeeper.On("GetAccountedBalance", mock.Anything, mock.Anything, "tokenB").Return(sdkmath.NewInt(2000)) }, @@ -128,7 +128,7 @@ func TestCalcExitPool(t *testing.T) { { "successful exit with oracle pricing", func(oracleKeeper *mocks.OracleKeeper, accKeeper *mocks.AccountedPoolKeeper) { - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromString("0.00001")) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.NewDec34FromString("0.00001"), uint64(0)) accKeeper.On("GetAccountedBalance", mock.Anything, mock.Anything, "tokenA").Return(sdkmath.NewInt(1000)) }, types.Pool{ @@ -164,7 +164,7 @@ func TestCalcExitPool(t *testing.T) { { "exiting shares greater than total shares", func(oracleKeeper *mocks.OracleKeeper, accKeeper *mocks.AccountedPoolKeeper) { - oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.ZeroDec34()) + oracleKeeper.On("GetAssetPriceFromDenom", mock.Anything, "tokenA").Return(elystypes.ZeroDec34(), uint64(0)) }, types.Pool{ PoolParams: types.PoolParams{UseOracle: true}, diff --git a/x/amm/types/expected_keepers.go b/x/amm/types/expected_keepers.go index 82baa7bed..604d92b35 100644 --- a/x/amm/types/expected_keepers.go +++ b/x/amm/types/expected_keepers.go @@ -39,7 +39,7 @@ type BankKeeper interface { //go:generate mockery --srcpkg . --name OracleKeeper --structname OracleKeeper --filename oracle_keeper.go --with-expecter type OracleKeeper interface { GetAssetPrice(ctx sdk.Context, asset string) (oracletypes.Price, bool) - GetAssetPriceFromDenom(ctx sdk.Context, denom string) elystypes.Dec34 + GetAssetPriceFromDenom(ctx sdk.Context, denom string) (elystypes.Dec34, uint64) GetPriceFeeder(ctx sdk.Context, feeder sdk.AccAddress) (val oracletypes.PriceFeeder, found bool) } diff --git a/x/amm/types/mocks/oracle_keeper.go b/x/amm/types/mocks/oracle_keeper.go index 90edda7ec..22f4d3237 100644 --- a/x/amm/types/mocks/oracle_keeper.go +++ b/x/amm/types/mocks/oracle_keeper.go @@ -82,7 +82,7 @@ func (_c *OracleKeeper_GetAssetPrice_Call) RunAndReturn(run func(types.Context, } // GetAssetPriceFromDenom provides a mock function with given fields: ctx, denom -func (_m *OracleKeeper) GetAssetPriceFromDenom(ctx types.Context, denom string) elystypes.Dec34 { +func (_m *OracleKeeper) GetAssetPriceFromDenom(ctx types.Context, denom string) (elystypes.Dec34, uint64) { ret := _m.Called(ctx, denom) if len(ret) == 0 { @@ -90,13 +90,23 @@ func (_m *OracleKeeper) GetAssetPriceFromDenom(ctx types.Context, denom string) } var r0 elystypes.Dec34 + var r1 uint64 + if rf, ok := ret.Get(0).(func(types.Context, string) (elystypes.Dec34, uint64)); ok { + return rf(ctx, denom) + } if rf, ok := ret.Get(0).(func(types.Context, string) elystypes.Dec34); ok { r0 = rf(ctx, denom) } else { r0 = ret.Get(0).(elystypes.Dec34) } - return r0 + if rf, ok := ret.Get(1).(func(types.Context, string) uint64); ok { + r1 = rf(ctx, denom) + } else { + r1 = ret.Get(1).(uint64) + } + + return r0, r1 } // OracleKeeper_GetAssetPriceFromDenom_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAssetPriceFromDenom' @@ -118,12 +128,12 @@ func (_c *OracleKeeper_GetAssetPriceFromDenom_Call) Run(run func(ctx types.Conte return _c } -func (_c *OracleKeeper_GetAssetPriceFromDenom_Call) Return(_a0 elystypes.Dec34) *OracleKeeper_GetAssetPriceFromDenom_Call { - _c.Call.Return(_a0) +func (_c *OracleKeeper_GetAssetPriceFromDenom_Call) Return(_a0 elystypes.Dec34, _a1 uint64) *OracleKeeper_GetAssetPriceFromDenom_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *OracleKeeper_GetAssetPriceFromDenom_Call) RunAndReturn(run func(types.Context, string) elystypes.Dec34) *OracleKeeper_GetAssetPriceFromDenom_Call { +func (_c *OracleKeeper_GetAssetPriceFromDenom_Call) RunAndReturn(run func(types.Context, string) (elystypes.Dec34, uint64)) *OracleKeeper_GetAssetPriceFromDenom_Call { _c.Call.Return(run) return _c } diff --git a/x/amm/types/one_token_unit.go b/x/amm/types/one_token_unit.go new file mode 100644 index 000000000..6b99dfe3e --- /dev/null +++ b/x/amm/types/one_token_unit.go @@ -0,0 +1,9 @@ +package types + +import ( + sdkmath "cosmossdk.io/math" +) + +func OneTokenUnit(decimal uint64) sdkmath.Int { + return sdkmath.NewIntWithDecimal(1, int(decimal)) +} diff --git a/x/amm/types/pool.go b/x/amm/types/pool.go index fb4c3b5eb..b2a6f98d5 100644 --- a/x/amm/types/pool.go +++ b/x/amm/types/pool.go @@ -302,7 +302,7 @@ func (p *Pool) TVL(ctx sdk.Context, oracleKeeper OracleKeeper, accountedPoolKeep totalWeight := sdkmath.ZeroInt() oracleAssetsWeight := sdkmath.ZeroInt() for _, asset := range p.PoolAssets { - tokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, asset.Token.Denom) + tokenPrice, decimals := oracleKeeper.GetAssetPriceFromDenom(ctx, asset.Token.Denom) totalWeight = totalWeight.Add(asset.Weight) if tokenPrice.IsZero() { if p.PoolParams.UseOracle { @@ -316,7 +316,7 @@ func (p *Pool) TVL(ctx sdk.Context, oracleKeeper OracleKeeper, accountedPoolKeep amount = accountedPoolAmt } } - v := elystypes.NewDec34FromInt(amount).Mul(tokenPrice) + v := tokenPrice.MulInt(amount).QuoInt(OneTokenUnit(decimals)) oracleAssetsTVL = oracleAssetsTVL.Add(v) oracleAssetsWeight = oracleAssetsWeight.Add(asset.Weight) } @@ -326,7 +326,7 @@ func (p *Pool) TVL(ctx sdk.Context, oracleKeeper OracleKeeper, accountedPoolKeep return elystypes.ZeroDec34(), nil } - return oracleAssetsTVL.Mul(elystypes.NewDec34FromInt(totalWeight)).Quo(elystypes.NewDec34FromInt(oracleAssetsWeight)), nil + return oracleAssetsTVL.MulInt(totalWeight).QuoInt(oracleAssetsWeight), nil } func (p *Pool) LpTokenPrice(ctx sdk.Context, oracleKeeper OracleKeeper, accPoolKeeper AccountedPoolKeeper) (elystypes.Dec34, error) { diff --git a/x/amm/types/pool_join_pool.go b/x/amm/types/pool_join_pool.go index 1e6d6f2b4..0a4e9628c 100644 --- a/x/amm/types/pool_join_pool.go +++ b/x/amm/types/pool_join_pool.go @@ -21,11 +21,11 @@ type InternalSwapRequest struct { func (p *Pool) CalcJoinValueWithoutSlippage(ctx sdk.Context, oracleKeeper OracleKeeper, accountedPoolKeeper AccountedPoolKeeper, tokensIn sdk.Coins) (elystypes.Dec34, error) { joinValue := elystypes.ZeroDec34() for _, asset := range tokensIn { - tokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, asset.Denom) + tokenPrice, decimals := oracleKeeper.GetAssetPriceFromDenom(ctx, asset.Denom) if tokenPrice.IsZero() { return elystypes.ZeroDec34(), fmt.Errorf("token price not set: %s", asset.Denom) } - v := tokenPrice.Mul(elystypes.NewDec34FromInt(asset.Amount)) + v := tokenPrice.MulInt(asset.Amount).QuoInt(OneTokenUnit(decimals)) joinValue = joinValue.Add(v) } return joinValue, nil diff --git a/x/amm/types/pool_test.go b/x/amm/types/pool_test.go index db2d35c85..e27bd29f5 100644 --- a/x/amm/types/pool_test.go +++ b/x/amm/types/pool_test.go @@ -37,7 +37,7 @@ func (suite *TestSuite) TestPoolTVL() { }, }, useOracle: true, - expTVL: elystypes.NewDec34FromString("2000.000000000000000000"), + expTVL: elystypes.NewDec34FromInt64(2000), expError: false, }, { @@ -85,7 +85,7 @@ func (suite *TestSuite) TestPoolTVL() { }, }, useOracle: false, - expTVL: elystypes.NewDec34FromString("2000.000000000000000000"), + expTVL: elystypes.NewDec34FromInt64(2000), expError: false, }, } { diff --git a/x/amm/types/swap_in_amt_given_out.go b/x/amm/types/swap_in_amt_given_out.go index 7c997a57e..f7c4ee758 100644 --- a/x/amm/types/swap_in_amt_given_out.go +++ b/x/amm/types/swap_in_amt_given_out.go @@ -27,17 +27,19 @@ func (p Pool) CalcGivenOutSlippage( } // ensure token prices for in/out tokens set properly - inTokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenInDenom) + inTokenPrice, inTokenDecimals := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenInDenom) if inTokenPrice.IsZero() { return elystypes.ZeroDec34(), fmt.Errorf("price for inToken not set: %s", poolAssetIn.Token.Denom) } - outTokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenOut.Denom) + outTokenPrice, outTokenDecimals := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenOut.Denom) if outTokenPrice.IsZero() { return elystypes.ZeroDec34(), fmt.Errorf("price for outToken not set: %s", poolAssetOut.Token.Denom) } // in amount is calculated in this formula - oracleInAmount := elystypes.NewDec34FromInt(tokenOut.Amount).Mul(outTokenPrice).Quo(inTokenPrice) + oracleInAmount := elystypes.NewDec34FromInt(tokenOut.Amount). + Mul(outTokenPrice.QuoInt(OneTokenUnit(outTokenDecimals))). + Quo(inTokenPrice.QuoInt(OneTokenUnit(inTokenDecimals))) balancerIn := elystypes.NewDec34FromInt(balancerInCoin.Amount) balancerSlippage := balancerIn.Sub(oracleInAmount) if balancerSlippage.IsNegative() { @@ -72,11 +74,11 @@ func (p *Pool) SwapInAmtGivenOut( } // ensure token prices for in/out tokens set properly - inTokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenInDenom) + inTokenPrice, inTokenDecimals := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenInDenom) if inTokenPrice.IsZero() { return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), fmt.Errorf("price for inToken not set: %s", poolAssetIn.Token.Denom) } - outTokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenOut.Denom) + outTokenPrice, outTokenDecimals := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenOut.Denom) if outTokenPrice.IsZero() { return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), fmt.Errorf("price for outToken not set: %s", poolAssetOut.Token.Denom) } @@ -88,7 +90,9 @@ func (p *Pool) SwapInAmtGivenOut( // balancer slippage amount = Max(oracleOutAmount-balancerOutAmount, 0) // resizedAmount = tokenIn / externalLiquidityRatio // actualSlippageAmount = balancer slippage(resizedAmount) - oracleInAmount = elystypes.NewDec34FromInt(tokenOut.Amount).Mul(outTokenPrice).Quo(inTokenPrice) + oracleInAmount = elystypes.NewDec34FromInt(tokenOut.Amount). + Mul(outTokenPrice.QuoInt(OneTokenUnit(outTokenDecimals))). + Quo(inTokenPrice.QuoInt(OneTokenUnit(inTokenDecimals))) externalLiquidityRatio, err := p.GetAssetExternalLiquidityRatio(tokenOut.Denom) if err != nil { @@ -139,6 +143,9 @@ func (p *Pool) SwapInAmtGivenOut( sdk.NewCoins(), sdk.NewCoins(), accountedAssets, ) + if err != nil { + return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), err + } initialWeightIn := GetDenomOracleAssetWeight(ctx, p.PoolId, oracleKeeper, initialAssetPools, tokenInDenom) initialWeightOut := GetDenomOracleAssetWeight(ctx, p.PoolId, oracleKeeper, initialAssetPools, tokenOut.Denom) weightBreakingFee := GetWeightBreakingFee(finalWeightIn, finalWeightOut, targetWeightIn, targetWeightOut, initialWeightIn, initialWeightOut, distanceDiff, params) diff --git a/x/amm/types/swap_out_amt_given_in.go b/x/amm/types/swap_out_amt_given_in.go index 13decfaea..7b4dcb195 100644 --- a/x/amm/types/swap_out_amt_given_in.go +++ b/x/amm/types/swap_out_amt_given_in.go @@ -36,12 +36,12 @@ func GetOraclePoolNormalizedWeights(ctx sdk.Context, poolId uint64, oracleKeeper oraclePoolWeights := []AssetWeight{} totalWeight := elystypes.ZeroDec34() for _, asset := range poolAssets { - tokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, asset.Token.Denom) + tokenPrice, decimals := oracleKeeper.GetAssetPriceFromDenom(ctx, asset.Token.Denom) if tokenPrice.IsZero() { return oraclePoolWeights, fmt.Errorf("price for token not set: %s", asset.Token.Denom) } amount := asset.Token.Amount - weight := elystypes.NewDec34FromInt(amount).Mul(tokenPrice) + weight := tokenPrice.MulInt(amount).QuoInt(OneTokenUnit(decimals)) oraclePoolWeights = append(oraclePoolWeights, AssetWeight{ Asset: asset.Token.Denom, Weight: weight, @@ -151,16 +151,18 @@ func (p Pool) CalcGivenInSlippage( } // ensure token prices for in/out tokens set properly - inTokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenIn.Denom) + inTokenPrice, inTokenDecimals := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenIn.Denom) if inTokenPrice.IsZero() { return elystypes.ZeroDec34(), fmt.Errorf("price for inToken not set: %s", poolAssetIn.Token.Denom) } - outTokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenOutDenom) + outTokenPrice, outTokenDecimals := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenOutDenom) if outTokenPrice.IsZero() { return elystypes.ZeroDec34(), fmt.Errorf("price for outToken not set: %s", poolAssetOut.Token.Denom) } - oracleOutAmount := elystypes.NewDec34FromInt(tokenIn.Amount).Mul(inTokenPrice).Quo(outTokenPrice) + oracleOutAmount := elystypes.NewDec34FromInt(tokenIn.Amount). + Mul(inTokenPrice.QuoInt(OneTokenUnit(inTokenDecimals))). + Quo(outTokenPrice.QuoInt(OneTokenUnit(outTokenDecimals))) balancerOut := elystypes.NewDec34FromInt(balancerOutCoin.Amount) slippageAmount := oracleOutAmount.Sub(balancerOut) if slippageAmount.IsNegative() { @@ -206,11 +208,11 @@ func (p *Pool) SwapOutAmtGivenIn( } // ensure token prices for in/out tokens set properly - inTokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenIn.Denom) + inTokenPrice, inTokenDecimals := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenIn.Denom) if inTokenPrice.IsZero() { return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), fmt.Errorf("price for inToken not set: %s", poolAssetIn.Token.Denom) } - outTokenPrice := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenOutDenom) + outTokenPrice, outTokenDecimals := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenOutDenom) if outTokenPrice.IsZero() { return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), fmt.Errorf("price for outToken not set: %s", poolAssetOut.Token.Denom) } @@ -222,7 +224,9 @@ func (p *Pool) SwapOutAmtGivenIn( // balancer slippage amount = Max(oracleOutAmount-balancerOutAmount, 0) // resizedAmount = tokenIn / externalLiquidityRatio // actualSlippageAmount = balancer slippage(resizedAmount) - oracleOutAmount = elystypes.NewDec34FromInt(tokenIn.Amount).Mul(inTokenPrice).Quo(outTokenPrice) + oracleOutAmount = elystypes.NewDec34FromInt(tokenIn.Amount). + Mul(inTokenPrice.QuoInt(OneTokenUnit(inTokenDecimals))). + Quo(outTokenPrice.QuoInt(OneTokenUnit(outTokenDecimals))) externalLiquidityRatio, err := p.GetAssetExternalLiquidityRatio(tokenOutDenom) if err != nil { diff --git a/x/leveragelp/keeper/hooks_amm.go b/x/leveragelp/keeper/hooks_amm.go index a8200a7a0..984e0ed2e 100644 --- a/x/leveragelp/keeper/hooks_amm.go +++ b/x/leveragelp/keeper/hooks_amm.go @@ -24,10 +24,10 @@ func (k Keeper) CheckAmmPoolUsdcBalance(ctx sdk.Context, ammPool ammtypes.Pool) QuoInt(ammPool.TotalShares.Amount) depositDenom := k.stableKeeper.GetDepositDenom(ctx) - price := k.oracleKeeper.GetAssetPriceFromDenom(ctx, depositDenom) + price, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, depositDenom) for _, asset := range ammPool.PoolAssets { - if asset.Token.Denom == depositDenom && price.MulInt(asset.Token.Amount).LT(leverageLpTvl) { + if asset.Token.Denom == depositDenom && price.MulInt(asset.Token.Amount).QuoInt(ammtypes.OneTokenUnit(decimals)).LT(leverageLpTvl) { return types.ErrInsufficientUsdcAfterOp } } diff --git a/x/leveragelp/keeper/query_position.go b/x/leveragelp/keeper/query_position.go index e2d5e188a..33367dec8 100644 --- a/x/leveragelp/keeper/query_position.go +++ b/x/leveragelp/keeper/query_position.go @@ -4,7 +4,6 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - elystypes "github.com/elys-network/elys/types" ammtypes "github.com/elys-network/elys/x/amm/types" "github.com/elys-network/elys/x/leveragelp/types" "google.golang.org/grpc/codes" @@ -63,8 +62,8 @@ func (k Keeper) LiquidationPrice(goCtx context.Context, req *types.QueryLiquidat // lpTokenPrice = totalDebt * params.SafetyFactor / lpTokenAmount totalDebt := debt.GetTotalLiablities() baseCurrency, _ := k.assetProfileKeeper.GetUsdcDenom(ctx) - usdcDenomPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) - liquidationPrice := elystypes.NewDec34FromLegacyDec(params.SafetyFactor).MulInt(totalDebt).Mul(usdcDenomPrice).MulInt(ammtypes.OneShare).QuoInt(position.LeveragedLpAmount) + usdcDenomPrice, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) + liquidationPrice := usdcDenomPrice.MulLegacyDec(params.SafetyFactor).MulInt(totalDebt).MulInt(ammtypes.OneShare).QuoInt(ammtypes.OneTokenUnit(decimals)).QuoInt(position.LeveragedLpAmount) return &types.QueryLiquidationPriceResponse{ Price: liquidationPrice.String(), diff --git a/x/leveragelp/keeper/utils.go b/x/leveragelp/keeper/utils.go index 1d38f0a92..7a45cae7a 100644 --- a/x/leveragelp/keeper/utils.go +++ b/x/leveragelp/keeper/utils.go @@ -108,10 +108,10 @@ func (k Keeper) GetInterestRateUsd(ctx sdk.Context, positions []*types.QueryPosi for _, position := range positions { var positionAndInterest types.PositionAndInterest positionAndInterest.Position = position - price := k.oracleKeeper.GetAssetPriceFromDenom(ctx, position.Position.Collateral.Denom) + price, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, position.Position.Collateral.Denom) interestRateHour := params.InterestRate.Quo(hours) positionAndInterest.InterestRateHour = interestRateHour - positionAndInterest.InterestRateHourUsd = interestRateHour.Mul(sdkmath.LegacyDec(position.Position.Liabilities.Mul(price.ToInt()))) + positionAndInterest.InterestRateHourUsd = interestRateHour.Mul(sdkmath.LegacyDec(position.Position.Liabilities.Mul(price.ToInt()).Quo(ammtypes.OneTokenUnit(decimals)))) positions_and_interest = append(positions_and_interest, &positionAndInterest) } diff --git a/x/masterchef/keeper/abci.go b/x/masterchef/keeper/abci.go index 3caed7f98..4c59f655e 100644 --- a/x/masterchef/keeper/abci.go +++ b/x/masterchef/keeper/abci.go @@ -82,7 +82,12 @@ func (k Keeper) ProcessExternalRewardsDistribution(ctx sdk.Context) { yearlyIncentiveRewardsTotal := externalIncentive.AmountPerBlock. Mul(math.NewInt(totalBlocksPerYear)) - apr := k.amm.GetTokenPrice(ctx, externalIncentive.RewardDenom, baseCurrency).MulInt(yearlyIncentiveRewardsTotal).Quo(tvl) + tokenPrice, decimals := k.amm.GetTokenPrice(ctx, externalIncentive.RewardDenom, baseCurrency) + + apr := tokenPrice. + MulInt(yearlyIncentiveRewardsTotal). + QuoInt(ammtypes.OneTokenUnit(decimals)). + Quo(tvl) externalIncentive.Apr = apr.ToLegacyDec() k.SetExternalIncentive(ctx, externalIncentive) poolExternalApr, ok := externalIncentiveAprs[pool.PoolId] @@ -195,7 +200,7 @@ func (k Keeper) UpdateLPRewards(ctx sdk.Context) error { lpsEdenAmount := edenAmountPerYear.Quo(math.NewInt(totalBlocksPerYear)) // Ensure edenDenomPrice is not zero to avoid division by zero - edenDenomPrice := k.amm.GetEdenDenomPrice(ctx, baseCurrency) + edenDenomPrice, decimals := k.amm.GetEdenDenomPrice(ctx, baseCurrency) if edenDenomPrice.IsZero() { return errorsmod.Wrap(types.ErrNoInflationaryParams, "invalid eden price") } @@ -225,7 +230,7 @@ func (k Keeper) UpdateLPRewards(ctx sdk.Context) error { // Maximum eden APR - 30% by default poolMaxEdenAmount := proxyTVL.MulLegacyDec(params.MaxEdenRewardAprLps). QuoInt64(totalBlocksPerYear). - Quo(edenDenomPrice) + Quo(edenDenomPrice.QuoInt(ammtypes.OneTokenUnit(decimals))) // Use min amount (eden allocation from tokenomics and max apr based eden amount) if pool.EnableEdenRewards { @@ -286,6 +291,7 @@ func (k Keeper) UpdateLPRewards(ctx sdk.Context) error { pool.EdenApr = newEdenAllocatedForPool. MulInt64(totalBlocksPerYear). Mul(edenDenomPrice). + QuoInt(ammtypes.OneTokenUnit(decimals)). Quo(tvl). ToLegacyDec() } else { @@ -296,7 +302,7 @@ func (k Keeper) UpdateLPRewards(ctx sdk.Context) error { } // Update APR for amm pools - k.UpdateAmmPoolAPR(ctx, totalBlocksPerYear, totalProxyTVL.ToLegacyDec(), edenDenomPrice.ToLegacyDec()) + k.UpdateAmmPoolAPR(ctx, totalBlocksPerYear, totalProxyTVL.ToLegacyDec()) return nil } @@ -603,9 +609,9 @@ func (k Keeper) InitStableStakePoolParams(ctx sdk.Context, poolId uint64) bool { } // Update APR for AMM pool -func (k Keeper) UpdateAmmPoolAPR(ctx sdk.Context, totalBlocksPerYear int64, totalProxyTVL math.LegacyDec, edenDenomPrice math.LegacyDec) { +func (k Keeper) UpdateAmmPoolAPR(ctx sdk.Context, totalBlocksPerYear int64, totalProxyTVL math.LegacyDec) { baseCurrency, _ := k.assetProfileKeeper.GetUsdcDenom(ctx) - usdcDenomPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) + usdcDenomPrice, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) k.amm.IterateLiquidityPools(ctx, func(p ammtypes.Pool) bool { tvl, err := p.TVL(ctx, k.oracleKeeper, k.accountedPoolKeeper) @@ -637,12 +643,14 @@ func (k Keeper) UpdateAmmPoolAPR(ctx sdk.Context, totalBlocksPerYear int64, tota poolInfo.DexApr = usdcDenomPrice. MulLegacyDec(lastAccum.DexReward). MulInt64(totalBlocksPerYear). + QuoInt(ammtypes.OneTokenUnit(decimals)). Quo(tvl). ToLegacyDec() poolInfo.GasApr = usdcDenomPrice. MulLegacyDec(lastAccum.GasReward). MulInt64(totalBlocksPerYear). + QuoInt(ammtypes.OneTokenUnit(decimals)). Quo(tvl). ToLegacyDec() } else { @@ -654,6 +662,7 @@ func (k Keeper) UpdateAmmPoolAPR(ctx sdk.Context, totalBlocksPerYear int64, tota Sub(firstAccum.DexReward). MulInt64(secondsInYear). QuoInt64(int64(duration))). + QuoInt(ammtypes.OneTokenUnit(decimals)). Quo(tvl). ToLegacyDec() poolInfo.GasApr = usdcDenomPrice. @@ -661,6 +670,7 @@ func (k Keeper) UpdateAmmPoolAPR(ctx sdk.Context, totalBlocksPerYear int64, tota Sub(firstAccum.GasReward). MulInt64(secondsInYear). QuoInt64(int64(duration))). + QuoInt(ammtypes.OneTokenUnit(decimals)). Quo(tvl). ToLegacyDec() } diff --git a/x/masterchef/keeper/apr_denom.go b/x/masterchef/keeper/apr_denom.go index 902bfba25..568ba259c 100644 --- a/x/masterchef/keeper/apr_denom.go +++ b/x/masterchef/keeper/apr_denom.go @@ -4,6 +4,7 @@ import ( errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" elystypes "github.com/elys-network/elys/types" + ammtypes "github.com/elys-network/elys/x/amm/types" assetprofiletypes "github.com/elys-network/elys/x/assetprofile/types" commitmenttypes "github.com/elys-network/elys/x/commitment/types" "github.com/elys-network/elys/x/masterchef/types" @@ -87,7 +88,7 @@ func (k Keeper) CalculateApr(ctx sdk.Context, query *types.QueryAprRequest) (ely // Calc Eden price in usdc // We put Elys as denom as Eden won't be avaialble in amm pool and has the same value as Elys - edenDenomPrice := k.amm.GetEdenDenomPrice(ctx, baseCurrency) + edenDenomPrice, decimals := k.amm.GetEdenDenomPrice(ctx, baseCurrency) if edenDenomPrice.IsZero() { return elystypes.ZeroDec34(), nil } @@ -108,10 +109,10 @@ func (k Keeper) CalculateApr(ctx sdk.Context, query *types.QueryAprRequest) (ely if !found { return elystypes.ZeroDec34(), assetprofiletypes.ErrAssetProfileNotFound } - yearlyDexRewardAmount := elystypes.NewDec34FromLegacyDec(usdcAmount).MulInt64(365).Quo(Pow10(entry.Decimals)) + yearlyDexRewardAmount := elystypes.NewDec34FromLegacyDec(usdcAmount).MulInt64(365).QuoInt(ammtypes.OneTokenUnit(entry.Decimals)) apr := yearlyDexRewardAmount. - Quo(edenDenomPrice). + Quo(edenDenomPrice.QuoInt(ammtypes.OneTokenUnit(decimals))). QuoInt(totalStakedSnapshot) return apr, nil @@ -151,18 +152,10 @@ func (k Keeper) GetDailyRewardsAmountForPool(ctx sdk.Context, poolId uint64) (el rewardCoins := sdk.NewCoins(sdk.NewCoin(ptypes.Eden, dailyEdenRewardsTotal.ToInt())) rewardCoins = rewardCoins.Add(sdk.NewCoin(baseCurrency, dailyDexRewardsTotal.Add(dailyGasRewardsTotal).ToInt())) - usdcDenomPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) - edenDenomPrice := k.amm.GetEdenDenomPrice(ctx, baseCurrency) + usdcDenomPrice, usdcDecimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) + edenDenomPrice, edenDecimals := k.amm.GetEdenDenomPrice(ctx, baseCurrency) - totalRewardsUsd := usdcDenomPrice.Mul(dailyDexRewardsTotal.Add(dailyGasRewardsTotal)). - Add(edenDenomPrice.Mul(dailyEdenRewardsTotal)) + totalRewardsUsd := (usdcDenomPrice.Mul(dailyDexRewardsTotal.Add(dailyGasRewardsTotal)).QuoInt(ammtypes.OneTokenUnit(usdcDecimals))). + Add(edenDenomPrice.Mul(dailyEdenRewardsTotal).QuoInt(ammtypes.OneTokenUnit(edenDecimals))) return totalRewardsUsd, rewardCoins } - -func Pow10(decimal uint64) (value elystypes.Dec34) { - value = elystypes.OneDec34() - for i := 0; i < int(decimal); i++ { - value = value.MulInt64(10) - } - return -} diff --git a/x/masterchef/keeper/apr_stable_stake.go b/x/masterchef/keeper/apr_stable_stake.go index 70e0ed6a3..51c1f2880 100644 --- a/x/masterchef/keeper/apr_stable_stake.go +++ b/x/masterchef/keeper/apr_stable_stake.go @@ -5,6 +5,7 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" elystypes "github.com/elys-network/elys/types" + ammtypes "github.com/elys-network/elys/x/amm/types" assetprofiletypes "github.com/elys-network/elys/x/assetprofile/types" "github.com/elys-network/elys/x/masterchef/types" ptypes "github.com/elys-network/elys/x/parameter/types" @@ -45,7 +46,7 @@ func (k Keeper) CalculateStableStakeApr(ctx sdk.Context, query *types.QueryStabl edenAmount := lpIncentive.EdenAmountPerYear.Quo(sdkmath.NewInt(totalBlocksPerYear)) - edenDenomPrice := k.amm.GetEdenDenomPrice(ctx, baseCurrency) + edenDenomPrice, decimals := k.amm.GetEdenDenomPrice(ctx, baseCurrency) // Get pool info from incentive param poolInfo, found := k.GetPoolInfo(ctx, uint64(stabletypes.PoolId)) @@ -66,13 +67,14 @@ func (k Keeper) CalculateStableStakeApr(ctx sdk.Context, query *types.QueryStabl poolMaxEdenAmount := proxyTVL. MulLegacyDec(params.MaxEdenRewardAprLps). QuoInt64(totalBlocksPerYear). - Quo(edenDenomPrice) + Quo(edenDenomPrice.QuoInt(ammtypes.OneTokenUnit(decimals))) stableStakeEdenAmount = elystypes.MinDec34(stableStakeEdenAmount, poolMaxEdenAmount) // Eden Apr for usdc earn program apr := stableStakeEdenAmount. MulInt64(totalBlocksPerYear). Mul(edenDenomPrice). + QuoInt(ammtypes.OneTokenUnit(decimals)). Quo(stableTvl) return apr, nil } else if query.Denom == ptypes.BaseCurrency { diff --git a/x/masterchef/keeper/query_chain_tvl.go b/x/masterchef/keeper/query_chain_tvl.go index 527dded8d..462aec58a 100644 --- a/x/masterchef/keeper/query_chain_tvl.go +++ b/x/masterchef/keeper/query_chain_tvl.go @@ -6,6 +6,7 @@ import ( "cosmossdk.io/math" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + ammtypes "github.com/elys-network/elys/x/amm/types" ptypes "github.com/elys-network/elys/x/parameter/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -43,10 +44,10 @@ func (k Keeper) ChainTVL(goCtx context.Context, req *types.QueryChainTVLRequest) stableStakeTVL := k.stableKeeper.TVL(ctx, k.oracleKeeper, baseCurrencyEntry.Denom) totalTVL = totalTVL.Add(stableStakeTVL.ToInt()) - elysPrice := k.amm.GetTokenPrice(ctx, ptypes.Elys, baseCurrencyEntry.Denom) + elysPrice, decimals := k.amm.GetTokenPrice(ctx, ptypes.Elys, baseCurrencyEntry.Denom) stakedElys := k.bankKeeper.GetBalance(ctx, authtypes.NewModuleAddress(stakingtypes.BondedPoolName), ptypes.Elys).Amount - stakedElysValue := elysPrice.MulInt(stakedElys) + stakedElysValue := elysPrice.MulInt(stakedElys).QuoInt(ammtypes.OneTokenUnit(decimals)) totalTVL = totalTVL.Add(stakedElysValue.ToInt()) commitmentParams := k.commitmentKeeper.GetParams(ctx) diff --git a/x/masterchef/keeper/query_pool_rewards.go b/x/masterchef/keeper/query_pool_rewards.go index 74ba452dd..7fc480bc9 100644 --- a/x/masterchef/keeper/query_pool_rewards.go +++ b/x/masterchef/keeper/query_pool_rewards.go @@ -104,10 +104,10 @@ func (k Keeper) generateExternalRewardsApr(ctx sdk.Context) map[uint64]elystypes for _, externalIncentive := range externalIncentives { if externalIncentive.FromBlock < curBlockHeight && curBlockHeight <= externalIncentive.ToBlock { - totalAmount := elystypes.NewDec34FromInt(externalIncentive.AmountPerBlock).MulInt64(totalBlocksPerYear) - price := k.oracleKeeper.GetAssetPriceFromDenom(ctx, externalIncentive.RewardDenom) + totalAmount := externalIncentive.AmountPerBlock.MulRaw(totalBlocksPerYear) + price, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, externalIncentive.RewardDenom) - rewardsPerPool[externalIncentive.PoolId] = rewardsPerPool[externalIncentive.PoolId].Add(totalAmount.Mul(price)) + rewardsPerPool[externalIncentive.PoolId] = rewardsPerPool[externalIncentive.PoolId].Add(price.MulInt(totalAmount).QuoInt(ammtypes.OneTokenUnit(decimals))) } } diff --git a/x/masterchef/types/expected_keepers.go b/x/masterchef/types/expected_keepers.go index 24972b977..177e016c4 100644 --- a/x/masterchef/types/expected_keepers.go +++ b/x/masterchef/types/expected_keepers.go @@ -81,8 +81,8 @@ type AmmKeeper interface { GetAccountedPoolSnapshotOrSet(ctx sdk.Context, pool ammtypes.Pool) (val ammtypes.Pool) CalcOutAmtGivenIn(ctx sdk.Context, poolId uint64, oracle ammtypes.OracleKeeper, snapshot *ammtypes.Pool, tokensIn sdk.Coins, tokenOutDenom string, swapFee math.LegacyDec) (sdk.Coin, elystypes.Dec34, error) - GetEdenDenomPrice(ctx sdk.Context, baseCurrency string) elystypes.Dec34 - GetTokenPrice(ctx sdk.Context, tokenInDenom, baseCurrency string) elystypes.Dec34 + GetEdenDenomPrice(ctx sdk.Context, baseCurrency string) (elystypes.Dec34, uint64) + GetTokenPrice(ctx sdk.Context, tokenInDenom, baseCurrency string) (elystypes.Dec34, uint64) InternalSwapExactAmountIn( ctx sdk.Context, sender sdk.AccAddress, @@ -98,7 +98,7 @@ type AmmKeeper interface { // OracleKeeper defines the expected interface needed to retrieve price info type OracleKeeper interface { GetAssetPrice(ctx sdk.Context, asset string) (oracletypes.Price, bool) - GetAssetPriceFromDenom(ctx sdk.Context, denom string) elystypes.Dec34 + GetAssetPriceFromDenom(ctx sdk.Context, denom string) (elystypes.Dec34, uint64) GetPriceFeeder(ctx sdk.Context, feeder sdk.AccAddress) (val oracletypes.PriceFeeder, found bool) } diff --git a/x/oracle/keeper/price.go b/x/oracle/keeper/price.go index cb15b237d..5b3ece27b 100644 --- a/x/oracle/keeper/price.go +++ b/x/oracle/keeper/price.go @@ -64,19 +64,20 @@ func (k Keeper) RemovePrice(ctx sdk.Context, asset, source string, timestamp uin } // GetAllPrice returns all price -func (k Keeper) GetAllPrice(ctx sdk.Context) (list []types.Price) { +func (k Keeper) GetAllPrice(ctx sdk.Context) []types.Price { store := prefix.NewStore(runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)), types.KeyPrefix(types.PriceKeyPrefix)) iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() + list := []types.Price{} for ; iterator.Valid(); iterator.Next() { var val types.Price k.cdc.MustUnmarshal(iterator.Value(), &val) list = append(list, val) } - return + return list } // MigrateAllLegacyPrices migrates all legacy prices @@ -98,8 +99,6 @@ func (k Keeper) MigrateAllLegacyPrices(ctx sdk.Context) { BlockHeight: uint64(ctx.BlockHeight()), }) } - - return } func (k Keeper) GetAssetPrice(ctx sdk.Context, asset string) (types.Price, bool) { @@ -119,15 +118,15 @@ func (k Keeper) GetAssetPrice(ctx sdk.Context, asset string) (types.Price, bool) return k.GetLatestPriceFromAnySource(ctx, asset) } -func (k Keeper) GetAssetPriceFromDenom(ctx sdk.Context, denom string) elystypes.Dec34 { +func (k Keeper) GetAssetPriceFromDenom(ctx sdk.Context, denom string) (elystypes.Dec34, uint64) { info, found := k.GetAssetInfo(ctx, denom) if !found { - return elystypes.ZeroDec34() + return elystypes.ZeroDec34(), 0 } price, found := k.GetAssetPrice(ctx, info.Display) if !found { - return elystypes.ZeroDec34() + return elystypes.ZeroDec34(), 0 } - return elystypes.NewDec34FromLegacyDec(price.Price).Quo(types.Pow10(info.Decimal)) + return elystypes.NewDec34FromLegacyDec(price.Price), info.Decimal } diff --git a/x/oracle/types/pow.go b/x/oracle/types/pow.go deleted file mode 100644 index 6141b708f..000000000 --- a/x/oracle/types/pow.go +++ /dev/null @@ -1,13 +0,0 @@ -package types - -import ( - elystypes "github.com/elys-network/elys/types" -) - -func Pow10(decimal uint64) elystypes.Dec34 { - value := elystypes.OneDec34() - for i := 0; i < int(decimal); i++ { - value = value.Mul(elystypes.NewDec34FromInt64(10)) - } - return value -} diff --git a/x/perpetual/types/expected_keepers.go b/x/perpetual/types/expected_keepers.go index 2667e3060..3b61b3026 100644 --- a/x/perpetual/types/expected_keepers.go +++ b/x/perpetual/types/expected_keepers.go @@ -61,7 +61,7 @@ type AssetProfileKeeper interface { type OracleKeeper interface { GetAssetPrice(ctx sdk.Context, asset string) (oracletypes.Price, bool) - GetAssetPriceFromDenom(ctx sdk.Context, denom string) elystypes.Dec34 + GetAssetPriceFromDenom(ctx sdk.Context, denom string) (elystypes.Dec34, uint64) GetPriceFeeder(ctx sdk.Context, feeder sdk.AccAddress) (val oracletypes.PriceFeeder, found bool) GetAssetInfo(ctx sdk.Context, denom string) (val oracletypes.AssetInfo, found bool) } diff --git a/x/stablestake/keeper/tvl.go b/x/stablestake/keeper/tvl.go index 861c6dde3..252bf5331 100644 --- a/x/stablestake/keeper/tvl.go +++ b/x/stablestake/keeper/tvl.go @@ -9,13 +9,13 @@ import ( func (k Keeper) TVL(ctx sdk.Context, oracleKeeper types.OracleKeeper, baseCurrency string) elystypes.Dec34 { params := k.GetParams(ctx) totalDeposit := params.TotalValue - price := oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) + price, _ := oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) return price.MulInt(totalDeposit) } func (k Keeper) ShareDenomPrice(ctx sdk.Context, oracleKeeper types.OracleKeeper, baseCurrency string) elystypes.Dec34 { params := k.GetParams(ctx) redemptionRate := params.RedemptionRate - price := oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) + price, _ := oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) return price.MulLegacyDec(redemptionRate) } diff --git a/x/stablestake/types/expected_keepers.go b/x/stablestake/types/expected_keepers.go index 5332b426b..700dabb06 100644 --- a/x/stablestake/types/expected_keepers.go +++ b/x/stablestake/types/expected_keepers.go @@ -38,6 +38,6 @@ type AssetProfileKeeper interface { // OracleKeeper defines the expected interface needed to retrieve price info type OracleKeeper interface { GetAssetPrice(ctx sdk.Context, asset string) (oracletypes.Price, bool) - GetAssetPriceFromDenom(ctx sdk.Context, denom string) elystypes.Dec34 + GetAssetPriceFromDenom(ctx sdk.Context, denom string) (elystypes.Dec34, uint64) GetPriceFeeder(ctx sdk.Context, feeder sdk.AccAddress) (val oracletypes.PriceFeeder, found bool) } diff --git a/x/tier/keeper/portfolio.go b/x/tier/keeper/portfolio.go index c95cf4947..555bc54c7 100644 --- a/x/tier/keeper/portfolio.go +++ b/x/tier/keeper/portfolio.go @@ -58,8 +58,8 @@ func (k Keeper) RetrieveAllPortfolio(ctx sdk.Context, user sdk.AccAddress) { // convert vesting to usd baseCurrency, found := k.assetProfileKeeper.GetUsdcDenom(ctx) if found { - edenDenomPrice := k.amm.GetEdenDenomPrice(ctx, baseCurrency) - totalVesting = totalVesting.Mul(edenDenomPrice) + edenDenomPrice, decimals := k.amm.GetEdenDenomPrice(ctx, baseCurrency) + totalVesting = totalVesting.Mul(edenDenomPrice).QuoInt(ammtypes.OneTokenUnit(decimals)) } totalValue = totalValue.Add(commit).Add(delegations).Add(unbondings).Add(totalVesting) @@ -111,16 +111,16 @@ func (k Keeper) RetrieveStaked(ctx sdk.Context, user sdk.AccAddress) (elystypes. if !found { continue } - tokenPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, usdcDenom) + tokenPrice, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, usdcDenom) params := k.stablestakeKeeper.GetParams(ctx) - usdValue := elystypes.NewDec34FromLegacyDec(params.RedemptionRate).MulInt(commitment.Amount).Mul(tokenPrice) + usdValue := tokenPrice.MulLegacyDec(params.RedemptionRate).MulInt(commitment.Amount).QuoInt(ammtypes.OneTokenUnit(decimals)) totalCommit = totalCommit.Add(usdValue) continue } if commitment.Denom == ptypes.Eden { commitment.Denom = ptypes.Elys } - tokenPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, commitment.Denom) + tokenPrice, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, commitment.Denom) asset, found := k.assetProfileKeeper.GetEntryByDenom(ctx, commitment.Denom) if !found { continue @@ -128,7 +128,7 @@ func (k Keeper) RetrieveStaked(ctx sdk.Context, user sdk.AccAddress) (elystypes. if tokenPrice.IsZero() { tokenPrice = k.amm.CalcAmmPrice(ctx, asset.Denom, asset.Decimals) } - totalCommit = totalCommit.Add(tokenPrice.MulInt(commitment.Amount)) + totalCommit = totalCommit.Add(tokenPrice.MulInt(commitment.Amount).QuoInt(ammtypes.OneTokenUnit(decimals))) } } @@ -143,7 +143,7 @@ func (k Keeper) RetrieveStaked(ctx sdk.Context, user sdk.AccAddress) (elystypes. if err != nil { panic(err) } - tokenPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, bondDenom) + tokenPrice, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, bondDenom) asset, found := k.assetProfileKeeper.GetEntryByDenom(ctx, bondDenom) if tokenPrice.IsZero() { tokenPrice = k.amm.CalcAmmPrice(ctx, asset.Denom, asset.Decimals) @@ -151,7 +151,7 @@ func (k Keeper) RetrieveStaked(ctx sdk.Context, user sdk.AccAddress) (elystypes. if found { for _, delegation := range delegations { amount := elystypes.NewDec34FromLegacyDec(delegation.Shares) - totalDelegations = totalDelegations.Add(tokenPrice.Mul(amount)) + totalDelegations = totalDelegations.Add(tokenPrice.Mul(amount).QuoInt(ammtypes.OneTokenUnit(decimals))) } } @@ -165,7 +165,7 @@ func (k Keeper) RetrieveStaked(ctx sdk.Context, user sdk.AccAddress) (elystypes. if found { for _, delegation := range unbondingDelegations { for _, entry := range delegation.Entries { - totalUnbondings = totalUnbondings.Add(tokenPrice.MulInt(entry.Balance)) + totalUnbondings = totalUnbondings.Add(tokenPrice.MulInt(entry.Balance).QuoInt(ammtypes.OneTokenUnit(decimals))) } } } @@ -182,7 +182,7 @@ func (k Keeper) RetrieveRewardsTotal(ctx sdk.Context, user sdk.AccAddress) elyst if balance.Denom == ptypes.Eden { balance.Denom = ptypes.Elys } - tokenPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, balance.Denom) + tokenPrice, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, balance.Denom) asset, found := k.assetProfileKeeper.GetEntryByDenom(ctx, balance.Denom) if !found { continue @@ -190,7 +190,7 @@ func (k Keeper) RetrieveRewardsTotal(ctx sdk.Context, user sdk.AccAddress) elyst if tokenPrice.IsZero() { tokenPrice = k.amm.CalcAmmPrice(ctx, asset.Denom, asset.Decimals) } - totalValue = totalValue.Add(tokenPrice.MulInt(balance.Amount)) + totalValue = totalValue.Add(tokenPrice.MulInt(balance.Amount).QuoInt(ammtypes.OneTokenUnit(decimals))) } } @@ -199,7 +199,7 @@ func (k Keeper) RetrieveRewardsTotal(ctx sdk.Context, user sdk.AccAddress) elyst if balance.Denom == ptypes.Eden { balance.Denom = ptypes.Elys } - tokenPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, balance.Denom) + tokenPrice, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, balance.Denom) asset, found := k.assetProfileKeeper.GetEntryByDenom(ctx, balance.Denom) if !found { continue @@ -207,7 +207,7 @@ func (k Keeper) RetrieveRewardsTotal(ctx sdk.Context, user sdk.AccAddress) elyst if tokenPrice.IsZero() { tokenPrice = k.amm.CalcAmmPrice(ctx, asset.Denom, asset.Decimals) } - totalValue = totalValue.Add(tokenPrice.MulInt(balance.Amount)) + totalValue = totalValue.Add(tokenPrice.MulInt(balance.Amount).QuoInt(ammtypes.OneTokenUnit(decimals))) } } return totalValue @@ -251,7 +251,7 @@ func (k Keeper) RetrieveLiquidAssetsTotal(ctx sdk.Context, user sdk.AccAddress) if balance.Denom == ptypes.Eden { balance.Denom = ptypes.Elys } - tokenPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, balance.Denom) + tokenPrice, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, balance.Denom) asset, found := k.assetProfileKeeper.GetEntryByDenom(ctx, balance.Denom) if !found { continue @@ -259,7 +259,7 @@ func (k Keeper) RetrieveLiquidAssetsTotal(ctx sdk.Context, user sdk.AccAddress) if tokenPrice.IsZero() { tokenPrice = k.amm.CalcAmmPrice(ctx, balance.Denom, asset.Decimals) } - totalValue = totalValue.Add(tokenPrice.MulInt(balance.Amount)) + totalValue = totalValue.Add(tokenPrice.MulInt(balance.Amount).QuoInt(ammtypes.OneTokenUnit(decimals))) } return totalValue } @@ -283,9 +283,9 @@ func (k Keeper) RetrieveLeverageLpTotal(ctx sdk.Context, user sdk.AccAddress) (e if !found { continue } - usdcPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, usdcDenom) + usdcPrice, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, usdcDenom) liab := debt.GetTotalLiablities() - totalBorrow = totalBorrow.Add(usdcPrice.MulInt(liab)) + totalBorrow = totalBorrow.Add(usdcPrice.MulInt(liab).QuoInt(ammtypes.OneTokenUnit(decimals))) } netValue = totalValue.Sub(totalBorrow) } @@ -323,7 +323,7 @@ func (k Keeper) RetrieveConsolidatedPrice(ctx sdk.Context, denom string) (elysty if denom == ptypes.Eden { denom = ptypes.Elys } - tokenPriceOracle := k.oracleKeeper.GetAssetPriceFromDenom(ctx, denom) + tokenPriceOracle, _ := k.oracleKeeper.GetAssetPriceFromDenom(ctx, denom) asset, found := k.assetProfileKeeper.GetEntryByDenom(ctx, denom) if !found { tokenPriceOracle = elystypes.ZeroDec34() @@ -491,5 +491,4 @@ func (k Keeper) RemoveLegacyPortfolioCounted(ctx sdk.Context, date string, num u break } } - return } diff --git a/x/tier/keeper/query_get_consolidated_price.go b/x/tier/keeper/query_get_consolidated_price.go index ead12e9d8..7999ab60d 100644 --- a/x/tier/keeper/query_get_consolidated_price.go +++ b/x/tier/keeper/query_get_consolidated_price.go @@ -5,7 +5,6 @@ import ( "strings" sdk "github.com/cosmos/cosmos-sdk/types" - oracletypes "github.com/elys-network/elys/x/oracle/types" ptypes "github.com/elys-network/elys/x/parameter/types" "github.com/elys-network/elys/x/tier/types" "google.golang.org/grpc/codes" @@ -45,8 +44,8 @@ func (k Keeper) GetAllPrices(goCtx context.Context, req *types.QueryGetAllPrices if assetEntry.Denom == ptypes.Eden { denom = ptypes.Elys } - tokenPriceOracle := k.oracleKeeper.GetAssetPriceFromDenom(ctx, denom).Mul(oracletypes.Pow10(assetEntry.Decimals)) - tokenPriceAmm := k.amm.CalcAmmPrice(ctx, denom, assetEntry.Decimals).Mul(oracletypes.Pow10(assetEntry.Decimals)) + tokenPriceOracle, _ := k.oracleKeeper.GetAssetPriceFromDenom(ctx, denom) + tokenPriceAmm := k.amm.CalcAmmPrice(ctx, denom, assetEntry.Decimals) prices = append(prices, &types.Price{ Denom: assetEntry.Denom, OraclePrice: tokenPriceOracle.String(), diff --git a/x/tier/keeper/query_get_users_pool_data.go b/x/tier/keeper/query_get_users_pool_data.go index 4209b0793..6662b9b56 100644 --- a/x/tier/keeper/query_get_users_pool_data.go +++ b/x/tier/keeper/query_get_users_pool_data.go @@ -40,7 +40,7 @@ func (k Keeper) GetUsersPoolData(goCtx context.Context, req *types.QueryGetUsers return nil, err } - tokenPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, usdcDenom) + tokenPrice, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, usdcDenom) params := k.stablestakeKeeper.GetParams(ctx) usersData := []*types.UserData{} @@ -56,7 +56,7 @@ func (k Keeper) GetUsersPoolData(goCtx context.Context, req *types.QueryGetUsers for _, commitment := range user.CommittedTokens { if strings.HasPrefix(commitment.Denom, "stablestake/share") { - fiatValue := tokenPrice.MulLegacyDec(params.RedemptionRate).MulInt(commitment.Amount) + fiatValue := tokenPrice.MulLegacyDec(params.RedemptionRate).MulInt(commitment.Amount).QuoInt(ammtypes.OneTokenUnit(decimals)) u.Pools = append(u.Pools, &types.Pool{ Pool: "USDC", PoolId: commitment.Denom, diff --git a/x/tier/types/expected_keepers.go b/x/tier/types/expected_keepers.go index 2ccea2608..99ae6c5ae 100644 --- a/x/tier/types/expected_keepers.go +++ b/x/tier/types/expected_keepers.go @@ -38,7 +38,7 @@ type BankKeeper interface { type OracleKeeper interface { GetAssetInfo(ctx sdk.Context, denom string) (val oracletypes.AssetInfo, found bool) GetAssetPrice(ctx sdk.Context, asset string) (oracletypes.Price, bool) - GetAssetPriceFromDenom(ctx sdk.Context, denom string) elystypes.Dec34 + GetAssetPriceFromDenom(ctx sdk.Context, denom string) (elystypes.Dec34, uint64) GetPriceFeeder(ctx sdk.Context, feeder sdk.AccAddress) (val oracletypes.PriceFeeder, found bool) } @@ -79,7 +79,7 @@ type AmmKeeper interface { overrideSwapFee math.LegacyDec, ) (elystypes.Dec34, elystypes.Dec34, sdk.Coin, math.LegacyDec, math.LegacyDec, sdk.Coin, elystypes.Dec34, elystypes.Dec34, error) Balance(goCtx context.Context, req *ammtypes.QueryBalanceRequest) (*ammtypes.QueryBalanceResponse, error) - GetEdenDenomPrice(ctx sdk.Context, baseCurrency string) elystypes.Dec34 + GetEdenDenomPrice(ctx sdk.Context, baseCurrency string) (elystypes.Dec34, uint64) CalculateUSDValue(ctx sdk.Context, denom string, amount math.Int) elystypes.Dec34 CalcAmmPrice(ctx sdk.Context, denom string, decimal uint64) elystypes.Dec34 } From b3be8c2dec13e3ca61c92ea27178de572da40f9a Mon Sep 17 00:00:00 2001 From: Cosmic Vagabond <121588426+cosmic-vagabond@users.noreply.github.com> Date: Tue, 14 Jan 2025 05:36:42 +0100 Subject: [PATCH 13/18] test(dec34): panics if wrong inputs --- types/dec34.go | 6 +++--- types/dec34_test.go | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/types/dec34.go b/types/dec34.go index a2abfced8..1ccb4ba74 100644 --- a/types/dec34.go +++ b/types/dec34.go @@ -11,7 +11,7 @@ type Dec34 regenmath.Dec func NewDec34FromString(s string) Dec34 { y, err := regenmath.NewDecFromString(s) if err != nil { - return ZeroDec34() + panic(err) } return Dec34(y) } @@ -19,7 +19,7 @@ func NewDec34FromString(s string) Dec34 { func NewDec34FromLegacyDec(d math.LegacyDec) Dec34 { y, err := regenmath.NewDecFromString(d.String()) if err != nil { - return ZeroDec34() + panic(err) } return Dec34(y) } @@ -27,7 +27,7 @@ func NewDec34FromLegacyDec(d math.LegacyDec) Dec34 { func NewDec34FromInt(i math.Int) Dec34 { y, err := regenmath.NewDecFromString(i.String()) if err != nil { - return ZeroDec34() + panic(err) } return Dec34(y) } diff --git a/types/dec34_test.go b/types/dec34_test.go index 000d32f5e..f986d1a18 100644 --- a/types/dec34_test.go +++ b/types/dec34_test.go @@ -240,4 +240,24 @@ func TestDec34(t *testing.T) { require.Equal(t, "8", NewDec34FromInt64(2).PowLegacyDec(math.LegacyNewDec(3)).String()) require.Equal(t, "16", NewDec34FromInt64(2).PowLegacyDec(math.LegacyNewDec(4)).String()) require.Equal(t, "27", NewDec34FromInt64(3).PowLegacyDec(math.LegacyNewDec(3)).String()) + + // Test panic cases for NewDec34FromString + require.Panics(t, func() { + NewDec34FromString("invalid.decimal.string") + }) + require.Panics(t, func() { + NewDec34FromString("abc") + }) + + // Test panic cases for NewDec34FromLegacyDec + require.Panics(t, func() { + invalidLegacyDec := math.LegacyDec{} // zero value, invalid state + NewDec34FromLegacyDec(invalidLegacyDec) + }) + + // Test panic cases for NewDec34FromInt + require.Panics(t, func() { + invalidInt := math.Int{} // zero value, invalid state + NewDec34FromInt(invalidInt) + }) } From a009a3a2a09827b1e11b98179b487696afcffbc2 Mon Sep 17 00:00:00 2001 From: Cosmic Vagabond <121588426+cosmic-vagabond@users.noreply.github.com> Date: Wed, 15 Jan 2025 06:16:27 +0100 Subject: [PATCH 14/18] test(perpetual): fix tests --- x/amm/types/calc_in_amt_given_out.go | 4 +--- x/amm/types/calc_out_amt_given_in.go | 4 +--- x/perpetual/keeper/close_test.go | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/x/amm/types/calc_in_amt_given_out.go b/x/amm/types/calc_in_amt_given_out.go index 4f4a9e175..d9aaf1362 100644 --- a/x/amm/types/calc_in_amt_given_out.go +++ b/x/amm/types/calc_in_amt_given_out.go @@ -80,13 +80,11 @@ func (p Pool) CalcInAmtGivenOut( return sdk.Coin{}, elystypes.ZeroDec34(), ErrTooMuchSwapFee } - swapFeeDec34 := elystypes.NewDec34FromLegacyDec(swapFee) - // We deduct a swap fee on the input asset. The swap happens by following the invariant curve on the input * (1 - swap fee) // and then the swap fee is added to the pool. // Thus in order to give X amount out, we solve the invariant for the invariant input. However invariant input = (1 - swapfee) * trade input. // Therefore we divide by (1 - swapfee) here - tokenAmountInBeforeFee := tokenAmountIn.Quo(elystypes.OneDec34().Sub(swapFeeDec34)) + tokenAmountInBeforeFee := tokenAmountIn.Quo(elystypes.OneDec34().SubLegacyDec(swapFee)) // We round up tokenInAmt, as this is whats charged for the swap, for the precise amount out. // Otherwise, the pool would under-charge by this rounding error. diff --git a/x/amm/types/calc_out_amt_given_in.go b/x/amm/types/calc_out_amt_given_in.go index 623eb6577..347fb581c 100644 --- a/x/amm/types/calc_out_amt_given_in.go +++ b/x/amm/types/calc_out_amt_given_in.go @@ -23,9 +23,7 @@ func (p Pool) CalcOutAmtGivenIn( return sdk.Coin{}, elystypes.ZeroDec34(), err } - swapFeeDec34 := elystypes.NewDec34FromLegacyDec(swapFee) - - tokenAmountInAfterFee := elystypes.NewDec34FromInt(tokenIn.Amount).Mul(elystypes.OneDec34().Sub(swapFeeDec34)) + tokenAmountInAfterFee := elystypes.NewDec34FromInt(tokenIn.Amount).Mul(elystypes.OneDec34().SubLegacyDec(swapFee)) poolTokenInBalance := elystypes.NewDec34FromInt(poolAssetIn.Token.Amount) // accounted pool balance acountedPoolAssetInAmt := accountedPool.GetAccountedBalance(ctx, p.PoolId, poolAssetIn.Token.Denom) diff --git a/x/perpetual/keeper/close_test.go b/x/perpetual/keeper/close_test.go index b4900ef8d..ad7fa1219 100644 --- a/x/perpetual/keeper/close_test.go +++ b/x/perpetual/keeper/close_test.go @@ -314,7 +314,7 @@ func (suite *PerpetualKeeperTestSuite) TestClose() { } }, "", - math.NewInt(203), + math.NewInt(202), }, { "Close short with Not Enough liquidity", From afebdaf06832ab5a152447f2503324b8aaa49830 Mon Sep 17 00:00:00 2001 From: Cosmic Vagabond <121588426+cosmic-vagabond@users.noreply.github.com> Date: Wed, 15 Jan 2025 06:41:05 +0100 Subject: [PATCH 15/18] test: debug --- x/amm/types/calc_in_amt_given_out.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/x/amm/types/calc_in_amt_given_out.go b/x/amm/types/calc_in_amt_given_out.go index d9aaf1362..6235aff78 100644 --- a/x/amm/types/calc_in_amt_given_out.go +++ b/x/amm/types/calc_in_amt_given_out.go @@ -1,6 +1,8 @@ package types import ( + "fmt" + errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" @@ -51,7 +53,7 @@ func (p Pool) CalcInAmtGivenOut( poolTokenInBalance = elystypes.NewDec34FromInt(acountedPoolAssetInAmt) } - poolPostSwapOutBalance := poolTokenOutBalance.Sub(elystypes.NewDec34FromInt(tokenOut.Amount)) + poolPostSwapOutBalance := poolTokenOutBalance.SubInt(tokenOut.Amount) // (x_0)(y_0) = (x_0 + in)(y_0 - out) tokenAmountIn, err := solveConstantFunctionInvariant( poolTokenOutBalance, poolPostSwapOutBalance, @@ -86,10 +88,16 @@ func (p Pool) CalcInAmtGivenOut( // Therefore we divide by (1 - swapfee) here tokenAmountInBeforeFee := tokenAmountIn.Quo(elystypes.OneDec34().SubLegacyDec(swapFee)) + // print tokenAmountInBeforeFee + fmt.Println("tokenAmountInBeforeFee", tokenAmountInBeforeFee.String()) + // We round up tokenInAmt, as this is whats charged for the swap, for the precise amount out. // Otherwise, the pool would under-charge by this rounding error. tokenInAmt := tokenAmountInBeforeFee.ToInt() + // print tokenInAmt + fmt.Println("tokenInAmt", tokenInAmt.String()) + if !tokenInAmt.IsPositive() { return sdk.Coin{}, elystypes.ZeroDec34(), errorsmod.Wrapf(ErrInvalidMathApprox, "token amount must be positive") } From 9e96166d496e961a4592d7b5fa8778155f8a2e64 Mon Sep 17 00:00:00 2001 From: Cosmic Vagabond <121588426+cosmic-vagabond@users.noreply.github.com> Date: Wed, 15 Jan 2025 07:22:20 +0100 Subject: [PATCH 16/18] feat(dec34): add ceil method --- types/dec34.go | 27 ++++++++++++- types/dec34_test.go | 7 ++++ .../keeper_swap_exact_amount_out_test.go | 38 +++++++++---------- x/amm/keeper/msg_server_swap_by_denom_test.go | 8 ++-- .../msg_server_swap_exact_amount_out_test.go | 12 +++--- x/amm/keeper/route_exact_amount_out_test.go | 24 ++++++------ x/amm/types/calc_in_amt_given_out.go | 10 +---- x/amm/types/pool.go | 6 +-- x/amm/types/swap_in_amt_given_out_test.go | 12 +++--- 9 files changed, 83 insertions(+), 61 deletions(-) diff --git a/types/dec34.go b/types/dec34.go index 1ccb4ba74..153f43357 100644 --- a/types/dec34.go +++ b/types/dec34.go @@ -197,16 +197,39 @@ func (d Dec34) Neg() Dec34 { } func (d Dec34) ToLegacyDec() math.LegacyDec { - y, _, _ := apd.NewFromString(d.String()) + y, _, err := apd.NewFromString(d.String()) + if err != nil { + panic(err) + } z := new(apd.Decimal) // add enough precision to handle big decimal values c := apd.BaseContext.WithPrecision(100) - c.Quantize(z, y, -18) + _, err = c.Quantize(z, y, -18) + if err != nil { + panic(err) + } return math.LegacyMustNewDecFromStr(z.Text('f')) } +func (d Dec34) Ceil() Dec34 { + y, _, err := apd.NewFromString(d.String()) + if err != nil { + panic(err) + } + z := new(apd.Decimal) + + // add enough precision to handle big decimal values + c := apd.BaseContext.WithPrecision(100) + _, err = c.Ceil(z, y) + if err != nil { + panic(err) + } + + return NewDec34FromString(z.Text('f')) +} + func (d Dec34) ToInt() math.Int { return regenmath.Dec(d).SdkIntTrim() } diff --git a/types/dec34_test.go b/types/dec34_test.go index f986d1a18..823ebdc6f 100644 --- a/types/dec34_test.go +++ b/types/dec34_test.go @@ -260,4 +260,11 @@ func TestDec34(t *testing.T) { invalidInt := math.Int{} // zero value, invalid state NewDec34FromInt(invalidInt) }) + + // Test Ceil method + require.Equal(t, NewDec34FromInt64(1).String(), NewDec34FromInt64(1).Ceil().String()) + require.Equal(t, NewDec34FromInt64(2).String(), NewDec34FromString("1.5").Ceil().String()) + require.Equal(t, NewDec34FromInt64(2).String(), NewDec34FromString("1.9").Ceil().String()) + require.Equal(t, NewDec34FromInt64(2).String(), NewDec34FromString("1.999999999999999999").Ceil().String()) + require.Equal(t, NewDec34FromInt64(3).String(), NewDec34FromString("2.000000000000000001").Ceil().String()) } diff --git a/x/amm/keeper/keeper_swap_exact_amount_out_test.go b/x/amm/keeper/keeper_swap_exact_amount_out_test.go index 850e315eb..a168fecb4 100644 --- a/x/amm/keeper/keeper_swap_exact_amount_out_test.go +++ b/x/amm/keeper/keeper_swap_exact_amount_out_test.go @@ -128,15 +128,15 @@ func (suite *AmmKeeperTestSuite) TestSwapExactAmountOut() { poolInitBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, treasuryInitBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, swapFeeOut: sdkmath.LegacyNewDecWithPrec(1, 2), // 1% - tokenIn: sdk.NewInt64Coin("uusda", 10203), + tokenIn: sdk.NewInt64Coin("uusda", 10204), tokenInMax: sdkmath.NewInt(10000000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), weightBalanceBonus: sdkmath.LegacyZeroDec(), isOraclePool: false, useNewRecipient: false, - expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 989797), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 989796), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, expRecipientBalance: sdk.Coins{}, - expPoolBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1010203), sdk.NewInt64Coin(ptypes.BaseCurrency, 989901)}, + expPoolBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1010204), sdk.NewInt64Coin(ptypes.BaseCurrency, 989901)}, expTreasuryBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, expPass: true, }, @@ -146,15 +146,15 @@ func (suite *AmmKeeperTestSuite) TestSwapExactAmountOut() { poolInitBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, treasuryInitBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, swapFeeOut: sdkmath.LegacyZeroDec(), - tokenIn: sdk.NewInt64Coin("uusda", 10101), + tokenIn: sdk.NewInt64Coin("uusda", 10102), tokenInMax: sdkmath.NewInt(10000000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), weightBalanceBonus: sdkmath.LegacyZeroDec(), isOraclePool: false, useNewRecipient: false, - expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 989899), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 989898), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, expRecipientBalance: sdk.Coins{}, - expPoolBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1010101), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, + expPoolBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1010102), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, expTreasuryBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, expPass: true, }, @@ -164,15 +164,15 @@ func (suite *AmmKeeperTestSuite) TestSwapExactAmountOut() { poolInitBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, treasuryInitBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, swapFeeOut: sdkmath.LegacyZeroDec(), - tokenIn: sdk.NewInt64Coin("uusda", 222543), + tokenIn: sdk.NewInt64Coin("uusda", 222545), tokenInMax: sdkmath.NewInt(10000000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 200000), weightBalanceBonus: sdkmath.LegacyZeroDec(), isOraclePool: true, useNewRecipient: false, - expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 777457), sdk.NewInt64Coin(ptypes.BaseCurrency, 1200000)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 777455), sdk.NewInt64Coin(ptypes.BaseCurrency, 1200000)}, expRecipientBalance: sdk.Coins{}, - expPoolBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1222399), sdk.NewInt64Coin(ptypes.BaseCurrency, 800000)}, + expPoolBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1222401), sdk.NewInt64Coin(ptypes.BaseCurrency, 800000)}, expTreasuryBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000144), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, expPass: true, }, @@ -182,15 +182,15 @@ func (suite *AmmKeeperTestSuite) TestSwapExactAmountOut() { poolInitBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, treasuryInitBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, swapFeeOut: sdkmath.LegacyZeroDec(), - tokenIn: sdk.NewInt64Coin("uusda", 10101), + tokenIn: sdk.NewInt64Coin("uusda", 10102), tokenInMax: sdkmath.NewInt(10000000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), isOraclePool: false, useNewRecipient: false, weightBalanceBonus: sdkmath.LegacyNewDecWithPrec(3, 1), // 30% bonus - expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 989899), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 989898), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, expRecipientBalance: sdk.Coins{}, - expPoolBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1010101), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, + expPoolBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1010102), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, expTreasuryBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, expPass: true, }, @@ -200,15 +200,15 @@ func (suite *AmmKeeperTestSuite) TestSwapExactAmountOut() { poolInitBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, treasuryInitBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 100)}, swapFeeOut: sdkmath.LegacyZeroDec(), - tokenIn: sdk.NewInt64Coin("uusda", 10101), + tokenIn: sdk.NewInt64Coin("uusda", 10102), tokenInMax: sdkmath.NewInt(10000000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), weightBalanceBonus: sdkmath.LegacyNewDecWithPrec(3, 1), // 30% bonus isOraclePool: false, useNewRecipient: false, - expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 989899), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 989898), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, expRecipientBalance: sdk.Coins{}, - expPoolBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1010101), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, + expPoolBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1010102), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, expTreasuryBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 100)}, expPass: true, }, @@ -218,15 +218,15 @@ func (suite *AmmKeeperTestSuite) TestSwapExactAmountOut() { poolInitBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, treasuryInitBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 100)}, swapFeeOut: sdkmath.LegacyZeroDec(), - tokenIn: sdk.NewInt64Coin("uusda", 10101), + tokenIn: sdk.NewInt64Coin("uusda", 10102), tokenInMax: sdkmath.NewInt(10000000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), weightBalanceBonus: sdkmath.LegacyNewDecWithPrec(3, 1), // 30% bonus isOraclePool: false, useNewRecipient: true, - expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 989899), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 989898), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, expRecipientBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.BaseCurrency, 10000)}, - expPoolBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1010101), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, + expPoolBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1010102), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, expTreasuryBalance: sdk.Coins{sdk.NewInt64Coin("uusda", 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 100)}, expPass: true, }, @@ -333,7 +333,7 @@ func (suite *AmmKeeperTestSuite) TestSwapExactAmountOut() { track := suite.app.AmmKeeper.GetSlippageTrack(suite.ctx, 1, uint64(suite.ctx.BlockTime().Unix())) if tc.isOraclePool { - suite.Require().Equal(track.Tracked.String(), "22222uusda") + suite.Require().Equal(track.Tracked.String(), "22224uusda") } else { suite.Require().Equal(track.Tracked.String(), "") } diff --git a/x/amm/keeper/msg_server_swap_by_denom_test.go b/x/amm/keeper/msg_server_swap_by_denom_test.go index 7b2fd2463..2c6c2812e 100644 --- a/x/amm/keeper/msg_server_swap_by_denom_test.go +++ b/x/amm/keeper/msg_server_swap_by_denom_test.go @@ -200,10 +200,10 @@ func (suite *AmmKeeperTestSuite) TestMsgServerSwapByDenomWithOutRoute() { senderInitBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, swapFee: sdkmath.LegacyNewDecWithPrec(1, 2), // 1% tokenOut: sdk.NewInt64Coin(ptypes.Elys, 10000), - expTokenIn: sdk.NewInt64Coin(ptypes.BaseCurrency, 10203), + expTokenIn: sdk.NewInt64Coin(ptypes.BaseCurrency, 10204), tokenOutMax: sdkmath.NewInt(1000000), tokenDenomIn: ptypes.BaseCurrency, - expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010000), sdk.NewInt64Coin(ptypes.BaseCurrency, 989797)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010000), sdk.NewInt64Coin(ptypes.BaseCurrency, 989796)}, expPass: true, }, { @@ -211,10 +211,10 @@ func (suite *AmmKeeperTestSuite) TestMsgServerSwapByDenomWithOutRoute() { senderInitBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, swapFee: sdkmath.LegacyZeroDec(), tokenOut: sdk.NewInt64Coin(ptypes.Elys, 10000), - expTokenIn: sdk.NewInt64Coin(ptypes.BaseCurrency, 10101), + expTokenIn: sdk.NewInt64Coin(ptypes.BaseCurrency, 10102), tokenOutMax: sdkmath.NewInt(1000000), tokenDenomIn: ptypes.BaseCurrency, - expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010000), sdk.NewInt64Coin(ptypes.BaseCurrency, 989899)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010000), sdk.NewInt64Coin(ptypes.BaseCurrency, 989898)}, expPass: true, }, } { diff --git a/x/amm/keeper/msg_server_swap_exact_amount_out_test.go b/x/amm/keeper/msg_server_swap_exact_amount_out_test.go index 56e2ca730..a0edfca9b 100644 --- a/x/amm/keeper/msg_server_swap_exact_amount_out_test.go +++ b/x/amm/keeper/msg_server_swap_exact_amount_out_test.go @@ -26,7 +26,7 @@ func (suite *AmmKeeperTestSuite) TestMsgServerSwapExactAmountOut() { desc: "successful execution with positive swap fee", senderInitBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, swapFee: sdkmath.LegacyNewDecWithPrec(1, 2), // 1% - tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10203), + tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10204), tokenInMax: sdkmath.NewInt(10000000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), swapRoutes: []types.SwapAmountOutRoute{ @@ -35,14 +35,14 @@ func (suite *AmmKeeperTestSuite) TestMsgServerSwapExactAmountOut() { TokenInDenom: ptypes.Elys, }, }, - expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 989797), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 989796), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, expPass: true, }, { desc: "successful execution with zero swap fee", senderInitBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, swapFee: sdkmath.LegacyZeroDec(), - tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10101), + tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10102), tokenInMax: sdkmath.NewInt(10000000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), swapRoutes: []types.SwapAmountOutRoute{ @@ -51,7 +51,7 @@ func (suite *AmmKeeperTestSuite) TestMsgServerSwapExactAmountOut() { TokenInDenom: ptypes.Elys, }, }, - expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 989899), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 989898), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, expPass: true, }, { @@ -74,7 +74,7 @@ func (suite *AmmKeeperTestSuite) TestMsgServerSwapExactAmountOut() { desc: "multiple routes", senderInitBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, swapFee: sdkmath.LegacyZeroDec(), - tokenIn: sdk.NewInt64Coin(ptypes.BaseCurrency, 10204), + tokenIn: sdk.NewInt64Coin(ptypes.BaseCurrency, 10206), tokenInMax: sdkmath.NewInt(10000000), tokenOut: sdk.NewInt64Coin("uusdt", 10000), swapRoutes: []types.SwapAmountOutRoute{ @@ -87,7 +87,7 @@ func (suite *AmmKeeperTestSuite) TestMsgServerSwapExactAmountOut() { TokenInDenom: ptypes.Elys, }, }, - expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 989796), sdk.NewInt64Coin("uusdt", 10000)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 989794), sdk.NewInt64Coin("uusdt", 10000)}, expPass: true, }, } { diff --git a/x/amm/keeper/route_exact_amount_out_test.go b/x/amm/keeper/route_exact_amount_out_test.go index 4334c35f4..14dd878e9 100644 --- a/x/amm/keeper/route_exact_amount_out_test.go +++ b/x/amm/keeper/route_exact_amount_out_test.go @@ -65,12 +65,12 @@ func (suite *AmmKeeperTestSuite) TestRouteExactAmountOut() { treasuryInitBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, swapFeeIn: math.LegacyNewDecWithPrec(1, 2), // 1% swapFeeOut: math.LegacyZeroDec(), - tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10101), + tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10102), tokenInMax: math.NewInt(10000000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), weightBalanceBonus: math.LegacyZeroDec(), - expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 989899), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, - expPoolBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010101), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 989898), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, + expPoolBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010102), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, expTreasuryBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, expPass: true, }, @@ -81,12 +81,12 @@ func (suite *AmmKeeperTestSuite) TestRouteExactAmountOut() { treasuryInitBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, swapFeeIn: math.LegacyZeroDec(), swapFeeOut: math.LegacyZeroDec(), - tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10101), + tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10102), tokenInMax: math.NewInt(10000000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), weightBalanceBonus: math.LegacyZeroDec(), - expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 989899), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, - expPoolBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010101), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 989898), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, + expPoolBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010102), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, expTreasuryBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, expPass: true, }, @@ -97,12 +97,12 @@ func (suite *AmmKeeperTestSuite) TestRouteExactAmountOut() { treasuryInitBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, swapFeeIn: math.LegacyZeroDec(), swapFeeOut: math.LegacyZeroDec(), - tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10101), + tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10102), tokenInMax: math.NewInt(10000000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), weightBalanceBonus: math.LegacyNewDecWithPrec(3, 1), // 30% bonus - expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 989899), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, - expPoolBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010101), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 989898), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, + expPoolBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010102), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, expTreasuryBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 1000000)}, expPass: true, }, @@ -113,12 +113,12 @@ func (suite *AmmKeeperTestSuite) TestRouteExactAmountOut() { treasuryInitBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 100)}, swapFeeIn: math.LegacyZeroDec(), swapFeeOut: math.LegacyZeroDec(), - tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10101), + tokenIn: sdk.NewInt64Coin(ptypes.Elys, 10102), tokenInMax: math.NewInt(10000000), tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 10000), weightBalanceBonus: math.LegacyNewDecWithPrec(3, 1), // 30% bonus - expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 989899), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, - expPoolBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010101), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, + expSenderBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 989898), sdk.NewInt64Coin(ptypes.BaseCurrency, 1010000)}, + expPoolBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1010102), sdk.NewInt64Coin(ptypes.BaseCurrency, 990000)}, expTreasuryBalance: sdk.Coins{sdk.NewInt64Coin(ptypes.Elys, 1000000), sdk.NewInt64Coin(ptypes.BaseCurrency, 100)}, expPass: true, }, diff --git a/x/amm/types/calc_in_amt_given_out.go b/x/amm/types/calc_in_amt_given_out.go index 6235aff78..6f84c8102 100644 --- a/x/amm/types/calc_in_amt_given_out.go +++ b/x/amm/types/calc_in_amt_given_out.go @@ -1,8 +1,6 @@ package types import ( - "fmt" - errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" @@ -88,15 +86,9 @@ func (p Pool) CalcInAmtGivenOut( // Therefore we divide by (1 - swapfee) here tokenAmountInBeforeFee := tokenAmountIn.Quo(elystypes.OneDec34().SubLegacyDec(swapFee)) - // print tokenAmountInBeforeFee - fmt.Println("tokenAmountInBeforeFee", tokenAmountInBeforeFee.String()) - // We round up tokenInAmt, as this is whats charged for the swap, for the precise amount out. // Otherwise, the pool would under-charge by this rounding error. - tokenInAmt := tokenAmountInBeforeFee.ToInt() - - // print tokenInAmt - fmt.Println("tokenInAmt", tokenInAmt.String()) + tokenInAmt := tokenAmountInBeforeFee.Ceil().ToInt() if !tokenInAmt.IsPositive() { return sdk.Coin{}, elystypes.ZeroDec34(), errorsmod.Wrapf(ErrInvalidMathApprox, "token amount must be positive") diff --git a/x/amm/types/pool.go b/x/amm/types/pool.go index b2a6f98d5..06763ba80 100644 --- a/x/amm/types/pool.go +++ b/x/amm/types/pool.go @@ -261,8 +261,8 @@ func (pool Pool) GetMaximalNoSwapLPAmount(shareOutAmount sdkmath.Int) (neededLpL totalSharesAmount := pool.GetTotalShares() // shareRatio is the desired number of shares, divided by the total number of // shares currently in the pool. It is intended to be used in scenarios where you want - shareRatio := sdkmath.LegacyNewDecFromBigInt(shareOutAmount.BigInt()).QuoInt(totalSharesAmount.Amount) - if shareRatio.LTE(sdkmath.LegacyZeroDec()) { + shareRatio := elystypes.NewDec34FromInt(shareOutAmount).QuoInt(totalSharesAmount.Amount) + if shareRatio.LTE(elystypes.ZeroDec34()) { return sdk.Coins{}, errorsmod.Wrapf(ErrInvalidMathApprox, "Too few shares out wanted. "+ "(debug: getMaximalNoSwapLPAmount share ratio is zero or negative)") } @@ -272,7 +272,7 @@ func (pool Pool) GetMaximalNoSwapLPAmount(shareOutAmount sdkmath.Int) (neededLpL for _, coin := range poolLiquidity { // (coin.Amt * shareRatio).Ceil() - neededAmt := sdkmath.LegacyNewDecFromBigInt(coin.Amount.BigInt()).Mul(shareRatio).Ceil().RoundInt() + neededAmt := shareRatio.MulInt(coin.Amount).Ceil().ToInt() if neededAmt.LTE(sdkmath.ZeroInt()) { return sdk.Coins{}, errorsmod.Wrapf(ErrInvalidMathApprox, "Too few shares out wanted") } diff --git a/x/amm/types/swap_in_amt_given_out_test.go b/x/amm/types/swap_in_amt_given_out_test.go index cc06e2219..fc676488f 100644 --- a/x/amm/types/swap_in_amt_given_out_test.go +++ b/x/amm/types/swap_in_amt_given_out_test.go @@ -58,8 +58,8 @@ func (suite *TestSuite) TestSwapInAmtGivenOut() { tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 100_000_000), // 100 USDC inTokenDenom: "uusdt", swapFee: sdkmath.LegacyZeroDec(), - expRecoveryBonus: elystypes.NewDec34FromString("-0.0003310563933869157211503902584191568"), - expTokenIn: sdk.NewInt64Coin("uusdt", 101043551), + expRecoveryBonus: elystypes.NewDec34FromString("-0.0003310564009040219593685405884609596"), + expTokenIn: sdk.NewInt64Coin("uusdt", 101043561), expErr: false, }, // scenario2 - oracle based @@ -94,8 +94,8 @@ func (suite *TestSuite) TestSwapInAmtGivenOut() { tokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 100_000_000), // 100 USDC inTokenDenom: "uusdt", swapFee: sdkmath.LegacyZeroDec(), - expRecoveryBonus: elystypes.NewDec34FromString("-0.006413552800214017166854821505321781"), - expTokenIn: sdk.NewInt64Coin("uusdt", 102008657), + expRecoveryBonus: elystypes.NewDec34FromString("-0.006413552900341021378891128886988564"), + expTokenIn: sdk.NewInt64Coin("uusdt", 102008667), expErr: false, }, // scenario3 - oracle based @@ -131,7 +131,7 @@ func (suite *TestSuite) TestSwapInAmtGivenOut() { inTokenDenom: ptypes.BaseCurrency, swapFee: sdkmath.LegacyZeroDec(), expRecoveryBonus: elystypes.NewDec34FromString("0.001558845726811989564174701707355285"), - expTokenIn: sdk.NewInt64Coin(ptypes.BaseCurrency, 101348290), + expTokenIn: sdk.NewInt64Coin(ptypes.BaseCurrency, 101348300), expErr: false, }, // scenario1 - non-oracle based @@ -167,7 +167,7 @@ func (suite *TestSuite) TestSwapInAmtGivenOut() { inTokenDenom: ptypes.BaseCurrency, swapFee: sdkmath.LegacyNewDecWithPrec(1, 2), // 1% expRecoveryBonus: elystypes.ZeroDec34(), - expTokenIn: sdk.NewInt64Coin(ptypes.BaseCurrency, 36075036), + expTokenIn: sdk.NewInt64Coin(ptypes.BaseCurrency, 36075037), expErr: false, }, From 787d233786166935a5bf3b32e8b40391ef2355b6 Mon Sep 17 00:00:00 2001 From: Cosmic Vagabond <121588426+cosmic-vagabond@users.noreply.github.com> Date: Wed, 15 Jan 2025 07:37:30 +0100 Subject: [PATCH 17/18] test(perpetual): fix tests --- x/perpetual/keeper/close_test.go | 14 ++++---- x/perpetual/keeper/open_consolidate_test.go | 4 +-- .../keeper/query_open_estimation_test.go | 32 +++++++++---------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/x/perpetual/keeper/close_test.go b/x/perpetual/keeper/close_test.go index ad7fa1219..f06a4b793 100644 --- a/x/perpetual/keeper/close_test.go +++ b/x/perpetual/keeper/close_test.go @@ -93,7 +93,7 @@ func (suite *PerpetualKeeperTestSuite) TestClose() { } }, "", - math.NewInt(202), + math.NewInt(205), }, { "Close with price greater than open price and less than take profit price", @@ -134,7 +134,7 @@ func (suite *PerpetualKeeperTestSuite) TestClose() { } }, "", - math.NewInt(29), // less than at the same price + math.NewInt(30), // less than at the same price }, { "Close at take profit price", @@ -175,7 +175,7 @@ func (suite *PerpetualKeeperTestSuite) TestClose() { } }, "", - math.NewInt(90), + math.NewInt(94), }, { "Close at stopLoss price", @@ -216,7 +216,7 @@ func (suite *PerpetualKeeperTestSuite) TestClose() { } }, "", - math.NewInt(501), + math.NewInt(503), }, { "Sucess: close long position,at same price as open price", @@ -247,7 +247,7 @@ func (suite *PerpetualKeeperTestSuite) TestClose() { } }, "", - math.NewInt(202), + math.NewInt(205), }, { "Success: close short position at same price as open price", @@ -276,7 +276,7 @@ func (suite *PerpetualKeeperTestSuite) TestClose() { } }, "", - math.NewInt(4503), + math.NewInt(4505), }, { "Force Close with too much unpaid Liability making custody amount 0", @@ -314,7 +314,7 @@ func (suite *PerpetualKeeperTestSuite) TestClose() { } }, "", - math.NewInt(202), + math.NewInt(205), }, { "Close short with Not Enough liquidity", diff --git a/x/perpetual/keeper/open_consolidate_test.go b/x/perpetual/keeper/open_consolidate_test.go index b04647082..26f1016e9 100644 --- a/x/perpetual/keeper/open_consolidate_test.go +++ b/x/perpetual/keeper/open_consolidate_test.go @@ -172,7 +172,7 @@ func (suite *PerpetualKeeperTestSuite) TestOpenConsolidateUsingOpen() { "", &types.MTP{ Collateral: math.NewInt(800), - Liabilities: math.NewInt(649), + Liabilities: math.NewInt(653), Custody: math.NewInt(4000), TakeProfitPrice: math.LegacyMustNewDecFromStr("0.692857142857142857"), }, @@ -211,7 +211,7 @@ func (suite *PerpetualKeeperTestSuite) TestOpenConsolidateUsingOpen() { "", &types.MTP{ Collateral: math.NewInt(800), - Liabilities: math.NewInt(406), + Liabilities: math.NewInt(408), Custody: math.NewInt(2800), TakeProfitPrice: math.LegacyMustNewDecFromStr("0.95"), }, diff --git a/x/perpetual/keeper/query_open_estimation_test.go b/x/perpetual/keeper/query_open_estimation_test.go index 6330978b4..ebb84d5d3 100644 --- a/x/perpetual/keeper/query_open_estimation_test.go +++ b/x/perpetual/keeper/query_open_estimation_test.go @@ -239,23 +239,23 @@ func TestOpenEstimation_Long5XAtom10Atom(t *testing.T) { require.NoError(t, err) require.Equal(t, &types.QueryOpenEstimationResponse{ Position: types.Position_LONG, - EffectiveLeverage: math.LegacyMustNewDecFromStr("5.080191534600483476"), + EffectiveLeverage: math.LegacyMustNewDecFromStr("5.080191741067260093"), TradingAsset: ptypes.ATOM, Collateral: sdk.NewCoin(ptypes.ATOM, math.NewInt(10_000_000)), PositionSize: sdk.NewCoin(ptypes.ATOM, math.NewInt(50_000_000)), - OpenPrice: math.LegacyMustNewDecFromStr("5.019731425000000000"), + OpenPrice: math.LegacyMustNewDecFromStr("5.019731475000000000"), TakeProfitPrice: tradingAssetPrice.MulInt64(3), - LiquidationPrice: math.LegacyMustNewDecFromStr("4.116179768500000000"), - EstimatedPnl: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(399210743)), + LiquidationPrice: math.LegacyMustNewDecFromStr("4.116179809500000000"), + EstimatedPnl: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(399210741)), HourlyInterestRate: math.LegacyZeroDec(), AvailableLiquidity: sdk.NewCoin(ptypes.ATOM, math.NewInt(10000000000)), - Slippage: elystypes.NewDec34FromString("0.0015025").String(), + Slippage: elystypes.NewDec34FromString("0.00150251").String(), BorrowInterestRate: math.LegacyMustNewDecFromStr("0.000000000000000000"), FundingRate: math.LegacyMustNewDecFromStr("0.000000000000000000"), - PriceImpact: math.LegacyMustNewDecFromStr("-0.003946285000000000"), + PriceImpact: math.LegacyMustNewDecFromStr("-0.003946295000000000"), Custody: sdk.NewCoin(ptypes.ATOM, math.NewInt(50_000_000)), - Liabilities: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(200789257)), - WeightBreakingFee: elystypes.NewDec34FromString("0.001435619047140196033471334892443643").String(), + Liabilities: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(200789259)), + WeightBreakingFee: elystypes.NewDec34FromString("0.001435619047211833495634519087291444").String(), }, res) } @@ -503,22 +503,22 @@ func TestOpenEstimation_Short5XAtom10Usdc(t *testing.T) { require.NoError(t, err) expectedRes := &types.QueryOpenEstimationResponse{ Position: types.Position_SHORT, - EffectiveLeverage: math.LegacyMustNewDecFromStr("4.081548693432199945"), + EffectiveLeverage: math.LegacyMustNewDecFromStr("4.081549209874994906"), TradingAsset: ptypes.ATOM, Collateral: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(100_000_000)), - PositionSize: sdk.NewCoin(ptypes.ATOM, math.NewInt(80320960)), - OpenPrice: math.LegacyMustNewDecFromStr("4.980020159121604124"), + PositionSize: sdk.NewCoin(ptypes.ATOM, math.NewInt(80320962)), + OpenPrice: math.LegacyMustNewDecFromStr("4.980020035118603286"), TakeProfitPrice: tradingAssetPrice.QuoInt64(3), - LiquidationPrice: math.LegacyMustNewDecFromStr("6.073195316001956249"), - EstimatedPnl: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(266131734)), + LiquidationPrice: math.LegacyMustNewDecFromStr("6.073195164778784495"), + EstimatedPnl: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(266131731)), HourlyInterestRate: math.LegacyZeroDec(), AvailableLiquidity: sdk.NewCoin(ptypes.ATOM, math.NewInt(10000000000)), - Slippage: elystypes.NewDec34FromString("0.003008").String(), + Slippage: elystypes.NewDec34FromString("0.003008025").String(), BorrowInterestRate: math.LegacyMustNewDecFromStr("0.000000000000000000"), FundingRate: math.LegacyMustNewDecFromStr("0.000000000000000000"), - PriceImpact: math.LegacyMustNewDecFromStr("0.003995968175679175"), + PriceImpact: math.LegacyMustNewDecFromStr("0.003995992976279343"), Custody: sdk.NewCoin(ptypes.BaseCurrency, math.NewInt(500000000)), - Liabilities: sdk.NewCoin(ptypes.ATOM, math.NewInt(80320960)), + Liabilities: sdk.NewCoin(ptypes.ATOM, math.NewInt(80320962)), WeightBreakingFee: elystypes.ZeroDec34().String(), } require.Equal(t, expectedRes, res) From c3eba57534563a7f3e54a25c2632680df5170f9b Mon Sep 17 00:00:00 2001 From: Cosmic Vagabond <121588426+cosmic-vagabond@users.noreply.github.com> Date: Sat, 25 Jan 2025 03:52:52 +0100 Subject: [PATCH 18/18] refactor: move division op to get asset price from denom --- types/dec34.go | 12 +- types/dec34_test.go | 113 +++++++++++++----- x/amm/keeper/estimate_price.go | 12 +- x/amm/keeper/estimate_price_test.go | 4 +- .../keeper/track_weight_breaking_slippage.go | 4 +- ...one_token_unit.go => base_token_amount.go} | 2 +- x/amm/types/calc_exit_pool.go | 4 +- x/amm/types/pool.go | 4 +- x/amm/types/pool_join_pool.go | 4 +- x/amm/types/swap_in_amt_given_out.go | 16 +-- x/amm/types/swap_out_amt_given_in.go | 20 ++-- x/amm/types/swap_out_amt_given_in_test.go | 4 +- x/leveragelp/keeper/hooks_amm.go | 4 +- x/leveragelp/keeper/query_position.go | 4 +- x/leveragelp/keeper/utils.go | 4 +- x/masterchef/keeper/abci.go | 14 +-- x/masterchef/keeper/apr_denom.go | 14 +-- x/masterchef/keeper/apr_stable_stake.go | 6 +- x/masterchef/keeper/query_chain_tvl.go | 5 +- x/masterchef/keeper/query_pool_rewards.go | 4 +- x/oracle/keeper/price.go | 3 +- x/tier/keeper/portfolio.go | 34 +++--- x/tier/keeper/query_get_consolidated_price.go | 4 +- x/tier/keeper/query_get_users_pool_data.go | 4 +- 24 files changed, 180 insertions(+), 119 deletions(-) rename x/amm/types/{one_token_unit.go => base_token_amount.go} (68%) diff --git a/types/dec34.go b/types/dec34.go index 153f43357..b808bffcb 100644 --- a/types/dec34.go +++ b/types/dec34.go @@ -1,6 +1,8 @@ package types import ( + "strconv" + "cosmossdk.io/math" "github.com/cockroachdb/apd/v2" regenmath "github.com/regen-network/regen-ledger/types/v2/math" @@ -68,7 +70,7 @@ func PowDec34(base, exp Dec34) Dec34 { d := new(apd.Decimal) // add enough precision to handle big decimal values - c := apd.BaseContext.WithPrecision(100) + c := apd.BaseContext.WithPrecision(34) _, err := c.Pow(d, b, e) if err != nil { panic(err) @@ -242,6 +244,14 @@ func (d Dec34) ToInt64() int64 { return y } +func (d Dec34) Float64() float64 { + y, err := strconv.ParseFloat(d.String(), 64) + if err != nil { + panic(err) + } + return y +} + func (d Dec34) Equal(other Dec34) bool { return regenmath.Dec(d).Equal(regenmath.Dec(other)) } diff --git a/types/dec34_test.go b/types/dec34_test.go index 823ebdc6f..be5252c46 100644 --- a/types/dec34_test.go +++ b/types/dec34_test.go @@ -1,9 +1,11 @@ package types import ( + "math" + "strconv" "testing" - "cosmossdk.io/math" + sdkmath "cosmossdk.io/math" "github.com/cockroachdb/apd/v2" "github.com/stretchr/testify/require" ) @@ -19,13 +21,26 @@ func TestDec34(t *testing.T) { require.Equal(t, NewDec34FromInt64(-1), MinusOneDec34()) require.Equal(t, NewDec34FromInt64(0), ZeroDec34()) + // Test amount calculation with legacy dec panics because precision cap at 18 decimals + require.Panics(t, func() { + rate := sdkmath.LegacyNewDecWithPrec(4, 18+3) // 0.004 + amount := sdkmath.NewInt(1000) + rate.MulInt(amount) + }) + + // Test amount calculation with dec34 + rate := NewDec34WithPrec(4, 18+3) // 0.004 + amount := sdkmath.NewInt(1000) + require.Equal(t, NewDec34WithPrec(4, 18).String(), rate.MulInt(amount).String()) + + // Test NewDec34FromLegacyDec - legacyDec := math.LegacyNewDec(123) + legacyDec := sdkmath.LegacyNewDec(123) dec34FromLegacy := NewDec34FromLegacyDec(legacyDec) require.Equal(t, "123", dec34FromLegacy.String()) // Test NewDec34FromInt - intVal := math.NewInt(456) + intVal := sdkmath.NewInt(456) dec34FromInt := NewDec34FromInt(intVal) require.Equal(t, "456", dec34FromInt.String()) @@ -39,53 +54,53 @@ func TestDec34(t *testing.T) { require.Equal(t, three, sum) // Test AddInt - require.Equal(t, NewDec34FromInt64(3), one.AddInt(math.NewInt(2))) + require.Equal(t, NewDec34FromInt64(3), one.AddInt(sdkmath.NewInt(2))) // Test AddInt64 require.Equal(t, NewDec34FromInt64(3), one.AddInt64(2)) // Test AddLegacyDec - require.Equal(t, NewDec34FromLegacyDec(math.LegacyNewDec(3)), one.AddLegacyDec(math.LegacyNewDec(2))) + require.Equal(t, NewDec34FromLegacyDec(sdkmath.LegacyNewDec(3)), one.AddLegacyDec(sdkmath.LegacyNewDec(2))) // Test Sub diff := three.Sub(two) require.Equal(t, one, diff) // Test SubInt - require.Equal(t, NewDec34FromInt64(1), three.SubInt(math.NewInt(2))) + require.Equal(t, NewDec34FromInt64(1), three.SubInt(sdkmath.NewInt(2))) // Test SubInt64 require.Equal(t, NewDec34FromInt64(1), three.SubInt64(2)) // Test SubLegacyDec - require.Equal(t, NewDec34FromLegacyDec(math.LegacyNewDec(1)), three.SubLegacyDec(math.LegacyNewDec(2))) + require.Equal(t, NewDec34FromLegacyDec(sdkmath.LegacyNewDec(1)), three.SubLegacyDec(sdkmath.LegacyNewDec(2))) // Test Mul prod := two.Mul(three) require.Equal(t, NewDec34FromInt64(6), prod) // Test MulInt - require.Equal(t, NewDec34FromInt64(10000).String(), OneDec34().MulInt(math.NewInt(10000)).String()) + require.Equal(t, NewDec34FromInt64(10000).String(), OneDec34().MulInt(sdkmath.NewInt(10000)).String()) // Test MulInt64 require.Equal(t, NewDec34FromInt64(10000).String(), OneDec34().MulInt64(10000).String()) // Test MulLegacyDec - require.Equal(t, NewDec34FromString("10000.000000000000000000").String(), OneDec34().MulLegacyDec(math.LegacyNewDec(10000)).String()) + require.Equal(t, NewDec34FromString("10000.000000000000000000").String(), OneDec34().MulLegacyDec(sdkmath.LegacyNewDec(10000)).String()) // Test Quo require.Equal(t, "1.5", three.Quo(two).String()) // Test QuoInt - require.Equal(t, OneDec34().String(), NewDec34FromInt64(100).QuoInt(math.NewInt(100)).String()) + require.Equal(t, OneDec34().String(), NewDec34FromInt64(100).QuoInt(sdkmath.NewInt(100)).String()) // Test QuoInt64 require.Equal(t, OneDec34().String(), NewDec34FromInt64(100).QuoInt64(100).String()) require.Equal(t, NewDec34FromString("0.1585489599188229325215626585489599").String(), NewDec34FromInt64(1000000).Quo(NewDec34FromString("6307200")).String()) - require.Equal(t, NewDec34FromString("0.1585489599188229325215626585489599").String(), NewDec34FromInt64(1000000).QuoInt(math.NewInt(6307200)).String()) + require.Equal(t, NewDec34FromString("0.1585489599188229325215626585489599").String(), NewDec34FromInt64(1000000).QuoInt(sdkmath.NewInt(6307200)).String()) // Test QuoLegacyDec - require.Equal(t, OneDec34().String(), NewDec34FromInt64(100).QuoLegacyDec(math.LegacyNewDec(100)).String()) + require.Equal(t, OneDec34().String(), NewDec34FromInt64(100).QuoLegacyDec(sdkmath.LegacyNewDec(100)).String()) require.Equal(t, NewDec34FromString("100000123456.789000000000000000").String(), @@ -98,30 +113,30 @@ func TestDec34(t *testing.T) { }) // Test ToLegacyDec - require.Equal(t, math.LegacyNewDec(3), three.ToLegacyDec()) + require.Equal(t, sdkmath.LegacyNewDec(3), three.ToLegacyDec()) require.Equal(t, NewDec34FromString("1000000000000000000000000000000000000123456789.000000000000000000").ToLegacyDec().String(), - math.LegacyMustNewDecFromStr("1000000000000000000000000000000000000123456789.000000000000000000").String(), + sdkmath.LegacyMustNewDecFromStr("1000000000000000000000000000000000000123456789.000000000000000000").String(), ) require.Equal(t, NewDec34FromString("1.000000000000000000000").ToLegacyDec().String(), - math.LegacyMustNewDecFromStr("1.000000000000000000").String(), + sdkmath.LegacyMustNewDecFromStr("1.000000000000000000").String(), ) require.Equal(t, NewDec34FromString("123.456000000000000000000").ToLegacyDec().String(), - math.LegacyMustNewDecFromStr("123.456000000000000000").String(), + sdkmath.LegacyMustNewDecFromStr("123.456000000000000000").String(), ) require.Equal(t, NewDec34FromString("0.000000000000000000000").ToLegacyDec().String(), - math.LegacyMustNewDecFromStr("0").String(), + sdkmath.LegacyMustNewDecFromStr("0").String(), ) require.Equal(t, NewDec34FromString("96346.39698847304510148894982122764").ToLegacyDec().String(), - math.LegacyMustNewDecFromStr("96346.396988473045101489").String(), + sdkmath.LegacyMustNewDecFromStr("96346.396988473045101489").String(), ) require.Equal(t, NewDec34FromString("0.0000002").ToLegacyDec().String(), - math.LegacyMustNewDecFromStr("0.0000002").String(), + sdkmath.LegacyMustNewDecFromStr("0.0000002").String(), ) input, _, _ := apd.NewFromString("96346.39698847304510148894982122764") output := new(apd.Decimal) @@ -134,7 +149,7 @@ func TestDec34(t *testing.T) { // Test ToInt intResult := three.ToInt() - require.Equal(t, math.NewInt(3), intResult) + require.Equal(t, sdkmath.NewInt(3), intResult) // Test String require.Equal(t, "3", three.String()) @@ -161,7 +176,7 @@ func TestDec34(t *testing.T) { // Test NewDec34WithPrec require.Equal(t, NewDec34WithPrec(1, 2).String(), NewDec34WithPrec(1, 2).String()) require.Equal(t, NewDec34FromInt64(100).String(), OneDec34().Mul(NewDec34WithPrec(100, 0)).String()) - require.Equal(t, NewDec34WithPrec(1, 2).String()+"0000000000000000", math.LegacyNewDecWithPrec(1, 2).String()) + require.Equal(t, NewDec34WithPrec(1, 2).String()+"0000000000000000", sdkmath.LegacyNewDecWithPrec(1, 2).String()) require.Equal(t, NewDec34WithPrec(1, 2).String(), "0.01") // Test NewDec34FromString @@ -219,11 +234,53 @@ func TestDec34(t *testing.T) { require.Equal(t, "27", PowDec34(NewDec34FromInt64(3), NewDec34FromInt64(3)).String()) // Test decimal powers - require.Equal(t, "1.414213562373095048801688724209698078569671875376948073176679737990732478462107038850387534327641573", + require.Equal(t, "1.414213562373095048801688724209698", PowDec34(NewDec34FromInt64(2), NewDec34FromString("0.5")).String()) - require.Equal(t, "3.162277660168379331998893544432718533719555139325216826857504852792594438639238221344248108379300295", + require.Equal(t, "3.162277660168379331998893544432719", PowDec34(NewDec34FromInt64(10), NewDec34FromString("0.5")).String()) + // Test against sdkmath.Pow results + require.InDelta(t, + sdkmath.LegacyNewDec(2).Power(3).MustFloat64(), + PowDec34(NewDec34FromInt64(2), NewDec34FromInt64(3)).Float64(), + 1e-34, + ) + + require.InDelta(t, math.Sqrt(2), PowDec34(NewDec34FromInt64(2), NewDec34FromString("0.5")).Float64(), 1e-34) + + require.InDelta(t, + sdkmath.LegacyNewDec(314).Quo(sdkmath.LegacyNewDec(100)).Power(27).MustFloat64(), + PowDec34(NewDec34FromString("3.14"), NewDec34FromString("27")).Float64(), + 1e-34, + ) + + require.InDelta(t, + sdkmath.LegacyMustNewDecFromStr("0.999999").Power(1000000000).MustFloat64(), + PowDec34(NewDec34FromString("0.999999"), NewDec34FromString("1e9")).Float64(), + 1e-1000, + ) + + // Test negative base with even/odd exponents + require.Equal(t, + strconv.FormatFloat(math.Pow(-2, 3), 'f', -1, 64), + PowDec34(NewDec34FromInt64(-2), NewDec34FromInt64(3)).String(), + ) + + // Test power function with base very close to 1 and large exponent that results to a number that is close to 0 + require.Equal(t, "0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005073421550798666518642372039988673", + PowDec34(NewDec34FromString("0.999999"), NewDec34FromInt64(1000000000)).String()) + require.Equal(t, "0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000001383882687839742170433613070736249", + PowDec34(NewDec34FromString("0.9999999"), NewDec34FromInt64(2000000000)).String()) + require.Equal(t, "0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000001383882670754770122309394609895554", + PowDec34(NewDec34FromString("0.9999999"), NewDec34FromString("2000000000.123456789")).String()) + // Test with much larger exponents + require.Equal(t, "0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005075705105932503148279788389545775", + PowDec34(NewDec34FromString("0.9999999"), NewDec34FromInt64(10000000000)).String()) + require.Equal(t, "0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011349162652560783926533913492002", + PowDec34(NewDec34FromString("0.9999999"), NewDec34FromInt64(100000000000)).String()) + require.Equal(t, "0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003545178928894079018545060981601405", + PowDec34(NewDec34FromString("0.9999999"), NewDec34FromString("1000000000000.987654321")).String()) + // Test powers with decimal base require.Equal(t, "3.375", PowDec34(NewDec34FromString("1.5"), NewDec34FromInt64(3)).String()) @@ -237,9 +294,9 @@ func TestDec34(t *testing.T) { require.Equal(t, "27", NewDec34FromInt64(3).Pow(NewDec34FromInt64(3)).String()) // Test PowLegacyDec method - require.Equal(t, "8", NewDec34FromInt64(2).PowLegacyDec(math.LegacyNewDec(3)).String()) - require.Equal(t, "16", NewDec34FromInt64(2).PowLegacyDec(math.LegacyNewDec(4)).String()) - require.Equal(t, "27", NewDec34FromInt64(3).PowLegacyDec(math.LegacyNewDec(3)).String()) + require.Equal(t, "8", NewDec34FromInt64(2).PowLegacyDec(sdkmath.LegacyNewDec(3)).String()) + require.Equal(t, "16", NewDec34FromInt64(2).PowLegacyDec(sdkmath.LegacyNewDec(4)).String()) + require.Equal(t, "27", NewDec34FromInt64(3).PowLegacyDec(sdkmath.LegacyNewDec(3)).String()) // Test panic cases for NewDec34FromString require.Panics(t, func() { @@ -251,13 +308,13 @@ func TestDec34(t *testing.T) { // Test panic cases for NewDec34FromLegacyDec require.Panics(t, func() { - invalidLegacyDec := math.LegacyDec{} // zero value, invalid state + invalidLegacyDec := sdkmath.LegacyDec{} // zero value, invalid state NewDec34FromLegacyDec(invalidLegacyDec) }) // Test panic cases for NewDec34FromInt require.Panics(t, func() { - invalidInt := math.Int{} // zero value, invalid state + invalidInt := sdkmath.Int{} // zero value, invalid state NewDec34FromInt(invalidInt) }) diff --git a/x/amm/keeper/estimate_price.go b/x/amm/keeper/estimate_price.go index 17ffae89a..e0c0a2e45 100644 --- a/x/amm/keeper/estimate_price.go +++ b/x/amm/keeper/estimate_price.go @@ -36,7 +36,7 @@ func (k Keeper) GetEdenDenomPrice(ctx sdk.Context, baseCurrency string) (elystyp } usdcDenomPrice, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) if usdcDenomPrice.IsZero() { - usdcDenomPrice = elystypes.OneDec34() + usdcDenomPrice = elystypes.NewDec34WithPrec(1, int32(decimals)) } return edenUsdcRate.Mul(usdcDenomPrice), decimals } @@ -51,19 +51,19 @@ func (k Keeper) GetTokenPrice(ctx sdk.Context, tokenInDenom, baseCurrency string tokenUsdcRate := k.EstimatePrice(ctx, tokenInDenom, baseCurrency) usdcDenomPrice, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) if usdcDenomPrice.IsZero() { - usdcDenomPrice = elystypes.OneDec34() + usdcDenomPrice = elystypes.NewDec34WithPrec(1, int32(decimals)) } return tokenUsdcRate.Mul(usdcDenomPrice), decimals } func (k Keeper) CalculateUSDValue(ctx sdk.Context, denom string, amount sdkmath.Int) elystypes.Dec34 { - tokenPrice, _ := k.oracleKeeper.GetAssetPriceFromDenom(ctx, denom) + tokenPrice, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, denom) if tokenPrice.IsZero() { asset, found := k.assetProfileKeeper.GetEntryByDenom(ctx, denom) if !found { return elystypes.ZeroDec34() } - tokenPrice = k.CalcAmmPrice(ctx, asset.Denom, asset.Decimals) + tokenPrice = k.CalcAmmPrice(ctx, asset.Denom, decimals) } return tokenPrice.MulInt(amount) } @@ -80,11 +80,11 @@ func (k Keeper) CalcAmmPrice(ctx sdk.Context, denom string, decimal uint64) elys } routes := resp.InRoute - tokenIn := sdk.NewCoin(denom, types.OneTokenUnit(decimal)) + tokenIn := sdk.NewCoin(denom, types.BaseTokenAmount(decimal)) discount := sdkmath.LegacyNewDec(1) spotPrice, _, _, _, _, _, _, _, err := k.CalcInRouteSpotPrice(ctx, tokenIn, routes, discount, sdkmath.LegacyZeroDec()) if err != nil { return elystypes.ZeroDec34() } return spotPrice.Mul(usdcPrice) -} +} \ No newline at end of file diff --git a/x/amm/keeper/estimate_price_test.go b/x/amm/keeper/estimate_price_test.go index e75037c7c..fd6bc3686 100644 --- a/x/amm/keeper/estimate_price_test.go +++ b/x/amm/keeper/estimate_price_test.go @@ -30,7 +30,7 @@ func (suite *AmmKeeperTestSuite) TestEstimatePrice() { }, func() { price, _ := suite.app.AmmKeeper.GetTokenPrice(suite.ctx, ptypes.BaseCurrency, ptypes.BaseCurrency) - suite.Require().Equal(elystypes.OneDec34().String(), price.String()) + suite.Require().Equal(elystypes.NewDec34FromString("0.000001").String(), price.String()) }, }, { @@ -69,7 +69,7 @@ func (suite *AmmKeeperTestSuite) TestCalculateUSDValue() { }, func() { value := suite.app.AmmKeeper.CalculateUSDValue(suite.ctx, ptypes.BaseCurrency, math.NewInt(1000)) - suite.Require().Equal(value.String(), elystypes.NewDec34FromInt64(1000).String()) + suite.Require().Equal(value.String(), elystypes.NewDec34FromString("0.001").String()) }, }, { diff --git a/x/amm/keeper/track_weight_breaking_slippage.go b/x/amm/keeper/track_weight_breaking_slippage.go index dadcb69b6..279a54bd5 100644 --- a/x/amm/keeper/track_weight_breaking_slippage.go +++ b/x/amm/keeper/track_weight_breaking_slippage.go @@ -53,11 +53,11 @@ func (k Keeper) AddWeightAndSlippageFee(ctx sdk.Context, track types.WeightBreak } func (k Keeper) TrackWeightBreakingSlippage(ctx sdk.Context, poolId uint64, token sdk.Coin) { - price, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, token.Denom) + price, _ := k.oracleKeeper.GetAssetPriceFromDenom(ctx, token.Denom) track := types.WeightBreakingSlippage{ PoolId: poolId, Date: ctx.BlockTime().Format("2006-01-02"), - Amount: price.MulInt(token.Amount).QuoInt(types.OneTokenUnit(decimals)).ToLegacyDec(), + Amount: price.MulInt(token.Amount).ToLegacyDec(), } k.AddWeightAndSlippageFee(ctx, track) } diff --git a/x/amm/types/one_token_unit.go b/x/amm/types/base_token_amount.go similarity index 68% rename from x/amm/types/one_token_unit.go rename to x/amm/types/base_token_amount.go index 6b99dfe3e..417ab2035 100644 --- a/x/amm/types/one_token_unit.go +++ b/x/amm/types/base_token_amount.go @@ -4,6 +4,6 @@ import ( sdkmath "cosmossdk.io/math" ) -func OneTokenUnit(decimal uint64) sdkmath.Int { +func BaseTokenAmount(decimal uint64) sdkmath.Int { return sdkmath.NewIntWithDecimal(1, int(decimal)) } diff --git a/x/amm/types/calc_exit_pool.go b/x/amm/types/calc_exit_pool.go index bd465e03f..97843e671 100644 --- a/x/amm/types/calc_exit_pool.go +++ b/x/amm/types/calc_exit_pool.go @@ -60,7 +60,7 @@ func CalcExitPool( accountedAssets := pool.GetAccountedBalance(ctx, accountedPoolKeeper, pool.PoolAssets) initialWeightDistance := pool.WeightDistanceFromTarget(ctx, oracleKeeper, accountedAssets) - tokenPrice, decimals := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenOutDenom) + tokenPrice, _ := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenOutDenom) exitValueWithoutSlippage, err := CalcExitValueWithoutSlippage(ctx, oracleKeeper, accountedPoolKeeper, pool, exitingShares, tokenOutDenom) if err != nil { return sdk.Coins{}, elystypes.ZeroDec34(), err @@ -71,7 +71,7 @@ func CalcExitPool( return sdk.Coins{}, elystypes.ZeroDec34(), ErrAmountTooLow } - oracleOutAmount := exitValueWithoutSlippage.Quo(tokenPrice.QuoInt(OneTokenUnit(decimals))) + oracleOutAmount := exitValueWithoutSlippage.Quo(tokenPrice) newAssetPools, err := pool.NewPoolAssetsAfterSwap(ctx, sdk.Coins{}, diff --git a/x/amm/types/pool.go b/x/amm/types/pool.go index 06763ba80..dc23e500f 100644 --- a/x/amm/types/pool.go +++ b/x/amm/types/pool.go @@ -302,7 +302,7 @@ func (p *Pool) TVL(ctx sdk.Context, oracleKeeper OracleKeeper, accountedPoolKeep totalWeight := sdkmath.ZeroInt() oracleAssetsWeight := sdkmath.ZeroInt() for _, asset := range p.PoolAssets { - tokenPrice, decimals := oracleKeeper.GetAssetPriceFromDenom(ctx, asset.Token.Denom) + tokenPrice, _ := oracleKeeper.GetAssetPriceFromDenom(ctx, asset.Token.Denom) totalWeight = totalWeight.Add(asset.Weight) if tokenPrice.IsZero() { if p.PoolParams.UseOracle { @@ -316,7 +316,7 @@ func (p *Pool) TVL(ctx sdk.Context, oracleKeeper OracleKeeper, accountedPoolKeep amount = accountedPoolAmt } } - v := tokenPrice.MulInt(amount).QuoInt(OneTokenUnit(decimals)) + v := tokenPrice.MulInt(amount) oracleAssetsTVL = oracleAssetsTVL.Add(v) oracleAssetsWeight = oracleAssetsWeight.Add(asset.Weight) } diff --git a/x/amm/types/pool_join_pool.go b/x/amm/types/pool_join_pool.go index 0a4e9628c..54e6215e2 100644 --- a/x/amm/types/pool_join_pool.go +++ b/x/amm/types/pool_join_pool.go @@ -21,11 +21,11 @@ type InternalSwapRequest struct { func (p *Pool) CalcJoinValueWithoutSlippage(ctx sdk.Context, oracleKeeper OracleKeeper, accountedPoolKeeper AccountedPoolKeeper, tokensIn sdk.Coins) (elystypes.Dec34, error) { joinValue := elystypes.ZeroDec34() for _, asset := range tokensIn { - tokenPrice, decimals := oracleKeeper.GetAssetPriceFromDenom(ctx, asset.Denom) + tokenPrice, _ := oracleKeeper.GetAssetPriceFromDenom(ctx, asset.Denom) if tokenPrice.IsZero() { return elystypes.ZeroDec34(), fmt.Errorf("token price not set: %s", asset.Denom) } - v := tokenPrice.MulInt(asset.Amount).QuoInt(OneTokenUnit(decimals)) + v := tokenPrice.MulInt(asset.Amount) joinValue = joinValue.Add(v) } return joinValue, nil diff --git a/x/amm/types/swap_in_amt_given_out.go b/x/amm/types/swap_in_amt_given_out.go index f7c4ee758..4fbfb2bf6 100644 --- a/x/amm/types/swap_in_amt_given_out.go +++ b/x/amm/types/swap_in_amt_given_out.go @@ -27,19 +27,19 @@ func (p Pool) CalcGivenOutSlippage( } // ensure token prices for in/out tokens set properly - inTokenPrice, inTokenDecimals := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenInDenom) + inTokenPrice, _ := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenInDenom) if inTokenPrice.IsZero() { return elystypes.ZeroDec34(), fmt.Errorf("price for inToken not set: %s", poolAssetIn.Token.Denom) } - outTokenPrice, outTokenDecimals := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenOut.Denom) + outTokenPrice, _ := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenOut.Denom) if outTokenPrice.IsZero() { return elystypes.ZeroDec34(), fmt.Errorf("price for outToken not set: %s", poolAssetOut.Token.Denom) } // in amount is calculated in this formula oracleInAmount := elystypes.NewDec34FromInt(tokenOut.Amount). - Mul(outTokenPrice.QuoInt(OneTokenUnit(outTokenDecimals))). - Quo(inTokenPrice.QuoInt(OneTokenUnit(inTokenDecimals))) + Mul(outTokenPrice). + Quo(inTokenPrice) balancerIn := elystypes.NewDec34FromInt(balancerInCoin.Amount) balancerSlippage := balancerIn.Sub(oracleInAmount) if balancerSlippage.IsNegative() { @@ -74,11 +74,11 @@ func (p *Pool) SwapInAmtGivenOut( } // ensure token prices for in/out tokens set properly - inTokenPrice, inTokenDecimals := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenInDenom) + inTokenPrice, _ := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenInDenom) if inTokenPrice.IsZero() { return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), fmt.Errorf("price for inToken not set: %s", poolAssetIn.Token.Denom) } - outTokenPrice, outTokenDecimals := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenOut.Denom) + outTokenPrice, _ := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenOut.Denom) if outTokenPrice.IsZero() { return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), fmt.Errorf("price for outToken not set: %s", poolAssetOut.Token.Denom) } @@ -91,8 +91,8 @@ func (p *Pool) SwapInAmtGivenOut( // resizedAmount = tokenIn / externalLiquidityRatio // actualSlippageAmount = balancer slippage(resizedAmount) oracleInAmount = elystypes.NewDec34FromInt(tokenOut.Amount). - Mul(outTokenPrice.QuoInt(OneTokenUnit(outTokenDecimals))). - Quo(inTokenPrice.QuoInt(OneTokenUnit(inTokenDecimals))) + Mul(outTokenPrice). + Quo(inTokenPrice) externalLiquidityRatio, err := p.GetAssetExternalLiquidityRatio(tokenOut.Denom) if err != nil { diff --git a/x/amm/types/swap_out_amt_given_in.go b/x/amm/types/swap_out_amt_given_in.go index 7b4dcb195..63e71c3b4 100644 --- a/x/amm/types/swap_out_amt_given_in.go +++ b/x/amm/types/swap_out_amt_given_in.go @@ -36,12 +36,12 @@ func GetOraclePoolNormalizedWeights(ctx sdk.Context, poolId uint64, oracleKeeper oraclePoolWeights := []AssetWeight{} totalWeight := elystypes.ZeroDec34() for _, asset := range poolAssets { - tokenPrice, decimals := oracleKeeper.GetAssetPriceFromDenom(ctx, asset.Token.Denom) + tokenPrice, _ := oracleKeeper.GetAssetPriceFromDenom(ctx, asset.Token.Denom) if tokenPrice.IsZero() { return oraclePoolWeights, fmt.Errorf("price for token not set: %s", asset.Token.Denom) } amount := asset.Token.Amount - weight := tokenPrice.MulInt(amount).QuoInt(OneTokenUnit(decimals)) + weight := tokenPrice.MulInt(amount) oraclePoolWeights = append(oraclePoolWeights, AssetWeight{ Asset: asset.Token.Denom, Weight: weight, @@ -151,18 +151,18 @@ func (p Pool) CalcGivenInSlippage( } // ensure token prices for in/out tokens set properly - inTokenPrice, inTokenDecimals := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenIn.Denom) + inTokenPrice, _ := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenIn.Denom) if inTokenPrice.IsZero() { return elystypes.ZeroDec34(), fmt.Errorf("price for inToken not set: %s", poolAssetIn.Token.Denom) } - outTokenPrice, outTokenDecimals := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenOutDenom) + outTokenPrice, _ := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenOutDenom) if outTokenPrice.IsZero() { return elystypes.ZeroDec34(), fmt.Errorf("price for outToken not set: %s", poolAssetOut.Token.Denom) } oracleOutAmount := elystypes.NewDec34FromInt(tokenIn.Amount). - Mul(inTokenPrice.QuoInt(OneTokenUnit(inTokenDecimals))). - Quo(outTokenPrice.QuoInt(OneTokenUnit(outTokenDecimals))) + Mul(inTokenPrice). + Quo(outTokenPrice) balancerOut := elystypes.NewDec34FromInt(balancerOutCoin.Amount) slippageAmount := oracleOutAmount.Sub(balancerOut) if slippageAmount.IsNegative() { @@ -208,11 +208,11 @@ func (p *Pool) SwapOutAmtGivenIn( } // ensure token prices for in/out tokens set properly - inTokenPrice, inTokenDecimals := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenIn.Denom) + inTokenPrice, _ := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenIn.Denom) if inTokenPrice.IsZero() { return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), fmt.Errorf("price for inToken not set: %s", poolAssetIn.Token.Denom) } - outTokenPrice, outTokenDecimals := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenOutDenom) + outTokenPrice, _ := oracleKeeper.GetAssetPriceFromDenom(ctx, tokenOutDenom) if outTokenPrice.IsZero() { return sdk.Coin{}, elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), elystypes.ZeroDec34(), sdkmath.LegacyZeroDec(), fmt.Errorf("price for outToken not set: %s", poolAssetOut.Token.Denom) } @@ -225,8 +225,8 @@ func (p *Pool) SwapOutAmtGivenIn( // resizedAmount = tokenIn / externalLiquidityRatio // actualSlippageAmount = balancer slippage(resizedAmount) oracleOutAmount = elystypes.NewDec34FromInt(tokenIn.Amount). - Mul(inTokenPrice.QuoInt(OneTokenUnit(inTokenDecimals))). - Quo(outTokenPrice.QuoInt(OneTokenUnit(outTokenDecimals))) + Mul(inTokenPrice). + Quo(outTokenPrice) externalLiquidityRatio, err := p.GetAssetExternalLiquidityRatio(tokenOutDenom) if err != nil { diff --git a/x/amm/types/swap_out_amt_given_in_test.go b/x/amm/types/swap_out_amt_given_in_test.go index 623155356..38fce28df 100644 --- a/x/amm/types/swap_out_amt_given_in_test.go +++ b/x/amm/types/swap_out_amt_given_in_test.go @@ -468,7 +468,7 @@ func (suite *TestSuite) TestSwapOutAmtGivenIn() { tokenIn: sdk.NewInt64Coin("uusdt", 100_000_000), // 100 USDC outTokenDenom: ptypes.BaseCurrency, swapFee: sdkmath.LegacyZeroDec(), - expRecoveryBonus: elystypes.NewDec34FromString("-0.0003293909486666284880839937742529153"), + expRecoveryBonus: elystypes.NewDec34FromString("-0.0003293909486666284880839937742529154"), expTokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 98977287), expErr: false, }, @@ -504,7 +504,7 @@ func (suite *TestSuite) TestSwapOutAmtGivenIn() { tokenIn: sdk.NewInt64Coin("uusdt", 100_000_000), // 100 USDC outTokenDenom: ptypes.BaseCurrency, swapFee: sdkmath.LegacyZeroDec(), - expRecoveryBonus: elystypes.NewDec34FromString("-0.006347556007845347576004236722241547"), + expRecoveryBonus: elystypes.NewDec34FromString("-0.006347556007845347576004236722241546"), expTokenOut: sdk.NewInt64Coin(ptypes.BaseCurrency, 98054944), expErr: false, }, diff --git a/x/leveragelp/keeper/hooks_amm.go b/x/leveragelp/keeper/hooks_amm.go index 984e0ed2e..adb439b8c 100644 --- a/x/leveragelp/keeper/hooks_amm.go +++ b/x/leveragelp/keeper/hooks_amm.go @@ -24,10 +24,10 @@ func (k Keeper) CheckAmmPoolUsdcBalance(ctx sdk.Context, ammPool ammtypes.Pool) QuoInt(ammPool.TotalShares.Amount) depositDenom := k.stableKeeper.GetDepositDenom(ctx) - price, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, depositDenom) + price, _ := k.oracleKeeper.GetAssetPriceFromDenom(ctx, depositDenom) for _, asset := range ammPool.PoolAssets { - if asset.Token.Denom == depositDenom && price.MulInt(asset.Token.Amount).QuoInt(ammtypes.OneTokenUnit(decimals)).LT(leverageLpTvl) { + if asset.Token.Denom == depositDenom && price.MulInt(asset.Token.Amount).LT(leverageLpTvl) { return types.ErrInsufficientUsdcAfterOp } } diff --git a/x/leveragelp/keeper/query_position.go b/x/leveragelp/keeper/query_position.go index 33367dec8..7b4e454ef 100644 --- a/x/leveragelp/keeper/query_position.go +++ b/x/leveragelp/keeper/query_position.go @@ -62,8 +62,8 @@ func (k Keeper) LiquidationPrice(goCtx context.Context, req *types.QueryLiquidat // lpTokenPrice = totalDebt * params.SafetyFactor / lpTokenAmount totalDebt := debt.GetTotalLiablities() baseCurrency, _ := k.assetProfileKeeper.GetUsdcDenom(ctx) - usdcDenomPrice, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) - liquidationPrice := usdcDenomPrice.MulLegacyDec(params.SafetyFactor).MulInt(totalDebt).MulInt(ammtypes.OneShare).QuoInt(ammtypes.OneTokenUnit(decimals)).QuoInt(position.LeveragedLpAmount) + usdcDenomPrice, _ := k.oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) + liquidationPrice := usdcDenomPrice.MulLegacyDec(params.SafetyFactor).MulInt(totalDebt).MulInt(ammtypes.OneShare).QuoInt(position.LeveragedLpAmount) return &types.QueryLiquidationPriceResponse{ Price: liquidationPrice.String(), diff --git a/x/leveragelp/keeper/utils.go b/x/leveragelp/keeper/utils.go index 7a45cae7a..65ac61fdd 100644 --- a/x/leveragelp/keeper/utils.go +++ b/x/leveragelp/keeper/utils.go @@ -108,10 +108,10 @@ func (k Keeper) GetInterestRateUsd(ctx sdk.Context, positions []*types.QueryPosi for _, position := range positions { var positionAndInterest types.PositionAndInterest positionAndInterest.Position = position - price, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, position.Position.Collateral.Denom) + price, _ := k.oracleKeeper.GetAssetPriceFromDenom(ctx, position.Position.Collateral.Denom) interestRateHour := params.InterestRate.Quo(hours) positionAndInterest.InterestRateHour = interestRateHour - positionAndInterest.InterestRateHourUsd = interestRateHour.Mul(sdkmath.LegacyDec(position.Position.Liabilities.Mul(price.ToInt()).Quo(ammtypes.OneTokenUnit(decimals)))) + positionAndInterest.InterestRateHourUsd = interestRateHour.Mul(sdkmath.LegacyDec(position.Position.Liabilities.Mul(price.ToInt()))) positions_and_interest = append(positions_and_interest, &positionAndInterest) } diff --git a/x/masterchef/keeper/abci.go b/x/masterchef/keeper/abci.go index 4c59f655e..c1c3f326d 100644 --- a/x/masterchef/keeper/abci.go +++ b/x/masterchef/keeper/abci.go @@ -82,11 +82,10 @@ func (k Keeper) ProcessExternalRewardsDistribution(ctx sdk.Context) { yearlyIncentiveRewardsTotal := externalIncentive.AmountPerBlock. Mul(math.NewInt(totalBlocksPerYear)) - tokenPrice, decimals := k.amm.GetTokenPrice(ctx, externalIncentive.RewardDenom, baseCurrency) + tokenPrice, _ := k.amm.GetTokenPrice(ctx, externalIncentive.RewardDenom, baseCurrency) apr := tokenPrice. MulInt(yearlyIncentiveRewardsTotal). - QuoInt(ammtypes.OneTokenUnit(decimals)). Quo(tvl) externalIncentive.Apr = apr.ToLegacyDec() k.SetExternalIncentive(ctx, externalIncentive) @@ -200,7 +199,7 @@ func (k Keeper) UpdateLPRewards(ctx sdk.Context) error { lpsEdenAmount := edenAmountPerYear.Quo(math.NewInt(totalBlocksPerYear)) // Ensure edenDenomPrice is not zero to avoid division by zero - edenDenomPrice, decimals := k.amm.GetEdenDenomPrice(ctx, baseCurrency) + edenDenomPrice, _ := k.amm.GetEdenDenomPrice(ctx, baseCurrency) if edenDenomPrice.IsZero() { return errorsmod.Wrap(types.ErrNoInflationaryParams, "invalid eden price") } @@ -230,7 +229,7 @@ func (k Keeper) UpdateLPRewards(ctx sdk.Context) error { // Maximum eden APR - 30% by default poolMaxEdenAmount := proxyTVL.MulLegacyDec(params.MaxEdenRewardAprLps). QuoInt64(totalBlocksPerYear). - Quo(edenDenomPrice.QuoInt(ammtypes.OneTokenUnit(decimals))) + Quo(edenDenomPrice) // Use min amount (eden allocation from tokenomics and max apr based eden amount) if pool.EnableEdenRewards { @@ -291,7 +290,6 @@ func (k Keeper) UpdateLPRewards(ctx sdk.Context) error { pool.EdenApr = newEdenAllocatedForPool. MulInt64(totalBlocksPerYear). Mul(edenDenomPrice). - QuoInt(ammtypes.OneTokenUnit(decimals)). Quo(tvl). ToLegacyDec() } else { @@ -611,7 +609,7 @@ func (k Keeper) InitStableStakePoolParams(ctx sdk.Context, poolId uint64) bool { // Update APR for AMM pool func (k Keeper) UpdateAmmPoolAPR(ctx sdk.Context, totalBlocksPerYear int64, totalProxyTVL math.LegacyDec) { baseCurrency, _ := k.assetProfileKeeper.GetUsdcDenom(ctx) - usdcDenomPrice, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) + usdcDenomPrice, _ := k.oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) k.amm.IterateLiquidityPools(ctx, func(p ammtypes.Pool) bool { tvl, err := p.TVL(ctx, k.oracleKeeper, k.accountedPoolKeeper) @@ -643,14 +641,12 @@ func (k Keeper) UpdateAmmPoolAPR(ctx sdk.Context, totalBlocksPerYear int64, tota poolInfo.DexApr = usdcDenomPrice. MulLegacyDec(lastAccum.DexReward). MulInt64(totalBlocksPerYear). - QuoInt(ammtypes.OneTokenUnit(decimals)). Quo(tvl). ToLegacyDec() poolInfo.GasApr = usdcDenomPrice. MulLegacyDec(lastAccum.GasReward). MulInt64(totalBlocksPerYear). - QuoInt(ammtypes.OneTokenUnit(decimals)). Quo(tvl). ToLegacyDec() } else { @@ -662,7 +658,6 @@ func (k Keeper) UpdateAmmPoolAPR(ctx sdk.Context, totalBlocksPerYear int64, tota Sub(firstAccum.DexReward). MulInt64(secondsInYear). QuoInt64(int64(duration))). - QuoInt(ammtypes.OneTokenUnit(decimals)). Quo(tvl). ToLegacyDec() poolInfo.GasApr = usdcDenomPrice. @@ -670,7 +665,6 @@ func (k Keeper) UpdateAmmPoolAPR(ctx sdk.Context, totalBlocksPerYear int64, tota Sub(firstAccum.GasReward). MulInt64(secondsInYear). QuoInt64(int64(duration))). - QuoInt(ammtypes.OneTokenUnit(decimals)). Quo(tvl). ToLegacyDec() } diff --git a/x/masterchef/keeper/apr_denom.go b/x/masterchef/keeper/apr_denom.go index 568ba259c..d83a79901 100644 --- a/x/masterchef/keeper/apr_denom.go +++ b/x/masterchef/keeper/apr_denom.go @@ -88,7 +88,7 @@ func (k Keeper) CalculateApr(ctx sdk.Context, query *types.QueryAprRequest) (ely // Calc Eden price in usdc // We put Elys as denom as Eden won't be avaialble in amm pool and has the same value as Elys - edenDenomPrice, decimals := k.amm.GetEdenDenomPrice(ctx, baseCurrency) + edenDenomPrice, _ := k.amm.GetEdenDenomPrice(ctx, baseCurrency) if edenDenomPrice.IsZero() { return elystypes.ZeroDec34(), nil } @@ -109,10 +109,10 @@ func (k Keeper) CalculateApr(ctx sdk.Context, query *types.QueryAprRequest) (ely if !found { return elystypes.ZeroDec34(), assetprofiletypes.ErrAssetProfileNotFound } - yearlyDexRewardAmount := elystypes.NewDec34FromLegacyDec(usdcAmount).MulInt64(365).QuoInt(ammtypes.OneTokenUnit(entry.Decimals)) + yearlyDexRewardAmount := elystypes.NewDec34FromLegacyDec(usdcAmount).MulInt64(365).QuoInt(ammtypes.BaseTokenAmount(entry.Decimals)) apr := yearlyDexRewardAmount. - Quo(edenDenomPrice.QuoInt(ammtypes.OneTokenUnit(decimals))). + Quo(edenDenomPrice). QuoInt(totalStakedSnapshot) return apr, nil @@ -152,10 +152,10 @@ func (k Keeper) GetDailyRewardsAmountForPool(ctx sdk.Context, poolId uint64) (el rewardCoins := sdk.NewCoins(sdk.NewCoin(ptypes.Eden, dailyEdenRewardsTotal.ToInt())) rewardCoins = rewardCoins.Add(sdk.NewCoin(baseCurrency, dailyDexRewardsTotal.Add(dailyGasRewardsTotal).ToInt())) - usdcDenomPrice, usdcDecimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) - edenDenomPrice, edenDecimals := k.amm.GetEdenDenomPrice(ctx, baseCurrency) + usdcDenomPrice, _ := k.oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) + edenDenomPrice, _ := k.amm.GetEdenDenomPrice(ctx, baseCurrency) - totalRewardsUsd := (usdcDenomPrice.Mul(dailyDexRewardsTotal.Add(dailyGasRewardsTotal)).QuoInt(ammtypes.OneTokenUnit(usdcDecimals))). - Add(edenDenomPrice.Mul(dailyEdenRewardsTotal).QuoInt(ammtypes.OneTokenUnit(edenDecimals))) + totalRewardsUsd := (usdcDenomPrice.Mul(dailyDexRewardsTotal.Add(dailyGasRewardsTotal))). + Add(edenDenomPrice.Mul(dailyEdenRewardsTotal)) return totalRewardsUsd, rewardCoins } diff --git a/x/masterchef/keeper/apr_stable_stake.go b/x/masterchef/keeper/apr_stable_stake.go index 51c1f2880..444d8f344 100644 --- a/x/masterchef/keeper/apr_stable_stake.go +++ b/x/masterchef/keeper/apr_stable_stake.go @@ -5,7 +5,6 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" elystypes "github.com/elys-network/elys/types" - ammtypes "github.com/elys-network/elys/x/amm/types" assetprofiletypes "github.com/elys-network/elys/x/assetprofile/types" "github.com/elys-network/elys/x/masterchef/types" ptypes "github.com/elys-network/elys/x/parameter/types" @@ -46,7 +45,7 @@ func (k Keeper) CalculateStableStakeApr(ctx sdk.Context, query *types.QueryStabl edenAmount := lpIncentive.EdenAmountPerYear.Quo(sdkmath.NewInt(totalBlocksPerYear)) - edenDenomPrice, decimals := k.amm.GetEdenDenomPrice(ctx, baseCurrency) + edenDenomPrice, _ := k.amm.GetEdenDenomPrice(ctx, baseCurrency) // Get pool info from incentive param poolInfo, found := k.GetPoolInfo(ctx, uint64(stabletypes.PoolId)) @@ -67,14 +66,13 @@ func (k Keeper) CalculateStableStakeApr(ctx sdk.Context, query *types.QueryStabl poolMaxEdenAmount := proxyTVL. MulLegacyDec(params.MaxEdenRewardAprLps). QuoInt64(totalBlocksPerYear). - Quo(edenDenomPrice.QuoInt(ammtypes.OneTokenUnit(decimals))) + Quo(edenDenomPrice) stableStakeEdenAmount = elystypes.MinDec34(stableStakeEdenAmount, poolMaxEdenAmount) // Eden Apr for usdc earn program apr := stableStakeEdenAmount. MulInt64(totalBlocksPerYear). Mul(edenDenomPrice). - QuoInt(ammtypes.OneTokenUnit(decimals)). Quo(stableTvl) return apr, nil } else if query.Denom == ptypes.BaseCurrency { diff --git a/x/masterchef/keeper/query_chain_tvl.go b/x/masterchef/keeper/query_chain_tvl.go index 462aec58a..c2ad99129 100644 --- a/x/masterchef/keeper/query_chain_tvl.go +++ b/x/masterchef/keeper/query_chain_tvl.go @@ -6,7 +6,6 @@ import ( "cosmossdk.io/math" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - ammtypes "github.com/elys-network/elys/x/amm/types" ptypes "github.com/elys-network/elys/x/parameter/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -44,10 +43,10 @@ func (k Keeper) ChainTVL(goCtx context.Context, req *types.QueryChainTVLRequest) stableStakeTVL := k.stableKeeper.TVL(ctx, k.oracleKeeper, baseCurrencyEntry.Denom) totalTVL = totalTVL.Add(stableStakeTVL.ToInt()) - elysPrice, decimals := k.amm.GetTokenPrice(ctx, ptypes.Elys, baseCurrencyEntry.Denom) + elysPrice, _ := k.amm.GetTokenPrice(ctx, ptypes.Elys, baseCurrencyEntry.Denom) stakedElys := k.bankKeeper.GetBalance(ctx, authtypes.NewModuleAddress(stakingtypes.BondedPoolName), ptypes.Elys).Amount - stakedElysValue := elysPrice.MulInt(stakedElys).QuoInt(ammtypes.OneTokenUnit(decimals)) + stakedElysValue := elysPrice.MulInt(stakedElys) totalTVL = totalTVL.Add(stakedElysValue.ToInt()) commitmentParams := k.commitmentKeeper.GetParams(ctx) diff --git a/x/masterchef/keeper/query_pool_rewards.go b/x/masterchef/keeper/query_pool_rewards.go index 7fc480bc9..cdc736aa1 100644 --- a/x/masterchef/keeper/query_pool_rewards.go +++ b/x/masterchef/keeper/query_pool_rewards.go @@ -105,9 +105,9 @@ func (k Keeper) generateExternalRewardsApr(ctx sdk.Context) map[uint64]elystypes for _, externalIncentive := range externalIncentives { if externalIncentive.FromBlock < curBlockHeight && curBlockHeight <= externalIncentive.ToBlock { totalAmount := externalIncentive.AmountPerBlock.MulRaw(totalBlocksPerYear) - price, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, externalIncentive.RewardDenom) + price, _ := k.oracleKeeper.GetAssetPriceFromDenom(ctx, externalIncentive.RewardDenom) - rewardsPerPool[externalIncentive.PoolId] = rewardsPerPool[externalIncentive.PoolId].Add(price.MulInt(totalAmount).QuoInt(ammtypes.OneTokenUnit(decimals))) + rewardsPerPool[externalIncentive.PoolId] = rewardsPerPool[externalIncentive.PoolId].Add(price.MulInt(totalAmount)) } } diff --git a/x/oracle/keeper/price.go b/x/oracle/keeper/price.go index 5b3ece27b..836de0553 100644 --- a/x/oracle/keeper/price.go +++ b/x/oracle/keeper/price.go @@ -6,6 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" elystypes "github.com/elys-network/elys/types" + ammtypes "github.com/elys-network/elys/x/amm/types" "github.com/elys-network/elys/x/oracle/types" ) @@ -128,5 +129,5 @@ func (k Keeper) GetAssetPriceFromDenom(ctx sdk.Context, denom string) (elystypes return elystypes.ZeroDec34(), 0 } - return elystypes.NewDec34FromLegacyDec(price.Price), info.Decimal + return elystypes.NewDec34FromLegacyDec(price.Price).QuoInt(ammtypes.BaseTokenAmount(info.Decimal)), info.Decimal } diff --git a/x/tier/keeper/portfolio.go b/x/tier/keeper/portfolio.go index 555bc54c7..c3d9665da 100644 --- a/x/tier/keeper/portfolio.go +++ b/x/tier/keeper/portfolio.go @@ -58,8 +58,8 @@ func (k Keeper) RetrieveAllPortfolio(ctx sdk.Context, user sdk.AccAddress) { // convert vesting to usd baseCurrency, found := k.assetProfileKeeper.GetUsdcDenom(ctx) if found { - edenDenomPrice, decimals := k.amm.GetEdenDenomPrice(ctx, baseCurrency) - totalVesting = totalVesting.Mul(edenDenomPrice).QuoInt(ammtypes.OneTokenUnit(decimals)) + edenDenomPrice, _ := k.amm.GetEdenDenomPrice(ctx, baseCurrency) + totalVesting = totalVesting.Mul(edenDenomPrice) } totalValue = totalValue.Add(commit).Add(delegations).Add(unbondings).Add(totalVesting) @@ -111,16 +111,16 @@ func (k Keeper) RetrieveStaked(ctx sdk.Context, user sdk.AccAddress) (elystypes. if !found { continue } - tokenPrice, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, usdcDenom) + tokenPrice, _ := k.oracleKeeper.GetAssetPriceFromDenom(ctx, usdcDenom) params := k.stablestakeKeeper.GetParams(ctx) - usdValue := tokenPrice.MulLegacyDec(params.RedemptionRate).MulInt(commitment.Amount).QuoInt(ammtypes.OneTokenUnit(decimals)) + usdValue := tokenPrice.MulLegacyDec(params.RedemptionRate).MulInt(commitment.Amount) totalCommit = totalCommit.Add(usdValue) continue } if commitment.Denom == ptypes.Eden { commitment.Denom = ptypes.Elys } - tokenPrice, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, commitment.Denom) + tokenPrice, _ := k.oracleKeeper.GetAssetPriceFromDenom(ctx, commitment.Denom) asset, found := k.assetProfileKeeper.GetEntryByDenom(ctx, commitment.Denom) if !found { continue @@ -128,7 +128,7 @@ func (k Keeper) RetrieveStaked(ctx sdk.Context, user sdk.AccAddress) (elystypes. if tokenPrice.IsZero() { tokenPrice = k.amm.CalcAmmPrice(ctx, asset.Denom, asset.Decimals) } - totalCommit = totalCommit.Add(tokenPrice.MulInt(commitment.Amount).QuoInt(ammtypes.OneTokenUnit(decimals))) + totalCommit = totalCommit.Add(tokenPrice.MulInt(commitment.Amount)) } } @@ -143,7 +143,7 @@ func (k Keeper) RetrieveStaked(ctx sdk.Context, user sdk.AccAddress) (elystypes. if err != nil { panic(err) } - tokenPrice, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, bondDenom) + tokenPrice, _ := k.oracleKeeper.GetAssetPriceFromDenom(ctx, bondDenom) asset, found := k.assetProfileKeeper.GetEntryByDenom(ctx, bondDenom) if tokenPrice.IsZero() { tokenPrice = k.amm.CalcAmmPrice(ctx, asset.Denom, asset.Decimals) @@ -151,7 +151,7 @@ func (k Keeper) RetrieveStaked(ctx sdk.Context, user sdk.AccAddress) (elystypes. if found { for _, delegation := range delegations { amount := elystypes.NewDec34FromLegacyDec(delegation.Shares) - totalDelegations = totalDelegations.Add(tokenPrice.Mul(amount).QuoInt(ammtypes.OneTokenUnit(decimals))) + totalDelegations = totalDelegations.Add(tokenPrice.Mul(amount)) } } @@ -165,7 +165,7 @@ func (k Keeper) RetrieveStaked(ctx sdk.Context, user sdk.AccAddress) (elystypes. if found { for _, delegation := range unbondingDelegations { for _, entry := range delegation.Entries { - totalUnbondings = totalUnbondings.Add(tokenPrice.MulInt(entry.Balance).QuoInt(ammtypes.OneTokenUnit(decimals))) + totalUnbondings = totalUnbondings.Add(tokenPrice.MulInt(entry.Balance)) } } } @@ -182,7 +182,7 @@ func (k Keeper) RetrieveRewardsTotal(ctx sdk.Context, user sdk.AccAddress) elyst if balance.Denom == ptypes.Eden { balance.Denom = ptypes.Elys } - tokenPrice, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, balance.Denom) + tokenPrice, _ := k.oracleKeeper.GetAssetPriceFromDenom(ctx, balance.Denom) asset, found := k.assetProfileKeeper.GetEntryByDenom(ctx, balance.Denom) if !found { continue @@ -190,7 +190,7 @@ func (k Keeper) RetrieveRewardsTotal(ctx sdk.Context, user sdk.AccAddress) elyst if tokenPrice.IsZero() { tokenPrice = k.amm.CalcAmmPrice(ctx, asset.Denom, asset.Decimals) } - totalValue = totalValue.Add(tokenPrice.MulInt(balance.Amount).QuoInt(ammtypes.OneTokenUnit(decimals))) + totalValue = totalValue.Add(tokenPrice.MulInt(balance.Amount)) } } @@ -199,7 +199,7 @@ func (k Keeper) RetrieveRewardsTotal(ctx sdk.Context, user sdk.AccAddress) elyst if balance.Denom == ptypes.Eden { balance.Denom = ptypes.Elys } - tokenPrice, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, balance.Denom) + tokenPrice, _ := k.oracleKeeper.GetAssetPriceFromDenom(ctx, balance.Denom) asset, found := k.assetProfileKeeper.GetEntryByDenom(ctx, balance.Denom) if !found { continue @@ -207,7 +207,7 @@ func (k Keeper) RetrieveRewardsTotal(ctx sdk.Context, user sdk.AccAddress) elyst if tokenPrice.IsZero() { tokenPrice = k.amm.CalcAmmPrice(ctx, asset.Denom, asset.Decimals) } - totalValue = totalValue.Add(tokenPrice.MulInt(balance.Amount).QuoInt(ammtypes.OneTokenUnit(decimals))) + totalValue = totalValue.Add(tokenPrice.MulInt(balance.Amount)) } } return totalValue @@ -251,7 +251,7 @@ func (k Keeper) RetrieveLiquidAssetsTotal(ctx sdk.Context, user sdk.AccAddress) if balance.Denom == ptypes.Eden { balance.Denom = ptypes.Elys } - tokenPrice, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, balance.Denom) + tokenPrice, _ := k.oracleKeeper.GetAssetPriceFromDenom(ctx, balance.Denom) asset, found := k.assetProfileKeeper.GetEntryByDenom(ctx, balance.Denom) if !found { continue @@ -259,7 +259,7 @@ func (k Keeper) RetrieveLiquidAssetsTotal(ctx sdk.Context, user sdk.AccAddress) if tokenPrice.IsZero() { tokenPrice = k.amm.CalcAmmPrice(ctx, balance.Denom, asset.Decimals) } - totalValue = totalValue.Add(tokenPrice.MulInt(balance.Amount).QuoInt(ammtypes.OneTokenUnit(decimals))) + totalValue = totalValue.Add(tokenPrice.MulInt(balance.Amount)) } return totalValue } @@ -283,9 +283,9 @@ func (k Keeper) RetrieveLeverageLpTotal(ctx sdk.Context, user sdk.AccAddress) (e if !found { continue } - usdcPrice, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, usdcDenom) + usdcPrice, _ := k.oracleKeeper.GetAssetPriceFromDenom(ctx, usdcDenom) liab := debt.GetTotalLiablities() - totalBorrow = totalBorrow.Add(usdcPrice.MulInt(liab).QuoInt(ammtypes.OneTokenUnit(decimals))) + totalBorrow = totalBorrow.Add(usdcPrice.MulInt(liab)) } netValue = totalValue.Sub(totalBorrow) } diff --git a/x/tier/keeper/query_get_consolidated_price.go b/x/tier/keeper/query_get_consolidated_price.go index 7999ab60d..92802a4f5 100644 --- a/x/tier/keeper/query_get_consolidated_price.go +++ b/x/tier/keeper/query_get_consolidated_price.go @@ -5,6 +5,7 @@ import ( "strings" sdk "github.com/cosmos/cosmos-sdk/types" + ammtypes "github.com/elys-network/elys/x/amm/types" ptypes "github.com/elys-network/elys/x/parameter/types" "github.com/elys-network/elys/x/tier/types" "google.golang.org/grpc/codes" @@ -45,7 +46,8 @@ func (k Keeper) GetAllPrices(goCtx context.Context, req *types.QueryGetAllPrices denom = ptypes.Elys } tokenPriceOracle, _ := k.oracleKeeper.GetAssetPriceFromDenom(ctx, denom) - tokenPriceAmm := k.amm.CalcAmmPrice(ctx, denom, assetEntry.Decimals) + tokenPriceOracle = tokenPriceOracle.MulInt(ammtypes.BaseTokenAmount(assetEntry.Decimals)) + tokenPriceAmm := k.amm.CalcAmmPrice(ctx, denom, assetEntry.Decimals).MulInt(ammtypes.BaseTokenAmount(assetEntry.Decimals)) prices = append(prices, &types.Price{ Denom: assetEntry.Denom, OraclePrice: tokenPriceOracle.String(), diff --git a/x/tier/keeper/query_get_users_pool_data.go b/x/tier/keeper/query_get_users_pool_data.go index 6662b9b56..a07782fb4 100644 --- a/x/tier/keeper/query_get_users_pool_data.go +++ b/x/tier/keeper/query_get_users_pool_data.go @@ -40,7 +40,7 @@ func (k Keeper) GetUsersPoolData(goCtx context.Context, req *types.QueryGetUsers return nil, err } - tokenPrice, decimals := k.oracleKeeper.GetAssetPriceFromDenom(ctx, usdcDenom) + tokenPrice, _ := k.oracleKeeper.GetAssetPriceFromDenom(ctx, usdcDenom) params := k.stablestakeKeeper.GetParams(ctx) usersData := []*types.UserData{} @@ -56,7 +56,7 @@ func (k Keeper) GetUsersPoolData(goCtx context.Context, req *types.QueryGetUsers for _, commitment := range user.CommittedTokens { if strings.HasPrefix(commitment.Denom, "stablestake/share") { - fiatValue := tokenPrice.MulLegacyDec(params.RedemptionRate).MulInt(commitment.Amount).QuoInt(ammtypes.OneTokenUnit(decimals)) + fiatValue := tokenPrice.MulLegacyDec(params.RedemptionRate).MulInt(commitment.Amount) u.Pools = append(u.Pools, &types.Pool{ Pool: "USDC", PoolId: commitment.Denom,