From 0abb916997837a1618fa5b60f9d44191366ba273 Mon Sep 17 00:00:00 2001 From: Cosmic Vagabond <121588426+cosmic-vagabond@users.noreply.github.com> Date: Wed, 19 Jun 2024 22:01:41 +0200 Subject: [PATCH] Lev totoal (#599) * [Perpetual]: Update checksameassetposition function (#576) * [Bug]: Fix calculate discount and add more tests (#570) * add calculate discount test and bug fix * get asset by denom * ci: use post-upgrade-snapshot-generator (#571) * ci: use post-upgrade-snapshot-generator * ci: update delete snapshot CI to use post upgrade snapshot gen binary * update checksame position * update tests * add comment --------- Co-authored-by: Cosmic Vagabond <121588426+cosmic-vagabond@users.noreply.github.com> * ci: clean up upgrade handler (#573) * [Bug]: Fix calculate discount and add more tests (#570) * add calculate discount test and bug fix * get asset by denom * ci: use post-upgrade-snapshot-generator (#571) * ci: use post-upgrade-snapshot-generator * ci: update delete snapshot CI to use post upgrade snapshot gen binary * ci: clean up upgrade handler * ci: use latest post upgrade snapshot gen version * ci: update post upgrade snapshot gen version * ci: cache snapshot * ci: use latest version of snapshot gen * ci: trigger software upgrade test and unit tests for develop, devnet and main branches --------- Co-authored-by: Amit Yadav * Leveragelp rewards claim fix (#577) * fix leveragelp rewards query and claim fix * incremenet version --------- Co-authored-by: Warao * Halborn finding fixes (#572) * [Bug]: Fix calculate discount and add more tests (#570) * add calculate discount test and bug fix * get asset by denom * ci: use post-upgrade-snapshot-generator (#571) * ci: use post-upgrade-snapshot-generator * ci: update delete snapshot CI to use post upgrade snapshot gen binary * halborn finding fixes * fix masterchef external incentive add * resolve tests --------- Co-authored-by: Amit Yadav Co-authored-by: Cosmic Vagabond <121588426+cosmic-vagabond@users.noreply.github.com> * add total leveragelp position query * handle logic * fix * decimal fix * remove realtime * update * reduce args * update * changes * delete file * update --------- Co-authored-by: Amit Yadav Co-authored-by: jelysn <129082781+jelysn@users.noreply.github.com> Co-authored-by: Warao --- app/app.go | 1 + docs/static/openapi.yml | 40 ++ go.mod | 23 - go.sum | 47 -- proto/elys/tier/query.proto | 21 +- testutil/keeper/membershiptier.go | 1 + x/tier/client/cli/query.go | 2 + x/tier/client/cli/query_leverage_lp_total.go | 45 ++ x/tier/keeper/keeper.go | 3 + x/tier/keeper/portfolio.go | 22 + x/tier/keeper/query_leverage_lp_total.go | 24 + x/tier/types/expected_keepers.go | 5 + x/tier/types/query.pb.go | 463 +++++++++++++++++-- x/tier/types/query.pb.gw.go | 101 ++++ 14 files changed, 685 insertions(+), 113 deletions(-) create mode 100644 x/tier/client/cli/query_leverage_lp_total.go create mode 100644 x/tier/keeper/query_leverage_lp_total.go diff --git a/app/app.go b/app/app.go index 20528a1cc..bbb04434a 100644 --- a/app/app.go +++ b/app/app.go @@ -1032,6 +1032,7 @@ func NewElysApp( app.CommitmentKeeper, app.StakingKeeper, app.PerpetualKeeper, + app.LeveragelpKeeper, ) tierModule := tiermodule.NewAppModule(appCodec, app.TierKeeper, app.AccountKeeper, app.BankKeeper) diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 556fad521..247fff5b6 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -44842,6 +44842,44 @@ paths: type: string tags: - Query + /elys-network/elys/tier/leverage_lp_total/{user}/{realtime}: + get: + summary: Queries a list of LeverageLpTotal items. + operationId: ElysTierLeverageLpTotal + responses: + '200': + description: A successful response. + schema: + type: object + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: user + in: path + required: true + type: string + - name: realtime + in: path + required: true + type: boolean + tags: + - Query /elys-network/elys/tokenomics/airdrop: get: operationId: ElysTokenomicsAirdropAll @@ -89169,6 +89207,8 @@ definitions: properties: total_portfolio: type: string + elys.tier.QueryLeverageLpTotalResponse: + type: object elys.tier.QueryParamsResponse: type: object properties: diff --git a/go.mod b/go.mod index 4b0dd15d6..a93a87329 100644 --- a/go.mod +++ b/go.mod @@ -9,10 +9,6 @@ require ( cosmossdk.io/simapp v0.0.0-20230323161446-0af178d721ff github.com/CosmWasm/wasmd v0.41.0 github.com/CosmWasm/wasmvm v1.3.1 - github.com/aws/aws-sdk-go-v2 v1.26.1 - github.com/aws/aws-sdk-go-v2/config v1.27.11 - github.com/aws/aws-sdk-go-v2/credentials v1.17.11 - github.com/aws/aws-sdk-go-v2/service/s3 v1.53.1 github.com/bandprotocol/bandchain-packet v0.0.2 github.com/cometbft/cometbft v0.37.6 github.com/cometbft/cometbft-db v0.11.0 @@ -28,7 +24,6 @@ require ( github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.9.0 - github.com/vbauerster/mpb/v8 v8.7.3 google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.34.1 @@ -41,22 +36,6 @@ require ( cosmossdk.io/log v1.3.1 // indirect cosmossdk.io/tools/rosetta v0.2.1 // indirect github.com/DataDog/zstd v1.5.2 // indirect - github.com/VividCortex/ewma v1.2.0 // indirect - github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.5 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.7 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.5 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.20.5 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.4 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.28.6 // indirect - github.com/aws/smithy-go v1.20.2 // indirect github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v1.1.0 // indirect @@ -79,9 +58,7 @@ require ( github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/linxGnu/grocksdb v1.8.12 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/rivo/uniseg v0.4.7 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect diff --git a/go.sum b/go.sum index 64b20aed6..92920e790 100644 --- a/go.sum +++ b/go.sum @@ -756,15 +756,11 @@ github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWX github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= -github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow= -github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/Workiva/go-datastructures v1.0.52/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA= github.com/Workiva/go-datastructures v1.0.53/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20201201074141-dd0ecada1be6/go.mod h1:eSYp2T6f0apnuW8TzhV3f6Aff2SE8Dwio++U4ha4yEM= -github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8= -github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo= github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/adlio/schema v1.1.13/go.mod h1:L5Z7tw+7lRK1Fnpi/LT/ooCP1elkXn0krMWBQHUhEDE= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= @@ -850,52 +846,16 @@ github.com/aws/aws-sdk-go v1.44.203/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8 github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= github.com/aws/aws-sdk-go-v2 v1.9.1/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= -github.com/aws/aws-sdk-go-v2 v1.26.1 h1:5554eUqIYVWpU0YmeeYZ0wU64H2VLBs8TlhRB2L+EkA= -github.com/aws/aws-sdk-go-v2 v1.26.1/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 h1:x6xsQXGSmW6frevwDA+vi/wqhp1ct18mVXYN08/93to= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2/go.mod h1:lPprDr1e6cJdyYeGXnRaJoP4Md+cDBvi2eOj00BlGmg= github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= -github.com/aws/aws-sdk-go-v2/config v1.27.11 h1:f47rANd2LQEYHda2ddSCKYId18/8BhSRM4BULGmfgNA= -github.com/aws/aws-sdk-go-v2/config v1.27.11/go.mod h1:SMsV78RIOYdve1vf36z8LmnszlRWkwMQtomCAI0/mIE= github.com/aws/aws-sdk-go-v2/credentials v1.1.1/go.mod h1:mM2iIjwl7LULWtS6JCACyInboHirisUUdkBPoTHMOUo= -github.com/aws/aws-sdk-go-v2/credentials v1.17.11 h1:YuIB1dJNf1Re822rriUOTxopaHHvIq0l/pX3fwO+Tzs= -github.com/aws/aws-sdk-go-v2/credentials v1.17.11/go.mod h1:AQtFPsDH9bI2O+71anW6EKL+NcD7LG3dpKGMV4SShgo= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2/go.mod h1:3hGg3PpiEjHnrkrlasTfxFqUsZ2GCk/fMUn4CbKgSkM= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1 h1:FVJ0r5XTHSmIHJV6KuDmdYhEpvlHpiSd38RQWhut5J4= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1/go.mod h1:zusuAeqezXzAB24LGuzuekqMAEgWkVYukBec3kr3jUg= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5 h1:aw39xVGeRWlWx9EzGVnhOR4yOjQDHPQ6o6NmBlscyQg= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5/go.mod h1:FSaRudD0dXiMPK2UjknVwwTYyZMRsHv3TtkabsZih5I= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5 h1:PG1F3OD1szkuQPzDw3CIQsRIrtTlUC3lP84taWzHlq0= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5/go.mod h1:jU1li6RFryMz+so64PpKtudI+QzbKoIEivqdf6LNpOc= -github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU= -github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.5 h1:81KE7vaZzrl7yHBYHVEzYB8sypz11NMOZ40YlWvPxsU= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.5/go.mod h1:LIt2rg7Mcgn09Ygbdh/RdIm0rQ+3BNkbP1gyVMFtRK0= github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.8.1/go.mod h1:CM+19rL1+4dFWnOQKwDc7H1KwXTz+h61oUSHyhV0b3o= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 h1:Ji0DY1xUsUr3I8cHps0G+XM3WWU16lP6yG8qu1GAZAs= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2/go.mod h1:5CsjAbs3NlGQyZNFACh+zztPDI7fU6eW9QsxjfnuBKg= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.7 h1:ZMeFZ5yk+Ek+jNr1+uwCd2tG89t6oTS5yVWpa6yy2es= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.7/go.mod h1:mxV05U+4JiHqIpGqqYXOHLPKUC6bDXC44bsUhNjOEwY= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2/go.mod h1:45MfaXZ0cNbeuT0KQ1XJylq8A6+OpVV2E5kvY/Kq+u8= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7 h1:ogRAwT1/gxJBcSWDMZlgyFUM962F51A5CRhDLbxLdmo= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7/go.mod h1:YCsIZhXfRPLFFCl5xxY+1T9RKzOKjCut+28JSX2DnAk= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.5 h1:f9RyWNtS8oH7cZlbn+/JNPpjUk5+5fLd5lM9M0i49Ys= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.5/go.mod h1:h5CoMZV2VF297/VLhRhO1WF+XYWOzXo+4HsObA4HjBQ= github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7NkwbjlijluLsrIbu/iyl35RO4= -github.com/aws/aws-sdk-go-v2/service/s3 v1.53.1 h1:6cnno47Me9bRykw9AEv9zkXE+5or7jz8TsskTTccbgc= -github.com/aws/aws-sdk-go-v2/service/s3 v1.53.1/go.mod h1:qmdkIIAC+GCLASF7R2whgNrJADz0QZPX+Seiw/i4S3o= github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= -github.com/aws/aws-sdk-go-v2/service/sso v1.20.5 h1:vN8hEbpRnL7+Hopy9dzmRle1xmDc7o8tmY0klsr175w= -github.com/aws/aws-sdk-go-v2/service/sso v1.20.5/go.mod h1:qGzynb/msuZIE8I75DVRCUXw3o3ZyBmUvMwQ2t/BrGM= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.4 h1:Jux+gDDyi1Lruk+KHF91tK2KCuY61kzoCpvtvJJBtOE= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.4/go.mod h1:mUYPBhaF2lGiukDEjJX2BLRRKTmoUSitGDUgM4tRxak= github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= -github.com/aws/aws-sdk-go-v2/service/sts v1.28.6 h1:cwIxeBttqPN3qkaAjcEcsh8NYr8n2HZPkcKgPAi1phU= -github.com/aws/aws-sdk-go-v2/service/sts v1.28.6/go.mod h1:FZf1/nKNEkHdGGJP/cI2MoIMquumuRK6ol3QQJNDxmw= github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/aws/smithy-go v1.20.2 h1:tbp628ireGtzcHDDmLT/6ADHidqnwgF57XOXZe6tp4Q= -github.com/aws/smithy-go v1.20.2/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= @@ -2395,8 +2355,6 @@ github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzp github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= -github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= github.com/mattn/go-shellwords v1.0.6/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= github.com/mattn/go-shellwords v1.0.10/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= @@ -2840,9 +2798,6 @@ github.com/remyoudompheng/go-dbus v0.0.0-20121104212943-b7232d34b1d5/go.mod h1:+ github.com/remyoudompheng/go-liblzma v0.0.0-20190506200333-81bf2d431b96/go.mod h1:90HvCY7+oHHUKkbeMCiHt1WuFR2/hPJ9QrljDG+v6ls= github.com/remyoudompheng/go-misc v0.0.0-20190427085024-2d6ac652a50e/go.mod h1:80FQABjoFzZ2M5uEa6FUaJYEmqU2UOKojlFVak1UAwI= github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= -github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.1.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= @@ -3187,8 +3142,6 @@ github.com/valyala/quicktemplate v1.7.0/go.mod h1:sqKJnoaOF88V07vkO+9FL8fb9uZg/V github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/vbatts/tar-split v0.11.2/go.mod h1:vV3ZuO2yWSVsz+pfFzDG/upWH1JhjOiEaWq6kXyQ3VI= -github.com/vbauerster/mpb/v8 v8.7.3 h1:n/mKPBav4FFWp5fH4U0lPpXfiOmCEgl5Yx/NM3tKJA0= -github.com/vbauerster/mpb/v8 v8.7.3/go.mod h1:9nFlNpDGVoTmQ4QvNjSLtwLmAFjwmq0XaAF26toHGNM= github.com/vdemeester/k8s-pkg-credentialprovider v1.17.4/go.mod h1:inCTmtUdr5KJbreVojo06krnTgaeAz/Z7lynpPk/Q2c= github.com/vektra/mockery/v2 v2.14.0/go.mod h1:bnD1T8tExSgPD1ripLkDbr60JA9VtQeu12P3wgLZd7M= github.com/viki-org/dnscache v0.0.0-20130720023526-c70c1f23c5d8/go.mod h1:dniwbG03GafCjFohMDmz6Zc6oCuiqgH6tGNyXTkHzXE= diff --git a/proto/elys/tier/query.proto b/proto/elys/tier/query.proto index a1bd17c0d..c449033b1 100644 --- a/proto/elys/tier/query.proto +++ b/proto/elys/tier/query.proto @@ -34,6 +34,12 @@ service Query { option (google.api.http).get = "/elys-network/elys/membershiptier/calculate_discount/{user}"; } + + // Queries a list of LeverageLpTotal items. + rpc LeverageLpTotal (QueryLeverageLpTotalRequest) returns (QueryLeverageLpTotalResponse) { + option (google.api.http).get = "/elys-network/elys/tier/leverage_lp_total/{user}"; + + } } // QueryParamsRequest is request type for the Query/Params RPC method. message QueryParamsRequest {} @@ -68,8 +74,19 @@ message QueryCalculateDiscountRequest { } message QueryCalculateDiscountResponse { - string discount = 1; - string tier = 2; + string discount = 1; + string tier = 2; string portfolio = 3; } +message QueryLeverageLpTotalRequest { + string user = 1; +} + +message QueryLeverageLpTotalResponse { + string total = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + diff --git a/testutil/keeper/membershiptier.go b/testutil/keeper/membershiptier.go index d32954c01..2abc93687 100644 --- a/testutil/keeper/membershiptier.go +++ b/testutil/keeper/membershiptier.go @@ -50,6 +50,7 @@ func MembershiptierKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { nil, nil, nil, + nil, ) ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) diff --git a/x/tier/client/cli/query.go b/x/tier/client/cli/query.go index 54413257f..c5a0c6038 100644 --- a/x/tier/client/cli/query.go +++ b/x/tier/client/cli/query.go @@ -29,6 +29,8 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdShowPortfolio()) cmd.AddCommand(CmdCalculateDiscount()) + cmd.AddCommand(CmdLeverageLpTotal()) + // this line is used by starport scaffolding # 1 return cmd diff --git a/x/tier/client/cli/query_leverage_lp_total.go b/x/tier/client/cli/query_leverage_lp_total.go new file mode 100644 index 000000000..b3c707b38 --- /dev/null +++ b/x/tier/client/cli/query_leverage_lp_total.go @@ -0,0 +1,45 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/elys-network/elys/x/tier/types" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdLeverageLpTotal() *cobra.Command { + cmd := &cobra.Command{ + Use: "leverage-lp-total [user]", + Short: "Query leverage-lp-total", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + reqUser := args[0] + + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryLeverageLpTotalRequest{ + User: reqUser, + } + + res, err := queryClient.LeverageLpTotal(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/tier/keeper/keeper.go b/x/tier/keeper/keeper.go index 8345d9269..bec56e0e3 100644 --- a/x/tier/keeper/keeper.go +++ b/x/tier/keeper/keeper.go @@ -27,6 +27,7 @@ type ( commitement types.CommitmentKeeper perpetual types.PerpetualKeeper stakingKeeper types.StakingKeeper + leveragelp types.LeverageLpKeeper } ) @@ -44,6 +45,7 @@ func NewKeeper( commitement types.CommitmentKeeper, stakingKeeper types.StakingKeeper, perpetual types.PerpetualKeeper, + leveragelp types.LeverageLpKeeper, ) *Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { @@ -64,6 +66,7 @@ func NewKeeper( commitement: commitement, stakingKeeper: stakingKeeper, perpetual: perpetual, + leveragelp: leveragelp, } } diff --git a/x/tier/keeper/portfolio.go b/x/tier/keeper/portfolio.go index 0d41f3dd7..008843bc1 100644 --- a/x/tier/keeper/portfolio.go +++ b/x/tier/keeper/portfolio.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" + ammtypes "github.com/elys-network/elys/x/amm/types" estakingtypes "github.com/elys-network/elys/x/estaking/types" mastercheftypes "github.com/elys-network/elys/x/masterchef/types" @@ -129,12 +130,33 @@ func (k Keeper) RetreiveAllPortfolio(ctx sdk.Context, user string) { } } + // LeverageLp + lev := k.RetreiveLeverageLpTotal(ctx, sender) + totalValue = totalValue.Add(lev) + k.SetPortfolio(ctx, todayDate, sender.String(), types.Portfolio{ Creator: user, Portfolio: totalValue, }) } +func (k Keeper) RetreiveLeverageLpTotal(ctx sdk.Context, user sdk.AccAddress) sdk.Dec { + positions, _, err := k.leveragelp.GetPositionsForAddress(ctx, user, &query.PageRequest{}) + totalValue := sdk.NewDec(0) + if err == nil { + for _, position := range positions { + pool, found := k.amm.GetPool(ctx, position.AmmPoolId) + if !found { + continue + } + info := k.amm.PoolExtraInfo(ctx, pool) + amount := position.LeveragedLpAmount.ToLegacyDec() + totalValue = totalValue.Add(amount.Mul(info.LpTokenPrice).QuoInt(ammtypes.OneShare)) + } + } + return totalValue +} + // SetPortfolio set a specific portfolio in the store from its index func (k Keeper) SetPortfolio(ctx sdk.Context, todayDate string, user string, portfolio types.Portfolio) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(todayDate)) diff --git a/x/tier/keeper/query_leverage_lp_total.go b/x/tier/keeper/query_leverage_lp_total.go new file mode 100644 index 000000000..8bd146e40 --- /dev/null +++ b/x/tier/keeper/query_leverage_lp_total.go @@ -0,0 +1,24 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/elys-network/elys/x/tier/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) LeverageLpTotal(goCtx context.Context, req *types.QueryLeverageLpTotalRequest) (*types.QueryLeverageLpTotalResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + sender := sdk.MustAccAddressFromBech32(req.User) + total := k.RetreiveLeverageLpTotal(ctx, sender) + + return &types.QueryLeverageLpTotalResponse{ + Total: total, + }, nil +} diff --git a/x/tier/types/expected_keepers.go b/x/tier/types/expected_keepers.go index 5900a0ae1..57c8d7a6a 100644 --- a/x/tier/types/expected_keepers.go +++ b/x/tier/types/expected_keepers.go @@ -12,6 +12,7 @@ import ( assetprofiletypes "github.com/elys-network/elys/x/assetprofile/types" commitmenttypes "github.com/elys-network/elys/x/commitment/types" estakingtypes "github.com/elys-network/elys/x/estaking/types" + leveragelptypes "github.com/elys-network/elys/x/leveragelp/types" mastercheftypes "github.com/elys-network/elys/x/masterchef/types" oracletypes "github.com/elys-network/elys/x/oracle/types" perpetualtypes "github.com/elys-network/elys/x/perpetual/types" @@ -81,3 +82,7 @@ type StakingKeeper interface { ) stakingtypes.Validators GetAllDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress) []stakingtypes.Delegation } + +type LeverageLpKeeper interface { + GetPositionsForAddress(ctx sdk.Context, positionAddress sdk.Address, pagination *query.PageRequest) ([]*leveragelptypes.Position, *query.PageResponse, error) +} diff --git a/x/tier/types/query.pb.go b/x/tier/types/query.pb.go index e60549acb..e371bfae0 100644 --- a/x/tier/types/query.pb.go +++ b/x/tier/types/query.pb.go @@ -6,6 +6,7 @@ package types import ( context "context" fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -409,6 +410,87 @@ func (m *QueryCalculateDiscountResponse) GetPortfolio() string { return "" } +type QueryLeverageLpTotalRequest struct { + User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` +} + +func (m *QueryLeverageLpTotalRequest) Reset() { *m = QueryLeverageLpTotalRequest{} } +func (m *QueryLeverageLpTotalRequest) String() string { return proto.CompactTextString(m) } +func (*QueryLeverageLpTotalRequest) ProtoMessage() {} +func (*QueryLeverageLpTotalRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_461504ebf74c9a97, []int{8} +} +func (m *QueryLeverageLpTotalRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLeverageLpTotalRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLeverageLpTotalRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryLeverageLpTotalRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLeverageLpTotalRequest.Merge(m, src) +} +func (m *QueryLeverageLpTotalRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryLeverageLpTotalRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLeverageLpTotalRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLeverageLpTotalRequest proto.InternalMessageInfo + +func (m *QueryLeverageLpTotalRequest) GetUser() string { + if m != nil { + return m.User + } + return "" +} + +type QueryLeverageLpTotalResponse struct { + Total github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=total,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"total"` +} + +func (m *QueryLeverageLpTotalResponse) Reset() { *m = QueryLeverageLpTotalResponse{} } +func (m *QueryLeverageLpTotalResponse) String() string { return proto.CompactTextString(m) } +func (*QueryLeverageLpTotalResponse) ProtoMessage() {} +func (*QueryLeverageLpTotalResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_461504ebf74c9a97, []int{9} +} +func (m *QueryLeverageLpTotalResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLeverageLpTotalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLeverageLpTotalResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryLeverageLpTotalResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLeverageLpTotalResponse.Merge(m, src) +} +func (m *QueryLeverageLpTotalResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryLeverageLpTotalResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLeverageLpTotalResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLeverageLpTotalResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "elys.tier.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "elys.tier.QueryParamsResponse") @@ -418,52 +500,60 @@ func init() { proto.RegisterType((*QueryAllPortfolioResponse)(nil), "elys.tier.QueryAllPortfolioResponse") proto.RegisterType((*QueryCalculateDiscountRequest)(nil), "elys.tier.QueryCalculateDiscountRequest") proto.RegisterType((*QueryCalculateDiscountResponse)(nil), "elys.tier.QueryCalculateDiscountResponse") + proto.RegisterType((*QueryLeverageLpTotalRequest)(nil), "elys.tier.QueryLeverageLpTotalRequest") + proto.RegisterType((*QueryLeverageLpTotalResponse)(nil), "elys.tier.QueryLeverageLpTotalResponse") } func init() { proto.RegisterFile("elys/tier/query.proto", fileDescriptor_461504ebf74c9a97) } var fileDescriptor_461504ebf74c9a97 = []byte{ - // 628 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0xc1, 0x6e, 0xd3, 0x4c, - 0x10, 0xc7, 0xe3, 0x34, 0x5f, 0xf4, 0x65, 0x8b, 0x40, 0x5d, 0x02, 0x4a, 0xad, 0xd6, 0x20, 0x83, - 0x68, 0x5a, 0x54, 0x2f, 0x4d, 0x2e, 0x48, 0x08, 0x44, 0x9b, 0x2a, 0xbd, 0x70, 0x08, 0x11, 0x27, - 0x2e, 0xd5, 0x3a, 0x2c, 0xae, 0x85, 0xe3, 0x75, 0xbd, 0x6b, 0x20, 0xaa, 0x7a, 0xe1, 0x01, 0x10, - 0x12, 0xf7, 0xbe, 0x01, 0xef, 0xd1, 0x63, 0x25, 0x2e, 0x9c, 0x10, 0x4a, 0xfa, 0x20, 0xc8, 0xeb, - 0xb1, 0xe3, 0x34, 0x49, 0x5b, 0x6e, 0xf6, 0xec, 0xcc, 0x7f, 0x7e, 0x3b, 0xff, 0xb1, 0xd1, 0x1d, - 0xe6, 0x0d, 0x04, 0x91, 0x2e, 0x0b, 0xc9, 0x61, 0xc4, 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x7d, 0x41, 0xf8, 0x44, 0x43, 0x95, 0xcc, 0x11, 0xfc, 0xe0, 0xa2, 0xfe, 0x8c, - 0xcd, 0xd6, 0x1f, 0x5e, 0x9e, 0x04, 0x28, 0x6d, 0x85, 0xf2, 0x12, 0xbf, 0xb8, 0x06, 0x4a, 0x5a, - 0x4c, 0x8e, 0x62, 0x23, 0x8e, 0xc9, 0x51, 0xf6, 0x51, 0x1c, 0xe3, 0xaf, 0x1a, 0xba, 0x91, 0xa9, - 0x6f, 0x7b, 0xde, 0x34, 0xe3, 0x8c, 0x4d, 0x9f, 0x66, 0x9c, 0xb5, 0xa9, 0x66, 0x53, 0x31, 0x6e, - 0xe2, 0xc7, 0xff, 0xc0, 0x88, 0x7f, 0x68, 0x68, 0x69, 0x6a, 0x45, 0x70, 0xfd, 0x62, 0xc3, 0x79, - 0xab, 0xa7, 0xaf, 0x5f, 0x23, 0x13, 0xf8, 0x5a, 0x8a, 0xef, 0x39, 0x7e, 0x76, 0x35, 0x5f, 0x2f, - 0x15, 0xd9, 0x4f, 0x37, 0x12, 0x86, 0xb9, 0xd3, 0x3a, 0x1d, 0x1a, 0xda, 0xd9, 0xd0, 0xd0, 0xfe, - 0x0c, 0x0d, 0xed, 0xdb, 0xc8, 0x28, 0x9c, 0x8d, 0x8c, 0xc2, 0xaf, 0x91, 0x51, 0x78, 0xbb, 0xee, - 0xb8, 0xf2, 0x20, 0xb2, 0xad, 0x1e, 0xef, 0xcf, 0x68, 0xf0, 0x39, 0xf9, 0xa3, 0xca, 0x41, 0xc0, - 0x84, 0x5d, 0x56, 0xbf, 0xd3, 0xe6, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa8, 0xa5, 0x9a, 0xc8, - 0x05, 0x06, 0x00, 0x00, + // 723 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x95, 0xcf, 0x4f, 0x13, 0x41, + 0x14, 0x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xda, 0x9b, 0xe8, 0x61, 0x97, 0x55, 0x84, 0x3c, + 0x10, 0x0c, 0x13, 0x94, 0xd7, 0xba, 0x13, 0xc6, 0x53, 0xa3, 0x38, 0x52, 0x1a, 0x73, 0x92, 0xb7, + 0x39, 0xda, 0x75, 0x7d, 0xe8, 0xec, 0x62, 0x26, 0x57, 0x01, 0x37, 0x7b, 0x1b, 0x4d, 0x28, 0x9d, + 0x2d, 0x26, 0x77, 0xda, 0x89, 0x21, 0x07, 0xc6, 0x68, 0xa8, 0x29, 0x58, 0xa4, 0xa4, 0x0a, 0x15, + 0x75, 0xc6, 0x53, 0xa8, 0x40, 0x85, 0x60, 0x72, 0xb7, 0x15, 0xb2, 0x89, 0x01, 0x75, 0xd1, 0x31, + 0xd8, 0x65, 0x34, 0x99, 0xa1, 0x06, 0x6c, 0x73, 0x68, 0x54, 0x72, 0x49, 0xfd, 0x6a, 0xf2, 0x42, + 0x50, 0x7e, 0xa0, 0xcc, 0x49, 0x80, 0x5d, 0x03, 0xa6, 0x35, 0xdf, 0xef, 0x63, 0xda, 0x44, 0xa8, + 0x53, 0x54, 0x78, 0xe4, 0xac, 0xa3, 0x3b, 0xe0, 0xc4, 0x1d, 0x70, 0x74, 0x67, 0xa1, 0x03, 0xce, + 0x0e, 0x75, 0x19, 0xc4, 0x56, 0x52, 0x91, 0xf6, 0xa9, 0x01, 0xa8, 0xdd, 0x49, 0x00, 0x75, 0x15, + 0x15, 0xd2, 0x90, 0x83, 0xc5, 0x91, 0xd2, 0x78, 0xba, 0x92, 0xed, 0x3b, 0x28, 0x66, 0xc7, 0x19, + 0x6f, 0x75, 0xf1, 0x0d, 0x28, 0xbe, 0xb9, 0x5b, 0xf9, 0x74, 0xda, 0x2e, 0xc0, 0x15, 0x34, 0xad, + 0xf8, 0x36, 0xa8, 0x5f, 0x6f, 0xfa, 0x54, 0xb2, 0xb2, 0x27, 0xea, 0xbc, 0x19, 0xc8, 0x1b, 0xba, + 0x63, 0x07, 0xc8, 0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 0x6c, 0xeb, 0x09, 0xfe, 0x62, 0xa0, 0xfb, + 0x89, 0xfa, 0x9a, 0xef, 0xf7, 0x33, 0x66, 0xac, 0x60, 0x3f, 0x63, 0xd6, 0x0a, 0xd9, 0x2b, 0x8a, + 0x71, 0x11, 0xbf, 0xf8, 0x0f, 0x46, 0xfc, 0xc3, 0x40, 0x63, 0x7d, 0xb3, 0x8b, 0x8b, 0xbd, 0x09, + 0xaf, 0xdb, 0x09, 0x73, 0xfe, 0x0e, 0x9e, 0xc0, 0xb7, 0xa1, 0xf8, 0x5e, 0xe1, 0x97, 0xb7, 0xf3, + 0xd5, 0xdb, 0x22, 0xd5, 0xf6, 0xaa, 0x40, 0x31, 0xf1, 0x77, 0x03, 0x8d, 0xf6, 0x0c, 0x32, 0x9e, + 0xed, 0x65, 0xc8, 0x5e, 0x0e, 0x73, 0xee, 0x56, 0x3f, 0x20, 0x5d, 0x55, 0xa4, 0x25, 0xbc, 0x94, + 0x41, 0xaa, 0xf8, 0x7c, 0x08, 0xac, 0xfa, 0x61, 0x55, 0x8d, 0x3f, 0xe0, 0xad, 0x6f, 0x9c, 0x5d, + 0x5a, 0xc6, 0xf9, 0xa5, 0x65, 0xfc, 0xb9, 0xb4, 0x8c, 0xaf, 0x57, 0x56, 0xee, 0xfc, 0xca, 0xca, + 0xfd, 0xba, 0xb2, 0x72, 0xef, 0xe6, 0x53, 0xeb, 0xd4, 0xaf, 0xfa, 0x51, 0xeb, 0xaa, 0xad, 0xaa, + 0xe5, 0xd5, 0xdf, 0xd0, 0xca, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x39, 0x78, 0x52, 0x26, 0x3d, + 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -485,6 +575,8 @@ type QueryClient interface { PortfolioAll(ctx context.Context, in *QueryAllPortfolioRequest, opts ...grpc.CallOption) (*QueryAllPortfolioResponse, error) // Queries a list of CalculateDiscount items. CalculateDiscount(ctx context.Context, in *QueryCalculateDiscountRequest, opts ...grpc.CallOption) (*QueryCalculateDiscountResponse, error) + // Queries a list of LeverageLpTotal items. + LeverageLpTotal(ctx context.Context, in *QueryLeverageLpTotalRequest, opts ...grpc.CallOption) (*QueryLeverageLpTotalResponse, error) } type queryClient struct { @@ -531,6 +623,15 @@ func (c *queryClient) CalculateDiscount(ctx context.Context, in *QueryCalculateD return out, nil } +func (c *queryClient) LeverageLpTotal(ctx context.Context, in *QueryLeverageLpTotalRequest, opts ...grpc.CallOption) (*QueryLeverageLpTotalResponse, error) { + out := new(QueryLeverageLpTotalResponse) + err := c.cc.Invoke(ctx, "/elys.tier.Query/LeverageLpTotal", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. @@ -540,6 +641,8 @@ type QueryServer interface { PortfolioAll(context.Context, *QueryAllPortfolioRequest) (*QueryAllPortfolioResponse, error) // Queries a list of CalculateDiscount items. CalculateDiscount(context.Context, *QueryCalculateDiscountRequest) (*QueryCalculateDiscountResponse, error) + // Queries a list of LeverageLpTotal items. + LeverageLpTotal(context.Context, *QueryLeverageLpTotalRequest) (*QueryLeverageLpTotalResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -558,6 +661,9 @@ func (*UnimplementedQueryServer) PortfolioAll(ctx context.Context, req *QueryAll func (*UnimplementedQueryServer) CalculateDiscount(ctx context.Context, req *QueryCalculateDiscountRequest) (*QueryCalculateDiscountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CalculateDiscount not implemented") } +func (*UnimplementedQueryServer) LeverageLpTotal(ctx context.Context, req *QueryLeverageLpTotalRequest) (*QueryLeverageLpTotalResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LeverageLpTotal not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -635,6 +741,24 @@ func _Query_CalculateDiscount_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Query_LeverageLpTotal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryLeverageLpTotalRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).LeverageLpTotal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/elys.tier.Query/LeverageLpTotal", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).LeverageLpTotal(ctx, req.(*QueryLeverageLpTotalRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.tier.Query", HandlerType: (*QueryServer)(nil), @@ -655,6 +779,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "CalculateDiscount", Handler: _Query_CalculateDiscount_Handler, }, + { + MethodName: "LeverageLpTotal", + Handler: _Query_LeverageLpTotal_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "elys/tier/query.proto", @@ -941,6 +1069,69 @@ func (m *QueryCalculateDiscountResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *QueryLeverageLpTotalRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryLeverageLpTotalRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLeverageLpTotalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.User) > 0 { + i -= len(m.User) + copy(dAtA[i:], m.User) + i = encodeVarintQuery(dAtA, i, uint64(len(m.User))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryLeverageLpTotalResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryLeverageLpTotalResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLeverageLpTotalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = 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)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -1068,6 +1259,30 @@ func (m *QueryCalculateDiscountResponse) Size() (n int) { return n } +func (m *QueryLeverageLpTotalRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.User) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryLeverageLpTotalResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Total.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1837,6 +2052,172 @@ func (m *QueryCalculateDiscountResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryLeverageLpTotalRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryLeverageLpTotalRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLeverageLpTotalRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.User = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryLeverageLpTotalResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryLeverageLpTotalResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLeverageLpTotalResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Total.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/tier/types/query.pb.gw.go b/x/tier/types/query.pb.gw.go index f8e8bd776..67a8f503c 100644 --- a/x/tier/types/query.pb.gw.go +++ b/x/tier/types/query.pb.gw.go @@ -215,6 +215,60 @@ func local_request_Query_CalculateDiscount_0(ctx context.Context, marshaler runt } +func request_Query_LeverageLpTotal_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLeverageLpTotalRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["user"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "user") + } + + protoReq.User, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "user", err) + } + + msg, err := client.LeverageLpTotal(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_LeverageLpTotal_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLeverageLpTotalRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["user"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "user") + } + + protoReq.User, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "user", err) + } + + msg, err := server.LeverageLpTotal(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -301,6 +355,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_LeverageLpTotal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_LeverageLpTotal_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_LeverageLpTotal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -422,6 +499,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_LeverageLpTotal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_LeverageLpTotal_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_LeverageLpTotal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -433,6 +530,8 @@ var ( pattern_Query_PortfolioAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"elys-network", "elys", "membershiptier", "portfolio"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_CalculateDiscount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"elys-network", "elys", "membershiptier", "calculate_discount", "user"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_LeverageLpTotal_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"elys-network", "elys", "tier", "leverage_lp_total", "user"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( @@ -443,4 +542,6 @@ var ( forward_Query_PortfolioAll_0 = runtime.ForwardResponseMessage forward_Query_CalculateDiscount_0 = runtime.ForwardResponseMessage + + forward_Query_LeverageLpTotal_0 = runtime.ForwardResponseMessage )