-
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.
Dev 1930 set max value for pool (#863)
* feat: add param * add check * fix: migration and test * update * update * update proto * update * update * fix: proto * update migration * update * update * update * Update pool.proto * update * test(leveragelp): fix tests * fix(leveragelp): migration * fix(leveragelp): fix data structure * fix(leveragelp): new pool * fix(leveragelp): migration * fix(leveragelp): fix tests and doc --------- Co-authored-by: Cosmic Vagabond <121588426+cosmic-vagabond@users.noreply.github.com>
- Loading branch information
1 parent
9482221
commit 28bb08f
Showing
12 changed files
with
162 additions
and
310 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package migrations | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/elys-network/elys/x/leveragelp/types" | ||
) | ||
|
||
func (m Migrator) V15Migration(ctx sdk.Context) error { | ||
legacyPools := m.keeper.GetAllLegacyPools(ctx) | ||
|
||
for _, legacyPool := range legacyPools { | ||
newPool := types.Pool{ | ||
AmmPoolId: legacyPool.AmmPoolId, | ||
Health: legacyPool.Health, | ||
LeveragedLpAmount: legacyPool.LeveragedLpAmount, | ||
LeverageMax: legacyPool.LeverageMax, | ||
MaxLeveragelpPercent: sdk.NewDec(60), | ||
} | ||
m.keeper.SetPool(ctx, newPool) | ||
} | ||
|
||
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
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.