Add dynamic Jupiter Perps liquidation price variables to alarm config #25

Open
opened 2026-06-30 07:10:27 +02:00 by minimons · 0 comments
Owner

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:

{{SOL_LONG_LIQ_PRICE}}
{{SOL_SHORT_LIQ_PRICE}}
{{BTC_LONG_LIQ_PRICE}}
{{BTC_SHORT_LIQ_PRICE}}
{{ETH_LONG_LIQ_PRICE}}
{{ETH_SHORT_LIQ_PRICE}}

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

  • Use JupiterPerpsService.getOpenPositions(owner) through the existing refresh flow.
  • Map tradedTokenMint to SOL, BTC, or ETH.
  • Map direction to LONG or SHORT.
  • Populate the matching *_LIQ_PRICE variable from liquidationPrice.
  • Remove stale liquidation price variables before inserting refreshed values, but only after a successful fetch.
  • Keep the existing entry price variable refresh behavior unchanged.

Non-goals

  • No liquidation price calculation in this issue.
  • No changes to alarm rule parsing.
  • No alarm rule reload.
  • No AssetAZ/Evelyn integration.
  • No trading or transaction signing.

Prerequisites

This issue depends on liquidationPrice being available in JupiterPerpsPosition.

Acceptance criteria

  • Liquidation price variables can be used in alarm target expressions without being manually maintained in the config file.
  • Touching conf/jupiter-perps-alarm-var.refresh refreshes both entry price and liquidation price variables.
  • Existing *_ENTRY_PRICE refresh behavior still works.
  • If a position is missing, affected alarm evaluations log errors without stopping the application.
  • If Jupiter fetch fails, previous variable values are kept.
  • Project compiles.
### 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: ```text {{SOL_LONG_LIQ_PRICE}} {{SOL_SHORT_LIQ_PRICE}} {{BTC_LONG_LIQ_PRICE}} {{BTC_SHORT_LIQ_PRICE}} {{ETH_LONG_LIQ_PRICE}} {{ETH_SHORT_LIQ_PRICE}} ``` 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 * Use `JupiterPerpsService.getOpenPositions(owner)` through the existing refresh flow. * Map `tradedTokenMint` to `SOL`, `BTC`, or `ETH`. * Map `direction` to `LONG` or `SHORT`. * Populate the matching `*_LIQ_PRICE` variable from `liquidationPrice`. * Remove stale liquidation price variables before inserting refreshed values, but only after a successful fetch. * Keep the existing entry price variable refresh behavior unchanged. ### Non-goals * No liquidation price calculation in this issue. * No changes to alarm rule parsing. * No alarm rule reload. * No AssetAZ/Evelyn integration. * No trading or transaction signing. ### Prerequisites This issue depends on `liquidationPrice` being available in `JupiterPerpsPosition`. ### Acceptance criteria * Liquidation price variables can be used in alarm target expressions without being manually maintained in the config file. * Touching `conf/jupiter-perps-alarm-var.refresh` refreshes both entry price and liquidation price variables. * Existing `*_ENTRY_PRICE` refresh behavior still works. * If a position is missing, affected alarm evaluations log errors without stopping the application. * If Jupiter fetch fails, previous variable values are kept. * Project compiles.
minimons added the enhancement label 2026-06-30 07:10:27 +02:00
minimons self-assigned this 2026-06-30 07:10:27 +02:00
minimons added this to the AssetAZ project 2026-06-30 07:10:27 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: r35157/com_r35157_nenjim-hubd-impl_ref#25