Compare commits

...
Author SHA1 Message Date
Madalina Raicu 87f62c08b7 fix: position dp in sub 2023-01-26 19:22:21 +00:00
4 changed files with 6 additions and 1 deletions
+1
View File
@@ -1,6 +1,7 @@
query Chart($marketId: ID!) { query Chart($marketId: ID!) {
market(id: $marketId) { market(id: $marketId) {
decimalPlaces decimalPlaces
positionDecimalPlaces
data { data {
priceMonitoringBounds { priceMonitoringBounds {
minValidPrice minValidPrice
+2 -1
View File
@@ -8,13 +8,14 @@ export type ChartQueryVariables = Types.Exact<{
}>; }>;
export type ChartQuery = { __typename?: 'Query', market?: { __typename?: 'Market', decimalPlaces: number, data?: { __typename?: 'MarketData', priceMonitoringBounds?: Array<{ __typename?: 'PriceMonitoringBounds', minValidPrice: string, maxValidPrice: string, referencePrice: string }> | null } | null } | null }; export type ChartQuery = { __typename?: 'Query', market?: { __typename?: 'Market', decimalPlaces: number, positionDecimalPlaces: number, data?: { __typename?: 'MarketData', priceMonitoringBounds?: Array<{ __typename?: 'PriceMonitoringBounds', minValidPrice: string, maxValidPrice: string, referencePrice: string }> | null } | null } | null };
export const ChartDocument = gql` export const ChartDocument = gql`
query Chart($marketId: ID!) { query Chart($marketId: ID!) {
market(id: $marketId) { market(id: $marketId) {
decimalPlaces decimalPlaces
positionDecimalPlaces
data { data {
priceMonitoringBounds { priceMonitoringBounds {
minValidPrice minValidPrice
+1
View File
@@ -20,6 +20,7 @@ export const chartQuery = (override?: PartialDeep<ChartQuery>): ChartQuery => {
const defaultResult: ChartQuery = { const defaultResult: ChartQuery = {
market: { market: {
decimalPlaces: 5, decimalPlaces: 5,
positionDecimalPlaces: 0,
data: { data: {
priceMonitoringBounds: [priceMonitoringBound], priceMonitoringBounds: [priceMonitoringBound],
__typename: 'MarketData', __typename: 'MarketData',
@@ -102,9 +102,11 @@ export class VegaDataSource implements DataSource {
if (data && data.market && data.market.data) { if (data && data.market && data.market.data) {
this._decimalPlaces = data.market.decimalPlaces; this._decimalPlaces = data.market.decimalPlaces;
this._positionDecimalPlaces = data.market.positionDecimalPlaces;
return { return {
decimalPlaces: this._decimalPlaces, decimalPlaces: this._decimalPlaces,
positionDecimalPlaces: this._positionDecimalPlaces,
supportedIntervals: [ supportedIntervals: [
PennantInterval.I1D, PennantInterval.I1D,
PennantInterval.I6H, PennantInterval.I6H,