Update healthcheck and display pnl on trades
This commit is contained in:
@@ -131,11 +131,17 @@ const plugin: FastifyPluginAsyncTypebox = async (fastify) => {
|
||||
const marketsInfo = await sdk.markets.getMarketsInfo();
|
||||
const responseTime = Date.now() - startTime;
|
||||
|
||||
// Get the uiFeeFactor
|
||||
const uiFeeFactor = await sdk.utils.getUiFeeFactor();
|
||||
|
||||
if (!marketsInfo.marketsInfoData || Object.keys(marketsInfo.marketsInfoData).length === 0) {
|
||||
return {
|
||||
status: 'degraded',
|
||||
message: 'GMX SDK returned empty markets info data',
|
||||
data: { responseTimeMs: responseTime }
|
||||
data: {
|
||||
responseTimeMs: responseTime,
|
||||
uiFeeFactor: uiFeeFactor.toString()
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -168,7 +174,8 @@ const plugin: FastifyPluginAsyncTypebox = async (fastify) => {
|
||||
message: 'ETH market not found in GMX markets data',
|
||||
data: {
|
||||
availableMarkets: marketInfoDetails,
|
||||
responseTimeMs: responseTime
|
||||
responseTimeMs: responseTime,
|
||||
uiFeeFactor: uiFeeFactor.toString()
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -179,7 +186,8 @@ const plugin: FastifyPluginAsyncTypebox = async (fastify) => {
|
||||
data: {
|
||||
marketCount: Object.keys(marketsInfo.marketsInfoData).length,
|
||||
responseTimeMs: responseTime,
|
||||
sampleMarkets: marketInfoDetails.slice(0, 3) // Just include first 3 markets for brevity
|
||||
sampleMarkets: marketInfoDetails.slice(0, 3), // Just include first 3 markets for brevity
|
||||
uiFeeFactor: uiFeeFactor.toString()
|
||||
}
|
||||
};
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user