Hyperliquid Funding Farming
monies stuff
Uhhh
The target audience of this writeup is me.
Before putting large (to me) sums of money behind my semi-vibe-coded, automated financial code, I like to at least be under the illusion that I understand all the risks involved.
A writeup like this gives me space to justify my reasoning, write down the math, and connect all the moving parts together in a coherent manner.
This then gives me confidence to press submit on what is really just a high stakes math problem.
I have published this online mostly because I am trying to pad my public facing writing. And, because it is a somewhat interesting topic that I had fun working on over a couple of days.
Anyway, the rest of this write-up will be me explaining why I think managing a 20+% APY hedged delta neutral position on Hyperliquid isn't as risky as it sounds.
Hyperliquid
I have been adjacently interested in decentralized financial markets on and off for a couple of years now.
While interesting the learn about, the utility of these markets has thus far focused on providing sophisticated investors with opportunities to participate in complex derivative markets such as, 10x leveraged FARTCOIN Perpetuals.
Hyperliquid now provides a decentralized platform to trade
is like a high stakes math problem. It has its own thrill to it.
and when I have money on the line, helps me sleep a bit better.
gives me confidence that I understand the risks associated
I have been interested in decentralized financial markets for a
Geeps slop
I run a HYPE funding-carry strategy on Hyperliquid: I hold HYPE spot and short approximately the same quantity of HYPE perpetual futures. The short receives funding when funding is positive, while the spot position offsets most of the short's exposure to HYPE's price.
Portfolio margin makes the trade more capital-efficient by allowing the HYPE collateral to support USDC borrowing and the perpetual position. Borrowing lets me run a larger matched position than I could otherwise afford.
The economic objective is:
$$ \text{profit}
\text{funding received} + \text{eligible supply interest}
\text{borrowing interest}
\text{trading costs} + \text{residual price/basis P&L}. $$
Matching the quantities removes much of the ordinary directional price exposure. It does not remove financing risk, liquidation risk, execution risk, or dependence on Hyperliquid.
This explanation distinguishes between accounting identities, simplifying assumptions, and the behaviour of the local implementation inspected on 3 September 2026. It is not a live account snapshot or a verification of the currently deployed process.
Start with the two positions.
Let:
| Symbol | Meaning |
|---|---|
| (q_s) | HYPE held in spot |
| (q_p) | HYPE short in the perpetual, expressed as a positive quantity |
| (S) | HYPE spot price |
| (P) | HYPE perpetual mark price |
| (O_f) | Oracle price used for funding |
| (O_b) | Borrow oracle price used to value collateral |
| (D) | Outstanding USDC debt |
| (V) | Perpetual account value, including its P&L |
| (E) | Net capital attributable to the strategy |
| (N) | Matched perpetual notional |
| (m) | Matched notional divided by strategy capital |
| (L) | Perpetual leverage parameter used in the margin calculation |
| (\lambda) | HYPE collateral loan-to-value ratio |
For an exactly matched position:
$$ q_s=q_p=q. $$
The immediate price P&L, before funding, interest and fees, is:
$$ d\Pi_{\text{price}}
q_s,dS-q_p,dP. $$
If spot and perp move together, so that (dS=dP), and the quantities match:
$$ d\Pi_{\text{price}}=0. $$
For example, suppose I own 2,250 HYPE and short 2,250 HYPE, with both initially priced at $80.
If both prices rise to $96:
$$ \text{spot gain}=2{,}250(96-80)=$36{,}000, $$
$$ \text{perp loss}=-2{,}250(96-80)=-$36{,}000. $$
The combined price P&L is approximately zero.
There is no need to change the quantities merely to preserve the hedge after that price move. The original 2,250 HYPE spot still offsets the original 2,250 HYPE short.
However, the dollar size of both positions has increased. That changes funding income, financing requirements and margin risk.
The hedge is in HYPE units. Matching dollar values at two different prices is not necessarily the same thing.
There are two residual exposures even before considering borrowing.
First, the quantities may differ.
Define:
$$ \delta=q_s-q_p. $$
For a coherent price move:
$$ d\Pi_{\text{directional}}\approx\delta,dP. $$
A positive (\delta) means I am net long HYPE; a negative (\delta) means I am net short.
Fees paid in HYPE, partial fills, supply-interest accrual, transfers and rounding can all change this mismatch.
Second, spot and perp prices may move differently.
Define the dollar basis:
$$ b=P-S. $$
Then:
$$ d\Pi_{\text{price}}
(q_s-q_p)dS-q_p,db. $$
With exactly matched quantities:
$$ d\Pi_{\text{price}}=-q,db. $$
A widening perp premium hurts a long-spot/short-perp position. A narrowing premium helps it.
For a fixed quantity held between entry and exit:
$$ \Pi_{\text{price}}=q(b_0-b_T). $$
This is separate from the funding received during the holding period.
For example, if the perp rises $1 relative to spot while I hold a matched 2,250-HYPE position, the basis loss is approximately $2,250. The quantity hedge can be perfect while this loss occurs.
A perpetual has no fixed expiry forcing convergence at a particular date. I cannot assume that an adverse basis will disappear before I need to exit.
Funding income comes from the opposite side of the perpetual market.
When funding is positive, longs pay shorts. When it is negative, shorts pay longs. The payment is a transfer between traders; it does not require a corresponding rise in HYPE's price.
For my short, the payment at hourly settlement (h) is:
$$ F_h=q_{p,h}O_{f,h}f_h, $$
where (f_h) is the signed hourly funding rate.
Therefore:
$$ F_{\text{total}}
\sum_h q_{p,h}O_{f,h}f_h. $$
The oracle price matters: funding notional and mark-price notional need not be identical.
Funding exists to influence the relative attractiveness of holding longs and shorts and help keep the perpetual price near its underlying reference. My economic interpretation is that I am supplying short exposure and capital to a market where other participants may be willing to pay for leveraged long exposure.
This opportunity can persist because earning it requires capital, financing, execution and risk-bearing. It can also disappear as demand changes or more capital enters the trade.
For annualized comparisons, an average hourly rate can be converted to a simple funding APR:
$$ r_f=\bar f_{\text{hourly}}\times24\times365. $$
For example:
$$ \bar f_{\text{hourly}}=0.0000125 \quad\Rightarrow\quad r_f=10.95%. $$
That is arithmetic annualization, not a forecast.
A 15% annualized funding rate means that today's or a historical average rate, if maintained, corresponds to 15% of funding notional per year. It does not promise that return over the next year.
The actual result depends on the entire path of quantities, oracle prices and funding rates. Multiplying my current position by a historical APR does not reconstruct historical income.
I also need to distinguish APR from APY. For equal hourly returns reinvested without friction:
$$ \text{APY}=(1+r_{\text{hourly}})^{8760}-1. $$
That compounding assumption is stronger than simply collecting funding. Reinvesting into a larger matched book can require additional borrowing and trades, each with its own constraints and costs.
The next question is how much of the position is financed.
For the dedicated HYPE book, the local code uses a strategy-capital calculation of the form:
$$ E=q_sS+V-D. $$
This is the spot asset plus perpetual account value minus USDC debt. Unrelated assets or idle capital outside the strategy should not make its leverage ratio look safer.
The perpetual's full notional is not another asset that I add to equity. Its account value and P&L are what enter the balance sheet.
Define matched notional and strategy multiple as:
$$ N=\min(q_s,q_p)P, $$
$$ m=\frac{N}{E}. $$
A strategy multiple of (1.8) means I have approximately $1.80 of spot exposure and $1.80 of offsetting perp exposure for every $1 of strategy capital.
Gross exposure is approximately (2mE). Net directional exposure is approximately zero when the hedge and price relationship hold.
The strategy multiple (m) is different from the perp leverage parameter (L).
In the simplified fresh-book model used for projections:
$$ I=\frac{N}{L}, $$
where (I) is initial perpetual margin.
If spot and perp prices are equal, the financed uses of capital are approximately:
$$ N+\frac{N}{L}. $$
Consequently:
$$ D\approx\max\left(0,N+\frac NL-E\right). $$
Equivalently:
$$ \frac DE \approx \max\left(0,m\left(1+\frac1L\right)-1\right). $$
This is a fresh-position approximation. For an existing position after price moves, funding, interest and transfers, I use the actual debt and perpetual account value rather than forcing them back into this formula.
The formula reveals a detail that is easy to miss: borrowing can finance the perp margin as well as the spot purchase.
With (L=10), each additional $1 of matched notional in this simplified model requires approximately $1.10 of financing if I do not contribute more equity.
Even (m=1) can involve borrowing:
$$ D\approx E/L. $$
Thus “one-times matched notional” does not automatically mean “zero debt.”
Consider a hypothetical starting book:
$$ E=$100{,}000,\quad P=S=$80,\quad m=1.8,\quad L=10. $$
Then:
$$ N=mE=$180{,}000, $$
$$ q=N/P=2{,}250\text{ HYPE}, $$
$$ I=N/L=$18{,}000, $$
$$ D=N+I-E=$98{,}000. $$
The balance sheet reconciles:
$$ $180{,}000+$18{,}000-$98{,}000
$100{,}000. $$
Suppose funding averages 15% annualized, borrowing costs 5% annualized, and I assume no HYPE supply income.
The annualized funding run rate is:
$$ $180{,}000\times0.15=$27{,}000. $$
The annualized borrowing cost is:
$$ $98{,}000\times0.05=$4{,}900. $$
Therefore:
$$ \text{net carry before trading costs}
$22{,}100\text{ per year}, $$
or approximately:
$$ $60.55\text{ per day}. $$
Relative to $100,000 of equity, that is 22.1% annualized before execution costs and other P&L.
It exceeds the 15% funding APR because funding is earned on $180,000 of notional while the denominator is $100,000 of equity.
The extra return comes with extra financing and risk.
More generally, let:
- (r_f) be annualized funding.
- (r_b) be the annualized borrowing accrual rate.
- (r_H) be the annualized supply rate on eligible supplied HYPE.
- (Q_H) be the quantity actually earning that supply rate.
An approximate daily carry calculation is:
$$ \text{daily carry} \approx \frac{ q_pO_fr_f + Q_HO_br_H
Dr_b }{365}. $$
If there is separately supplied USDC, its earned interest can be added as another term. It must not be counted both as strategy income and as income from capital excluded from the strategy denominator.
Supply income should be based on actual eligible balances and actual rates. Holding spot HYPE is not the same as staking HYPE, and I should not insert a staking yield into this calculation.
Under the simplifying assumptions (O_f=O_b=P=S), all spot HYPE earning (r_H), and active borrowing:
$$ R_{\text{carry}} \approx m(r_f+r_H)
\left[m\left(1+\frac1L\right)-1\right]r_b. $$
This is an annualized equity return before trading costs, basis changes and other losses.
For rate conversions, the units must agree. If an input is an effective annual yield (y), its equivalent continuous annual rate is:
$$ r=\ln(1+y). $$
For constant debt under continuous accrual:
$$ \text{interest over }T\text{ years}
D(e^{rT}-1). $$
The daily approximation (Dr/365) is suitable for a short-horizon estimate, but actual settled interest is authoritative.
There is a difference between a profitable total position and a profitable additional dollar of leverage.
Let:
$$ a=\frac SP. $$
For an incremental matched slice, the projected financing per dollar of perp notional is approximately:
$$ a+\frac1L. $$
While borrowing is active, the marginal annual carry rate is approximately:
$$ g= \frac{O_f}{P}r_f + \frac{O_b}{P}r_H
\left(a+\frac1L\right)r_b. $$
With coherent prices:
$$ g=r_f+r_H-\left(1+\frac1L\right)r_b. $$
An increase in notional (\Delta N) then earns approximately:
$$ \Delta\text{carry per year}=\Delta N,g. $$
Using the example:
$$ g=0.15-1.1(0.05)=0.095. $$
An extra $10,000 of matched notional produces about $950 a year before its execution costs, assuming those rates persist.
But suppose borrowing rises to 15%.
Then:
$$ g=0.15-1.1(0.15)=-0.015. $$
The next dollar of leveraged exposure has negative marginal carry.
The existing example book still has positive total carry:
$$ $27{,}000-$98{,}000(0.15)
$12{,}300. $$
Both statements can be true because the existing book also employs my own capital.
For the example, total carry reaches zero when:
$$ r_b=\frac{Nr_f}{D}
\frac{180{,}000(0.15)}{98{,}000} \approx27.55%. $$
Marginal carry reaches zero much earlier:
$$ r_b=\frac{r_f}{1+1/L}
\frac{0.15}{1.1} \approx13.64%. $$
This distinction matters when deciding whether to keep an existing book, add exposure, or reduce it.
Borrow rates can also change rapidly as reserve utilization rises. A low current borrowing rate is not a fixed financing contract.
A price-neutral book can become harder to finance when HYPE rises.
The reason is that the short's losses and the increase in borrowing capacity occur at different rates.
Collateral borrowing capacity is approximately:
$$ K=\lambda q_sO_b. $$
For a coherent $1 increase in HYPE's price:
- A short of (q_p) HYPE loses approximately (q_p) dollars.
- Collateral borrowing capacity increases by approximately (\lambda q_s) dollars.
For a matched position:
$$ q_p-\lambda q_s=q(1-\lambda)>0. $$
The short loses more than the collateral creates in additional borrowing capacity.
Under the local model's conditional assumption that available borrowing finances short losses dollar-for-dollar:
$$ D(P)\approx D_0+q_p(P-P_0), $$
while capacity is:
$$ K(P)\approx\lambda q_sP. $$
The initial capacity gap is:
$$ G_0=\lambda q_sP_0-D_0. $$
That gap erodes at:
$$ q_p-\lambda q_s $$
dollars per $1 price increase.
The corresponding modeled capacity-exhaustion price is:
$$ P_{\text{capacity}}
P_0+ \frac{\lambda q_sP_0-D_0} {q_p-\lambda q_s}. $$
This assumes coherent prices, unchanged quantities and collateral parameters, and available external financing.
Using the example and (\lambda=0.65):
$$ K_0=0.65(180{,}000)=$117{,}000, $$
$$ G_0=$117{,}000-$98{,}000=$19{,}000. $$
Thus:
$$ P_{\text{capacity}}
80+ \frac{19{,}000}{2{,}250(1-0.65)} \approx$104.13. $$
At a price of $96, before resizing and ignoring carry:
$$ D\approx98{,}000+36{,}000=$134{,}000, $$
$$ K=0.65(2{,}250)(96)=$140{,}400. $$
The borrowing health factor is approximately:
$$ HF=\frac KD=\frac{140{,}400}{134{,}000}\approx1.048. $$
It began at approximately 1.194.
The spot gain and short loss still offset economically, but borrowing headroom has narrowed substantially.
The opposite coherent move generally helps this borrowing constraint. If price falls from $80 to $64, the short gains $36,000. In the idealized repayment path:
$$ D\approx98{,}000-36{,}000=$62{,}000. $$
Collateral capacity falls too, but only to:
$$ K=0.65(2{,}250)(64)=$93{,}600. $$
The health factor improves to approximately 1.51.
This explains the model's asymmetric concern about upward price moves. It does not establish that a crash is harmless: a crash can also cause basis dislocations, execution failures or loss of the short hedge.
Borrowing health and liquidation risk are different measurements.
For this simplified collateral/debt structure:
$$ HF=\frac{\lambda q_sO_b}{D}. $$
An (HF) of 1 means the personal borrowing capacity is fully used. It is not the same threshold as portfolio liquidation.
The local risk model also constructs a maintenance-headroom checkpoint.
Let:
$$ \tau=\frac{1+\lambda}{2}, $$
and let (M) be perpetual maintenance margin.
The modeled headroom is:
$$ H=\tau q_sO_b+V-D-M. $$
For the modeled USDC-debt branch:
$$ PMR_{\text{model}}=\frac{D}{D+H}. $$
This is the implementation's reduced model for the dedicated HYPE book. Hyperliquid's general portfolio-margin calculation covers more assets and constraints and takes the maximum across borrowable-token branches.
I should not substitute this reduced equation for the venue's actual PMR.
The official portfolio-margin liquidation boundary is around 95% PMR. The strategy should act before reaching it.
Three values therefore need separate attention:
- Personal borrowing health: can the collateral support more borrowing?
- Venue portfolio-margin ratio: how close is the account to the venue's portfolio liquidation boundary?
- Venue position liquidation information: what does the exchange report about the perpetual position?
A single displayed liquidation price cannot summarize every possible future.
The local model considers several financing paths:
- Further short losses are financed while personal and external capacity remain available.
- After personal capacity is reached, only the new capacity created by further collateral appreciation is borrowed.
- Future borrowing stops, and further short losses reduce perpetual account value.
These paths are conditional. The code compares applicable modeled boundaries and also watches venue-reported risk.
Current agreement with the venue does not prove that a forward projection is correct. Where the model is anchored to venue PMR, matching that checkpoint is partly a consequence of the anchoring. The independent raw-model reconciliation is an additional check.
External financing can fail before my own collateral capacity is exhausted.
I need to distinguish:
- My personal LTV capacity.
- Available USDC in the lending reserve.
- Global and user borrowing caps.
- HYPE supply/collateral caps.
- Whether the market and account still qualify for the expected margin treatment.
A strategy can have a healthy personal (HF) while being unable to obtain additional USDC because the reserve or a global cap is exhausted.
Borrowing availability is therefore part of the hedge's operating conditions. It is not something established permanently when the position is opened.
The local code confirms external financing using multiple observations rather than one snapshot. The checked policy requires three successful read pairs spanning at least ten seconds.
That reduces dependence on a transient reading. It cannot guarantee that the capacity will remain available after the check.
The position's multiple changes even when its quantities remain perfectly matched.
With approximately unchanged equity:
$$ m=\frac{qP}{E}. $$
If price increases by a factor (k):
$$ m_{\text{new}}\approx k,m_{\text{old}}. $$
In the example, a 20% price rise takes the multiple from:
$$ 1.8\longrightarrow2.16. $$
A 20% fall takes it to:
$$ 1.8\longrightarrow1.44. $$
Accumulated carry also matters. Positive net carry increases equity and gradually lowers the multiple if quantities and price stay unchanged. Fees or negative carry reduce equity and increase it.
There are consequently two different reasons to trade:
- Repair a quantity mismatch.
- Resize an already matched position to manage financing, risk or desired exposure.
Repairing a hedge does not require resetting the whole strategy multiple. Conversely, a perfectly matched book can still need a matched reduction.
The implementation repairs by reducing the excess leg: sell excess spot, or buy back excess short.
Resizing costs money on both markets.
Let:
- (c_s) be the effective spot taker fee rate.
- (c_p) be the effective perp taker fee rate.
- (\Delta N) be the change in matched perp notional.
Ignoring rounding and fee-currency effects initially:
$$ C_{\text{fees}} \approx \Delta N\left(\frac SPc_s+c_p\right). $$
If prices are equal:
$$ C_{\text{fees}}\approx\Delta N(c_s+c_p). $$
For illustration, use:
$$ c_s=0.0007,\qquad c_p=0.00045. $$
These are example rates, not a claim about my current account fees.
The paired one-way fee rate is:
$$ c=0.00115=0.115%. $$
Changing $10,000 of matched notional costs approximately:
$$ $10{,}000(0.00115)=$11.50. $$
Adding that slice and later removing the same dollar notional costs approximately $23 in fees.
Opening a $180,000 matched book would cost approximately $207, and closing the same dollar notional another $207.
If prices differ at exit, closing the same HYPE quantity involves a different dollar notional and therefore a different dollar fee.
Fees are charged on turnover, not on my net directional exposure. A nearly zero-delta trade can still pay substantial fees.
Actual fees can depend on account tier and applicable discounts. Referral discounts already reflected in paid fees must not be subtracted twice. A possible later referral recovery is separate cash flow; the current code does not credit an unobserved future recovery to automation.
Fees are only part of execution cost.
I also cross bid/ask spreads and may move through multiple order-book levels.
For a reference price (P_{\text{ref}}), implementation shortfall on a buy is:
$$ C_{\text{buy}}
q(P_{\text{fill}}-P_{\text{ref}}). $$
For a sell:
$$ C_{\text{sell}}
q(P_{\text{ref}}-P_{\text{fill}}). $$
I need an explicit reference because otherwise “slippage” can ambiguously mean spread, market impact, price movement while submitting, or all three.
A paired trade crosses two books. Spot liquidity and perp liquidity can differ substantially.
The executor uses marketable immediate-or-cancel limit orders. It permits a fill only within a price bound; any unfilled remainder is cancelled.
The checked policy uses a 10-basis-point bound per leg.
For a $10,000 change with similar spot and perp prices, allowing 10 basis points on each leg corresponds to approximately:
$$ $10{,}000(0.001+0.001)=$20 $$
of price allowance, in addition to fees.
This is not a promise that the entire action, including later repairs, can never cost more than $20. Each leg is quoted separately, and the market can move between them.
A tight limit controls the price of a fill. It does not guarantee a fill when I urgently need one.
When evaluating completed trades, I must also avoid double-counting basis and execution cost. If I calculate P&L from actual entry and exit fills, those prices already contain the spreads and basis I traded.
Spot-buy fees create a quantity problem.
If a spot-buy fee is deducted in HYPE, buying (q_{\text{gross}}) credits approximately:
$$ q_{\text{net}}=q_{\text{gross}}(1-c_s). $$
To obtain a desired net quantity (\Delta q), the gross purchase is approximately:
$$ q_{\text{gross}}=\frac{\Delta q}{1-c_s}. $$
The planner rounds this upward to a permitted size step. It then shorts the observed credited quantity, subject to perp precision.
If I instead shorted the gross spot order quantity, I would be slightly net short.
The live executor does not assume that the requested quantity filled. It observes the first leg's actual account change and sizes the second leg from that change.
For a matched increase:
- Buy spot.
- Observe the actual net HYPE credit.
- Short the corresponding executable HYPE quantity.
For a matched reduction:
- Buy back the perp using a reduce-only order.
- Observe the actual reduction.
- Sell the corresponding spot quantity.
These trades are sequential. They are not an atomic exchange of both legs.
Between legs there is temporary directional exposure. A partial fill or failure can leave a mismatch that requires repair.
The code re-reads account state after uncertain submissions and does not blindly retry an order whose outcome is unknown. This matters because a timeout is not evidence that an order failed to execute.
Below-minimum residuals are retained as dust. The checked code uses a $10 minimum trade-notional threshold, so “matched” operationally means matched within permitted precision and executable dust limits.
Fees also change the amount I need to trade.
Suppose the current matched notional is (N), equity is (E), and the target multiple is (m_*).
If a paired reduction of (x) dollars costs (cx), the resulting multiple is:
$$ \frac{N-x}{E-cx}. $$
Setting this equal to (m_*):
$$ N-x=m_*(E-cx). $$
Therefore:
$$ x=\frac{N-m_E}{1-m_c}. $$
Ignoring fees would give (x=N-m_*E), which leaves the result slightly above the requested multiple.
For an increase:
$$ \frac{N+x}{E-cx}=m_*, $$
so:
$$ x=\frac{m_E-N}{1+m_c}. $$
These are simplified closed-form equations. The actual planner also handles different spot/perp prices, fees paid in HYPE, quantity steps and the current account state.
In the example, after the 20% price rise:
$$ N=$216{,}000,\quad E=$100{,}000. $$
Reducing to (m_*=1.8), with (c=0.00115), requires:
$$ x= \frac{216{,}000-1.8(100{,}000)} {1-1.8(0.00115)} \approx$36{,}074.67. $$
Estimated fees are:
$$ C\approx$41.49. $$
The calculation targets the multiple after estimated fees. Actual fills and rounding determine the final result.
A matched rebalance does not create a directional trading profit merely because I sell spot after a rise or buy it after a fall.
After a rise, selling appreciated spot realizes a gain, but buying back the short realizes an offsetting loss.
After a fall, buying cheaper spot may look attractive in isolation, but I also add a corresponding short.
In the ideal coherent-price model, resizing changes future carry and risk. It does not harvest the price move itself.
What price movement does generate is turnover.
If a position starts at multiple (m), price rises by a factor (k), and I reset to (m) without fees:
$$ \Delta N=mE(k-1). $$
The paired fee cost as a fraction of equity is approximately:
$$ \frac CE=c,m(k-1). $$
This shows why a volatile path can consume carry even if the hedge works.
Repeated rises trigger reductions; sufficiently large falls can trigger additions. A choppy path can therefore cost more to manage than a quiet path ending at the same price.
Continuously maintaining an exact target would generate unnecessary trading. A band permits natural drift and trades only when the benefit or risk constraint justifies it.
The economic question for an added slice is how long it must remain deployed to recover its trading costs.
Let:
- (g) be marginal annual carry per dollar of added notional.
- (c_{\text{in}}) be entry cost per dollar.
- (c_{\text{out}}) be expected exit cost per dollar.
- (T) be holding time in years.
For constant rates:
$$ \text{incremental profit} \approx \Delta N\left[gT-c_{\text{in}}-c_{\text{out}}\right]. $$
If (g>0), break-even holding time is:
$$ T_{\text{BE}}
\frac{c_{\text{in}}+c_{\text{out}}}{g}. $$
In days:
$$ T_{\text{BE,days}}
365\frac{c_{\text{in}}+c_{\text{out}}}{g}. $$
Using (g=0.095) and fee-only round-trip cost of (0.0023):
$$ T_{\text{BE,days}}
365\frac{0.0023}{0.095} \approx8.84\text{ days}. $$
If I also budget 10 basis points per leg in each direction:
$$ c_{\text{round trip}}
2(0.00115+0.002)
0.0063, $$
giving:
$$ T_{\text{BE,days}}\approx24.21. $$
This is a cost scenario, not a forecast of actual slippage.
The slice size cancels because both modeled carry and proportional costs scale with (\Delta N). There is no special economically optimal dollar size arising from those linear terms alone.
Size can still matter because of minimum orders, depth, nonlinear impact, fixed costs and execution cadence.
If marginal carry is negative, holding longer does not recover the cost under unchanged assumptions.
For risk reductions, the question is different: avoiding liquidation may justify a trade even when its fee payback is unattractive.
The local controller implements three broad automatic actions:
- Repair an executable hedge mismatch.
- Reduce a matched book when a risk boundary is reached.
- Restore matched exposure when the position falls below the permitted lower band.
The active band deserves a precise description.
Although the repository contains a reflected-band optimizer using carry, volatility and proportional trading costs, the inspected controller path does not use that optimizer to select its current band.
Instead, it combines a live risk ceiling with preserved, reviewed band widths.
In simplified form, the upper edge is:
$$ m_U=\min(m_{\text{reflexive risk}},m_{\text{borrowing health}}). $$
The checked policy requires a minimum borrowing health factor of:
$$ HF_{\min}=1.01. $$
For the simplified fresh-book model with coherent prices, this implies:
$$ \frac{\lambda m}{m(1+1/L)-1}\ge HF_{\min}. $$
Rearranging:
$$ m \le \frac{1} {1+1/L-\lambda/HF_{\min}}. $$
With illustrative (L=10) and (\lambda=0.65):
$$ m_{\text{borrowing health}}\approx2.191 $$
before exact fees and size rounding.
A health factor of 1.01 means capacity is 1.01 times debt. It does not mean there is a 1% probability of loss, or that HYPE can rise 1% safely. Price headroom depends on the whole balance sheet.
The preserved lower-band offsets in the checked policy are:
$$ 2.57-2.14=0.43, $$
$$ 2.57-2.17=0.40. $$
The code subtracts these from the live health ceiling to obtain the lower trigger and lower reset.
Using the illustrative ceiling:
$$ m_L\approx2.191-0.43=1.761, $$
$$ m_{L,\text{reset}}\approx2.191-0.40=1.791. $$
The upper reset also includes an execution buffer. These values are recomputed from live inputs; the example is not a report of today's active band.
There is an implementation limitation I should keep explicit: the current flag called increase_economic checks whether the lower reset fits beneath the permitted increase ceiling. In the inspected Restore path, it is not itself a positive-net-funding or fee-payback test.
Therefore I should not describe the running logic as automatically maximizing forecast net carry, or assume that this flag guarantees an increase is profitable after funding, borrowing and turnover.
The separate economics functions are useful analytical tools, but their existence does not establish that their checks gate every live increase.
The risk boundary includes room for an adverse move before modeled liquidation.
For a modeled liquidation price (P_{\text{liq}}) and an upside safety move (s), the conceptual action price is:
$$ P_{\text{action}}=\frac{P_{\text{liq}}}{1+s}. $$
The checked policy uses (s=50%), along with a 12-hour borrowing-interest stress horizon.
The model translates the action price into an equivalent PMR threshold so that live price and venue PMR can provide separate observations of the boundary. Venue position headroom supplies another trigger.
This does not mean the account is guaranteed to survive any 50% rally.
The calculation depends on assumed financing, coherent prices, collateral treatment and timely execution. A gap, oracle dislocation, cap change or outage can invalidate those assumptions.
The shorter execution buffer also incorporates measured price movement, current price disagreement and the order-price allowance.
Historical movement is evidence for calibration, not a maximum possible future move.
The checked policy also treats account state older than 30 seconds as aging and older than 60 seconds as critical. Stale data causes the decision logic to stop submitting orders and request attention.
That avoids trading on unknown state, but leaves the existing position exposed while the data problem persists.
Similarly, if the reduction solver cannot produce a safe nonzero target, the inspected code requests manual review rather than automatically closing everything. This is an operational dependency I need to understand before relying on the controller unattended.
Adding and removing capital are more complicated than changing a number in the dashboard.
At constant price and ignoring fees, increasing equity by (A) while preserving multiple (m) requires:
$$ \Delta N=mA. $$
The corresponding fresh-book debt increase is approximately:
$$ \Delta D= \left[m\left(1+\frac1L\right)-1\right]A. $$
For (m=1.8) and (L=10), adding $10,000 of equity supports approximately $18,000 of additional matched notional and $9,800 of additional debt.
Withdrawing (W) while preserving the same multiple requires reducing matched notional by approximately:
$$ \Delta N=mW. $$
Fees require further adjustment because the equity remaining after the withdrawal is lower than (E-W).
The implementation uses a separate holder account and an owner-signed HYPE transfer.
For an addition, the holder buys HYPE, the funding account shorts the observed credited quantity, and the owner transfers that HYPE into the funding account. After receipt and fresh checks, the controller can add the extra matched financing needed to restore the intended ratio.
For a removal, the funding account first reduces part of the matched book. The owner then transfers a bounded HYPE quantity to the holder. The funding short is reduced by the observed transferred quantity, and the holder sells the corresponding HYPE for USDC.
The temporary hedge can span two accounts. That may offset economic price exposure across the two accounts, but it does not give one account access to the other's collateral for liquidation purposes.
In the ideal fee-free withdrawal arithmetic, approximately ((m-1)W) of matched notional is reduced before transferring (W) of HYPE, followed by reducing another (W) of short notional and selling that HYPE in the holder.
Across the workflow, approximately (mW) of spot and (mW) of perp turnover occurs.
This is why “withdraw $10,000” is not equivalent to paying fees on only $10,000 of one asset.
Intermediate states also matter. A final allocation can look safe while the transfer temporarily removes too much collateral from the funding account. The planner must check those intermediate states, not just the endpoint.
The tail risks are combinations of events that break the normal relationship between the hedge, financing and execution.
A fast HYPE rally can consume borrowing headroom before the controller completes a reduction. A simultaneous rise in borrowing utilization or loss of external financing makes that worse.
A basis or oracle dislocation can create real losses and margin stress without a large change in a single headline HYPE price. Spot valuation, perpetual mark, funding oracle and borrow oracle serve different purposes and need not update identically.
Negative funding can turn the short into a payer. High positive funding is not a safety signal by itself either: it may accompany a crowded, volatile market with expensive financing and poor exit liquidity.
A spot-liquidity failure can make it possible to close the short but difficult to sell the collateral at an acceptable price. A perp-liquidity failure can make it difficult to remove the short before selling collateral. The two legs' liquidity must be assessed separately.
Liquidation can destroy the hedge. Once the venue takes over part of the spot collateral or perp position, I cannot assume that the remaining quantities are matched, or that liquidation will follow the same sequence as my own executor.
Auto-deleveraging can also remove a profitable short when an opposing account becomes insolvent. In a crash, that can leave the remaining spot position exposed to further downside. A profitable short is therefore not guaranteed to remain open indefinitely.
Execution failures can leave a temporary position permanently unpaired until repair succeeds. Relevant failures include partial fills, ambiguous responses, rejected orders, insufficient depth and price movement between legs.
Infrastructure failure can leave a correctly designed strategy unmanaged. The local process, network, API, signer authorization and exchange must all remain usable. An alert is useful only if it is delivered and acted upon.
A model can be wrong or incomplete. Margin tiers, collateral parameters, caps or exchange rules can change. A forward model calibrated to one regime may become inaccurate precisely during stress.
There is also direct exposure to the platform and collateral system: protocol faults, consensus or oracle failures, account compromise and USDC-related disruption. A spot/perp hedge does not hedge custody or access to the account.
Finally, the strategy is primarily measured in USDC. If my spending benchmark is AUD, I retain currency exposure:
$$ E_{\text{AUD}}
E_{\text{USDC}} \times P_{\text{USDC/USD}} \times X_{\text{AUD per USD}}. $$
Neutrality to HYPE does not imply neutrality to USDC's dollar value or to USD/AUD.
Several of these risks can occur together. The dangerous scenario is often a price move plus depleted financing plus thin liquidity plus delayed execution.
Monitoring needs to cover the position, its economics and the machinery operating it.
| Area | Measurements | What they tell me |
|---|---|---|
| Hedge | Spot quantity, signed perp quantity, mismatch value | Whether I still have the intended exposure |
| Capital | Strategy equity, matched notional, multiple | How large the book is relative to its own capital |
| Debt | Actual USDC debt, interest accrual | What financing is really costing |
| Personal capacity | Borrowing health and remaining capacity | Whether collateral supports more borrowing |
| Venue risk | Actual PMR, position liquidation information, liquidation events | Whether the venue sees danger |
| Model risk | Raw-model reconciliation, conditional action and liquidation prices | Whether local calculations remain credible |
| External financing | Reserve liquidity, utilization, global/user caps | Whether the assumed financing path remains available |
| Collateral | LTV, eligible supplied amounts, supply caps | Whether HYPE supports the book as expected |
| Prices | Spot, perp mark, funding oracle, borrow oracle | Whether basis or valuation disagreement is growing |
| Carry | Current funding, historical windows, settled funding, borrow/supply rates | Whether the trade is earning enough |
| Trading costs | Actual fees, both books' depth, fill shortfall, repair costs | How much carry management consumes |
| Operations | Data age, worker health, signer status, blocked actions, unresolved orders | Whether the controller can act |
| Transfers | Holder balances and active transfer checkpoints | Whether capital movement left an unintended exposure |
The important economic views are both total and marginal net carry.
The important risk views are both current venue state and conditional future scenarios.
The important operational question is whether a required trade can actually be completed in the market now.
Finally, I need to measure the result from settled cash flows and reconciled equity, not from a displayed funding APR.
A useful attribution is:
$$ \text{strategy P&L}
\text{settled funding} + \text{settled supply interest}
\text{settled borrow interest} + \text{spot/perp price P&L}
\text{trading fees} + \text{other attributable cash flows}. $$
Price P&L should include both realized and unrealized changes where appropriate.
Deposits and withdrawals are capital flows, not investment profit.
For a consistent strategy boundary:
$$ \text{period profit}
E_{\text{end}}-E_{\text{start}} -\text{contributions} +\text{withdrawals}. $$
If the period includes substantial capital changes, dividing that profit by starting equity can misstate the return. Time-weighted returns measure the strategy independently of contribution timing; money-weighted returns measure the experience of the actual invested cash flows.
I should separately reconcile funding, borrowing, fees, basis and residual hedge P&L against the total equity change. An unexplained difference is a reason to investigate the accounting.
The strategy earns a spread for committing capital and managing a financed short/spot relationship. Its success depends on that spread remaining positive after the cost of keeping the relationship intact, and on being able to reduce or exit before financing or execution conditions overwhelm the hedge.