From e6f1f36a603cd56db4d55a034c37e4013555eb3e Mon Sep 17 00:00:00 2001 From: Amit Yadav Date: Thu, 27 Jun 2024 22:24:58 +0530 Subject: [PATCH] Check and fix leverage LP allocated amount (#630) * fix percent * remove protection * devnet * update --- .github/workflows/deploy.yml | 2 +- .github/workflows/devnet-branch-protection.yml | 14 -------------- .github/workflows/main-branch-protection.yml | 14 -------------- x/amm/client/wasm/query_earn_mining_pool_all.go | 2 +- 4 files changed, 2 insertions(+), 30 deletions(-) delete mode 100644 .github/workflows/devnet-branch-protection.yml delete mode 100644 .github/workflows/main-branch-protection.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8498a7c3f..2d4972a11 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,7 +2,7 @@ name: Deploy in devnet on: push: branches: - - devnet + - main jobs: deploy: runs-on: ubuntu-latest diff --git a/.github/workflows/devnet-branch-protection.yml b/.github/workflows/devnet-branch-protection.yml deleted file mode 100644 index 58dab786b..000000000 --- a/.github/workflows/devnet-branch-protection.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: "Devnet branch protection" - -on: - pull_request: - -jobs: - check_branch: - runs-on: ubuntu-latest - steps: - - name: Check branch - if: github.base_ref == 'devnet' && github.head_ref != 'develop' - run: | - echo "ERROR: You can only merge to devnet from develop." - exit 1 diff --git a/.github/workflows/main-branch-protection.yml b/.github/workflows/main-branch-protection.yml deleted file mode 100644 index 45c221680..000000000 --- a/.github/workflows/main-branch-protection.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: "Main branch protection" - -on: - pull_request: - -jobs: - check_branch: - runs-on: ubuntu-latest - steps: - - name: Check branch - if: github.base_ref == 'main' && github.head_ref != 'devnet' - run: | - echo "ERROR: You can only merge to main from devnet." - exit 1 diff --git a/x/amm/client/wasm/query_earn_mining_pool_all.go b/x/amm/client/wasm/query_earn_mining_pool_all.go index 3c461248c..e58223da1 100644 --- a/x/amm/client/wasm/query_earn_mining_pool_all.go +++ b/x/amm/client/wasm/query_earn_mining_pool_all.go @@ -82,7 +82,7 @@ func (oq *Querier) generateEarnPool(ctx sdk.Context, ammPool *types.Pool, filter leverageLpPool, found := oq.leveragelpKeeper.GetPool(ctx, ammPool.PoolId) if found { - leverageLpPercent = leverageLpPool.Health + leverageLpPercent = leverageLpPool.LeveragedLpAmount.ToLegacyDec().Quo(ammPool.TotalShares.Amount.ToLegacyDec()).Mul(sdk.NewDec(100)) } perpetualPool, found := oq.perpetualKeeper.GetPool(ctx, ammPool.PoolId)