chore: remove lpPriceRange

This commit is contained in:
Madalina Raicu
2023-08-23 17:01:39 +01:00
parent be52f22fc9
commit 87ca719ed3
24 changed files with 26 additions and 203 deletions
@@ -16,7 +16,6 @@ function getSuccessorTxBody(parentMarketId) {
positionDecimalPlaces: '5',
linearSlippageFactor: '0.001',
quadraticSlippageFactor: '0',
lpPriceRange: '10',
instrument: {
name: 'Token test market',
code: 'TEST.24h',
@@ -9,7 +9,6 @@ import {
LiquidityMonitoringParametersInfoPanel,
InstrumentInfoPanel,
KeyDetailsInfoPanel,
LiquidityPriceRangeInfoPanel,
MetadataInfoPanel,
OracleInfoPanel,
RiskFactorsInfoPanel,
@@ -104,8 +103,6 @@ export const MarketDetails = ({ market }: { market: MarketInfoWithData }) => {
<LiquidityMonitoringParametersInfoPanel market={market} />
<h2 className={headerClassName}>{t('Liquidity')}</h2>
<LiquidityInfoPanel market={market} />
<h2 className={headerClassName}>{t('Liquidity price range')}</h2>
<LiquidityPriceRangeInfoPanel market={market} />
{showTwoOracles ? (
<>
<h2 className={headerClassName}>{t('Settlement oracle')}</h2>
@@ -5,8 +5,6 @@ import * as Apollo from '@apollo/client';
const defaultOptions = {} as const;
export type ExplorerPartyAssetsAccountsFragment = { __typename?: 'AccountBalance', type: Types.AccountType, balance: string, asset: { __typename?: 'Asset', name: string, id: string, decimals: number, symbol: string, source: { __typename: 'BuiltinAsset' } | { __typename: 'ERC20', contractAddress: string } }, market?: { __typename?: 'Market', id: string, decimalPlaces: number, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', name: string, product: { __typename?: 'Future', quoteName: string } | { __typename?: 'Perpetual', quoteName: string } | { __typename?: 'Spot' } } } } | null };
export type ExplorerPartyLinksFragment = { __typename?: 'AccountBalance', type: Types.AccountType, balance: string, asset: { __typename?: 'Asset', name: string, id: string, decimals: number, symbol: string, source: { __typename: 'BuiltinAsset' } | { __typename: 'ERC20', contractAddress: string } }, market?: { __typename?: 'Market', id: string, decimalPlaces: number, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', name: string, product: { __typename?: 'Future', quoteName: string } | { __typename?: 'Perpetual' } | { __typename?: 'Spot' } } } } | null };
export type ExplorerPartyAssetsQueryVariables = Types.Exact<{
partyId: Types.Scalars['ID'];
}>;
@@ -49,38 +47,6 @@ export const ExplorerPartyAssetsAccountsFragmentDoc = gql`
}
}
`;
export const ExplorerPartyLinksFragmentDoc = gql`
fragment ExplorerPartyLinks on AccountBalance {
asset {
name
id
decimals
symbol
source {
__typename
... on ERC20 {
contractAddress
}
}
}
type
balance
market {
id
decimalPlaces
tradableInstrument {
instrument {
name
product {
... on Future {
quoteName
}
}
}
}
}
}
`;
export const ExplorerPartyAssetsDocument = gql`
query ExplorerPartyAssets($partyId: ID!) {
partiesConnection(id: $partyId) {
-10
View File
@@ -1449,11 +1449,6 @@ export interface components {
readonly liquidityMonitoringParameters?: components['schemas']['vegaLiquidityMonitoringParameters'];
/** @description Log normal risk model parameters, valid only if MODEL_LOG_NORMAL is selected. */
readonly logNormal?: components['schemas']['vegaLogNormalRiskModel'];
/**
* @description Percentage move up and down from the mid price which specifies the range of
* price levels over which automated liquidity provision orders will be deployed.
*/
readonly lpPriceRange?: string;
/** @description Optional new futures market metadata, tags. */
readonly metadata?: readonly string[];
/**
@@ -1849,11 +1844,6 @@ export interface components {
readonly liquidityMonitoringParameters?: components['schemas']['vegaLiquidityMonitoringParameters'];
/** @description Log normal risk model parameters, valid only if MODEL_LOG_NORMAL is selected. */
readonly logNormal?: components['schemas']['vegaLogNormalRiskModel'];
/**
* @description Percentage move up and down from the mid price which specifies the range of
* price levels over which automated liquidity provision orders will be deployed.
*/
readonly lpPriceRange?: string;
/** @description Optional futures market metadata, tags. */
readonly metadata?: readonly string[];
/** @description Price monitoring parameters. */
@@ -10,7 +10,6 @@
"positionDecimalPlaces": "5",
"linearSlippageFactor": "0.001",
"quadraticSlippageFactor": "0",
"lpPriceRange": "10",
"instrument": {
"name": "Token test market",
"code": "TEST.24h",
@@ -4,7 +4,6 @@
"positionDecimalPlaces": "5",
"linearSlippageFactor": "0.001",
"quadraticSlippageFactor": "0",
"lpPriceRange": "10",
"instrument": {
"name": "Token test market",
"code": "Token.24h",
@@ -4,7 +4,6 @@
"positionDecimalPlaces": "5",
"linearSlippageFactor": "0.001",
"quadraticSlippageFactor": "0",
"lpPriceRange": "10",
"instrument": {
"name": "Token test market",
"code": "Token.24h",
@@ -1,5 +1,4 @@
{
"lpPriceRange": "11",
"instrument": {
"code": "Token.24h",
"future": {
@@ -1,5 +1,4 @@
{
"lpPriceRange": "10",
"linearSlippageFactor": "0.001",
"quadraticSlippageFactor": "0",
"instrument": {
@@ -106,7 +106,6 @@ export function createNewMarketProposalTxBody(): ProposalSubmissionBody {
positionDecimalPlaces: '5',
linearSlippageFactor: '0.001',
quadraticSlippageFactor: '0',
lpPriceRange: '10',
instrument: {
name: 'Token test market',
code: 'TEST.24h',
@@ -235,7 +234,6 @@ export function createSuccessorMarketProposalTxBody(
positionDecimalPlaces: '5',
linearSlippageFactor: '0.001',
quadraticSlippageFactor: '0',
lpPriceRange: '10',
instrument: {
name: 'Token test market',
code: 'TEST.24h',
@@ -5,7 +5,6 @@ import {
InstrumentInfoPanel,
KeyDetailsInfoPanel,
LiquidityMonitoringParametersInfoPanel,
LiquidityPriceRangeInfoPanel,
MetadataInfoPanel,
OracleInfoPanel,
PriceMonitoringBoundsInfoPanel,
@@ -276,16 +275,6 @@ export const ProposalMarketData = ({
/>
}
/>
<AccordionItem
itemId="liquidity-price-range"
title={t('Liquidity price range')}
content={
<LiquidityPriceRangeInfoPanel
market={marketData}
parentMarket={parentMarketData}
/>
}
/>
</Accordion>
</div>
</>
@@ -20,7 +20,6 @@ query Proposal($proposalId: ID!) {
... on NewMarket {
decimalPlaces
metadata
lpPriceRange
riskParameters {
... on LogNormalRiskModel {
riskAversionParameter
@@ -152,7 +151,6 @@ query Proposal($proposalId: ID!) {
}
}
positionDecimalPlaces
lpPriceRange
linearSlippageFactor
quadraticSlippageFactor
}
File diff suppressed because one or more lines are too long
@@ -37,7 +37,6 @@ function createNewMarketProposal(): ProposalSubmissionBody {
positionDecimalPlaces: '5',
linearSlippageFactor: '0.001',
quadraticSlippageFactor: '0',
lpPriceRange: '10',
instrument: {
name: 'Test market 1',
code: 'TEST.24h',
@@ -36,7 +36,6 @@ query MarketInfo($marketId: ID!) {
positionDecimalPlaces
state
tradingMode
lpPriceRange
proposal {
id
rationale {
@@ -107,6 +106,7 @@ query MarketInfo($marketId: ID!) {
symbol
name
decimals
quantum
}
dataSourceSpecForSettlementData {
id
@@ -132,6 +132,7 @@ query MarketInfo($marketId: ID!) {
symbol
name
decimals
quantum
}
dataSourceSpecForSettlementData {
id
File diff suppressed because one or more lines are too long
@@ -28,7 +28,6 @@ import {
KeyDetailsInfoPanel,
LiquidityInfoPanel,
LiquidityMonitoringParametersInfoPanel,
LiquidityPriceRangeInfoPanel,
MarketPriceInfoPanel,
MarketVolumeInfoPanel,
MetadataInfoPanel,
@@ -299,11 +298,6 @@ export const MarketInfoAccordion = ({
</LiquidityInfoPanel>
}
/>
<AccordionItem
itemId="liquidity-price-range"
title={t('Liquidity price range')}
content={<LiquidityPriceRangeInfoPanel market={market} />}
/>
</Accordion>
</div>
{VEGA_TOKEN_URL && market.proposal?.id && (
@@ -722,104 +722,6 @@ export const LiquidityInfoPanel = ({ market, children }: MarketInfoProps) => {
);
};
export const LiquidityPriceRangeInfoPanel = ({
market,
parentMarket,
}: MarketInfoProps) => {
const quoteUnit =
('quoteName' in market.tradableInstrument.instrument.product &&
market?.tradableInstrument.instrument.product?.quoteName) ||
'';
const parentQuoteUnit =
(parentMarket &&
'quoteName' in parentMarket.tradableInstrument.instrument.product &&
parentMarket?.tradableInstrument.instrument.product?.quoteName) ||
'';
const liquidityPriceRange = formatNumberPercentage(
new BigNumber(market.lpPriceRange).times(100)
);
const parentLiquidityPriceRange = parentMarket
? formatNumberPercentage(
new BigNumber(parentMarket.lpPriceRange).times(100)
)
: null;
const { data } = useDataProvider({
dataProvider: marketDataProvider,
variables: { marketId: market.id },
});
const { data: parentMarketData } = useDataProvider({
dataProvider: marketDataProvider,
variables: { marketId: parentMarket?.id || '' },
skip: !parentMarket,
});
let parentData;
if (parentMarket && parentMarketData && quoteUnit === parentQuoteUnit) {
parentData = {
liquidityPriceRange: `${parentLiquidityPriceRange} of mid price`,
lowestPrice:
parentMarketData?.midPrice &&
`${addDecimalsFormatNumber(
new BigNumber(1)
.minus(parentMarket.lpPriceRange)
.times(parentMarketData.midPrice)
.toString(),
parentMarket.decimalPlaces
)} ${quoteUnit}`,
highestPrice:
parentMarketData?.midPrice &&
`${addDecimalsFormatNumber(
new BigNumber(1)
.plus(parentMarket.lpPriceRange)
.times(parentMarketData.midPrice)
.toString(),
parentMarket.decimalPlaces
)} ${quoteUnit}`,
};
}
return (
<>
<p className="text-sm mb-2">
{`For liquidity orders to count towards a commitment, they must be
within the liquidity monitoring bounds.`}
</p>
<p className="text-sm mb-2">
{`The liquidity price range is a ${liquidityPriceRange} difference from the mid
price.`}
</p>
<MarketInfoTable
data={{
liquidityPriceRange: `${liquidityPriceRange} of mid price`,
lowestPrice:
data?.midPrice &&
`${addDecimalsFormatNumber(
new BigNumber(1)
.minus(market.lpPriceRange)
.times(data.midPrice)
.toString(),
market.decimalPlaces
)} ${quoteUnit}`,
highestPrice:
data?.midPrice &&
`${addDecimalsFormatNumber(
new BigNumber(1)
.plus(market.lpPriceRange)
.times(data.midPrice)
.toString(),
market.decimalPlaces
)} ${quoteUnit}`,
}}
parentData={parentData}
/>
</>
);
};
export const OracleInfoPanel = ({
market,
type,
@@ -92,7 +92,6 @@ export const marketInfoQuery = (
short: '0.008571790367285281',
long: '0.008508132993273576',
},
lpPriceRange: '0.02',
liquidityMonitoringParameters: {
triggeringRatio: '0.7',
targetStakeParameters: {
@@ -111,7 +111,6 @@ fragment NewMarketFields on NewMarket {
# triggeringRatio
# auctionExtensionSecs
# }
lpPriceRange
# linearSlippageFactor
# quadraticSlippageFactor
}
File diff suppressed because one or more lines are too long
@@ -149,7 +149,7 @@ export const createProposalListFieldsFragment = (
enactmentDatetime: '2022-11-15T12:44:54Z',
change: {
decimalPlaces: 1,
lpPriceRange: '',
riskParameters: {
__typename: 'SimpleRiskModel',
params: {
@@ -244,7 +244,7 @@ const proposalListFields: ProposalListFieldsFragment[] = [
enactmentDatetime: '2022-11-15T12:39:51Z',
change: {
decimalPlaces: 1,
lpPriceRange: '',
riskParameters: {
__typename: 'SimpleRiskModel',
params: {
@@ -334,7 +334,7 @@ const proposalListFields: ProposalListFieldsFragment[] = [
enactmentDatetime: '2022-11-14T16:24:34Z',
change: {
decimalPlaces: 1,
lpPriceRange: '',
riskParameters: {
__typename: 'SimpleRiskModel',
params: {
@@ -424,7 +424,7 @@ const proposalListFields: ProposalListFieldsFragment[] = [
enactmentDatetime: '2022-11-11T16:32:32Z',
change: {
decimalPlaces: 1,
lpPriceRange: '',
riskParameters: {
__typename: 'SimpleRiskModel',
params: {
@@ -514,7 +514,7 @@ const proposalListFields: ProposalListFieldsFragment[] = [
enactmentDatetime: '2022-11-14T09:41:17Z',
change: {
decimalPlaces: 1,
lpPriceRange: '',
riskParameters: {
__typename: 'SimpleRiskModel',
params: {
@@ -604,7 +604,7 @@ const proposalListFields: ProposalListFieldsFragment[] = [
enactmentDatetime: '2022-11-11T16:32:32Z',
change: {
decimalPlaces: 1,
lpPriceRange: '',
riskParameters: {
__typename: 'SimpleRiskModel',
params: {
@@ -694,7 +694,7 @@ const proposalListFields: ProposalListFieldsFragment[] = [
enactmentDatetime: '2022-11-11T16:30:35Z',
change: {
decimalPlaces: 1,
lpPriceRange: '',
riskParameters: {
__typename: 'SimpleRiskModel',
params: {
@@ -784,7 +784,7 @@ const proposalListFields: ProposalListFieldsFragment[] = [
enactmentDatetime: '2022-11-11T16:30:35Z',
change: {
decimalPlaces: 1,
lpPriceRange: '',
riskParameters: {
__typename: 'SimpleRiskModel',
params: {
@@ -874,7 +874,7 @@ const proposalListFields: ProposalListFieldsFragment[] = [
enactmentDatetime: '2022-11-11T16:30:35Z',
change: {
decimalPlaces: 1,
lpPriceRange: '',
riskParameters: {
__typename: 'SimpleRiskModel',
params: {
@@ -964,7 +964,7 @@ const proposalListFields: ProposalListFieldsFragment[] = [
enactmentDatetime: '2022-11-11T16:30:35Z',
change: {
decimalPlaces: 1,
lpPriceRange: '',
riskParameters: {
__typename: 'SimpleRiskModel',
params: {
@@ -1054,7 +1054,7 @@ const proposalListFields: ProposalListFieldsFragment[] = [
enactmentDatetime: '2022-11-11T16:30:35Z',
change: {
decimalPlaces: 1,
lpPriceRange: '',
riskParameters: {
__typename: 'SimpleRiskModel',
params: {
@@ -1144,7 +1144,7 @@ const proposalListFields: ProposalListFieldsFragment[] = [
enactmentDatetime: '2022-11-11T16:30:35Z',
change: {
decimalPlaces: 1,
lpPriceRange: '',
riskParameters: {
__typename: 'SimpleRiskModel',
params: {
@@ -1234,7 +1234,7 @@ const proposalListFields: ProposalListFieldsFragment[] = [
enactmentDatetime: '2022-11-11T16:30:35Z',
change: {
decimalPlaces: 1,
lpPriceRange: '',
riskParameters: {
__typename: 'SimpleRiskModel',
params: {
+4 -4
View File
@@ -1793,8 +1793,6 @@ export type Market = {
liquidityProvisionsConnection?: Maybe<LiquidityProvisionsConnection>;
/** Optional: Liquidity SLA parameters for the market */
liquiditySLAParameters?: Maybe<LiquiditySLAParameters>;
/** Liquidity Provision order price range */
lpPriceRange: Scalars['String'];
/** Timestamps for state changes in the market */
marketTimestamps: MarketTimestamps;
/**
@@ -1916,6 +1914,8 @@ export type MarketData = {
commitments: MarketDataCommitments;
/** What extended the ongoing auction (if an auction was extended) */
extensionTrigger: AuctionTrigger;
/** The current funding rate. This applies only to a perpetual market */
fundingRate?: Maybe<Scalars['String']>;
/** Indicative price if the auction ended now, 0 if not in auction mode */
indicativePrice: Scalars['String'];
/** Indicative volume if the auction ended now, 0 if not in auction mode */
@@ -2203,8 +2203,6 @@ export type NewMarket = {
linearSlippageFactor: Scalars['String'];
/** Liquidity monitoring parameters */
liquidityMonitoringParameters: LiquidityMonitoringParameters;
/** Liquidity Provision order price range */
lpPriceRange: Scalars['String'];
/** Metadata for this instrument, tags */
metadata?: Maybe<Array<Scalars['String']>>;
/** Decimal places for order sizes, sets what size the smallest order / position on the market can be */
@@ -2469,6 +2467,8 @@ export type ObservableMarketData = {
bestStaticOfferVolume: Scalars['String'];
/** What extended the ongoing auction (if an auction was extended) */
extensionTrigger: AuctionTrigger;
/** The current funding rate. This applies only to a perpetual market */
fundingRate?: Maybe<Scalars['String']>;
/** Indicative price if the auction ended now, 0 if not in auction mode */
indicativePrice: Scalars['String'];
/** Indicative volume if the auction ended now, 0 if not in auction mode */
@@ -129,7 +129,6 @@ interface ProposalNewMarketTerms {
changes: {
decimalPlaces: string;
positionDecimalPlaces: string;
lpPriceRange: string;
linearSlippageFactor: string;
quadraticSlippageFactor: string;
instrument: {