Merge pull request #507 from drift-labs/master

bump staging
This commit is contained in:
jack
2025-09-17 10:43:51 +10:00
committed by GitHub
6 changed files with 10 additions and 10 deletions

View File

@@ -16,7 +16,7 @@ RUN yarn && yarn build
FROM public.ecr.aws/docker/library/node:20.18.1-alpine FROM public.ecr.aws/docker/library/node:20.18.1-alpine
RUN apk add python3 make g++ --virtual .build &&\ 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 apk del .build
COPY --from=builder /app/lib/ ./lib/ COPY --from=builder /app/lib/ ./lib/

View File

@@ -13,7 +13,8 @@ const commonConfig = {
format: 'cjs', format: 'cjs',
external: [ external: [
'bigint-buffer', 'bigint-buffer',
'@triton-one/yellowstone-grpc' '@triton-one/yellowstone-grpc',
'helius-laserstream'
] ]
}; };

View File

@@ -109,6 +109,7 @@ const endpoint = process.env.ENDPOINT;
const grpcEndpoint = useGrpc const grpcEndpoint = useGrpc
? process.env.GRPC_ENDPOINT ?? endpoint + `/${token}` ? process.env.GRPC_ENDPOINT ?? endpoint + `/${token}`
: ''; : '';
const grpcClient = process.env.GRPC_CLIENT ?? 'yellowstone'
const wsEndpoint = process.env.WS_ENDPOINT; const wsEndpoint = process.env.WS_ENDPOINT;
const useOrderSubscriber = const useOrderSubscriber =
@@ -503,6 +504,8 @@ const main = async () => {
'grpc.keepalive_timeout_ms': 1_000, 'grpc.keepalive_timeout_ms': 1_000,
'grpc.keepalive_permit_without_calls': 1, 'grpc.keepalive_permit_without_calls': 1,
}, },
client: grpcClient
}, },
commitment: stateCommitment, commitment: stateCommitment,
}; };

View File

@@ -218,14 +218,10 @@ const buildUserMarketLists = (
) )
return []; return [];
const perpPositionWithLpSettle = redisUser.user.getPerpPosition(
perpPosition.marketIndex
)[0];
const marketPnl = calculateClaimablePnl( const marketPnl = calculateClaimablePnl(
perpMarketAccount, perpMarketAccount,
usdcSpotMarket, usdcSpotMarket,
perpPositionWithLpSettle, perpPosition,
oraclePriceData oraclePriceData
); );

View File

@@ -1192,12 +1192,12 @@ export const calculateDynamicSlippage = (
// Apply multiplier from env var // Apply multiplier from env var
const multiplier = isMajor 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'); : parseFloat(process.env.DYNAMIC_SLIPPAGE_MULTIPLIER_NON_MAJOR || '1.4');
dynamicSlippage = dynamicSlippage * multiplier; dynamicSlippage = dynamicSlippage * multiplier;
// Enforce minimum and maximum limits from env vars // 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 const maxSlippage = parseFloat(process.env.DYNAMIC_SLIPPAGE_MAX || '5'); // 5% maximum
return Math.min(Math.max(dynamicSlippage, minSlippage), maxSlippage); return Math.min(Math.max(dynamicSlippage, minSlippage), maxSlippage);