Surviving the Bad Moments
Crypto agents face an asymmetric reality: bull markets reward patience and long exposure, but bear markets and black swan events can erase months of accumulated gains in a matter of hours. A 50% portfolio drawdown requires a 100% recovery just to break even. This mathematical asymmetry is why professional traders treat risk management โ specifically, hedging โ as more important than entry strategy.
Systematic hedging does not mean eliminating all risk. That would also eliminate all returns. It means protecting against the scenarios that would force you to close positions or stop operating โ while preserving full upside during normal market conditions. An agent that survives a crash and keeps operating is in a fundamentally better position than one that earned more during the bull but got wiped out.
Hedging vs Risk Reduction
These two concepts are often conflated but represent distinct approaches:
- Risk reduction means taking smaller positions, diversifying across uncorrelated assets, or holding more cash. It lowers your total exposure but also lowers your expected return proportionally.
- Hedging means adding a specific offset position that profits when your main position loses. A good hedge can protect against a tail risk scenario while costing only a fraction of the protected value โ preserving most of the upside.
Smart agents combine both: size positions appropriately (risk reduction) and add targeted hedges for specific scenarios they cannot afford to lose to (hedging).
Hedge Type 1: Delta Hedging (Continuous)
Delta measures how much your portfolio value changes for a $1 move in the underlying asset. A portfolio of 10 ETH has a delta of 10 โ if ETH moves $1, the portfolio moves $10. Delta hedging adjusts this exposure to a target level.
A common approach: hold 1 ETH long on spot, short 0.5 ETH-PERP. Net delta = 0.5. If ETH falls 20%, you lose 0.5 ETH worth of value instead of 1 ETH. As prices move, the agent continuously rebalances the perp short to maintain the target delta.
Python implementation using Purple Flea's portfolio and trading APIs:
import requests
import time
PF_BASE = "https://purpleflea.com/api/v1"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}
class HedgeManager:
def __init__(self, target_delta: float = 0.5, tolerance: float = 0.05):
self.target_delta = target_delta
self.tolerance = tolerance # 5% tolerance band before rehedging
def get_current_delta(self) -> float:
portfolio = requests.get(
f"{PF_BASE}/portfolio/balances", headers=HEADERS
).json()
return portfolio["net_delta"]
def get_portfolio_value_usd(self) -> float:
portfolio = requests.get(
f"{PF_BASE}/portfolio/balances", headers=HEADERS
).json()
return portfolio["total_value_usd"]
def hedge_to_target(self):
current = self.get_current_delta()
delta_diff = current - self.target_delta
if abs(delta_diff) < self.tolerance:
return # Within tolerance band, no action needed
portfolio_value = self.get_portfolio_value_usd()
side = "short" if delta_diff > 0 else "long"
size_usd = abs(delta_diff) * portfolio_value
print(f"[HEDGE] Delta: {current:.3f} โ {self.target_delta}. "
f"Placing {side} BTC-PERP ${size_usd:,.0f}")
requests.post(
f"{PF_BASE}/trade",
json={"symbol": "BTC-PERP", "side": side, "size_usd": size_usd},
headers=HEADERS
)
if __name__ == "__main__":
manager = HedgeManager(target_delta=0.5)
while True:
manager.hedge_to_target()
time.sleep(300) # Recheck every 5 minutes
Hedge Type 2: Put Options for Tail Risk
Out-of-the-money (OTM) put options are the most efficient instrument for tail risk protection. A put option gives you the right to sell an asset at a fixed price (the strike) until expiration. If the market crashes below the strike, your put increases in value โ often dramatically.
A typical tail hedge: buy 30-day BTC puts at 20% below current price. Cost is approximately 1โ3% of protected portfolio value per month. In a normal month, the puts expire worthless and you lose the premium. In a crash month (BTC -40%), the puts pay out 2โ3x their cost, protecting your portfolio against catastrophic drawdown.
This is asymmetric insurance: small regular losses in exchange for large payout in rare, catastrophic scenarios. For agents with large unrealized gains โ or agents whose continued operation depends on not losing capital โ tail protection via puts is essential.
Buy puts when volatility (IV) is low. When IV is low, options are cheap relative to their protection value. When IV is high (after a crash), everyone wants puts and they are expensive. The best time to buy insurance is when you feel you do not need it.
Hedge Type 3: Portfolio Beta Reduction
Most altcoins have a beta greater than 1.0 relative to BTC โ meaning they fall harder than BTC in a downturn. An altcoin portfolio with an average beta of 1.5 will lose 30% when BTC falls 20%. This amplified volatility can be managed by shorting BTC-PERP proportional to the portfolio's altcoin exposure.
To target a portfolio beta of 0.5 with $50,000 in altcoins at average beta 1.5, an agent needs to short $25,000 worth of BTC-PERP (bringing net beta from 1.5 to approximately 0.75, then adding the short brings it to ~0.5). The calculation:
def calculate_hedge_size(
portfolio_value: float,
current_beta: float,
target_beta: float,
btc_price: float
) -> dict:
"""Calculate BTC-PERP short size to reduce portfolio beta."""
beta_to_reduce = current_beta - target_beta
hedge_value_usd = portfolio_value * beta_to_reduce
btc_contracts = hedge_value_usd / btc_price
return {
"hedge_value_usd": hedge_value_usd,
"btc_contracts": round(btc_contracts, 4),
"resulting_beta": target_beta,
"action": f"Short {btc_contracts:.4f} BTC-PERP (${hedge_value_usd:,.0f})"
}
# Example
result = calculate_hedge_size(
portfolio_value=50_000,
current_beta=1.5,
target_beta=0.5,
btc_price=78_000
)
print(result["action"])
# โ Short 0.6410 BTC-PERP ($50,000)
Hedge Type 4: Volatility Hedging
Volatility is itself an asset class that can be traded. When volatility is low (quiet market), options are cheap and a straddle (buying both call and put at the same strike) will profit from any large move in either direction. When volatility is high, the agent can sell options to collect premium (theta income) from an inflated volatility environment.
Implied Volatility (IV) rank measures current IV relative to its own 52-week range. IV rank of 20 means IV is in the 20th percentile of the past year โ cheap. IV rank of 80 means IV is expensive.
| IV Rank | Volatility State | Recommended Action |
|---|---|---|
| 0โ25 | Cheap volatility | Buy straddles / protective puts |
| 25โ60 | Normal | Directional trades only |
| 60โ100 | Expensive volatility | Sell covered calls / iron condors |
When NOT to Hedge
Hedging has costs. An agent should avoid hedging in these situations:
- When hedge cost exceeds expected benefit: If put options cost 5% monthly but your expected portfolio volatility loss is 2%, the hedge destroys value.
- When correlations break down: During liquidity crises, "safe haven" assets can be sold alongside risk assets. Hedges built on correlation assumptions can fail exactly when needed most.
- When already diversified: A portfolio split across 20 uncorrelated assets has natural internal hedging. Adding additional hedging costs money without much benefit.
- When position sizes are small: Below $5,000 in total exposure, hedge transaction costs are proportionally too high to justify.
Building a Hedged Agent
The most robust approach combines multiple hedge types: continuous delta management for daily market moves, periodic put buying for tail protection, and beta adjustment when altcoin exposure is high. Each hedge layer has a different cost structure and protects against a different scenario.
Start simple: implement delta hedging first, since it requires no options knowledge and provides meaningful daily protection. Add put hedging once the agent is consistently profitable and has capital worth protecting.