> ## Documentation Index
> Fetch the complete documentation index at: https://docs.extractor.live/llms.txt
> Use this file to discover all available pages before exploring further.

# Aster DEX Monitor

> Monitors Asterdex DEX for portfolio value changes and market price drops. Supports portfolio monitoring (requires API key), market monitoring (public data), or both.

Monitors Asterdex DEX for portfolio value changes and market price drops. Supports portfolio monitoring (requires API key), market monitoring (public data), or both.

## Functionality

* A monitoring service that tracks portfolio values and market prices on Aster DEX, alerting when thresholds are breached.
* Two modes: 'portfolio' (monitors account balance value) or 'market' (monitors price changes). To monitor both, create two separate detector instances with different modes.
* The monitor generates events for: portfolio value falling below threshold, significant price drops in monitored assets, and API connection errors.
* API keys are required for 'portfolio' mode. Market monitoring only uses public endpoints and doesn't require authentication.
* The detector runs on a configurable interval (default: 600 seconds / 10 minutes). You can adjust the check\_interval parameter to customize the monitoring frequency. Each check evaluates all configured conditions for portfolio thresholds and/or price drops depending on the monitoring mode. Minimum recommended: 60 seconds to avoid API rate limits.
* # SUPPORTED SYNTAX

## 1. BASIC COMPARISON OPERATORS

| Syntax | Meaning |
| - | - |
| `= value` | equals value (exact match) |
| `!= value` | not equals value (exact match) |

## 2. ABSOLUTE VALUE HANDLING

| Syntax | Meaning |
| - | - |
| `> 10` | `v > 10` **OR** `v < -10` (absolute value handling) |
| `< 25` | `\|v\| < 25` |
| `>= 35` | `\|v\| >= 35` |
| `<= 50` | `\|v\| <= 50` |

## 3. EXPLICIT SIGN HANDLING (no absolute value)

| Syntax | Meaning |
| - | - |
| `> +10` | `v > 10` (exact value, no absolute handling) |
| `> -15` | `v > -15` (exact value, no absolute handling) |
| `< +30` | `v < 30` (exact value, no absolute handling) |
| `< -20` | `v < -20` (exact value, no absolute handling) |

## 3.5. ONCE OPERATORS (edge detection – trigger only when condition transitions from false to true)

| Syntax | Meaning |
| - | - |
| `>> 10` | `v > 10` (triggers only once when condition becomes true, then false on subsequent evaluations) |
| `<< 25` | `v < 25` (triggers only once when condition becomes true, then false on subsequent evaluations) |
| `>> ++100` | increase > 100 (triggers only once when the increase condition becomes true) |
| `<< --50` | decrease > 50 (triggers only once when the decrease condition becomes true) |
| `>> 25%` | percentage change > 25% (triggers only once when condition becomes true) |
| `<< 10%` | percentage change \< 10% (triggers only once when condition becomes true) |

> **Note:**
>
> * These operators return `true` only when the condition transitions from false → true (edge detection).
> * Once true, subsequent evaluations return false even if the condition remains true.
> * Useful for detecting **threshold crossings** or **one-time events**.

## 4. PERCENTAGE OPERATIONS

| Syntax | Meaning |
| - | - |
| `> 25%` | percentage change > 25% (absolute value handling) |
| `< 10%` | percentage change \< 10% (absolute value handling) |
| `>= 50%` | percentage change >= 50% (absolute value handling) |
| `<= 75%` | percentage change \<= 75% (absolute value handling) |
| `= 100%` | percentage change = 100% (exact match) |
| `!= 200%` | percentage change != 200% (exact match) |

**Formula:** `(v - v₀) / v₀ * 100`

Examples:

* `v₀ = 1000`, `v = 700` → **-30%** (decreased by 30%)
* `v₀ = 1000`, `v = 1300` → **30%** (increased by 30%)
* `v₀ = 100`, `v = 100` → **0%** (no change)

