Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix incentive abci division by zero error #275

Merged
merged 1 commit into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ validators:
bonded: 100000000uelys
genesis:
app_state:
clock:
params:
contract_addresses:
["elys14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s3fsthx"]
crisis:
constant_fee:
denom: uelys
Expand Down
4 changes: 4 additions & 0 deletions docs/static/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82951,11 +82951,15 @@ definitions:
properties:
token_out_amount:
type: string
discount:
type: string
elys.amm.MsgSwapExactAmountOutResponse:
type: object
properties:
token_in_amount:
type: string
discount:
type: string
elys.amm.OraclePoolSlippageTrack:
type: object
properties:
Expand Down
5 changes: 4 additions & 1 deletion x/incentive/keeper/keeper_lps.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ func (k Keeper) CalculateRewardsForLPs(ctx sdk.Context, totalProxyTVL sdk.Dec, c

// Calculate Proxy TVL share considering multiplier
proxyTVL := tvl.Mul(poolInfo.Multiplier)
poolShare := proxyTVL.Quo(totalProxyTVL)
poolShare := sdk.ZeroDec()
if totalProxyTVL.IsPositive() {
poolShare = proxyTVL.Quo(totalProxyTVL)
}

// Calculate new Eden for this pool
newEdenAllocatedForPool := poolShare.MulInt(edenAmountPerEpochLp)
Expand Down
Loading