test(governance): perpetual market e2e test (#4892)
This commit is contained in:
parent
7453acd632
commit
56c662e5ba
@ -88,13 +88,6 @@ context('Market page', { tags: '@regression' }, function () {
|
||||
cy.validate_element_from_table('Target Stake', '0.00 fUSDC');
|
||||
cy.validate_element_from_table('Supplied Stake', '0.00 fUSDC');
|
||||
cy.validate_element_from_table('Market Value Proxy', '0.00 fUSDC');
|
||||
// Liquidity price range
|
||||
cy.validate_element_from_table(
|
||||
'Liquidity Price Range',
|
||||
'1,000.00% of mid price'
|
||||
);
|
||||
cy.validate_element_from_table('Lowest Price', '0.00 fUSDC');
|
||||
cy.validate_element_from_table('Highest Price', '0.00 fUSDC');
|
||||
cy.getByTestId('oracle-spec-links')
|
||||
.should('have.attr', 'href')
|
||||
.and(
|
||||
@ -143,11 +136,12 @@ context('Market page', { tags: '@regression' }, function () {
|
||||
.as('successorMarketId');
|
||||
cy.contains('Token test market').click();
|
||||
cy.getByTestId(marketHeaders).should('have.text', 'Token test market');
|
||||
cy.validate_proposal_change_type('Triggering Ratio', 'Added');
|
||||
// Assertions commented out due to #4869
|
||||
// cy.validate_proposal_change_type('Triggering Ratio', 'Added');
|
||||
cy.validate_element_from_table('Triggering Ratio', '0.7');
|
||||
cy.validate_proposal_change_type('Time Window', 'Added');
|
||||
// cy.validate_proposal_change_type('Time Window', 'Added');
|
||||
cy.validate_element_from_table('Time Window', '3,600');
|
||||
cy.validate_proposal_change_type('Scaling Factor', 'Added');
|
||||
// cy.validate_proposal_change_type('Scaling Factor', 'Added');
|
||||
cy.validate_element_from_table('Scaling Factor', '10');
|
||||
|
||||
cy.getByTestId(successionLineItem)
|
||||
|
@ -129,6 +129,12 @@ function getSuccessorTxBody(parentMarketId) {
|
||||
parentMarketId: parentMarketId,
|
||||
insurancePoolFraction: '0.75',
|
||||
},
|
||||
liquiditySlaParameters: {
|
||||
priceRange: '0.95',
|
||||
commitmentMinTimeFraction: '0.5',
|
||||
performanceHysteresisEpochs: 2,
|
||||
slaCompetitionFactor: '0.75',
|
||||
},
|
||||
},
|
||||
},
|
||||
closingTimestamp,
|
||||
|
@ -0,0 +1,138 @@
|
||||
{
|
||||
"rationale": {
|
||||
"description": "## Summary\n\nThis proposal requests to list BTC PERPS Incentive as a market with USD-P as a settlement asset on the Vega Network as discussed in: https://community.vega.xyz/.\n\n## Rationale\n\n- BTC is the largest Crypto asset with the highest volume and Marketcap.\n- Given the price, 1 decimal places will be used for price due to the number of valid digits in asset price. \n- Position decimal places will be set to 4 considering the value per contract\n- USDT is chosen as settlement asset due to its stability.",
|
||||
"title": "perpetual market proposal"
|
||||
},
|
||||
"terms": {
|
||||
"closingTimestamp": 0,
|
||||
"enactmentTimestamp": 0,
|
||||
"newMarket": {
|
||||
"changes": {
|
||||
"instrument": {
|
||||
"name": "Token test market",
|
||||
"code": "TEST.24h",
|
||||
"perpetual": {
|
||||
"clampLowerBound": "0",
|
||||
"clampUpperBound": "0",
|
||||
"interestRate": "0",
|
||||
"marginFundingFactor": "0.1",
|
||||
"settlementAsset": "73174a6fb1d5802ba0ac7bd7ab79e0a3a4837b262de0a4e80815a55442692bd0",
|
||||
"quoteName": "fBTC",
|
||||
"dataSourceSpecForSettlementData": {
|
||||
"external": {
|
||||
"ethOracle": {
|
||||
"address": "0x1b44F3514812d835EB1BDB0acB33d3fA3351Ee43",
|
||||
"abi": "[{\"inputs\":[],\"name\":\"latestAnswer\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]",
|
||||
"method": "latestAnswer",
|
||||
"normalisers": [
|
||||
{
|
||||
"name": "btc.price",
|
||||
"expression": "$[0]"
|
||||
}
|
||||
],
|
||||
"requiredConfirmations": 3,
|
||||
"trigger": {
|
||||
"timeTrigger": {
|
||||
"every": 30
|
||||
}
|
||||
},
|
||||
"filters": [
|
||||
{
|
||||
"key": {
|
||||
"name": "btc.price",
|
||||
"type": "TYPE_INTEGER",
|
||||
"numberDecimalPlaces": 8
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"operator": "OPERATOR_GREATER_THAN_OR_EQUAL",
|
||||
"value": "0"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"dataSourceSpecForSettlementSchedule": {
|
||||
"internal": {
|
||||
"timeTrigger": {
|
||||
"conditions": [
|
||||
{
|
||||
"operator": "OPERATOR_GREATER_THAN_OR_EQUAL",
|
||||
"value": "0"
|
||||
}
|
||||
],
|
||||
"triggers": [
|
||||
{
|
||||
"every": 1800
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"dataSourceSpecBinding": {
|
||||
"settlementDataProperty": "btc.price",
|
||||
"settlementScheduleProperty": "vegaprotocol.builtin.timetrigger"
|
||||
}
|
||||
}
|
||||
},
|
||||
"metadata": [
|
||||
"base:BTC",
|
||||
"quote:USD-P",
|
||||
"class:fx/crypto",
|
||||
"quarterly",
|
||||
"sector:defi",
|
||||
"enactment:2023-06-15T14:00:00Z",
|
||||
"settlement:2023-09-30T08:00:00Z"
|
||||
],
|
||||
"priceMonitoringParameters": {
|
||||
"triggers": [
|
||||
{
|
||||
"horizon": "3600",
|
||||
"probability": "0.9999",
|
||||
"auctionExtension": "120"
|
||||
},
|
||||
{
|
||||
"horizon": "14400",
|
||||
"probability": "0.9999",
|
||||
"auctionExtension": "180"
|
||||
},
|
||||
{
|
||||
"horizon": "43200",
|
||||
"probability": "0.9999",
|
||||
"auctionExtension": "300"
|
||||
}
|
||||
]
|
||||
},
|
||||
"liquidityMonitoringParameters": {
|
||||
"targetStakeParameters": {
|
||||
"timeWindow": "3600",
|
||||
"scalingFactor": 1
|
||||
},
|
||||
"triggeringRatio": "0.7",
|
||||
"auctionExtension": "1"
|
||||
},
|
||||
|
||||
"liquiditySlaParameters": {
|
||||
"priceRange": "0.05",
|
||||
"commitmentMinTimeFraction": "0.95",
|
||||
"performanceHysteresisEpochs": 1,
|
||||
"slaCompetitionFactor": "0.95"
|
||||
},
|
||||
|
||||
"logNormal": {
|
||||
"riskAversionParameter": 0.000001,
|
||||
"tau": 0.0001140771161,
|
||||
"params": {
|
||||
"sigma": 1.5
|
||||
}
|
||||
},
|
||||
"decimalPlaces": "1",
|
||||
"positionDecimalPlaces": "4",
|
||||
"linearSlippageFactor": "0.001",
|
||||
"quadraticSlippageFactor": "0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -9,6 +9,7 @@ import {
|
||||
createTenDigitUnixTimeStampForSpecifiedDays,
|
||||
generateFreeFormProposalTitle,
|
||||
getDateFormatForSpecifiedDays,
|
||||
getProposalDetailsValue,
|
||||
getProposalFromTitle,
|
||||
getProposalInformationFromTable,
|
||||
goToMakeNewProposal,
|
||||
@ -50,6 +51,7 @@ const openProposals = 'open-proposals';
|
||||
const viewProposalButton = 'view-proposal-btn';
|
||||
const proposalTermsToggle = 'proposal-json-toggle';
|
||||
const marketDataToggle = 'proposal-market-data-toggle';
|
||||
const marketProposalType = 'proposal-type';
|
||||
|
||||
describe(
|
||||
'Governance flow for proposal details',
|
||||
@ -386,5 +388,54 @@ describe(
|
||||
'The fraction of the insurance pool balance that is carried over from the parent market to the successor.'
|
||||
);
|
||||
});
|
||||
|
||||
it('Able to see perpetual market', function () {
|
||||
const proposalPath =
|
||||
'src/fixtures/proposals/new-market-perpetual-raw.json';
|
||||
const enactmentTimestamp = createTenDigitUnixTimeStampForSpecifiedDays(3);
|
||||
const closingTimestamp = createTenDigitUnixTimeStampForSpecifiedDays(2);
|
||||
submitUniqueRawProposal({
|
||||
proposalBody: proposalPath,
|
||||
enactmentTimestamp: enactmentTimestamp,
|
||||
closingTimestamp: closingTimestamp,
|
||||
});
|
||||
getProposalFromTitle('perpetual market proposal').within(() => {
|
||||
cy.getByTestId(marketProposalType).should(
|
||||
'have.text',
|
||||
'New market - perpetual'
|
||||
);
|
||||
cy.getByTestId(viewProposalButton).click();
|
||||
});
|
||||
cy.getByTestId(marketDataToggle).click();
|
||||
getProposalDetailsValue('Product Type').should(
|
||||
'contain.text',
|
||||
'Perpetual'
|
||||
);
|
||||
cy.getByTestId(marketProposalType).should(
|
||||
'have.text',
|
||||
'New market - perpetual'
|
||||
);
|
||||
// Liquidity SLA protocols
|
||||
getProposalDetailsValue('Performance Hysteresis Epochs').should(
|
||||
'contain.text',
|
||||
'1'
|
||||
);
|
||||
getProposalDetailsValue('SLA Competition Factor').should(
|
||||
'contain.text',
|
||||
'95.00%'
|
||||
);
|
||||
getProposalDetailsValue('Epoch Length').should('contain.text', '5s');
|
||||
getProposalDetailsValue('Non Performance Bond Penalty Max').should(
|
||||
'contain.text',
|
||||
'0.05'
|
||||
);
|
||||
getProposalDetailsValue('Stake To CCY Volume').should(
|
||||
'contain.text',
|
||||
'0.3'
|
||||
);
|
||||
getProposalDetailsValue(
|
||||
'Minimum Probability Of Trading LP Orders'
|
||||
).should('contain.text', '1e-8');
|
||||
});
|
||||
}
|
||||
);
|
||||
|
@ -89,11 +89,12 @@ describe('Governance flow for proposal list', { tags: '@slow' }, function () {
|
||||
|
||||
it('Newly created proposals list - shows title and portion of summary', function () {
|
||||
const proposalPath = 'src/fixtures/proposals/new-market-raw.json';
|
||||
const proposalTimestamp = createTenDigitUnixTimeStampForSpecifiedDays(3);
|
||||
const enactmentTimestamp = createTenDigitUnixTimeStampForSpecifiedDays(3);
|
||||
const closingTimestamp = createTenDigitUnixTimeStampForSpecifiedDays(2);
|
||||
submitUniqueRawProposal({
|
||||
proposalBody: proposalPath,
|
||||
enactmentTimestamp: proposalTimestamp,
|
||||
closingTimestamp: proposalTimestamp,
|
||||
enactmentTimestamp: enactmentTimestamp,
|
||||
closingTimestamp: closingTimestamp,
|
||||
}); // 3001-VOTE-052
|
||||
// 3001-VOTE-008
|
||||
// 3001-VOTE-034
|
||||
|
@ -232,21 +232,25 @@ export function getDownloadedProposalJsonPath(proposalType: string) {
|
||||
return filepath;
|
||||
}
|
||||
|
||||
export function getProposalDetailsValue(RowName: string) {
|
||||
return cy
|
||||
.contains(RowName)
|
||||
.parentsUntil(proposalInformationTableRows)
|
||||
.parent()
|
||||
.first();
|
||||
}
|
||||
|
||||
export function validateProposalDetailsDiff(
|
||||
RowName: string,
|
||||
changeType: proposalChangeType,
|
||||
newValue: string,
|
||||
oldValue?: string
|
||||
) {
|
||||
cy.contains(RowName)
|
||||
.parentsUntil(proposalInformationTableRows)
|
||||
.parent()
|
||||
.first()
|
||||
.within(() => {
|
||||
cy.contains(changeType).should('be.visible');
|
||||
cy.contains(newValue).should('be.visible');
|
||||
if (oldValue) cy.contains(oldValue).should('have.class', 'line-through');
|
||||
});
|
||||
getProposalDetailsValue(RowName).within(() => {
|
||||
cy.contains(changeType).should('be.visible');
|
||||
cy.contains(newValue).should('be.visible');
|
||||
if (oldValue) cy.contains(oldValue).should('have.class', 'line-through');
|
||||
});
|
||||
}
|
||||
|
||||
function getFormattedTime() {
|
||||
|
@ -190,6 +190,7 @@
|
||||
"governance.proposal.updateNetParam.requiredParticipation": "0.00000000000000000000000015",
|
||||
"governance.proposal.freeform.minClose": "2s",
|
||||
"governance.proposal.freeform.requiredParticipation": "0.00000000000000000000000015",
|
||||
"limits.markets.proposePerpetualEnabled" : "1",
|
||||
"market.auction.minimumDuration": "3s",
|
||||
"market.fee.factors.infrastructureFee": "0.001",
|
||||
"market.fee.factors.makerFee": "0.004",
|
||||
|
Loading…
Reference in New Issue
Block a user