## 5. DELTA OPERATIONS (change from previous value)

| Syntax | Meaning |
| - | - |
| `> ++100` | increase > 100 (absolute change) |
| `< --50` | decrease > 50 (magnitude of decrease) |
| `>= ++30` | increase >= 30 (absolute change) |
| `<= --25` | decrease >= 25 (magnitude of decrease) |
| `= ++20` | increase = 20 (exact change) |
| `!= ++40` | increase != 40 (exact change) |

## 6. PERCENTAGE DELTA OPERATIONS

| Syntax | Meaning |
| - | - |
| `> ++25%` | increase of percentage change > 25% |
| `< --10%` | decrease of percentage change > 10% |
| `>= ++50%` | increase of percentage change >= 50% |
| `<= --30%` | decrease of percentage change >= 30% |
| `= ++100%` | increase of percentage change = 100% |
| `!= ++200%` | increase of percentage change != 200% |

## 7. SPACES SUPPORT

| Syntax | Meaning |
| - | - |
| `> ++ 100` | increase > 100 (spaces ignored) |
| `<= -- 25` | decrease >= 25 (spaces ignored) |
| `= ++ 30.0 %` | increase = 30% (spaces ignored) |

## NOTES

* `=` and `!=` always use **exact value matching**

* `>`, `<`, `>=`, `<=` respect **absolute value handling**

* `>>`, `<<` (once operators) trigger only on **false → true** transitions

* `++`, `--` (delta operations) work with all comparison operators (including once operators)

* Percentage operations are compatible with all comparison operators

* **Spaces are ignored** during parsing

* The `abs` parameter is automatically detected:
  * `+` / `-` prefixes **disable** absolute value handling

* Once operators trigger only when a condition transitions from false to true (edge detection). For example, '>> 5%' triggers when portfolio change exceeds 5%, but won't trigger again until the change drops below 5% and then exceeds it again. This prevents repeated alerts for the same event. Use > instead of >> if you want alerts every check while the condition is true.

* Use the 'Mock Account Data' field to provide a JSON string with fake balance data. When set, the detector skips the /api/v1/account API call and uses your mock data instead. Price data is still fetched from real public endpoints. Format: `{"balances": [{"asset": "BTC", "free": "100", "locked": "0"}]}`

## Configuration

* **API Key (Portfolio mode)** (`api_key`, default: `None`): Asterex API key for authentication
* **API Secret (Portfolio mode)** (`api_secret`, default: `None`): Asterex API secret for HMAC SHA256 signature
* **Check Interval (seconds)** (`check_interval`, default: `600`): Time interval between monitoring checks in seconds. Default is 600 seconds (10 minutes). Minimum recommended: 60 seconds to avoid API rate limits.
* **Monitoring Mode** (`monitoring_mode`, default: `portfolio`): Monitoring mode: 'portfolio' or 'market'
* **Monitored Assets - Market mode** (`monitored_assets`, default: `[{'asset': 'BTC', 'condition': '>> 10'}, {'asset': 'BNB', 'condition': '> 5%'}]`): List of assets to monitor with flexible conditions (only used in market mode). Each asset has its own condition. Not needed for portfolio mode.
* **Mock Account Data (Testing Only) - Portfolio mode** (`mock_account_data`, default: `None`): Optional JSON string with mock account balance data for testing. When provided, skips the /api/v1/account API call. Format: `{"balances": [{"asset": "BTC", "free": "100", "locked": "0"}]}`
* **Portfolio Condition - Portfolio mode** (`portfolio_condition`, default: `>> 5%`): Flexible condition using Scala SDK syntax. Examples: >> 5% (alert once when portfolio drops >5%), > 10% (alert every time portfolio changes >10%), \< 10000000 (alert when below $10M), >> ++1000000 (alert once when portfolio increases >$1M)

> [!NOTE]
>
> Supported networks: evm.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.