@@ -16,7 +16,7 @@ RUN yarn && yarn build
|
||||
|
||||
FROM public.ecr.aws/docker/library/node:20.18.1-alpine
|
||||
RUN apk add python3 make g++ --virtual .build &&\
|
||||
npm install -C /lib bigint-buffer @triton-one/yellowstone-grpc@1.3.0 &&\
|
||||
npm install -C /lib bigint-buffer @triton-one/yellowstone-grpc@1.3.0 helius-laserstream &&\
|
||||
apk del .build
|
||||
|
||||
COPY --from=builder /app/lib/ ./lib/
|
||||
|
||||
Submodule drift-common updated: bbf31370e3...1c5cc61b82
@@ -13,7 +13,8 @@ const commonConfig = {
|
||||
format: 'cjs',
|
||||
external: [
|
||||
'bigint-buffer',
|
||||
'@triton-one/yellowstone-grpc'
|
||||
'@triton-one/yellowstone-grpc',
|
||||
'helius-laserstream'
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
@@ -109,6 +109,7 @@ const endpoint = process.env.ENDPOINT;
|
||||
const grpcEndpoint = useGrpc
|
||||
? process.env.GRPC_ENDPOINT ?? endpoint + `/${token}`
|
||||
: '';
|
||||
const grpcClient = process.env.GRPC_CLIENT ?? 'yellowstone'
|
||||
|
||||
const wsEndpoint = process.env.WS_ENDPOINT;
|
||||
const useOrderSubscriber =
|
||||
@@ -503,6 +504,8 @@ const main = async () => {
|
||||
'grpc.keepalive_timeout_ms': 1_000,
|
||||
'grpc.keepalive_permit_without_calls': 1,
|
||||
},
|
||||
client: grpcClient
|
||||
|
||||
},
|
||||
commitment: stateCommitment,
|
||||
};
|
||||
|
||||
@@ -218,14 +218,10 @@ const buildUserMarketLists = (
|
||||
)
|
||||
return [];
|
||||
|
||||
const perpPositionWithLpSettle = redisUser.user.getPerpPosition(
|
||||
perpPosition.marketIndex
|
||||
)[0];
|
||||
|
||||
const marketPnl = calculateClaimablePnl(
|
||||
perpMarketAccount,
|
||||
usdcSpotMarket,
|
||||
perpPositionWithLpSettle,
|
||||
perpPosition,
|
||||
oraclePriceData
|
||||
);
|
||||
|
||||
|
||||
@@ -1192,12 +1192,12 @@ export const calculateDynamicSlippage = (
|
||||
|
||||
// Apply multiplier from env var
|
||||
const multiplier = isMajor
|
||||
? parseFloat(process.env.DYNAMIC_SLIPPAGE_MULTIPLIER_MAJOR || '1.02')
|
||||
? parseFloat(process.env.DYNAMIC_SLIPPAGE_MULTIPLIER_MAJOR || '1.01')
|
||||
: parseFloat(process.env.DYNAMIC_SLIPPAGE_MULTIPLIER_NON_MAJOR || '1.4');
|
||||
dynamicSlippage = dynamicSlippage * multiplier;
|
||||
|
||||
// Enforce minimum and maximum limits from env vars
|
||||
const minSlippage = parseFloat(process.env.DYNAMIC_SLIPPAGE_MIN || '0.05'); // 0.05% minimum
|
||||
const minSlippage = parseFloat(process.env.DYNAMIC_SLIPPAGE_MIN || '0.035'); // 0.035% minimum
|
||||
const maxSlippage = parseFloat(process.env.DYNAMIC_SLIPPAGE_MAX || '5'); // 5% maximum
|
||||
|
||||
return Math.min(Math.max(dynamicSlippage, minSlippage), maxSlippage);
|
||||
|
||||
Reference in New Issue
Block a user