mirror of
https://github.com/0x1d/drift-keeper.git
synced 2026-03-22 09:04:16 +01:00
* Introduce instances list to scale bots and add config templating * Use env var for wallet address if not provided as path param * Expose SOL price as metric * Update docs * Add auto-swap * Add Panopticon * implement backoff stategy in autoswap * Add retry logic for withdraw and swap * bump drift-sdk, update ctl.sh and docs * Update filler bot, add tx metrics * Add user-metrics * Update build and dashboard
43 lines
1.2 KiB
JavaScript
43 lines
1.2 KiB
JavaScript
const client = require('prom-client');
|
|
|
|
const createMetrics = () => {
|
|
const registry = new client.Registry();
|
|
|
|
const solBalanceMetric = new client.Gauge({
|
|
name: "sol_balance",
|
|
help: "SOL Balance",
|
|
labelNames: ['wallet','walletShort']
|
|
});
|
|
const usdcBalanceMetric = new client.Gauge({
|
|
name: "usdc_balance",
|
|
help: "USDC Balance",
|
|
labelNames: ['wallet','walletShort']
|
|
});
|
|
const totalCollateralMetric = new client.Gauge({
|
|
name: "total_collateral",
|
|
help: "Total Collateral",
|
|
labelNames: ['wallet','walletShort']
|
|
});
|
|
const unrealizedPNLMetric = new client.Gauge({
|
|
name: "unrealized_pnl",
|
|
help: "Unrealized PNL",
|
|
labelNames: ['wallet','walletShort']
|
|
});
|
|
|
|
registry.registerMetric(usdcBalanceMetric);
|
|
registry.registerMetric(solBalanceMetric);
|
|
registry.registerMetric(totalCollateralMetric);
|
|
registry.registerMetric(unrealizedPNLMetric);
|
|
|
|
return [registry, {
|
|
usdcBalance: usdcBalanceMetric,
|
|
solBalance: solBalanceMetric,
|
|
totalCollateral: totalCollateralMetric,
|
|
unrealizedPNL: unrealizedPNLMetric
|
|
}];
|
|
};
|
|
|
|
module.exports = {
|
|
createMetrics
|
|
}
|