Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/src/exchanges/opinion/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const DEFAULT_OPINION_API_URL = "https://proxy.opinion.trade:8443/openapi";
export const OPINION_WS_URL = "wss://ws.opinion.trade";
export const DEFAULT_OPINION_API_URL = process.env.OPINION_API_URL || "https://proxy.opinion.trade:8443/openapi";
export const OPINION_WS_URL = process.env.OPINION_WS_URL || "wss://ws.opinion.trade";
export const OPINION_MAX_PAGE_SIZE = 20;

// CLOB SDK chain constants
Expand Down
2 changes: 1 addition & 1 deletion core/src/router/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {
RouterEventSearchParams,
} from './types';

const DEFAULT_BASE_URL = 'https://api.pmxt.dev';
const DEFAULT_BASE_URL = process.env.PMXT_API_URL || 'https://api.pmxt.dev';

export class PmxtApiClient {
private readonly http: AxiosInstance;
Expand Down
9 changes: 6 additions & 3 deletions core/src/subscriber/external/goldsky.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,12 @@ export interface GoldSkyConfig extends Omit<SubscriberConfig, 'buildSubscription
// ----------------------------------------------------------------------------

// Reference: https://docs.polymarket.com/market-data/subgraph
const POLYMARKET_TRADES_ENDPOINT =
const POLYMARKET_TRADES_ENDPOINT = process.env.POLYMARKET_GOLDSKY_URL ||
'https://api.goldsky.com/api/public/project_cl6mb8i9h0003e201j6li0diw/subgraphs/orderbook-subgraph/prod/gn';

const GOLDSKY_MAKER_TRADES_LIMIT = 5;
const GOLDSKY_TAKER_TRADES_LIMIT = 20;

// NOTE: orderBy must use `id` (primary key) on pnl-subgraph and positions-subgraph.
// Sorting by any unindexed column (e.g. amount, balance) causes a statement timeout.

Expand All @@ -80,7 +83,7 @@ const BUILD_POLYMARKET_TRADES_AS_MAKER_QUERY = (address: string, url?: string):
query GetPolymarketTradesMaker($address: Bytes!) {
orderFilledEvents(
where: { maker: $address }
first: 5
first: ${GOLDSKY_MAKER_TRADES_LIMIT}
orderBy: timestamp
orderDirection: desc
) {${TRADES_FIELDS}
Expand All @@ -96,7 +99,7 @@ const BUILD_POLYMARKET_TRADES_AS_TAKER_QUERY = (address: string, url?: string):
query GetPolymarketTradesTaker($address: Bytes!) {
orderFilledEvents(
where: { taker: $address }
first: 20
first: ${GOLDSKY_TAKER_TRADES_LIMIT}
orderBy: timestamp
orderDirection: desc
) {${TRADES_FIELDS}
Expand Down
Loading