Skip to content

Commit

Permalink
Merge branch 'main' into dong/symbol-USD-psm
Browse files Browse the repository at this point in the history
  • Loading branch information
DongLieu committed Nov 11, 2024
2 parents dc68bf4 + 52f0ab1 commit a8696a8
Show file tree
Hide file tree
Showing 18 changed files with 524 additions and 246 deletions.
1 change: 0 additions & 1 deletion app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ func NewAppKeeper(
appKeepers.AccountKeeper,
appKeepers.BankKeeper,
&appKeepers.VaultsKeeper,
&appKeepers.OracleKeeper,
logger,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
Expand Down
16 changes: 9 additions & 7 deletions proto/reserve/vaults/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -34,43 +34,44 @@ message Params {
// VaultParams defines the parameters for each collateral vault type.
message VaultMamagerParams {
string mint_denom = 1;
string mint_symbol = 2;

string min_collateral_ratio = 2 [
string min_collateral_ratio = 3 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(amino.dont_omitempty) = true,
(gogoproto.nullable) = false
];

string liquidation_ratio = 3 [
string liquidation_ratio = 4 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(amino.dont_omitempty) = true,
(gogoproto.nullable) = false
];

string max_debt = 4 [
string max_debt = 5 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(amino.dont_omitempty) = true,
(gogoproto.nullable) = false
];

string stability_fee = 5 [
string stability_fee = 6 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(amino.dont_omitempty) = true,
(gogoproto.nullable) = false
];

string liquidation_penalty = 6 [
string liquidation_penalty = 7 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(amino.dont_omitempty) = true,
(gogoproto.nullable) = false
];

string minting_fee = 7 [
string minting_fee = 8 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(amino.dont_omitempty) = true,
Expand All @@ -84,8 +85,9 @@ message VaultMamager {
[ (amino.dont_omitempty) = true, (gogoproto.nullable) = false ];

string denom = 2;
string symbol = 3;

string mint_available = 3 [
string mint_available = 4 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(amino.dont_omitempty) = true,
Expand Down
4 changes: 4 additions & 0 deletions proto/reserve/vaults/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ message MsgActiveCollateral {
uint64 oracl_script = 8;

string authority = 9 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
string sym_bol = 10;
string mint_denom = 11;
}

// MsgActiveCollateralResponse defines the Msg/ActiveCollateral response type.
Expand Down Expand Up @@ -175,6 +177,8 @@ message MsgUpdatesCollateral {
uint64 oracl_script = 8;

string authority = 9 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
string sym_bol = 10;
string mint_denom = 11;
}

// MsgActiveCollateralResponse defines the Msg/ActiveCollateral response type.
Expand Down
18 changes: 17 additions & 1 deletion script/proposal-vault-1.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,23 @@
"authority":"onomy10d07y265gmmuvt4z0w9aw880jnsr700jqr8n8k",
"min_collateral_ratio": "0.5",
"liquidation_ratio":"0.5",
"max_debt":"1000000000000000000000000000"
"max_debt":"1000000000000000000000000000",
"sym_bol": "usdt",
"oracl_script": "44",
"mint_denom": "nomUSD",
"stability_fee": "0.1"
},
{
"@type": "/reserve.vaults.MsgActiveCollateral",
"denom": "atom",
"authority":"onomy10d07y265gmmuvt4z0w9aw880jnsr700jqr8n8k",
"min_collateral_ratio": "0.5",
"liquidation_ratio":"0.5",
"max_debt":"1000000000000000000000000000",
"sym_bol": "atom",
"oracl_script": "44",
"mint_denom": "nomUSD",
"stability_fee": "0.1"
}],
"deposit": "100000000stake",
"title": "My proposal",
Expand Down
13 changes: 0 additions & 13 deletions script/proposal-vault-2.json

This file was deleted.

7 changes: 1 addition & 6 deletions script/vaults-gov-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,21 +122,16 @@ reserved q gov proposals
# reserved tx gov submit-legacy-proposal active-collateral "title" "description" "atom" "10" "0.1" "10000" 10000000000000000000stake --keyring-backend=test --home=$HOME/.reserved/validator1 --from validator1 -y --chain-id testing-1 --fees 20stake

reserved tx gov submit-proposal ./script/proposal-vault-1.json --home=$HOME/.reserved/validator1 --from validator1 --keyring-backend test --fees 20stake --chain-id testing-1 -y
reserved tx gov submit-proposal ./script/proposal-vault-2.json --home=$HOME/.reserved/validator2 --from validator2 --keyring-backend test --fees 20stake --chain-id testing-1 -y

# # vote
sleep 7
reserved tx gov vote 1 yes --from validator1 --keyring-backend test --home ~/.reserved/validator1 --chain-id testing-1 -y --fees 20stake
reserved tx gov vote 1 yes --from validator2 --keyring-backend test --home ~/.reserved/validator2 --chain-id testing-1 -y --fees 20stake
reserved tx gov vote 1 yes --from validator3 --keyring-backend test --home ~/.reserved/validator3 --chain-id testing-1 -y --fees 20stake
sleep 7
reserved tx gov vote 2 yes --from validator1 --keyring-backend test --home ~/.reserved/validator1 --chain-id testing-1 -y --fees 20stake
reserved tx gov vote 2 yes --from validator2 --keyring-backend test --home ~/.reserved/validator2 --chain-id testing-1 -y --fees 20stake
reserved tx gov vote 2 yes --from validator3 --keyring-backend test --home ~/.reserved/validator3 --chain-id testing-1 -y --fees 20stake

# wait voting_perio=15s
echo "========sleep=========="
sleep 8
sleep 15
reserved q gov proposals
reserved tx oracle set-price usdt 1 --home=$HOME/.reserved/validator1 --from validator1 --keyring-backend test --fees 20stake --chain-id testing-1 -y
reserved tx oracle set-price atom 8 --home=$HOME/.reserved/validator2 --from validator2 --keyring-backend test --fees 20stake --chain-id testing-1 -y
Expand Down
9 changes: 3 additions & 6 deletions x/auction/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ type (
logger log.Logger

// keepers
authKeeper types.AccountKeeper
bankKeeper types.BankKeeper
vaultKeeper types.VaultKeeper
OracleKeeper types.OracleKeeper
authKeeper types.AccountKeeper
bankKeeper types.BankKeeper
vaultKeeper types.VaultKeeper

// the address capable of executing a MsgUpdateParams message. Typically, this
// should be the x/gov module account.
Expand Down Expand Up @@ -55,7 +54,6 @@ func NewKeeper(
ak types.AccountKeeper,
bk types.BankKeeper,
vk types.VaultKeeper,
ok types.OracleKeeper,
logger log.Logger,
authority string,

Expand All @@ -73,7 +71,6 @@ func NewKeeper(
authKeeper: ak,
bankKeeper: bk,
vaultKeeper: vk,
OracleKeeper: ok,
AuctionIdSeq: collections.NewSequence(sb, types.AuctionIdSeqPrefix, "auction_id_sequence"),
LastestAuctionPeriods: collections.NewItem(sb, types.LastestAuctionPeriodPrefix, "lastestAuctionPeriods", collections.Int64Value),
BidIdSeq: collections.NewMap(sb, types.BidIdSeqPrefix, "bid_id_sequence", collections.Uint64Key, collections.Uint64Value),
Expand Down
1 change: 0 additions & 1 deletion x/auction/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ func ProvideModule(in ModuleInputs) ModuleOutputs {
in.AccountKeeper,
in.BankKeeper,
&in.VaultKeeper,
&in.OracleKeeper,
in.Logger,
authority.String(),
)
Expand Down
6 changes: 0 additions & 6 deletions x/auction/types/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package types
import (
"context"

"cosmossdk.io/math"

addresscodec "cosmossdk.io/core/address"
sdk "github.com/cosmos/cosmos-sdk/types"
vaulttypes "github.com/onomyprotocol/reserve/x/vaults/types"
Expand Down Expand Up @@ -48,7 +46,3 @@ type VaultKeeper interface {
GetVault(ctx context.Context, vaultId uint64) (vaulttypes.Vault, error)
GetAllowedMintDenoms(ctx context.Context) []string
}

type OracleKeeper interface {
GetPrice(ctx context.Context, base, quote string) *math.LegacyDec
}
2 changes: 1 addition & 1 deletion x/psm/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (k Keeper) checkLimitTotalStablecoin(ctx context.Context, coin sdk.Coin) er
return err
}
if (totalStablecoinLock.Add(coin.Amount)).GT(totalLimit) {
return fmt.Errorf("unable to perform %s token swap transaction because the amount of %s you want to swap exceeds the allowed limit, can only swap up to %s%s", coin.Denom, coin.Denom, (totalLimit).Sub(totalStablecoinLock).String(), coin.Denom)
return fmt.Errorf("unable to perform %s token swap transaction: exceeds the allowed limit %s , can only swap up to %s%s", coin.Denom, coin.Denom, (totalLimit).Sub(totalStablecoinLock).String(), coin.Denom)
}

return nil
Expand Down
4 changes: 2 additions & 2 deletions x/vaults/keeper/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (s *KeeperTestSuite) TestBeginBlock() {
name: "success: one vault",
setup: func() { // 100000000000atom debt 210000000nomUSD(get 200000000nomUSD + 10000000nomUSD MintingFee)
err := s.k.ActiveCollateralAsset(s.Ctx,
denom, math.LegacyMustNewDecFromStr("1.6"),
denom, denom, "nomUSD", math.LegacyMustNewDecFromStr("1.6"),
math.LegacyMustNewDecFromStr("1.5"),
maxDebt, stabilityFee,
types.DefaultMintingFee,
Expand Down Expand Up @@ -62,7 +62,7 @@ func (s *KeeperTestSuite) TestBeginBlock() {
name: "success: no vault, LastUpdateTime updates",
setup: func() { // 100000000000atom debt 210000000nomUSD(get 200000000nomUSD + 10000000nomUSD MintingFee)
err := s.k.ActiveCollateralAsset(s.Ctx,
denom, math.LegacyMustNewDecFromStr("1.6"),
denom, denom, "nomUSD", math.LegacyMustNewDecFromStr("1.6"),
math.LegacyMustNewDecFromStr("1.5"),
maxDebt, stabilityFee,
types.DefaultMintingFee,
Expand Down
7 changes: 6 additions & 1 deletion x/vaults/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ func (k Keeper) GetAuthority() string {
func (k *Keeper) ActiveCollateralAsset(
ctx context.Context,
denom string,
symbol string,
mintDenom string,
minCollateralRatio math.LegacyDec,
liquidationRatio math.LegacyDec,
maxDebt math.Int,
Expand All @@ -90,8 +92,11 @@ func (k *Keeper) ActiveCollateralAsset(
return fmt.Errorf("denom %s already be actived", denom)
}
vm := types.VaultMamager{
Denom: denom,
Denom: denom,
Symbol: symbol,
Params: types.VaultMamagerParams{
MintDenom: mintDenom,
MintSymbol: symbol,
MinCollateralRatio: minCollateralRatio,
LiquidationRatio: liquidationRatio,
MaxDebt: maxDebt,
Expand Down
4 changes: 2 additions & 2 deletions x/vaults/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (k msgServer) ActiveCollateral(ctx context.Context, msg *types.MsgActiveCol
return nil, errorsmod.Wrapf(types.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.authority, msg.Authority)
}

err = k.ActiveCollateralAsset(ctx, msg.Denom, msg.MinCollateralRatio, msg.LiquidationRatio, msg.MaxDebt, msg.StabilityFee, msg.MintingFee, msg.LiquidationPenalty, int64(msg.OraclScript))
err = k.ActiveCollateralAsset(ctx, msg.Denom, msg.SymBol, msg.MintDenom, msg.MinCollateralRatio, msg.LiquidationRatio, msg.MaxDebt, msg.StabilityFee, msg.MintingFee, msg.LiquidationPenalty, int64(msg.OraclScript))
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -173,7 +173,7 @@ func (k msgServer) Close(ctx context.Context, msg *types.MsgClose) (*types.MsgCl
if err != nil {
return nil, fmt.Errorf("vault %d was not found", msg.VaultId)
}

err = k.CloseVault(ctx, msg.Sender, vault)
if err != nil {
return nil, err
Expand Down
17 changes: 13 additions & 4 deletions x/vaults/keeper/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ func (k *Keeper) CreateNewVault(
if err != nil {
return fmt.Errorf("%s was not actived", denom)
}
collateralSymbol := vm.Symbol
mintDenom := vm.Params.MintDenom

allowedMintDenoms := k.GetAllowedMintDenoms(ctx)
// TODO: Check if mint denom is allowed
Expand All @@ -43,7 +45,8 @@ func (k *Keeper) CreateNewVault(
}

// Calculate collateral ratio
price := k.OracleKeeper.GetPrice(ctx, denom, mint.Denom)
price := k.OracleKeeper.GetPrice(ctx, collateralSymbol, mintDenom)
fmt.Println(price, collateralSymbol, mintDenom)
if price == nil || price.IsNil() {
return errors.Wrapf(oracletypes.ErrInvalidOracle, "CreateNewVault: can not get price with base %s quote %s", denom, types.DefaultMintDenoms)
}
Expand Down Expand Up @@ -180,7 +183,9 @@ func (k *Keeper) MintCoin(
}

lockedCoin := vault.CollateralLocked
price := k.OracleKeeper.GetPrice(ctx, lockedCoin.Denom, mint.Denom)
collateralSymbol := vm.Symbol
mintSymbol := vm.Params.MintSymbol
price := k.OracleKeeper.GetPrice(ctx, collateralSymbol, mintSymbol)
if price == nil || price.IsNil() {
return errors.Wrapf(oracletypes.ErrInvalidOracle, "MintCoin: can not get price with base %s quote %s", lockedCoin.Denom, types.DefaultMintDenoms)
}
Expand Down Expand Up @@ -381,7 +386,9 @@ func (k *Keeper) WithdrawFromVault(
}

newLock := vault.CollateralLocked.Sub(collateral)
price := k.OracleKeeper.GetPrice(ctx, collateral.Denom, vault.Debt.Denom)
collateralSymbol := vm.Symbol
mintSymbol := vm.Params.MintSymbol
price := k.OracleKeeper.GetPrice(ctx, collateralSymbol, mintSymbol)
// defensive programming: should never happen since when withdraw should always have a valid oracle price
if price == nil || price.IsNil() {
return errors.Wrapf(oracletypes.ErrInvalidOracle, "WithdrawFromVault: can not get price with base %s quote %s", collateral.Denom, types.DefaultMintDenoms)
Expand Down Expand Up @@ -489,7 +496,9 @@ func (k *Keeper) GetLiquidations(
liquidations := make(map[string]*types.Liquidation)

err := k.VaultsManager.Walk(ctx, nil, func(key string, vm types.VaultMamager) (bool, error) {
price := k.OracleKeeper.GetPrice(ctx, vm.Denom, mintDenom)
collateralSymbol := vm.Symbol
mintSymbol := vm.Params.MintSymbol
price := k.OracleKeeper.GetPrice(ctx, collateralSymbol, mintSymbol)
if price == nil || price.IsNil() {
return true, errors.Wrapf(oracletypes.ErrInvalidOracle, "GetLiquidations: can not get price with base %s quote %s", vm.Denom, types.DefaultMintDenoms)
}
Expand Down
16 changes: 8 additions & 8 deletions x/vaults/keeper/vaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (s *KeeperTestSuite) TestCreateNewVault() {
collateral = sdk.NewCoin(denom, math.NewInt(10_000_000)) // 10 atom = 80$
maxDebt = math.NewInt(100_000_000)
)
err := s.k.ActiveCollateralAsset(s.Ctx, denom, math.LegacyMustNewDecFromStr("1.6"), math.LegacyMustNewDecFromStr("1.5"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1)
err := s.k.ActiveCollateralAsset(s.Ctx, denom, denom, "nomUSD", math.LegacyMustNewDecFromStr("1.6"), math.LegacyMustNewDecFromStr("1.5"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1)
s.Require().NoError(err)

tests := []struct {
Expand Down Expand Up @@ -166,7 +166,7 @@ func (s *KeeperTestSuite) TestRepayDebt() {
maxDebt = math.NewInt(2000000000)
mintedCoin = sdk.NewCoin(types.DefaultMintDenoms[0], math.NewInt(300000000))
)
err := s.k.ActiveCollateralAsset(s.Ctx, denom, math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1)
err := s.k.ActiveCollateralAsset(s.Ctx, denom, denom, "nomUSD", math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1)
s.Require().NoError(err)

tests := []struct {
Expand Down Expand Up @@ -284,7 +284,7 @@ func (s *KeeperTestSuite) TestDepositToVault() {
maxDebt = math.NewInt(2000000000)
mintedCoin = sdk.NewCoin(types.DefaultMintDenoms[0], math.NewInt(200000000))
)
err := s.k.ActiveCollateralAsset(s.Ctx, denom, math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1)
err := s.k.ActiveCollateralAsset(s.Ctx, denom, denom, "nomUSD", math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1)
s.Require().NoError(err)

tests := []struct {
Expand Down Expand Up @@ -407,7 +407,7 @@ func (s *KeeperTestSuite) TestWithdrawFromVault() {
setup: func() {
s.FundAccount(s.TestAccs[0], types.ModuleName, sdk.NewCoins(fund))

err := s.k.ActiveCollateralAsset(s.Ctx, denom, math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1)
err := s.k.ActiveCollateralAsset(s.Ctx, denom, denom, "nomUSD", math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1)
s.Require().NoError(err)

err = s.k.CreateNewVault(s.Ctx, s.TestAccs[0], coinMintToAcc, mintedCoin)
Expand Down Expand Up @@ -443,7 +443,7 @@ func (s *KeeperTestSuite) TestWithdrawFromVault() {
setup: func() {
s.FundAccount(s.TestAccs[0], types.ModuleName, sdk.NewCoins(fund))

err := s.k.ActiveCollateralAsset(s.Ctx, denom, math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1)
err := s.k.ActiveCollateralAsset(s.Ctx, denom, denom, "nomUSD", math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1)
s.Require().NoError(err)

err = s.k.CreateNewVault(s.Ctx, s.TestAccs[0], coinMintToAcc, mintedCoin)
Expand All @@ -460,7 +460,7 @@ func (s *KeeperTestSuite) TestWithdrawFromVault() {
setup: func() {
s.FundAccount(s.TestAccs[0], types.ModuleName, sdk.NewCoins(fund))

err := s.k.ActiveCollateralAsset(s.Ctx, denom, math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1)
err := s.k.ActiveCollateralAsset(s.Ctx, denom, denom, "nomUSD", math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1)
s.Require().NoError(err)

err = s.k.CreateNewVault(s.Ctx, s.TestAccs[0], coinMintToAcc, mintedCoin)
Expand All @@ -477,7 +477,7 @@ func (s *KeeperTestSuite) TestWithdrawFromVault() {
setup: func() {
s.FundAccount(s.TestAccs[0], types.ModuleName, sdk.NewCoins(fund))

err := s.k.ActiveCollateralAsset(s.Ctx, denom, math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1)
err := s.k.ActiveCollateralAsset(s.Ctx, denom, denom, "nomUSD", math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), maxDebt, types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1)
s.Require().NoError(err)

err = s.k.CreateNewVault(s.Ctx, s.TestAccs[0], coinMintToAcc, mintedCoin)
Expand Down Expand Up @@ -709,7 +709,7 @@ func (s *KeeperTestSuite) TestLiquidate() {
for _, t := range tests {
s.Run(t.name, func() {
s.SetupTest()
err := s.k.ActiveCollateralAsset(s.Ctx, "atom", math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), math.NewInt(1000_000_000), types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1)
err := s.k.ActiveCollateralAsset(s.Ctx, "atom", "atom", "nomUSD", math.LegacyMustNewDecFromStr("0.1"), math.LegacyMustNewDecFromStr("0.1"), math.NewInt(1000_000_000), types.DefaultStabilityFee, types.DefaultMintingFee, types.DefaultLiquidationPenalty, 1)
s.Require().NoError(err)

for _, vault := range t.liquidation.LiquidatingVaults {
Expand Down
Loading

0 comments on commit a8696a8

Please sign in to comment.