Skip to content

Commit

Permalink
Merge pull request #10619 from vegaprotocol/release/v0.74.1
Browse files Browse the repository at this point in the history
Release/v0.74.1
  • Loading branch information
jeremyletang authored Feb 12, 2024
2 parents 43c0791 + ec33b5e commit c58e8fc
Show file tree
Hide file tree
Showing 15 changed files with 152 additions and 10 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
- [](https://github.com/vegaprotocol/vega/issues/xxx) -


## 0.74.1

### 🐛 Fixes

- [10611](https://github.com/vegaprotocol/vega/issues/10611) - Added internal config price to update `perps`.
- [10615](https://github.com/vegaprotocol/vega/issues/10615) - Fix oracle scaling function in internal composite price.
- [10621](https://github.com/vegaprotocol/vega/issues/10516) - Fix market activity tracker storing incorrect data for previous `epochMakerFeesPaid`.


## 0.74.0

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


## 0.70.0

### 🚨 Breaking changes
Expand Down
2 changes: 1 addition & 1 deletion core/execution/common/market_activity_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ func (mt *marketTracker) clearFeeActivity() {
mt.epochTotalLpFees = mt.epochTotalLpFees[1:]
}
mt.epochMakerFeesReceived = append(mt.epochMakerFeesReceived, mt.makerFeesReceived)
mt.epochMakerFeesPaid = append(mt.epochMakerFeesReceived, mt.makerFeesPaid)
mt.epochMakerFeesPaid = append(mt.epochMakerFeesPaid, mt.makerFeesPaid)
mt.epochLpFees = append(mt.epochLpFees, mt.lpFees)
mt.makerFeesReceived = map[string]*num.Uint{}
mt.makerFeesPaid = map[string]*num.Uint{}
Expand Down
1 change: 1 addition & 0 deletions core/execution/future/market.go
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ func (m *Market) Update(ctx context.Context, config *types.Market, oracleEngine
} else if internalCompositePriceConfig != nil {
// it's a new index calculator
m.internalCompositePriceCalculator = NewCompositePriceCalculator(ctx, internalCompositePriceConfig, oracleEngine, m.timeService)
m.internalCompositePriceCalculator.setOraclePriceScalingFunc(m.scaleOracleData)
}
}

Expand Down
1 change: 1 addition & 0 deletions core/governance/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -1266,6 +1266,7 @@ func (e *Engine) updatedMarketFromProposal(p *proposal) (*types.Market, types.Pr
DataSourceSpecForSettlementData: product.Perps.DataSourceSpecForSettlementData,
DataSourceSpecForSettlementSchedule: product.Perps.DataSourceSpecForSettlementSchedule,
DataSourceSpecBinding: product.Perps.DataSourceSpecBinding,
InternalCompositePriceConfig: product.Perps.InternalCompositePrice,
},
}
default:
Expand Down
116 changes: 116 additions & 0 deletions core/integration/features/verified/rewards-over-window.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
Feature: Maker fees paid reward metric calculated correctly for time window

# Test checks bug where previous maker fees received were being stored in place of
# maker fees paid in the market activity tracker.

Background:

# Initialise the network
Given time is updated to "2023-01-01T00:00:00Z"
And the average block duration is "1"
And the following network parameters are set:
| name | value |
| market.fee.factors.makerFee | 0.001 |
| network.markPriceUpdateMaximumFrequency | 0s |
| market.auction.minimumDuration | 1 |
| validators.epoch.length | 60s |
| limits.markets.maxPeggedOrders | 4 |
| referralProgram.minStakedVegaTokens | 0 |

# Initialise the markets
And the following assets are registered:
| id | decimal places | quantum |
| USD-1-10 | 1 | 10 |
And the markets:
| 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 |
| 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 |

# Initialise the parties
Given the parties deposit on asset's general account the following amount:
| party | asset | amount |
| lpprov | USD-1-10 | 10000000000 |
| aux1 | USD-1-10 | 10000000 |
| aux2 | USD-1-10 | 10000000 |
| referrer1 | USD-1-10 | 10000000 |
| referee1 | USD-1-10 | 10000000 |
| referee2 | USD-1-10 | 10000000 |
| referee3 | USD-1-10 | 10000000 |
| a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | USD-1-10 | 10000000 |

# Exit opening auctions
Given the parties submit the following liquidity provision:
| id | party | market id | commitment amount | fee | lp type |
| lp1 | lpprov | ETH/USD-1-10 | 1000000 | 0.01 | submission |
And the parties place the following pegged iceberg orders:
| party | market id | peak size | minimum visible size | side | pegged reference | volume | offset |
| lpprov | ETH/USD-1-10 | 5000 | 1000 | buy | BID | 10000 | 1 |
| lpprov | ETH/USD-1-10 | 5000 | 1000 | sell | ASK | 10000 | 1 |
When the parties place the following orders:
| party | market id | side | volume | price | resulting trades | type | tif |
| aux1 | ETH/USD-1-10 | buy | 1 | 990 | 0 | TYPE_LIMIT | TIF_GTC |
| aux1 | ETH/USD-1-10 | buy | 1 | 1000 | 0 | TYPE_LIMIT | TIF_GTC |
| aux1 | ETH/USD-1-10 | sell | 1 | 1000 | 0 | TYPE_LIMIT | TIF_GTC |
| aux2 | ETH/USD-1-10 | sell | 1 | 1100 | 0 | TYPE_LIMIT | TIF_GTC |
And the opening auction period ends for market "ETH/USD-1-10"
When the network moves ahead "1" blocks
And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/USD-1-10"

# Create the teams
Given the parties create the following referral codes:
| party | code | is_team | team |
| referrer1 | referral-code-1 | true | team1 |
| referrer2 | referral-code-2 | true | team2 |
And the parties apply the following referral codes:
| party | code | is_team | team |
| referee1 | referral-code-1 | true | team1 |
| referee2 | referral-code-2 | true | team2 |
| referee3 | referral-code-2 | true | team2 |
And the team "team1" has the following members:
| party |
| referrer1 |
| referee1 |
And the team "team2" has the following members:
| party |
| referrer2 |
| referee2 |
| referee3 |


Scenario: Party funds pool with recurring transfer scoping individuals

Given the parties submit the following recurring transfers:
| 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 |
| 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 |
And the parties place the following orders:
| party | market id | side | volume | price | resulting trades | type | tif |
| referrer1 | ETH/USD-1-10 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC |
| referee1 | ETH/USD-1-10 | buy | 10 | 1000 | 1 | TYPE_LIMIT | TIF_GTC |
| referrer1 | ETH/USD-1-10 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC |
| referee2 | ETH/USD-1-10 | buy | 10 | 1000 | 1 | TYPE_LIMIT | TIF_GTC |
| referrer1 | ETH/USD-1-10 | sell | 5 | 1000 | 0 | TYPE_LIMIT | TIF_GTC |
| referee3 | ETH/USD-1-10 | buy | 5 | 1000 | 1 | TYPE_LIMIT | TIF_GTC |
When the network moves ahead "1" epochs

Then "referee1" should have vesting account balance of "4000" for asset "USD-1-10"
And "referee2" should have vesting account balance of "4000" for asset "USD-1-10"
And "referee3" should have vesting account balance of "2000" for asset "USD-1-10"


Scenario: Party funds pool with recurring transfer scoping teams

Given the parties submit the following recurring transfers:
| 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 |
| 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 |
And the parties place the following orders:
| party | market id | side | volume | price | resulting trades | type | tif |
| referrer1 | ETH/USD-1-10 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC |
| referee1 | ETH/USD-1-10 | buy | 10 | 1000 | 1 | TYPE_LIMIT | TIF_GTC |
| referrer1 | ETH/USD-1-10 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC |
| referee2 | ETH/USD-1-10 | buy | 10 | 1000 | 1 | TYPE_LIMIT | TIF_GTC |
| referrer1 | ETH/USD-1-10 | sell | 5 | 1000 | 0 | TYPE_LIMIT | TIF_GTC |
| referee3 | ETH/USD-1-10 | buy | 5 | 1000 | 1 | TYPE_LIMIT | TIF_GTC |
When the network moves ahead "1" epochs

Then "referee1" should have vesting account balance of "5000" for asset "USD-1-10"
And "referee2" should have vesting account balance of "2500" for asset "USD-1-10"
And "referee3" should have vesting account balance of "2500" for asset "USD-1-10"
14 changes: 14 additions & 0 deletions core/types/governance_update_market.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,11 @@ func UpdateInstrumentConfigurationFromProto(p *vegapb.UpdateInstrumentConfigurat
upperBound = &d
}

var ipc *CompositePriceConfiguration
if pr.Perpetual.InternalCompositePriceConfiguration != nil {
ipc = CompositePriceConfigurationFromProto(pr.Perpetual.InternalCompositePriceConfiguration)
}

r.Product = &UpdateInstrumentConfigurationPerps{
Perps: &UpdatePerpsProduct{
QuoteName: pr.Perpetual.QuoteName,
Expand All @@ -533,6 +538,7 @@ func UpdateInstrumentConfigurationFromProto(p *vegapb.UpdateInstrumentConfigurat
DataSourceSpecForSettlementData: *datasource.NewDefinitionWith(settlement),
DataSourceSpecForSettlementSchedule: *datasource.NewDefinitionWith(settlementSchedule),
DataSourceSpecBinding: datasource.SpecBindingForPerpsFromProto(pr.Perpetual.DataSourceSpecBinding),
InternalCompositePrice: ipc,
},
}
}
Expand Down Expand Up @@ -589,6 +595,7 @@ type UpdatePerpsProduct struct {
DataSourceSpecForSettlementData dsdefinition.Definition
DataSourceSpecForSettlementSchedule dsdefinition.Definition
DataSourceSpecBinding *datasource.SpecBindingForPerps
InternalCompositePrice *CompositePriceConfiguration
}

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

var ipc *vegapb.CompositePriceConfiguration
if p.InternalCompositePrice != nil {
ipc = p.InternalCompositePrice.IntoProto()
}

return &vegapb.UpdatePerpetualProduct{
QuoteName: p.QuoteName,
MarginFundingFactor: p.MarginFundingFactor.String(),
Expand All @@ -615,6 +627,7 @@ func (p UpdatePerpsProduct) IntoProto() *vegapb.UpdatePerpetualProduct {
DataSourceSpecForSettlementData: p.DataSourceSpecForSettlementData.IntoProto(),
DataSourceSpecForSettlementSchedule: p.DataSourceSpecForSettlementSchedule.IntoProto(),
DataSourceSpecBinding: p.DataSourceSpecBinding.IntoProto(),
InternalCompositePriceConfiguration: ipc,
}
}

Expand All @@ -628,6 +641,7 @@ func (p UpdatePerpsProduct) DeepClone() *UpdatePerpsProduct {
DataSourceSpecForSettlementData: *p.DataSourceSpecForSettlementData.DeepClone().(*dsdefinition.Definition),
DataSourceSpecForSettlementSchedule: *p.DataSourceSpecForSettlementSchedule.DeepClone().(*dsdefinition.Definition),
DataSourceSpecBinding: p.DataSourceSpecBinding.DeepClone(),
InternalCompositePrice: p.InternalCompositePrice.DeepClone(),
}
}

Expand Down
2 changes: 1 addition & 1 deletion protos/blockexplorer/api/v1/blockexplorer.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion protos/data-node/api/v2/trading_data.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion protos/sources/blockexplorer/api/v1/blockexplorer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ option go_package = "code.vegaprotocol.io/vega/protos/blockexplorer/api/v1";
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "Vega block explorer APIs";
version: "v0.74.0";
version: "v0.74.1";
}
schemes: [
HTTP,
Expand Down
2 changes: 1 addition & 1 deletion protos/sources/data-node/api/v2/trading_data.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ option go_package = "code.vegaprotocol.io/vega/protos/data-node/api/v2";
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "Vega data node APIs";
version: "v0.74.0";
version: "v0.74.1";
}
schemes: [
HTTP,
Expand Down
2 changes: 1 addition & 1 deletion protos/sources/vega/api/v1/core.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ option go_package = "code.vegaprotocol.io/vega/protos/vega/api/v1";
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "Vega core APIs";
version: "v0.74.0";
version: "v0.74.1";
}
schemes: [
HTTP,
Expand Down
2 changes: 1 addition & 1 deletion protos/sources/vega/api/v1/corestate.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ option go_package = "code.vegaprotocol.io/vega/protos/vega/api/v1";
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "Vega core state APIs";
version: "v0.74.0";
version: "v0.74.1";
}
schemes: [
HTTP,
Expand Down
2 changes: 1 addition & 1 deletion protos/vega/api/v1/core.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion protos/vega/api/v1/corestate.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

var (
cliVersionHash = ""
cliVersion = "v0.74.0"
cliVersion = "v0.74.1"
)

func init() {
Expand Down

0 comments on commit c58e8fc

Please sign in to comment.