From 31a0fb7561dce84753a4d6fd20bd336fe82a216f Mon Sep 17 00:00:00 2001 From: Tian Date: Thu, 28 Mar 2024 14:27:26 -0400 Subject: [PATCH] rename order_size_ppm to order_size_pct_ppm in vault params (#1271) --- .../src/codegen/dydxprotocol/vault/params.ts | 14 ++--- proto/dydxprotocol/vault/params.proto | 2 +- .../app/testdata/default_genesis_state.json | 2 +- .../scripts/genesis/sample_pregenesis.json | 2 +- protocol/testutil/constants/genesis.go | 2 +- .../keeper/msg_server_update_params_test.go | 4 +- protocol/x/vault/keeper/orders.go | 4 +- protocol/x/vault/keeper/orders_test.go | 8 +-- protocol/x/vault/keeper/params_test.go | 4 +- protocol/x/vault/types/errors.go | 4 +- protocol/x/vault/types/params.go | 6 +- protocol/x/vault/types/params.pb.go | 59 ++++++++++--------- protocol/x/vault/types/params_test.go | 12 ++-- 13 files changed, 62 insertions(+), 61 deletions(-) diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/params.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/params.ts index af968398bc..29ecf2563d 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/params.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/params.ts @@ -23,7 +23,7 @@ export interface Params { skewFactorPpm: number; /** The percentage of vault equity that each order is sized at. */ - orderSizePpm: number; + orderSizePctPpm: number; /** The duration that a vault's orders are valid for. */ orderExpirationSeconds: number; @@ -51,7 +51,7 @@ export interface ParamsSDKType { skew_factor_ppm: number; /** The percentage of vault equity that each order is sized at. */ - order_size_ppm: number; + order_size_pct_ppm: number; /** The duration that a vault's orders are valid for. */ order_expiration_seconds: number; @@ -63,7 +63,7 @@ function createBaseParams(): Params { spreadMinPpm: 0, spreadBufferPpm: 0, skewFactorPpm: 0, - orderSizePpm: 0, + orderSizePctPpm: 0, orderExpirationSeconds: 0 }; } @@ -86,8 +86,8 @@ export const Params = { writer.uint32(32).uint32(message.skewFactorPpm); } - if (message.orderSizePpm !== 0) { - writer.uint32(40).uint32(message.orderSizePpm); + if (message.orderSizePctPpm !== 0) { + writer.uint32(40).uint32(message.orderSizePctPpm); } if (message.orderExpirationSeconds !== 0) { @@ -123,7 +123,7 @@ export const Params = { break; case 5: - message.orderSizePpm = reader.uint32(); + message.orderSizePctPpm = reader.uint32(); break; case 6: @@ -145,7 +145,7 @@ export const Params = { message.spreadMinPpm = object.spreadMinPpm ?? 0; message.spreadBufferPpm = object.spreadBufferPpm ?? 0; message.skewFactorPpm = object.skewFactorPpm ?? 0; - message.orderSizePpm = object.orderSizePpm ?? 0; + message.orderSizePctPpm = object.orderSizePctPpm ?? 0; message.orderExpirationSeconds = object.orderExpirationSeconds ?? 0; return message; } diff --git a/proto/dydxprotocol/vault/params.proto b/proto/dydxprotocol/vault/params.proto index 8e1c8b2378..ec80d2e971 100644 --- a/proto/dydxprotocol/vault/params.proto +++ b/proto/dydxprotocol/vault/params.proto @@ -21,7 +21,7 @@ message Params { uint32 skew_factor_ppm = 4; // The percentage of vault equity that each order is sized at. - uint32 order_size_ppm = 5; + uint32 order_size_pct_ppm = 5; // The duration that a vault's orders are valid for. uint32 order_expiration_seconds = 6; diff --git a/protocol/app/testdata/default_genesis_state.json b/protocol/app/testdata/default_genesis_state.json index 5a95e2d5f3..ead2cf2d7e 100644 --- a/protocol/app/testdata/default_genesis_state.json +++ b/protocol/app/testdata/default_genesis_state.json @@ -461,7 +461,7 @@ "spread_min_ppm": 3000, "spread_buffer_ppm": 1500, "skew_factor_ppm": 500000, - "order_size_ppm": 100000, + "order_size_pct_ppm": 100000, "order_expiration_seconds": 2 } }, diff --git a/protocol/scripts/genesis/sample_pregenesis.json b/protocol/scripts/genesis/sample_pregenesis.json index 68307d6092..40b3eb7b9d 100644 --- a/protocol/scripts/genesis/sample_pregenesis.json +++ b/protocol/scripts/genesis/sample_pregenesis.json @@ -1810,7 +1810,7 @@ "params": { "layers": 2, "order_expiration_seconds": 2, - "order_size_ppm": 100000, + "order_size_pct_ppm": 100000, "skew_factor_ppm": 500000, "spread_buffer_ppm": 1500, "spread_min_ppm": 3000 diff --git a/protocol/testutil/constants/genesis.go b/protocol/testutil/constants/genesis.go index 3c0282ec6b..6ee1737fba 100644 --- a/protocol/testutil/constants/genesis.go +++ b/protocol/testutil/constants/genesis.go @@ -1498,7 +1498,7 @@ const GenesisState = `{ "spread_min_ppm": 3000, "spread_buffer_ppm": 1500, "skew_factor_ppm": 500000, - "order_size_ppm": 100000, + "order_size_pct_ppm": 100000, "order_expiration_seconds": 2 } }, diff --git a/protocol/x/vault/keeper/msg_server_update_params_test.go b/protocol/x/vault/keeper/msg_server_update_params_test.go index acfc221ecb..29ceef08ce 100644 --- a/protocol/x/vault/keeper/msg_server_update_params_test.go +++ b/protocol/x/vault/keeper/msg_server_update_params_test.go @@ -41,11 +41,11 @@ func TestMsgUpdateParams(t *testing.T) { SpreadMinPpm: 4_000, SpreadBufferPpm: 2_000, SkewFactorPpm: 500_000, - OrderSizePpm: 0, // invalid + OrderSizePctPpm: 0, // invalid OrderExpirationSeconds: 5, }, }, - expectedErr: types.ErrInvalidOrderSizePpm.Error(), + expectedErr: types.ErrInvalidOrderSizePctPpm.Error(), }, } diff --git a/protocol/x/vault/keeper/orders.go b/protocol/x/vault/keeper/orders.go index b5b5c29811..12512a72c9 100644 --- a/protocol/x/vault/keeper/orders.go +++ b/protocol/x/vault/keeper/orders.go @@ -189,7 +189,7 @@ func (k Keeper) GetVaultClobOrders( // = order_size_pct * equity / (price * 10^(exponent - quote_atomic_resolution + base_atomic_resolution)) orderSizeBaseQuantums := lib.BigRatMulPpm( new(big.Rat).SetInt(equity), - params.OrderSizePpm, + params.OrderSizePctPpm, ) orderSizeBaseQuantums = orderSizeBaseQuantums.Quo( orderSizeBaseQuantums, @@ -228,7 +228,7 @@ func (k Keeper) GetVaultClobOrders( ) *clobtypes.Order { // Calculate size that will have been filled before this layer is matched. sizeFilledByThisLayer := new(big.Rat).SetFrac( - new(big.Int).SetUint64(uint64(params.OrderSizePpm*layer)), + new(big.Int).SetUint64(uint64(params.OrderSizePctPpm*layer)), lib.BigIntOneMillion(), ) diff --git a/protocol/x/vault/keeper/orders_test.go b/protocol/x/vault/keeper/orders_test.go index fc8853225e..ae4313499c 100644 --- a/protocol/x/vault/keeper/orders_test.go +++ b/protocol/x/vault/keeper/orders_test.go @@ -254,7 +254,7 @@ func TestGetVaultClobOrders(t *testing.T) { SpreadMinPpm: 3_000, // 30 bps SpreadBufferPpm: 1_500, // 15 bps SkewFactorPpm: 500_000, // 0.5 - OrderSizePpm: 100_000, // 10% + OrderSizePctPpm: 100_000, // 10% OrderExpirationSeconds: 2, // 2 seconds }, vaultId: constants.Vault_Clob_0, @@ -273,7 +273,7 @@ func TestGetVaultClobOrders(t *testing.T) { // b_i = oracle_price * (1 + skew_i) / (1 + spread)^{i+1} // 6. subticks needs to be a multiple of subticks_per_tick (round up for asks, round down for bids) // To calculate size of each order - // 1. `order_size_ppm * equity / oracle_price`. + // 1. `order_size_pct_ppm * equity / oracle_price`. expectedOrderSubticks: []uint64{ // spreadPpm = max(3_000, 1_500 + 50) = 3_000 // spread = 0.003 @@ -312,7 +312,7 @@ func TestGetVaultClobOrders(t *testing.T) { SpreadMinPpm: 3_000, // 30 bps SpreadBufferPpm: 8_500, // 85 bps SkewFactorPpm: 900_000, // 0.9 - OrderSizePpm: 200_000, // 20% + OrderSizePctPpm: 200_000, // 20% OrderExpirationSeconds: 4, // 4 seconds }, vaultId: constants.Vault_Clob_1, @@ -331,7 +331,7 @@ func TestGetVaultClobOrders(t *testing.T) { // b_i = oracle_price * (1 + skew_i) / (1 + spread)^{i+1} // 6. subticks needs to be a multiple of subticks_per_tick (round up for asks, round down for bids) // To calculate size of each order - // 1. `order_size_ppm * equity / oracle_price`. + // 1. `order_size_pct_ppm * equity / oracle_price`. expectedOrderSubticks: []uint64{ // spreadPpm = max(3_000, 8_500 + 50) = 8_550 // spread = 0.00855 diff --git a/protocol/x/vault/keeper/params_test.go b/protocol/x/vault/keeper/params_test.go index 54b396c3ec..2807715b6a 100644 --- a/protocol/x/vault/keeper/params_test.go +++ b/protocol/x/vault/keeper/params_test.go @@ -23,7 +23,7 @@ func TestGetSetParams(t *testing.T) { SpreadMinPpm: 4_000, SpreadBufferPpm: 2_000, SkewFactorPpm: 999_999, - OrderSizePpm: 200_000, + OrderSizePctPpm: 200_000, OrderExpirationSeconds: 10, } err := k.SetParams(ctx, newParams) @@ -36,7 +36,7 @@ func TestGetSetParams(t *testing.T) { SpreadMinPpm: 4_000, SpreadBufferPpm: 2_000, SkewFactorPpm: 1_000_000, - OrderSizePpm: 200_000, + OrderSizePctPpm: 200_000, OrderExpirationSeconds: 0, // invalid } err = k.SetParams(ctx, invalidParams) diff --git a/protocol/x/vault/types/errors.go b/protocol/x/vault/types/errors.go index f3fd2f9180..e38d0c94d1 100644 --- a/protocol/x/vault/types/errors.go +++ b/protocol/x/vault/types/errors.go @@ -40,10 +40,10 @@ var ( 7, "Fraction is nil", ) - ErrInvalidOrderSizePpm = errorsmod.Register( + ErrInvalidOrderSizePctPpm = errorsmod.Register( ModuleName, 8, - "OrderSizePpm must be strictly greater than 0", + "OrderSizePctPpm must be strictly greater than 0", ) ErrInvalidOrderExpirationSeconds = errorsmod.Register( ModuleName, diff --git a/protocol/x/vault/types/params.go b/protocol/x/vault/types/params.go index e6450a5750..ad7994a074 100644 --- a/protocol/x/vault/types/params.go +++ b/protocol/x/vault/types/params.go @@ -9,7 +9,7 @@ func DefaultParams() Params { SpreadMinPpm: 3_000, // 30 bps SpreadBufferPpm: 1_500, // 15 bps SkewFactorPpm: 500_000, // 0.5 - OrderSizePpm: 100_000, // 10% + OrderSizePctPpm: 100_000, // 10% OrderExpirationSeconds: 2, // 2 seconds } } @@ -25,8 +25,8 @@ func (p Params) Validate() error { return ErrInvalidSpreadMinPpm } // Order size must be positive. - if p.OrderSizePpm == 0 { - return ErrInvalidOrderSizePpm + if p.OrderSizePctPpm == 0 { + return ErrInvalidOrderSizePctPpm } // Order expiration seconds must be positive. if p.OrderExpirationSeconds == 0 { diff --git a/protocol/x/vault/types/params.pb.go b/protocol/x/vault/types/params.pb.go index 428d8b1836..8f7984ff35 100644 --- a/protocol/x/vault/types/params.pb.go +++ b/protocol/x/vault/types/params.pb.go @@ -36,7 +36,7 @@ type Params struct { // The factor that determines how aggressive a vault skews its orders. SkewFactorPpm uint32 `protobuf:"varint,4,opt,name=skew_factor_ppm,json=skewFactorPpm,proto3" json:"skew_factor_ppm,omitempty"` // The percentage of vault equity that each order is sized at. - OrderSizePpm uint32 `protobuf:"varint,5,opt,name=order_size_ppm,json=orderSizePpm,proto3" json:"order_size_ppm,omitempty"` + OrderSizePctPpm uint32 `protobuf:"varint,5,opt,name=order_size_pct_ppm,json=orderSizePctPpm,proto3" json:"order_size_pct_ppm,omitempty"` // The duration that a vault's orders are valid for. OrderExpirationSeconds uint32 `protobuf:"varint,6,opt,name=order_expiration_seconds,json=orderExpirationSeconds,proto3" json:"order_expiration_seconds,omitempty"` } @@ -102,9 +102,9 @@ func (m *Params) GetSkewFactorPpm() uint32 { return 0 } -func (m *Params) GetOrderSizePpm() uint32 { +func (m *Params) GetOrderSizePctPpm() uint32 { if m != nil { - return m.OrderSizePpm + return m.OrderSizePctPpm } return 0 } @@ -123,25 +123,26 @@ func init() { func init() { proto.RegisterFile("dydxprotocol/vault/params.proto", fileDescriptor_6043e0b8bfdbca9f) } var fileDescriptor_6043e0b8bfdbca9f = []byte{ - // 287 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0xd0, 0x3f, 0x4b, 0xc4, 0x30, - 0x18, 0xc7, 0xf1, 0xc6, 0x3f, 0x1d, 0x82, 0x77, 0x87, 0x1d, 0x8e, 0x4e, 0x51, 0xe4, 0x10, 0x11, - 0x6c, 0x07, 0x05, 0x9d, 0x0f, 0x74, 0x13, 0x4e, 0x6f, 0x73, 0x29, 0x69, 0x9b, 0x7a, 0xc1, 0xb6, - 0x09, 0x49, 0xaa, 0xed, 0xbd, 0x0a, 0x5f, 0x96, 0xe3, 0x8d, 0x8e, 0xd2, 0xbe, 0x0b, 0x27, 0xe9, - 0x93, 0x72, 0x78, 0x63, 0xbe, 0xbf, 0x0f, 0x04, 0x1e, 0x7c, 0x92, 0x36, 0x69, 0x2d, 0x95, 0x30, - 0x22, 0x11, 0x79, 0xf8, 0x4e, 0xab, 0xdc, 0x84, 0x92, 0x2a, 0x5a, 0xe8, 0x00, 0xaa, 0xe7, 0xfd, - 0x07, 0x01, 0x80, 0xb3, 0x5f, 0x84, 0xdd, 0x05, 0x20, 0x6f, 0x8a, 0xdd, 0x9c, 0x36, 0x4c, 0x69, - 0x1f, 0x9d, 0xa2, 0x8b, 0xd1, 0xf3, 0xf0, 0xf2, 0x66, 0x78, 0xac, 0xa5, 0x62, 0x34, 0x8d, 0x0a, - 0x5e, 0x46, 0x52, 0x16, 0xfe, 0x1e, 0xec, 0x47, 0xb6, 0x3e, 0xf2, 0x72, 0x21, 0x0b, 0xef, 0x12, - 0x1f, 0x0f, 0x2a, 0xae, 0xb2, 0x8c, 0x29, 0x80, 0xfb, 0x00, 0x27, 0x76, 0x98, 0x43, 0xef, 0xed, - 0x39, 0x9e, 0xe8, 0x37, 0xf6, 0x11, 0x65, 0x34, 0x31, 0xc2, 0xca, 0x03, 0x90, 0xa3, 0x3e, 0x3f, - 0x40, 0xed, 0xdd, 0x0c, 0x8f, 0x85, 0x4a, 0x99, 0x8a, 0x34, 0x5f, 0x33, 0x60, 0x87, 0xf6, 0x67, - 0xa8, 0x4b, 0xbe, 0x66, 0xbd, 0xba, 0xc3, 0xbe, 0x55, 0xac, 0x96, 0x5c, 0x51, 0xc3, 0x45, 0x19, - 0x69, 0x96, 0x88, 0x32, 0xd5, 0xbe, 0x0b, 0x7e, 0x0a, 0xfb, 0xfd, 0x76, 0x5e, 0xda, 0x75, 0xfe, - 0xf4, 0xd5, 0x12, 0xb4, 0x69, 0x09, 0xfa, 0x69, 0x09, 0xfa, 0xec, 0x88, 0xb3, 0xe9, 0x88, 0xf3, - 0xdd, 0x11, 0xe7, 0xe5, 0xf6, 0x95, 0x9b, 0x55, 0x15, 0x07, 0x89, 0x28, 0xc2, 0xdd, 0xb3, 0xde, - 0x5c, 0x25, 0x2b, 0xca, 0xcb, 0x70, 0x5b, 0xea, 0xe1, 0xd4, 0xa6, 0x91, 0x4c, 0xc7, 0x2e, 0xf4, - 0xeb, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xce, 0x3a, 0xeb, 0x7c, 0x8d, 0x01, 0x00, 0x00, + // 293 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0xd0, 0xb1, 0x4e, 0xeb, 0x30, + 0x14, 0xc6, 0xf1, 0xa6, 0xf7, 0x92, 0xc1, 0xa2, 0x54, 0x78, 0xa8, 0x32, 0x19, 0x84, 0x10, 0x42, + 0x20, 0x9a, 0x01, 0x24, 0x98, 0x2b, 0xc1, 0x86, 0x54, 0xe8, 0xc6, 0x62, 0xb9, 0x8e, 0x43, 0x2d, + 0x92, 0xd8, 0xb2, 0x1d, 0x48, 0xba, 0xf1, 0x06, 0x3c, 0x16, 0x63, 0x47, 0x46, 0x94, 0xbc, 0x08, + 0xca, 0x71, 0x54, 0xc1, 0x98, 0xff, 0xf7, 0x8b, 0x87, 0x83, 0x0e, 0x92, 0x3a, 0xa9, 0xb4, 0x51, + 0x4e, 0x71, 0x95, 0xc5, 0xaf, 0xac, 0xcc, 0x5c, 0xac, 0x99, 0x61, 0xb9, 0x9d, 0x42, 0xc5, 0xf8, + 0x37, 0x98, 0x02, 0x38, 0x7a, 0x1f, 0xa2, 0x70, 0x0e, 0x08, 0x4f, 0x50, 0x98, 0xb1, 0x5a, 0x18, + 0x1b, 0x05, 0x87, 0xc1, 0xe9, 0xe8, 0xb1, 0xff, 0xc2, 0xc7, 0x68, 0xcf, 0x6a, 0x23, 0x58, 0x42, + 0x73, 0x59, 0x50, 0xad, 0xf3, 0x68, 0x08, 0xfb, 0xae, 0xaf, 0xf7, 0xb2, 0x98, 0xeb, 0x1c, 0x9f, + 0xa1, 0xfd, 0x5e, 0x2d, 0xcb, 0x34, 0x15, 0x06, 0xe0, 0x3f, 0x80, 0x63, 0x3f, 0xcc, 0xa0, 0x77, + 0xf6, 0x04, 0x8d, 0xed, 0x8b, 0x78, 0xa3, 0x29, 0xe3, 0x4e, 0x79, 0xf9, 0x1f, 0xe4, 0xa8, 0xcb, + 0x77, 0x50, 0x3b, 0x77, 0x8e, 0xb0, 0x32, 0x89, 0x30, 0xd4, 0xca, 0xb5, 0xa0, 0x9a, 0x3b, 0xa0, + 0x3b, 0xfe, 0x51, 0x58, 0x16, 0x72, 0x2d, 0xe6, 0xdc, 0x75, 0xf8, 0x06, 0x45, 0x1e, 0x8b, 0x4a, + 0x4b, 0xc3, 0x9c, 0x54, 0x05, 0xb5, 0x82, 0xab, 0x22, 0xb1, 0x51, 0x08, 0xbf, 0x4c, 0x60, 0xbf, + 0xdd, 0xce, 0x0b, 0xbf, 0xce, 0x1e, 0x3e, 0x1b, 0x12, 0x6c, 0x1a, 0x12, 0x7c, 0x37, 0x24, 0xf8, + 0x68, 0xc9, 0x60, 0xd3, 0x92, 0xc1, 0x57, 0x4b, 0x06, 0x4f, 0xd7, 0xcf, 0xd2, 0xad, 0xca, 0xe5, + 0x94, 0xab, 0x3c, 0xfe, 0x7b, 0xdd, 0xab, 0x0b, 0xbe, 0x62, 0xb2, 0x88, 0xb7, 0xa5, 0xea, 0x2f, + 0xee, 0x6a, 0x2d, 0xec, 0x32, 0x84, 0x7e, 0xf9, 0x13, 0x00, 0x00, 0xff, 0xff, 0xf6, 0x9e, 0x6e, + 0xd5, 0x94, 0x01, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -169,8 +170,8 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x30 } - if m.OrderSizePpm != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.OrderSizePpm)) + if m.OrderSizePctPpm != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.OrderSizePctPpm)) i-- dAtA[i] = 0x28 } @@ -226,8 +227,8 @@ func (m *Params) Size() (n int) { if m.SkewFactorPpm != 0 { n += 1 + sovParams(uint64(m.SkewFactorPpm)) } - if m.OrderSizePpm != 0 { - n += 1 + sovParams(uint64(m.OrderSizePpm)) + if m.OrderSizePctPpm != 0 { + n += 1 + sovParams(uint64(m.OrderSizePctPpm)) } if m.OrderExpirationSeconds != 0 { n += 1 + sovParams(uint64(m.OrderExpirationSeconds)) @@ -348,9 +349,9 @@ func (m *Params) Unmarshal(dAtA []byte) error { } case 5: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field OrderSizePpm", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OrderSizePctPpm", wireType) } - m.OrderSizePpm = 0 + m.OrderSizePctPpm = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowParams @@ -360,7 +361,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.OrderSizePpm |= uint32(b&0x7F) << shift + m.OrderSizePctPpm |= uint32(b&0x7F) << shift if b < 0x80 { break } diff --git a/protocol/x/vault/types/params_test.go b/protocol/x/vault/types/params_test.go index d0e23eb04c..ba3131b37f 100644 --- a/protocol/x/vault/types/params_test.go +++ b/protocol/x/vault/types/params_test.go @@ -24,7 +24,7 @@ func TestValidate(t *testing.T) { SpreadMinPpm: 3_000, SpreadBufferPpm: 1_500, SkewFactorPpm: 500_000, - OrderSizePpm: 100_000, + OrderSizePctPpm: 100_000, OrderExpirationSeconds: 5, }, expectedErr: types.ErrInvalidLayers, @@ -35,21 +35,21 @@ func TestValidate(t *testing.T) { SpreadMinPpm: 0, SpreadBufferPpm: 1_500, SkewFactorPpm: 500_000, - OrderSizePpm: 100_000, + OrderSizePctPpm: 100_000, OrderExpirationSeconds: 5, }, expectedErr: types.ErrInvalidSpreadMinPpm, }, - "Failure - OrderSizePpm is 0": { + "Failure - OrderSizePctPpm is 0": { params: types.Params{ Layers: 2, SpreadMinPpm: 3_000, SpreadBufferPpm: 1_500, SkewFactorPpm: 500_000, - OrderSizePpm: 0, + OrderSizePctPpm: 0, OrderExpirationSeconds: 5, }, - expectedErr: types.ErrInvalidOrderSizePpm, + expectedErr: types.ErrInvalidOrderSizePctPpm, }, "Failure - OrderExpirationSeconds is 0": { params: types.Params{ @@ -57,7 +57,7 @@ func TestValidate(t *testing.T) { SpreadMinPpm: 3_000, SpreadBufferPpm: 1_500, SkewFactorPpm: 500_000, - OrderSizePpm: 100_000, + OrderSizePctPpm: 100_000, OrderExpirationSeconds: 0, }, expectedErr: types.ErrInvalidOrderExpirationSeconds,