Templates

Carry

Collects funding with no price exposure. When a perp's funding pays enough, it buys the coin and shorts the perp at the same size; it exits when funding falls.

What it does

On Hyperliquid, when funding is positive, shorts are paid by longs every hour. A Carry token holds the coin on HyperCore's spot market and shorts the same amount on the perp: a price move cancels out, and the short collects the funding. It only takes the positive-funding side.

One period, and the call behind each step
Elysium · the token's contract
HyperCore · its own account
  1. 1Read funding
    Averages funding over the last hours
    coreTimeMsfundingRatespotPxmarkPxspotBalancepositionaccountValue
    Funding, spot and perp prices, balances
    coreTimeMsfundingRatespotPxmarkPxspotBalancepositionaccountValue
  2. 2Enter both sides
    Funding at or above the entry level
    usdClassTransferlimitOrder · IOC
    Buys the spot, shorts the perp, same size
    usdClassTransferlimitOrder · IOC
  3. 3Collect
    no transaction
    The short is paid funding every hour
  4. 4Exit
    Funding under the exit level
    limitOrder · IOCusdClassTransfer
    Sells the spot, closes the short
    limitOrder · IOCusdClassTransfer
Then it waits for funding to pay enough again.

What happens next

The white line is funding, as a yearly rate averaged over the last 72 hours: what the rule reads. The first three charts move the price 20% up, sideways and down: the result doesn't change. Only funding does.

What happens to $1,000
HYPE: 80% of the pool, enters at 10% funding a year, exits under 3%, funding averaged over 72 h
Price up 20%funding 15% a year
15%3%in 10%out 3%$1,000$1,009your $1,000
$1,000 →$1,009+0.9%
in for 100% of the month · funding earned 0.98% · the price move cancels out

If HYPE rises 20% over a month while funding pays 15% a year, your $1,000 becomes about $1,009.

Price sidewaysfunding 15% a year
15%3%in 10%out 3%$1,000$1,009your $1,000
$1,000 →$1,009+0.9%
in for 100% of the month · funding earned 0.98% · the price move cancels out

If HYPE goes sideways for a month while funding pays 15% a year, your $1,000 becomes about $1,009.

Price down 20%funding 15% a year
15%3%in 10%out 3%$1,000$1,009your $1,000
$1,000 →$1,009+0.9%
in for 100% of the month · funding earned 0.98% · the price move cancels out

If HYPE falls 20% over a month while funding pays 15% a year, your $1,000 becomes about $1,009.

Funding fades15% → −5% a year
15%-5%in 10%out 3%$1,000$1,002your $1,000
$1,000 →$1,002+0.2%
in for 57% of the month · funding earned 0.47% · the price move cancels out

If HYPE goes sideways while funding fades from 15% to −5% a year, your $1,000 becomes about $1,002.

  • Enters
  • Exits
  • Funding, a yearly rate

Illustrative price paths over a month. What the token does on them, and every dollar figure, comes from the template's own simulator with these settings and Hyperliquid's fees, with funding and order-book slippage where they apply. Before the fees to buy and sell the token. Not a forecast.

How it runs

  1. 01Wait
    Checks funding every hour. Below the entry level the token shows “waiting”.
  2. 02Enter
    At or above the entry level, it buys the spot and shorts the perp at the same size.
  3. 03Hold
    The token shows “holding” and collects funding every hour.
  4. 04Exit
    Below the exit level, it closes both sides and waits again.

Settings

Market
Range: A listed perp with a HyperCore spot pair
Default: HYPE
What it does: Only coins that trade on HyperCore's spot market too.
Size
Range: 10%–90% of the pool
Default: 80%
What it does: More: more funding, less margin left for the short.
Entry level
Range: 1%–100% a year
Default: 10%
What it does: Higher: waits for richer funding, in less often.
Exit level
Range: Any, up to the entry level
Default: 3%
What it does: Higher: leaves sooner when funding fades.
Averaged over
Range: 1–720 hours
Default: 72 h
What it does: Longer: steadier decisions, fewer round trips.
Entry and exit levels
When it goes in and out, on the “funding fades” month.
10% / 3%
Ends at $1,002
20% / 10%
15% never reaches 20%: $1,000
Size
How much of the pool is in the trade, at 15% a year for a month.
80%
Ends at $1,009
50%
Ends at $1,005

Plus the settings every template shares: the cash share, breakers, pool cap, end date, fees, market liquidity, metadata and seed. See Shared settings.

Under the hoodintended, on Elysium's precompiles

Every precompile call a Carry token makes, in the order its cycle first makes them, then the pool's own. Until Elysium publishes its precompiles these are the intended calls; the contracts run them on HyperEVM testnet today. What each does, and the assumptions behind them: Precompiles on Elysium.

coreTimeMs()
Kind: read
What it does here: How fresh the reads are. A step stops when they're older than 2 seconds.
Where today: HyperEVM: the block's time
fundingRate(asset)
Kind: read
What it does here: A perp's hourly funding. A Carry averages it before it enters or exits.
Where today: No precompile yet: a keeper reports it, stamped with its time
spotPx(pair)
Kind: read
What it does here: A spot pair's price, so a Carry can size its spot side.
Where today: L1Read 0x…0808
markPx(asset)
Kind: read
What it does here: Hyperliquid's mark price: what the stop, the bands, the levels and the strikes are checked against.
Where today: L1Read 0x…0806
spotBalance(vault, token)
Kind: read
What it does here: A spot balance on HyperCore: USDC, the coin a Carry holds, or the tickets an Options round holds.
Where today: L1Read 0x…0801
position(vault, asset)
Kind: read
What it does here: The vault's own position on a market: its size and what it cost.
Where today: L1Read 0x…0800
accountValue(vault)
Kind: read
What it does here: What the vault's HyperCore account is worth: margin plus the open result. NAV is built from it.
Where today: L1Read 0x…080F
usdClassTransfer(amount, toPerp)
Kind: money
What it does here: Moves USDC between the account's perp and spot balances.
Where today: CoreWriter action 7
limitOrder(… IOC)
Kind: write
What it does here: An order that fills at once or cancels, never worse than its limit: entries, stops, rebalances, grid steps.
Where today: CoreWriter action 1, time-in-force 3
withdrawable(vault)
Kind: read
What it does here: How much USDC can leave the account right now, to pay sellers.
Where today: L1Read 0x…0803
depositFor(vault, amount, dest)
Kind: money
What it does here: Sends USDC from the vault on the chain into its own HyperCore account.
Where today: Circle's CoreDepositWallet
spotSend(system, USDC, amount)
Kind: money
What it does here: Sends USDC from the HyperCore account back to the vault on the chain, to pay sellers.
Where today: CoreWriter action 6