agentleFS
SKE-LabsSKE-Labs/agent-trading-skills/skills/risk-management/leverage-management/SKILL.md

leverage-management

Skill17 starsChanged 4 months agoApache-2.0View on GitHub

Calculate effective leverage, margin, stress loss, and venue-specific liquidation state. Use when sizing derivatives or managing collateral, cross/isolated margin, funding, fees, and forced-liquidation risk.

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Treat the setup as a testable hypothesis, not a prediction.

    line 50
  2. Distinctive:

    Never confuse platform maximum leverage with an acceptable exposure.

    line 58

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Leverage Management

Leverage amplifies both gains and losses -- use it responsibly.

Leverage Basics

Leverage$1,000 ControlsExposure
1x$1,000None
5x$5,0005x
10x$10,00010x
100x$100,000100x

There is no universally safe leverage by asset label or trading style. Faster intended exits do not remove gap, latency, liquidation, or venue risk. Derive exposure from maximum stress loss, maintenance margin, liquidity, and the portfolio mandate.

Key Formulas

Effective Leverage: Position Size / Account Equity

Example: $50,000 position on $10,000 equity = 5x effective leverage.

Position sizing with leverage: Position Size = (Account x Risk%) / Stop Distance%. Leverage does not change how much you risk -- it changes how much capital you tie up.

For a linear position before costs, account return is approximately effective leverage × asset return. Add contract multiplier, inverse/quanto payoff, fees, funding/interest, FX, collateral haircuts, and nonlinear option exposure as applicable.

Liquidation Awareness

Obtain the venue's actual calculator and rules: initial/maintenance tiers, mark or index price, liquidation fees, isolated versus cross margin, collateral valuation, open orders, and other positions. Record the estimated liquidation price and a stressed value after fee/funding/volatility changes. A stop can gap or fail before liquidation.

Workflow

  1. Assess volatility of the asset being traded
  2. Set exposure from mandate loss limits and shocked volatility/liquidity
  3. Calculate effective leverage -- position size / equity
  4. Verify liquidation state with the venue-specific formula and cross-position effects
  5. Maintain the mandate's margin buffer under mark-price and collateral stresses
  6. Reduce leverage in volatile conditions or after losses

Evidence and Validation

  • Treat the setup as a testable hypothesis, not a prediction. Define thresholds, entry, invalidation, and exit before evaluating outcomes.
  • Calibrate on the same instrument, venue, session, and timeframe. Use closed candles and a held-out or walk-forward sample; record every variant tried.
  • Include spread, fees, slippage, borrow or funding, partial fills, and latency. Reject the setup when net expectancy is not positive or depends on one narrow parameter.
  • Return observed inputs, missing data, cost assumptions, entry, invalidation, exit, and a valid, watch, or no-trade status.
  • Research basis: The SEC margin bulletin and CFTC crypto advisory explain that leverage amplifies losses and can require additional margin or forced closure.

Key Rules

  • Never confuse platform maximum leverage with an acceptable exposure.
  • Calculate effective leverage, stress loss, and venue-specific liquidation state before entry and after material moves.
  • Include gap, mark/index divergence, funding, interest, fee, collateral, and forced-liquidation scenarios.
  • Reduce exposure or add collateral when the approved margin buffer fails; cross margin can spread losses.
  • Position size determines risk; selecting a low leverage setting alone does not.

Related Skills

  • position-sizing -- leverage changes capital allocation but not risk amount
  • stop-loss-strategies -- stops must be set before liquidation price

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.