Development of Exposure Control System
Exposure is the aggregate market exposure of the portfolio: how much is invested relative to capital. Exposure control prevents portfolio overload in one direction, one asset, or one sector.
Types of Exposure
Gross exposure: sum of absolute values of all positions / capital. With long $60k and short $40k: gross = $100k.
Net exposure: (longs − shorts) / capital. Pure market direction. Neutral portfolio: net = 0%.
Sector exposure: aggregate position in one sector (DeFi, Layer-1, memes, stablecoins).
Single asset exposure: share of one asset in portfolio.
Limits System
@dataclass
class ExposureLimits:
max_gross_exposure: float = 2.0 # 200% (with leverage)
max_net_exposure: float = 0.80 # 80% net in one direction
max_single_asset: float = 0.20 # 20% in one asset
max_sector: float = 0.40 # 40% in one sector
max_correlated_group: float = 0.35 # 35% in highly correlated assets
class ExposureController:
def __init__(self, limits: ExposureLimits, sector_map: dict):
self.limits = limits
self.sector_map = sector_map # symbol -> sector
def check_new_position(self, new_position, current_positions, capital):
violations = []
# Calculate exposure after adding new position
all_positions = current_positions + [new_position]
gross = sum(abs(p.value) for p in all_positions) / capital
if gross > self.limits.max_gross_exposure:
violations.append(f"Gross exposure {gross:.0%} > limit {self.limits.max_gross_exposure:.0%}")
net = sum(p.value for p in all_positions) / capital # + for long, - for short
if abs(net) > self.limits.max_net_exposure:
violations.append(f"Net exposure {net:.0%} > limit")
# Single asset check
asset_exposure = sum(
abs(p.value) for p in all_positions
if p.symbol == new_position.symbol
) / capital
if asset_exposure > self.limits.max_single_asset:
violations.append(f"Single asset {new_position.symbol}: {asset_exposure:.0%}")
# Sector check
sector = self.sector_map.get(new_position.symbol, 'other')
sector_exposure = sum(
abs(p.value) for p in all_positions
if self.sector_map.get(p.symbol) == sector
) / capital
if sector_exposure > self.limits.max_sector:
violations.append(f"Sector {sector}: {sector_exposure:.0%}")
return len(violations) == 0, violations
Real-time Monitoring
Exposure is recalculated with each position change or significant price change (>2%). Dashboard shows:
- Current gross/net exposure
- Breakdown by sectors (pie chart)
- Top-5 largest positions
- Exposure trend for last 24h
Delta-Neutral Monitoring
For strategies using spot + futures (hedge):
Portfolio delta = net USD exposure. Should be close to 0 when hedged. Hedge ratio monitoring: as price changes hedge ratio shifts, rebalancing needed.
We integrate exposure control as middleware before each order — checking before execution. Realtime dashboard + Telegram alerts when approaching limits.







