Add dynamic Jupiter Perps liquidation price variables to alarm config #25
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Add runtime-updated Jupiter Perps liquidation price variables to the Jupiter Perps Alarm application.
The alarm config should no longer need manually maintained liquidation price constants. Instead, the application should fetch open Jupiter Perps positions for the configured wallet and update liquidation price variables in the shared variable map.
This should work the same way as the existing dynamic entry price variables.
Runtime liquidation price variables
The refresh code should create/update liquidation price variables based on the currently open Jupiter Perps positions.
Expected variable names:
Only variables for positions that actually exist need to be created or updated. If no matching position exists, no variable should be created for that position.
Required changes
JupiterPerpsService.getOpenPositions(owner)through the existing refresh flow.tradedTokenMinttoSOL,BTC, orETH.directiontoLONGorSHORT.*_LIQ_PRICEvariable fromliquidationPrice.Non-goals
Prerequisites
This issue depends on
liquidationPricebeing available inJupiterPerpsPosition.Acceptance criteria
conf/jupiter-perps-alarm-var.refreshrefreshes both entry price and liquidation price variables.*_ENTRY_PRICErefresh behavior still works.