Skip to content

Commit c58e8fc

Browse files
authored
Merge pull request #10619 from vegaprotocol/release/v0.74.1
Release/v0.74.1
2 parents 43c0791 + ec33b5e commit c58e8fc

File tree

15 files changed

+152
-10
lines changed

15 files changed

+152
-10
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@
1919
- [](https://github.com/vegaprotocol/vega/issues/xxx) -
2020

2121

22+
## 0.74.1
23+
24+
### 🐛 Fixes
25+
26+
- [10611](https://github.com/vegaprotocol/vega/issues/10611) - Added internal config price to update `perps`.
27+
- [10615](https://github.com/vegaprotocol/vega/issues/10615) - Fix oracle scaling function in internal composite price.
28+
- [10621](https://github.com/vegaprotocol/vega/issues/10516) - Fix market activity tracker storing incorrect data for previous `epochMakerFeesPaid`.
29+
30+
2231
## 0.74.0
2332

2433
### 🚨 Breaking changes
@@ -838,6 +847,7 @@
838847
- [9793](https://github.com/vegaprotocol/vega/issues/9793) - Map network owner correctly in creating account from transfer.
839848
- [10516](https://github.com/vegaprotocol/vega/issues/10516) - Fix mapping of estimate position.
840849

850+
841851
## 0.70.0
842852

843853
### 🚨 Breaking changes

core/execution/common/market_activity_tracker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ func (mt *marketTracker) clearFeeActivity() {
418418
mt.epochTotalLpFees = mt.epochTotalLpFees[1:]
419419
}
420420
mt.epochMakerFeesReceived = append(mt.epochMakerFeesReceived, mt.makerFeesReceived)
421-
mt.epochMakerFeesPaid = append(mt.epochMakerFeesReceived, mt.makerFeesPaid)
421+
mt.epochMakerFeesPaid = append(mt.epochMakerFeesPaid, mt.makerFeesPaid)
422422
mt.epochLpFees = append(mt.epochLpFees, mt.lpFees)
423423
mt.makerFeesReceived = map[string]*num.Uint{}
424424
mt.makerFeesPaid = map[string]*num.Uint{}

core/execution/future/market.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,7 @@ func (m *Market) Update(ctx context.Context, config *types.Market, oracleEngine
621621
} else if internalCompositePriceConfig != nil {
622622
// it's a new index calculator
623623
m.internalCompositePriceCalculator = NewCompositePriceCalculator(ctx, internalCompositePriceConfig, oracleEngine, m.timeService)
624+
m.internalCompositePriceCalculator.setOraclePriceScalingFunc(m.scaleOracleData)
624625
}
625626
}
626627

core/governance/engine.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,6 +1266,7 @@ func (e *Engine) updatedMarketFromProposal(p *proposal) (*types.Market, types.Pr
12661266
DataSourceSpecForSettlementData: product.Perps.DataSourceSpecForSettlementData,
12671267
DataSourceSpecForSettlementSchedule: product.Perps.DataSourceSpecForSettlementSchedule,
12681268
DataSourceSpecBinding: product.Perps.DataSourceSpecBinding,
1269+
InternalCompositePriceConfig: product.Perps.InternalCompositePrice,
12691270
},
12701271
}
12711272
default:
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
Feature: Maker fees paid reward metric calculated correctly for time window
2+
3+
# Test checks bug where previous maker fees received were being stored in place of
4+
# maker fees paid in the market activity tracker.
5+
6+
Background:
7+
8+
# Initialise the network
9+
Given time is updated to "2023-01-01T00:00:00Z"
10+
And the average block duration is "1"
11+
And the following network parameters are set:
12+
| name | value |
13+
| market.fee.factors.makerFee | 0.001 |
14+
| network.markPriceUpdateMaximumFrequency | 0s |
15+
| market.auction.minimumDuration | 1 |
16+
| validators.epoch.length | 60s |
17+
| limits.markets.maxPeggedOrders | 4 |
18+
| referralProgram.minStakedVegaTokens | 0 |
19+
20+
# Initialise the markets
21+
And the following assets are registered:
22+
| id | decimal places | quantum |
23+
| USD-1-10 | 1 | 10 |
24+
And the markets:
25+
| id | quote name | asset | risk model | margin calculator | auction duration | fees | price monitoring | data source config | linear slippage factor | quadratic slippage factor | sla params | decimal places | position decimal places |
26+
| ETH/USD-1-10 | ETH | USD-1-10 | default-log-normal-risk-model | default-margin-calculator | 1 | default-none | default-none | default-eth-for-future | 1e-3 | 0 | default-futures | 0 | 0 |
27+
28+
# Initialise the parties
29+
Given the parties deposit on asset's general account the following amount:
30+
| party | asset | amount |
31+
| lpprov | USD-1-10 | 10000000000 |
32+
| aux1 | USD-1-10 | 10000000 |
33+
| aux2 | USD-1-10 | 10000000 |
34+
| referrer1 | USD-1-10 | 10000000 |
35+
| referee1 | USD-1-10 | 10000000 |
36+
| referee2 | USD-1-10 | 10000000 |
37+
| referee3 | USD-1-10 | 10000000 |
38+
| a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | USD-1-10 | 10000000 |
39+
40+
# Exit opening auctions
41+
Given the parties submit the following liquidity provision:
42+
| id | party | market id | commitment amount | fee | lp type |
43+
| lp1 | lpprov | ETH/USD-1-10 | 1000000 | 0.01 | submission |
44+
And the parties place the following pegged iceberg orders:
45+
| party | market id | peak size | minimum visible size | side | pegged reference | volume | offset |
46+
| lpprov | ETH/USD-1-10 | 5000 | 1000 | buy | BID | 10000 | 1 |
47+
| lpprov | ETH/USD-1-10 | 5000 | 1000 | sell | ASK | 10000 | 1 |
48+
When the parties place the following orders:
49+
| party | market id | side | volume | price | resulting trades | type | tif |
50+
| aux1 | ETH/USD-1-10 | buy | 1 | 990 | 0 | TYPE_LIMIT | TIF_GTC |
51+
| aux1 | ETH/USD-1-10 | buy | 1 | 1000 | 0 | TYPE_LIMIT | TIF_GTC |
52+
| aux1 | ETH/USD-1-10 | sell | 1 | 1000 | 0 | TYPE_LIMIT | TIF_GTC |
53+
| aux2 | ETH/USD-1-10 | sell | 1 | 1100 | 0 | TYPE_LIMIT | TIF_GTC |
54+
And the opening auction period ends for market "ETH/USD-1-10"
55+
When the network moves ahead "1" blocks
56+
And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/USD-1-10"
57+
58+
# Create the teams
59+
Given the parties create the following referral codes:
60+
| party | code | is_team | team |
61+
| referrer1 | referral-code-1 | true | team1 |
62+
| referrer2 | referral-code-2 | true | team2 |
63+
And the parties apply the following referral codes:
64+
| party | code | is_team | team |
65+
| referee1 | referral-code-1 | true | team1 |
66+
| referee2 | referral-code-2 | true | team2 |
67+
| referee3 | referral-code-2 | true | team2 |
68+
And the team "team1" has the following members:
69+
| party |
70+
| referrer1 |
71+
| referee1 |
72+
And the team "team2" has the following members:
73+
| party |
74+
| referrer2 |
75+
| referee2 |
76+
| referee3 |
77+
78+
79+
Scenario: Party funds pool with recurring transfer scoping individuals
80+
81+
Given the parties submit the following recurring transfers:
82+
| id | from | from_account_type | to | to_account_type | entity_scope | teams | ntop | asset | amount | start_epoch | end_epoch | factor | metric | metric_asset | markets | window_length |
83+
| 1 | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL | 0000000000000000000000000000000000000000000000000000000000000000 | ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES | INDIVIDUALS | | 1 | USD-1-10 | 10000 | 1 | | 1 | DISPATCH_METRIC_MAKER_FEES_PAID | USD-1-10 | ETH/USD-1-10 | 2 |
84+
And the parties place the following orders:
85+
| party | market id | side | volume | price | resulting trades | type | tif |
86+
| referrer1 | ETH/USD-1-10 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC |
87+
| referee1 | ETH/USD-1-10 | buy | 10 | 1000 | 1 | TYPE_LIMIT | TIF_GTC |
88+
| referrer1 | ETH/USD-1-10 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC |
89+
| referee2 | ETH/USD-1-10 | buy | 10 | 1000 | 1 | TYPE_LIMIT | TIF_GTC |
90+
| referrer1 | ETH/USD-1-10 | sell | 5 | 1000 | 0 | TYPE_LIMIT | TIF_GTC |
91+
| referee3 | ETH/USD-1-10 | buy | 5 | 1000 | 1 | TYPE_LIMIT | TIF_GTC |
92+
When the network moves ahead "1" epochs
93+
94+
Then "referee1" should have vesting account balance of "4000" for asset "USD-1-10"
95+
And "referee2" should have vesting account balance of "4000" for asset "USD-1-10"
96+
And "referee3" should have vesting account balance of "2000" for asset "USD-1-10"
97+
98+
99+
Scenario: Party funds pool with recurring transfer scoping teams
100+
101+
Given the parties submit the following recurring transfers:
102+
| id | from | from_account_type | to | to_account_type | entity_scope | teams | ntop | asset | amount | start_epoch | end_epoch | factor | metric | metric_asset | markets | window_length |
103+
| 1 | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL | 0000000000000000000000000000000000000000000000000000000000000000 | ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES | TEAMS | | 1 | USD-1-10 | 10000 | 1 | | 1 | DISPATCH_METRIC_MAKER_FEES_PAID | USD-1-10 | ETH/USD-1-10 | 2 |
104+
And the parties place the following orders:
105+
| party | market id | side | volume | price | resulting trades | type | tif |
106+
| referrer1 | ETH/USD-1-10 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC |
107+
| referee1 | ETH/USD-1-10 | buy | 10 | 1000 | 1 | TYPE_LIMIT | TIF_GTC |
108+
| referrer1 | ETH/USD-1-10 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC |
109+
| referee2 | ETH/USD-1-10 | buy | 10 | 1000 | 1 | TYPE_LIMIT | TIF_GTC |
110+
| referrer1 | ETH/USD-1-10 | sell | 5 | 1000 | 0 | TYPE_LIMIT | TIF_GTC |
111+
| referee3 | ETH/USD-1-10 | buy | 5 | 1000 | 1 | TYPE_LIMIT | TIF_GTC |
112+
When the network moves ahead "1" epochs
113+
114+
Then "referee1" should have vesting account balance of "5000" for asset "USD-1-10"
115+
And "referee2" should have vesting account balance of "2500" for asset "USD-1-10"
116+
And "referee3" should have vesting account balance of "2500" for asset "USD-1-10"

core/types/governance_update_market.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,11 @@ func UpdateInstrumentConfigurationFromProto(p *vegapb.UpdateInstrumentConfigurat
520520
upperBound = &d
521521
}
522522

523+
var ipc *CompositePriceConfiguration
524+
if pr.Perpetual.InternalCompositePriceConfiguration != nil {
525+
ipc = CompositePriceConfigurationFromProto(pr.Perpetual.InternalCompositePriceConfiguration)
526+
}
527+
523528
r.Product = &UpdateInstrumentConfigurationPerps{
524529
Perps: &UpdatePerpsProduct{
525530
QuoteName: pr.Perpetual.QuoteName,
@@ -533,6 +538,7 @@ func UpdateInstrumentConfigurationFromProto(p *vegapb.UpdateInstrumentConfigurat
533538
DataSourceSpecForSettlementData: *datasource.NewDefinitionWith(settlement),
534539
DataSourceSpecForSettlementSchedule: *datasource.NewDefinitionWith(settlementSchedule),
535540
DataSourceSpecBinding: datasource.SpecBindingForPerpsFromProto(pr.Perpetual.DataSourceSpecBinding),
541+
InternalCompositePrice: ipc,
536542
},
537543
}
538544
}
@@ -589,6 +595,7 @@ type UpdatePerpsProduct struct {
589595
DataSourceSpecForSettlementData dsdefinition.Definition
590596
DataSourceSpecForSettlementSchedule dsdefinition.Definition
591597
DataSourceSpecBinding *datasource.SpecBindingForPerps
598+
InternalCompositePrice *CompositePriceConfiguration
592599
}
593600

594601
func (p UpdatePerpsProduct) IntoProto() *vegapb.UpdatePerpetualProduct {
@@ -603,6 +610,11 @@ func (p UpdatePerpsProduct) IntoProto() *vegapb.UpdatePerpetualProduct {
603610
upperBound = ptr.From(p.FundingRateUpperBound.String())
604611
}
605612

613+
var ipc *vegapb.CompositePriceConfiguration
614+
if p.InternalCompositePrice != nil {
615+
ipc = p.InternalCompositePrice.IntoProto()
616+
}
617+
606618
return &vegapb.UpdatePerpetualProduct{
607619
QuoteName: p.QuoteName,
608620
MarginFundingFactor: p.MarginFundingFactor.String(),
@@ -615,6 +627,7 @@ func (p UpdatePerpsProduct) IntoProto() *vegapb.UpdatePerpetualProduct {
615627
DataSourceSpecForSettlementData: p.DataSourceSpecForSettlementData.IntoProto(),
616628
DataSourceSpecForSettlementSchedule: p.DataSourceSpecForSettlementSchedule.IntoProto(),
617629
DataSourceSpecBinding: p.DataSourceSpecBinding.IntoProto(),
630+
InternalCompositePriceConfiguration: ipc,
618631
}
619632
}
620633

@@ -628,6 +641,7 @@ func (p UpdatePerpsProduct) DeepClone() *UpdatePerpsProduct {
628641
DataSourceSpecForSettlementData: *p.DataSourceSpecForSettlementData.DeepClone().(*dsdefinition.Definition),
629642
DataSourceSpecForSettlementSchedule: *p.DataSourceSpecForSettlementSchedule.DeepClone().(*dsdefinition.Definition),
630643
DataSourceSpecBinding: p.DataSourceSpecBinding.DeepClone(),
644+
InternalCompositePrice: p.InternalCompositePrice.DeepClone(),
631645
}
632646
}
633647

protos/blockexplorer/api/v1/blockexplorer.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protos/data-node/api/v2/trading_data.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protos/sources/blockexplorer/api/v1/blockexplorer.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ option go_package = "code.vegaprotocol.io/vega/protos/blockexplorer/api/v1";
1111
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
1212
info: {
1313
title: "Vega block explorer APIs";
14-
version: "v0.74.0";
14+
version: "v0.74.1";
1515
}
1616
schemes: [
1717
HTTP,

protos/sources/data-node/api/v2/trading_data.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ option go_package = "code.vegaprotocol.io/vega/protos/data-node/api/v2";
1717
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
1818
info: {
1919
title: "Vega data node APIs";
20-
version: "v0.74.0";
20+
version: "v0.74.1";
2121
}
2222
schemes: [
2323
HTTP,

protos/sources/vega/api/v1/core.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ option go_package = "code.vegaprotocol.io/vega/protos/vega/api/v1";
1212
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
1313
info: {
1414
title: "Vega core APIs";
15-
version: "v0.74.0";
15+
version: "v0.74.1";
1616
}
1717
schemes: [
1818
HTTP,

protos/sources/vega/api/v1/corestate.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ option go_package = "code.vegaprotocol.io/vega/protos/vega/api/v1";
1313
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
1414
info: {
1515
title: "Vega core state APIs";
16-
version: "v0.74.0";
16+
version: "v0.74.1";
1717
}
1818
schemes: [
1919
HTTP,

protos/vega/api/v1/core.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protos/vega/api/v1/corestate.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

version/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222

2323
var (
2424
cliVersionHash = ""
25-
cliVersion = "v0.74.0"
25+
cliVersion = "v0.74.1"
2626
)
2727

2828
func init() {

0 commit comments

Comments
 (0)