-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EdenApr and externalApr calculation forward looking (#604)
* edenApr and externalApr calculation forward looking * fix GetDailyRewardsAmountForPool
- Loading branch information
Showing
11 changed files
with
93 additions
and
1,547 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,9 @@ | ||
package migrations | ||
|
||
import ( | ||
"cosmossdk.io/math" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/elys-network/elys/x/masterchef/types" | ||
) | ||
|
||
func (m Migrator) V2Migration(ctx sdk.Context) error { | ||
// migrate params | ||
legacy := m.keeper.GetLegacyParams(ctx) | ||
params := types.NewParams( | ||
legacy.LpIncentives, | ||
legacy.RewardPortionForLps, | ||
legacy.RewardPortionForStakers, | ||
legacy.MaxEdenRewardAprLps, | ||
legacy.ProtocolRevenueAddress, | ||
) | ||
m.keeper.SetParams(ctx, params) | ||
|
||
// migrate pools | ||
legacyPools := m.keeper.GetAllLegacyPools(ctx) | ||
for _, legacyPool := range legacyPools { | ||
m.keeper.SetPool(ctx, types.PoolInfo{ | ||
PoolId: legacyPool.PoolId, | ||
RewardWallet: legacyPool.RewardWallet, | ||
Multiplier: legacyPool.Multiplier, | ||
EdenApr: legacyPool.EdenApr, | ||
DexApr: legacyPool.DexApr, | ||
GasApr: math.LegacyZeroDec(), | ||
ExternalIncentiveApr: legacyPool.ExternalIncentiveApr, | ||
ExternalRewardDenoms: legacyPool.ExternalRewardDenoms, | ||
}) | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.