OS Trading Engine
Getting Started
Core Concepts
Risk Management

Risk Management

Nexgent provides two primary risk management tools: Stop Loss to limit downside and DCA (Dollar Cost Averaging) to average into positions.


Overview

FeaturePurposeWhen It Triggers
Stop LossLimit lossesPrice drops below threshold
DCALower average costPrice drops to configured levels

Both features are configurable per agent and can be enabled/disabled independently.


Stop Loss

What It Is

Stop loss automatically sells a position when the price drops below a configured threshold, limiting your losses.

How It Works

  1. Track peak price - Highest price since purchase
  2. Calculate threshold - Based on mode and configuration
  3. Evaluate on every price update - Sub-second checks
  4. Trigger sell - When current price ≤ threshold

Stop Loss Modes

Nexgent offers four stop loss calculation modes:

1. Fixed Mode

Linear steps based on price increase:

Stop Loss = Price Change - 10%
Price ChangeStop Loss (Keep %)
+10%Keep 0% (break even)
+50%Keep 40%
+100%Keep 90%
+200%Keep 190%

Best for: Simple, predictable protection

2. Exponential Mode

Starts loose, gets tighter as gains increase:

Stop Loss = 100 - (100 × e^(-change/50))
Price ChangeStop Loss (Keep %)
+25%Keep ~39%
+50%Keep ~63%
+100%Keep ~86%
+200%Keep ~98%

Best for: Letting winners run while protecting large gains

3. Zones Mode

Step-based zones with different keep percentages:

ZonePrice ChangeKeep %
Zone 110-50%60%
Zone 250-100%70%
Zone 3100-200%80%
Zone 4200-500%85%
Zone 5500%+90%

Best for: Balanced approach with clear levels

4. Custom Mode

Define your own trailing levels:

trailingLevels: [
  { change: 200, stopLoss: 90 },  // At 200%+, keep 90%
  { change: 100, stopLoss: 80 },  // At 100%+, keep 80%
  { change: 50, stopLoss: 40 },   // At 50%+, keep 40%
  { change: 10, stopLoss: 5 },    // At 10%+, keep 5%
]

Best for: Traders with specific strategies

Default Stop Loss

Before any price increase, the default stop loss applies:

stopLoss: {
  enabled: true,
  defaultPercentage: -32,  // Sell at 32% loss
  mode: 'fixed'
}

This means: if price drops 32% from purchase before any gains, sell.

Configuration Example

stopLoss: {
  enabled: true,
  defaultPercentage: -32,
  mode: 'exponential',
  trailingLevels: []  // Not used in exponential mode
}

DCA (Dollar Cost Averaging)

What It Is

DCA automatically buys more of a token when its price drops, lowering your average cost basis.

How It Works

  1. Monitor price vs average - Track current price against your average purchase price
  2. Check DCA levels - Has price dropped to a configured level?
  3. Execute buy - Purchase more tokens
  4. Update average - Recalculate weighted average price

DCA Modes

1. Aggressive Mode

Tighter levels, more frequent DCAs:

Drop %Buy % of Position
-10%50%
-20%50%
-30%50%
-40%50%

Best for: High conviction plays, averaging aggressively

2. Moderate Mode (Default)

Balanced approach:

Drop %Buy % of Position
-15%50%
-30%50%
-45%50%

Best for: Most traders

3. Conservative Mode

Wider levels, fewer DCAs:

Drop %Buy % of Position
-20%50%
-40%50%

Best for: Lower risk tolerance

4. Custom Mode

Define your own levels:

levels: [
  { dropPercent: -15, buyPercent: 30 },
  { dropPercent: -30, buyPercent: 40 },
  { dropPercent: -50, buyPercent: 50 },
]

DCA Safeguards

Max DCA Count

Limits how many times you can DCA into a position:

dca: {
  maxDCACount: 3  // Maximum 3 additional buys
}

This prevents unlimited buying into a "falling knife."

Cooldown Period

Minimum time between DCAs:

dca: {
  cooldownSeconds: 30  // Wait 30 seconds between DCAs
}

Prevents rapid-fire DCAs during volatile price swings.

Configuration Example

dca: {
  enabled: true,
  mode: 'moderate',
  levels: [],  // Not used in preset modes
  maxDCACount: 3,
  cooldownSeconds: 30
}

Stop Loss vs DCA

These features have opposite behaviors:

ScenarioStop LossDCA
Price dropsSell (limit loss)Buy (lower average)
Price risesTrail higherNo action
GoalProtect capitalImprove entry

Can You Use Both?

Yes! They work together:

  1. Price drops 15% → DCA triggers (buy more)
  2. Price drops 32% from new average → Stop loss triggers (sell all)

This allows you to average down on dips while still having downside protection.


Practical Examples

Example 1: Conservative Setup

"I want minimal risk"

{
  stopLoss: {
    enabled: true,
    defaultPercentage: -20,  // Tight stop
    mode: 'fixed'
  },
  dca: {
    enabled: false  // No DCA, just cut losses
  }
}

Example 2: Aggressive Setup

"I have high conviction and want to average down"

{
  stopLoss: {
    enabled: true,
    defaultPercentage: -50,  // Wide stop
    mode: 'exponential'
  },
  dca: {
    enabled: true,
    mode: 'aggressive',
    maxDCACount: 4
  }
}

Example 3: Balanced Setup

"Standard risk management"

{
  stopLoss: {
    enabled: true,
    defaultPercentage: -32,
    mode: 'zones'
  },
  dca: {
    enabled: true,
    mode: 'moderate',
    maxDCACount: 2
  }
}

Configuring in the Dashboard

  1. Navigate to Agent Profile in the sidebar
  2. Under Trading Strategy, select the Stop Loss tab to configure stop loss settings
  3. Under Trading Strategy, select the DCA tab to configure DCA settings
  4. Modify settings as needed

All changes auto-save automatically. You'll see "Saving...", "Saved", or "Save failed" indicators.


Best Practices

Stop Loss

  1. Always enable stop loss - Even a wide stop is better than none
  2. Match to volatility - Tighter for stable tokens, wider for volatile
  3. Consider the token - Some tokens are more volatile than others
  4. Review and adjust - Check if your stops are triggering too early or too late

DCA

  1. Don't over-DCA - Set reasonable maxDCACount limits
  2. Consider total exposure - DCA increases your position size
  3. Use cooldowns - Prevent emotional rapid-fire buying
  4. Have conviction - Only DCA into positions you believe will recover

General

  1. Test in simulation - See how your settings perform
  2. Review historical swaps - Learn from past trades
  3. Adjust based on results - Optimize over time
  4. Don't override - Let the system work as configured

FAQ

What if stop loss and DCA conflict?

They don't directly conflict. DCA adds to your position, then stop loss is calculated against your new average price.

Can I disable both?

Yes, but not recommended. Without stop loss, losses are unlimited.

How is the stop loss price calculated?

Stop Price = Peak Price × (Stop Loss % / 100)

Example: Peak = $1.00, Stop Loss = 85% → Sells at $0.85

Does DCA update my average price?

Yes. After each DCA:

New Average = Total SOL Invested / Total Tokens Held