diff --git a/protocol/app/testdata/default_genesis_state.json b/protocol/app/testdata/default_genesis_state.json index c2a5d29739..48de48a5ba 100644 --- a/protocol/app/testdata/default_genesis_state.json +++ b/protocol/app/testdata/default_genesis_state.json @@ -355,7 +355,7 @@ "listing": { "hard_cap_for_markets": 500, "listing_vault_deposit_params": { - "new_vault_deposit_amount": "10000", + "new_vault_deposit_amount": "10000000000", "main_vault_deposit_amount": "0", "num_blocks_to_lock_shares": 2592000 } diff --git a/protocol/scripts/genesis/sample_pregenesis.json b/protocol/scripts/genesis/sample_pregenesis.json index 8db431aea6..6594f9c167 100644 --- a/protocol/scripts/genesis/sample_pregenesis.json +++ b/protocol/scripts/genesis/sample_pregenesis.json @@ -872,7 +872,7 @@ "hard_cap_for_markets": 500, "listing_vault_deposit_params": { "main_vault_deposit_amount": "0", - "new_vault_deposit_amount": "10000", + "new_vault_deposit_amount": "10000000000", "num_blocks_to_lock_shares": 2592000 } }, diff --git a/protocol/testing/genesis.sh b/protocol/testing/genesis.sh index 3f9476f515..69dab93c04 100755 --- a/protocol/testing/genesis.sh +++ b/protocol/testing/genesis.sh @@ -2262,7 +2262,7 @@ function edit_genesis() { # Set hard cap for markets dasel put -t int -f "$GENESIS" ".app_state.listing.hard_cap_for_markets" -v '500' # Set default listing vault deposit params - dasel put -t string -f "$GENESIS" ".app_state.listing.listing_vault_deposit_params.new_vault_deposit_amount" -v "10000" # 10_000 USDC + dasel put -t string -f "$GENESIS" ".app_state.listing.listing_vault_deposit_params.new_vault_deposit_amount" -v "10000000000" # 10_000 USDC dasel put -t string -f "$GENESIS" ".app_state.listing.listing_vault_deposit_params.main_vault_deposit_amount" -v "0" # 0 USDC dasel put -t int -f "$GENESIS" ".app_state.listing.listing_vault_deposit_params.num_blocks_to_lock_shares" -v '2592000' # 30 days diff --git a/protocol/testutil/constants/genesis.go b/protocol/testutil/constants/genesis.go index 2f94b85f38..f56364819b 100644 --- a/protocol/testutil/constants/genesis.go +++ b/protocol/testutil/constants/genesis.go @@ -875,7 +875,7 @@ const GenesisState = `{ "listing": { "hard_cap_for_markets": 500, "listing_vault_deposit_params": { - "new_vault_deposit_amount": "10000", + "new_vault_deposit_amount": "10000000000", "main_vault_deposit_amount": "0", "num_blocks_to_lock_shares": 2592000 } diff --git a/protocol/x/listing/keeper/listing.go b/protocol/x/listing/keeper/listing.go index 1545fff5ab..120546c98b 100644 --- a/protocol/x/listing/keeper/listing.go +++ b/protocol/x/listing/keeper/listing.go @@ -4,8 +4,6 @@ import ( "math" "math/big" - "github.com/dydxprotocol/v4-chain/protocol/dtypes" - vaulttypes "github.com/dydxprotocol/v4-chain/protocol/x/vault/types" satypes "github.com/dydxprotocol/v4-chain/protocol/x/subaccounts/types" @@ -209,8 +207,7 @@ func (k Keeper) DepositToMegavaultforPML( vaultDepositParams := k.GetListingVaultDepositParams(ctx) // Deposit to the megavault - totalDepositAmount := big.NewInt(0) - totalDepositAmount.Add( + totalDepositAmount := new(big.Int).Add( vaultDepositParams.NewVaultDepositAmount.BigInt(), vaultDepositParams.MainVaultDepositAmount.BigInt(), ) @@ -242,7 +239,7 @@ func (k Keeper) DepositToMegavaultforPML( err = k.VaultKeeper.LockShares( ctx, fromSubaccount.Owner, - vaulttypes.NumShares{NumShares: dtypes.NewIntFromBigInt(mintedShares)}, + vaulttypes.BigIntToNumShares(mintedShares), uint32(ctx.BlockHeight())+vaultDepositParams.NumBlocksToLockShares, ) if err != nil { diff --git a/protocol/x/listing/keeper/msg_create_market_permissionless.go b/protocol/x/listing/keeper/msg_create_market_permissionless.go index 27eb3ca930..a54cff5145 100644 --- a/protocol/x/listing/keeper/msg_create_market_permissionless.go +++ b/protocol/x/listing/keeper/msg_create_market_permissionless.go @@ -37,7 +37,6 @@ func (k msgServer) CreateMarketPermissionless( return nil, err } - // TODO: vault deposit for PML err = k.Keeper.DepositToMegavaultforPML(ctx, *msg.SubaccountId, clobPairId) if err != nil { k.Logger(ctx).Error("failed to deposit to megavault for PML market", "error", err) diff --git a/protocol/x/listing/types/params.go b/protocol/x/listing/types/params.go index 2cf5960179..073654d4d7 100644 --- a/protocol/x/listing/types/params.go +++ b/protocol/x/listing/types/params.go @@ -5,7 +5,7 @@ import "github.com/dydxprotocol/v4-chain/protocol/dtypes" // DefaultParams defines the default parameters for listing vault deposits. func DefaultParams() ListingVaultDepositParams { return ListingVaultDepositParams{ - NewVaultDepositAmount: dtypes.NewIntFromUint64(10_000), + NewVaultDepositAmount: dtypes.NewIntFromUint64(10_000_000_000), // 10_000 USDC MainVaultDepositAmount: dtypes.NewIntFromUint64(0), NumBlocksToLockShares: 30 * 24 * 3600, // 30 days }