| Token | 24h % | Structure | Fund /8h | Avg last 3 fund /8h | Windows left | Carry budget | Hedge cost | Unwind cost | Passive spread / pnl | Moderate spread / pnl | Aggressive spread / pnl | Avg funding cover cost / pnl |
|---|
| Token | 24h % | Structure | Fund /8h | Avg last 3 fund /8h | Windows left | Carry budget | Hedge cost | Unwind cost | Passive spread / pnl | Moderate spread / pnl | Aggressive spread / pnl | Avg funding cover cost / pnl |
|---|
# Client Flow Funding Optimiser -- how each token is priced (all bps vs mid). # Per token: fund_bps = 8h-equiv funding on the hedge perp; hrs = its funding # cadence; plus the perp maker/taker fees and each leg's live half-spread. MOD_SHARE, AGG_SHARE = 1/3, 1/2 # share of net carry passed to the client PERP_HORIZON_D = 3 # holding horizon for perpetual (long-spot) rows (editable) SETTLE_VENUES = ["BN", "KuCoin", "OKX", "Bitstamp"] # can buy + withdraw to deliver per_window = abs(fund_bps) * hrs/8 # funding collected per settlement hedge = maker_fee(hedge_perp) # perp hedge ENTRY, worked passively if regime == "P(X) buys spot": # we are LONG the token # client delivers the token, we deliver stablecoins (held in size) -> # funding is PERPETUAL: no forced buyback, not clipped by the deadline. windows = round(PERP_HORIZON_D*24 / hrs) unwind = 0 else: # "P(X) sells spot": we are SHORT the token # must buy it back to deliver -> capped at the 17:00 settlement, and # forced to CROSS the book on both legs to get flat (taker): windows = funding_windows_until(settlement_deadline) # 03:30 snap / 17:00 deliver unwind = ( taker_fee(hedge_perp) + half_spread(hedge_perp) # sell perp at the bid + taker_fee(spot_v) + half_spread(spot_v) ) # buy spot at the offer # spot_v = cheapest SETTLE_VENUE on fee+half_spread; a missing book is # estimated from the token's other markets (flagged ~/est). carry = windows * per_window # subsidy budget, before costs cost = hedge + unwind net_edge = carry - cost # the most we can quote THROUGH mid # Quotes vs mid: + = client pays a markup; - = we price THROUGH mid (subsidy). passive = +cost # covers costs, keep the WHOLE carry moderate = -net_edge * MOD_SHARE # give 1/3 of the net carry, keep 2/3 aggressive = -net_edge * AGG_SHARE # give 1/2 of the net carry, keep 1/2 # PnL the desk keeps at each quote = carry - cost + quote: pnl_passive = carry pnl_moderate = net_edge * (1 - MOD_SHARE) # = 2/3 * net_edge pnl_aggressive = net_edge * (1 - AGG_SHARE) # = 1/2 * net_edge # Reversion check -- an alternative carry from the LAST 3 realized settlements, # signed to the direction we collect (dir = +1 for P(X) buys, -1 for P(X) sells): avg_fund_bps = mean(last_3_settlements) * 8/hrs # signed 8h-equiv avg_carry = windows * (dir * avg_fund_bps * hrs/8) # "Avg funding" column is passive-style: spread = +cost, PnL kept = avg_carry. # If avg_carry is far below pnl_passive, the live funding is a spike likely to revert.