Add dynamic Jupiter Perps entry price variables to alarm config #20
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 entry price variables to the Jupiter Perps Alarm application.
The alarm config should no longer need manually maintained entry price constants. Instead, the application should be able to fetch open Jupiter Perps positions for a configured wallet and update the same variable map that is also populated by the config file.
Variable model
null/ unresolved during alarm evaluation.Wallet configuration
JUPITER_PERPS_WALLETfrom the same shared variable map.Runtime entry price variables
The refresh code should create/update entry 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.
Alarm expression behavior
Refresh mechanism
WatchService.confdirectory for:Implementation
JupiterPerpsService.getOpenPositions(owner)to fetch positions.tradedTokenMinttoSOL,BTC, orETH.directiontoLONGorSHORT.*_ENTRY_PRICEvariable fromentryPrice.Non-goals
Acceptance criteria
{{JUPITER_PERPS_WALLET}}can be read from the config file.conf/jupiter-perps-alarm-var.refreshrefreshes Jupiter Perps entry price variables.