diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/tx.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/tx.ts index 827716578f..beac0bce37 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/tx.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/tx.ts @@ -1,6 +1,7 @@ import { SubaccountId, SubaccountIdSDKType } from "../subaccounts/subaccount"; import { QuotingParams, QuotingParamsSDKType, VaultParams, VaultParamsSDKType } from "./params"; import { VaultId, VaultIdSDKType } from "./vault"; +import { NumShares, NumSharesSDKType } from "./share"; import * as _m0 from "protobufjs/minimal"; import { DeepPartial } from "../../helpers"; /** @@ -29,10 +30,16 @@ export interface MsgDepositToMegavaultSDKType { } /** MsgDepositToMegavaultResponse is the Msg/DepositToMegavault response type. */ -export interface MsgDepositToMegavaultResponse {} +export interface MsgDepositToMegavaultResponse { + /** The number of shares minted from the deposit. */ + mintedShares?: NumShares; +} /** MsgDepositToMegavaultResponse is the Msg/DepositToMegavault response type. */ -export interface MsgDepositToMegavaultResponseSDKType {} +export interface MsgDepositToMegavaultResponseSDKType { + /** The number of shares minted from the deposit. */ + minted_shares?: NumSharesSDKType; +} /** * MsgUpdateDefaultQuotingParams is the Msg/UpdateDefaultQuotingParams request * type. @@ -152,11 +159,17 @@ export const MsgDepositToMegavault = { }; function createBaseMsgDepositToMegavaultResponse(): MsgDepositToMegavaultResponse { - return {}; + return { + mintedShares: undefined + }; } export const MsgDepositToMegavaultResponse = { - encode(_: MsgDepositToMegavaultResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgDepositToMegavaultResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.mintedShares !== undefined) { + NumShares.encode(message.mintedShares, writer.uint32(10).fork()).ldelim(); + } + return writer; }, @@ -169,6 +182,10 @@ export const MsgDepositToMegavaultResponse = { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.mintedShares = NumShares.decode(reader, reader.uint32()); + break; + default: reader.skipType(tag & 7); break; @@ -178,8 +195,9 @@ export const MsgDepositToMegavaultResponse = { return message; }, - fromPartial(_: DeepPartial): MsgDepositToMegavaultResponse { + fromPartial(object: DeepPartial): MsgDepositToMegavaultResponse { const message = createBaseMsgDepositToMegavaultResponse(); + message.mintedShares = object.mintedShares !== undefined && object.mintedShares !== null ? NumShares.fromPartial(object.mintedShares) : undefined; return message; } diff --git a/proto/dydxprotocol/vault/tx.proto b/proto/dydxprotocol/vault/tx.proto index 7f91e0a8e0..b904fb1502 100644 --- a/proto/dydxprotocol/vault/tx.proto +++ b/proto/dydxprotocol/vault/tx.proto @@ -5,6 +5,7 @@ import "cosmos_proto/cosmos.proto"; import "cosmos/msg/v1/msg.proto"; import "dydxprotocol/subaccounts/subaccount.proto"; import "dydxprotocol/vault/params.proto"; +import "dydxprotocol/vault/share.proto"; import "dydxprotocol/vault/vault.proto"; import "gogoproto/gogo.proto"; @@ -44,7 +45,10 @@ message MsgDepositToMegavault { } // MsgDepositToMegavaultResponse is the Msg/DepositToMegavault response type. -message MsgDepositToMegavaultResponse {} +message MsgDepositToMegavaultResponse { + // The number of shares minted from the deposit. + NumShares minted_shares = 1 [ (gogoproto.nullable) = false ]; +} // MsgUpdateDefaultQuotingParams is the Msg/UpdateDefaultQuotingParams request // type. diff --git a/protocol/x/vault/keeper/deposit.go b/protocol/x/vault/keeper/deposit.go index cf99f604ab..df8f7cd5a7 100644 --- a/protocol/x/vault/keeper/deposit.go +++ b/protocol/x/vault/keeper/deposit.go @@ -4,9 +4,49 @@ import ( "math/big" sdk "github.com/cosmos/cosmos-sdk/types" + assettypes "github.com/dydxprotocol/v4-chain/protocol/x/assets/types" + sendingtypes "github.com/dydxprotocol/v4-chain/protocol/x/sending/types" + satypes "github.com/dydxprotocol/v4-chain/protocol/x/subaccounts/types" "github.com/dydxprotocol/v4-chain/protocol/x/vault/types" ) +// DepositToMegavault deposits from a subaccount to megavault by +// 1. Minting shares for owner address of `fromSubaccount`. +// 2. Transferring `quoteQuantums` from `fromSubaccount` to megavault subaccount 0. +func (k Keeper) DepositToMegavault( + ctx sdk.Context, + fromSubaccount satypes.SubaccountId, + quoteQuantums *big.Int, +) (mintedShares *big.Int, err error) { + // Mint shares. + mintedShares, err = k.MintShares( + ctx, + fromSubaccount.Owner, + quoteQuantums, + ) + if err != nil { + return nil, err + } + + // Transfer from sender subaccount to megavault. + // Note: Transfer should take place after minting shares for + // shares calculation to be correct. + err = k.sendingKeeper.ProcessTransfer( + ctx, + &sendingtypes.Transfer{ + Sender: fromSubaccount, + Recipient: types.MegavaultMainSubaccount, + AssetId: assettypes.AssetUsdc.Id, + Amount: quoteQuantums.Uint64(), + }, + ) + if err != nil { + return nil, err + } + + return mintedShares, nil +} + // MintShares mints shares for `owner` based on `quantumsToDeposit` by: // 1. Increasing total shares. // 2. Increasing owner shares for given `owner`. @@ -14,10 +54,10 @@ func (k Keeper) MintShares( ctx sdk.Context, owner string, quantumsToDeposit *big.Int, -) error { +) (mintedShares *big.Int, err error) { // Quantums to deposit should be positive. if quantumsToDeposit.Sign() <= 0 { - return types.ErrInvalidDepositAmount + return nil, types.ErrInvalidDepositAmount } // Get existing TotalShares of the vault. existingTotalShares := k.GetTotalShares(ctx).NumShares.BigInt() @@ -30,11 +70,11 @@ func (k Keeper) MintShares( // Get megavault equity. equity, err := k.GetMegavaultEquity(ctx) if err != nil { - return err + return nil, err } // Don't mint shares if equity is non-positive. if equity.Sign() <= 0 { - return types.ErrNonPositiveEquity + return nil, types.ErrNonPositiveEquity } // Mint `deposit (in quote quantums) * existing shares / vault equity (in quote quantums)` // number of shares. @@ -48,19 +88,19 @@ func (k Keeper) MintShares( // Return error if `sharesToMint` is rounded down to 0. if sharesToMint.Sign() == 0 { - return types.ErrZeroSharesToMint + return nil, types.ErrZeroSharesToMint } } // Increase total shares. - err := k.SetTotalShares( + err = k.SetTotalShares( ctx, types.BigIntToNumShares( existingTotalShares.Add(existingTotalShares, sharesToMint), ), ) if err != nil { - return err + return nil, err } // Increase owner shares. @@ -73,7 +113,7 @@ func (k Keeper) MintShares( types.BigIntToNumShares(sharesToMint), ) if err != nil { - return err + return nil, err } } else { // Increase existing owner shares by sharesToMint. @@ -86,9 +126,9 @@ func (k Keeper) MintShares( ), ) if err != nil { - return err + return nil, err } } - return nil + return sharesToMint, nil } diff --git a/protocol/x/vault/keeper/deposit_test.go b/protocol/x/vault/keeper/deposit_test.go index cbb15ee101..7acbe3e6eb 100644 --- a/protocol/x/vault/keeper/deposit_test.go +++ b/protocol/x/vault/keeper/deposit_test.go @@ -184,7 +184,7 @@ func TestMintShares(t *testing.T) { } // Mint shares. - err = tApp.App.VaultKeeper.MintShares( + mintedShares, err := tApp.App.VaultKeeper.MintShares( ctx, tc.owner, tc.quantumsToDeposit, @@ -192,6 +192,7 @@ func TestMintShares(t *testing.T) { if tc.expectedErr != nil { // Check that error is as expected. require.ErrorContains(t, err, tc.expectedErr.Error()) + require.Nil(t, mintedShares) // Check that TotalShares is unchanged. totalShares := tApp.App.VaultKeeper.GetTotalShares(ctx) require.Equal( @@ -204,6 +205,12 @@ func TestMintShares(t *testing.T) { require.Equal(t, vaulttypes.BigIntToNumShares(tc.ownerShares), ownerShares) } else { require.NoError(t, err) + // Check that minted shares is as expected. + require.Equal( + t, + new(big.Int).Sub(tc.expectedTotalShares, tc.totalShares), + mintedShares, + ) // Check that TotalShares is as expected. totalShares := tApp.App.VaultKeeper.GetTotalShares(ctx) require.Equal( diff --git a/protocol/x/vault/keeper/msg_server_deposit_to_megavault.go b/protocol/x/vault/keeper/msg_server_deposit_to_megavault.go index 508319ce5f..4a9d85717b 100644 --- a/protocol/x/vault/keeper/msg_server_deposit_to_megavault.go +++ b/protocol/x/vault/keeper/msg_server_deposit_to_megavault.go @@ -4,8 +4,6 @@ import ( "context" "github.com/dydxprotocol/v4-chain/protocol/lib" - assettypes "github.com/dydxprotocol/v4-chain/protocol/x/assets/types" - sendingtypes "github.com/dydxprotocol/v4-chain/protocol/x/sending/types" "github.com/dydxprotocol/v4-chain/protocol/x/vault/types" ) @@ -17,31 +15,16 @@ func (k msgServer) DepositToMegavault( ctx := lib.UnwrapSDKContext(goCtx, types.ModuleName) quoteQuantums := msg.QuoteQuantums.BigInt() - // Mint shares. - err := k.MintShares( + mintedShares, err := k.Keeper.DepositToMegavault( ctx, - msg.SubaccountId.Owner, + *msg.SubaccountId, quoteQuantums, ) if err != nil { return nil, err } - // Transfer from sender subaccount to megavault. - // Note: Transfer should take place after minting shares for - // shares calculation to be correct. - err = k.sendingKeeper.ProcessTransfer( - ctx, - &sendingtypes.Transfer{ - Sender: *msg.SubaccountId, - Recipient: types.MegavaultMainSubaccount, - AssetId: assettypes.AssetUsdc.Id, - Amount: quoteQuantums.Uint64(), - }, - ) - if err != nil { - return nil, err - } - - return &types.MsgDepositToMegavaultResponse{}, nil + return &types.MsgDepositToMegavaultResponse{ + MintedShares: types.BigIntToNumShares(mintedShares), + }, nil } diff --git a/protocol/x/vault/types/tx.pb.go b/protocol/x/vault/types/tx.pb.go index ddc802f984..af54e88518 100644 --- a/protocol/x/vault/types/tx.pb.go +++ b/protocol/x/vault/types/tx.pb.go @@ -83,6 +83,8 @@ func (m *MsgDepositToMegavault) GetSubaccountId() *types.SubaccountId { // MsgDepositToMegavaultResponse is the Msg/DepositToMegavault response type. type MsgDepositToMegavaultResponse struct { + // The number of shares minted from the deposit. + MintedShares NumShares `protobuf:"bytes,1,opt,name=minted_shares,json=mintedShares,proto3" json:"minted_shares"` } func (m *MsgDepositToMegavaultResponse) Reset() { *m = MsgDepositToMegavaultResponse{} } @@ -118,6 +120,13 @@ func (m *MsgDepositToMegavaultResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDepositToMegavaultResponse proto.InternalMessageInfo +func (m *MsgDepositToMegavaultResponse) GetMintedShares() NumShares { + if m != nil { + return m.MintedShares + } + return NumShares{} +} + // MsgUpdateDefaultQuotingParams is the Msg/UpdateDefaultQuotingParams request // type. type MsgUpdateDefaultQuotingParams struct { @@ -323,44 +332,46 @@ func init() { func init() { proto.RegisterFile("dydxprotocol/vault/tx.proto", fileDescriptor_ced574c6017ce006) } var fileDescriptor_ced574c6017ce006 = []byte{ - // 588 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x41, 0x6f, 0x12, 0x41, - 0x14, 0x66, 0x5b, 0xa3, 0x76, 0x4a, 0x49, 0x9c, 0xa0, 0xd2, 0x25, 0x2e, 0x95, 0xa4, 0xda, 0x9a, - 0xb0, 0x9b, 0xa2, 0xd1, 0xd8, 0x78, 0x50, 0xd2, 0x43, 0x89, 0x21, 0x11, 0x50, 0x0f, 0x26, 0x86, - 0x0c, 0x3b, 0xd3, 0x65, 0x13, 0xd8, 0x59, 0x76, 0x66, 0x09, 0x78, 0xf4, 0xe8, 0xc9, 0x9f, 0xe2, - 0xc1, 0xdf, 0x60, 0x7a, 0x6c, 0x3c, 0x19, 0x0f, 0x8d, 0x81, 0x83, 0xf1, 0xe2, 0x6f, 0x30, 0x3b, - 0xb3, 0x0b, 0xac, 0x2c, 0x0d, 0xc6, 0x0b, 0xcc, 0xbc, 0xf7, 0xcd, 0xfb, 0xde, 0xf7, 0xcd, 0xdb, - 0x01, 0x79, 0x3c, 0xc2, 0x43, 0xd7, 0xa3, 0x9c, 0x9a, 0xb4, 0x6b, 0x0c, 0x90, 0xdf, 0xe5, 0x06, - 0x1f, 0xea, 0x22, 0x02, 0xe1, 0x7c, 0x52, 0x17, 0x49, 0x75, 0xdb, 0xa4, 0xac, 0x47, 0x59, 0x4b, - 0x84, 0x0d, 0xb9, 0x91, 0x70, 0xf5, 0xa6, 0xdc, 0x19, 0x3d, 0x66, 0x19, 0x83, 0x83, 0xe0, 0x2f, - 0x4c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b2, 0x8a, 0xcb, - 0x8f, 0xa8, 0x8f, 0xff, 0xf9, 0xc8, 0xb4, 0x99, 0x13, 0x90, 0xf9, 0x6b, 0x0e, 0x76, 0x97, 0x14, - 0x8b, 0xc3, 0xd4, 0xd2, 0x4a, 0xb0, 0x88, 0xa7, 0x52, 0x3f, 0x1d, 0x6b, 0xca, 0xd9, 0x58, 0x53, - 0x7e, 0x8c, 0x35, 0xe5, 0xe3, 0x44, 0x4b, 0x9d, 0x4d, 0xb4, 0xd4, 0xb7, 0x89, 0x96, 0x7a, 0xf3, - 0x68, 0xf5, 0x57, 0x60, 0x18, 0x3d, 0xc9, 0xc1, 0x63, 0xd0, 0xbe, 0x2c, 0xe2, 0xf7, 0xff, 0x04, - 0x00, 0x00, 0xff, 0xff, 0x04, 0x28, 0x4d, 0xe4, 0xb5, 0x05, 0x00, 0x00, + // 622 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcf, 0x6f, 0x12, 0x41, + 0x14, 0x66, 0x5b, 0xa3, 0x76, 0x4a, 0x9b, 0xb8, 0x41, 0xa5, 0x4b, 0xba, 0x54, 0x92, 0x6a, 0x6b, + 0xc2, 0x6e, 0x8a, 0x46, 0x63, 0xe3, 0x41, 0x49, 0x0f, 0x10, 0x83, 0x11, 0x50, 0x0f, 0x26, 0x66, + 0x33, 0xec, 0x4c, 0x97, 0x4d, 0xd8, 0x9d, 0x65, 0x67, 0x96, 0x80, 0x47, 0x8f, 0x9e, 0xfc, 0x53, + 0x3c, 0xf8, 0x37, 0x98, 0x1e, 0x1b, 0x4f, 0xc6, 0x43, 0x63, 0xe0, 0x60, 0xbc, 0xf8, 0x37, 0x98, + 0x9d, 0x59, 0x7e, 0xac, 0x2c, 0x04, 0xe3, 0x05, 0x66, 0xde, 0xfb, 0xde, 0xfb, 0xde, 0xf7, 0xf1, + 0x18, 0x90, 0x43, 0x03, 0xd4,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 0x95, 0x4f, 0x1e, 0xee, 0x9d, 0xd0, 0x95, 0x4b, 0xd2, 0xc5, 0xa9, 0xaa, 0x28, + 0x52, 0x74, 0xa5, 0x27, 0xae, 0x72, 0x05, 0xa4, 0x45, 0x75, 0xe4, 0xcc, 0x3a, 0xef, 0x90, 0x5f, + 0xd8, 0x21, 0xe6, 0xcb, 0x66, 0x6f, 0x1a, 0x9a, 0xb3, 0x23, 0x07, 0x76, 0xe6, 0x44, 0x8e, 0x2d, + 0x28, 0xfd, 0x5e, 0x03, 0xeb, 0x35, 0x6a, 0xc9, 0x3e, 0x90, 0x13, 0xfe, 0x4f, 0x87, 0x49, 0xf4, + 0x89, 0xfb, 0xa8, 0x1c, 0xad, 0x0c, 0x9d, 0xac, 0xee, 0x07, 0x09, 0x28, 0x4b, 0xb6, 0x6d, 0x51, + 0xc7, 0xc5, 0x25, 0xca, 0xa3, 0x7f, 0x2e, 0x99, 0x0c, 0x73, 0x0a, 0xb6, 0xff, 0xda, 0x83, 0xfd, + 0x05, 0xcd, 0xe2, 0x30, 0xa5, 0xb8, 0x12, 0x6c, 0xcc, 0x53, 0xae, 0x9f, 0x0d, 0x55, 0xe9, 0x7c, + 0xa8, 0x4a, 0x3f, 0x86, 0xaa, 0xf4, 0x71, 0xa4, 0xa6, 0xce, 0x47, 0x6a, 0xea, 0xdb, 0x48, 0x4d, + 0xbd, 0x79, 0xb8, 0xfa, 0x7b, 0xd2, 0x1f, 0x3f, 0xfe, 0xe1, 0xb3, 0xd2, 0xba, 0xcc, 0xe3, 0xf7, + 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0x68, 0xf8, 0xfa, 0x52, 0x1f, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -586,6 +597,16 @@ func (m *MsgDepositToMegavaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, _ = i var l int _ = l + { + size, err := m.MintedShares.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -757,6 +778,8 @@ func (m *MsgDepositToMegavaultResponse) Size() (n int) { } var l int _ = l + l = m.MintedShares.Size() + n += 1 + l + sovTx(uint64(l)) return n } @@ -964,6 +987,39 @@ func (m *MsgDepositToMegavaultResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgDepositToMegavaultResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MintedShares", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MintedShares.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:])