Buy & Sell

Buy & Sell

Followers enter and exit vault positions via hypers.funarrow-up-right or directly through HyperFunToken.sol.


For Users (UI)

Buying Vault Tokens

  1. Go to vault page (e.g., hypers.fun/vault/0x...)

  2. Connect wallet

  3. Enter USDC amount to invest

  4. Review:

    • Tokens you'll receive

    • Price per token

    • Price impact

    • Trading fee (1%)

  5. Click "Buy" and confirm transaction

  6. Receive vault tokens in your wallet

Selling Vault Tokens

  1. Go to vault page

  2. Connect wallet

  3. Enter token amount to sell (or click "Max")

  4. Review:

    • USDC you'll receive

    • Exit fee (based on holding time)

    • Performance fee (if profitable)

    • Price impact

  5. Click "Sell" and confirm transaction

  6. Receive USDC (or pending sell if low liquidity)

Understanding Fees

Fee
When
Rate

Trading Fee

Every buy/sell

1%

Exit Fee

When selling

0-15% (based on hold time)

Performance Fee

When selling at profit

0-30% (set by leader)

Exit Fee Tiers

Hold Duration
Exit Fee

< 7 days

15%

7-30 days

8%

30-90 days

3%

> 90 days

0%

Tip: Hold longer to reduce exit fees!

Pending Sells

If the vault doesn't have enough liquid USDC, your sell becomes "pending":

  1. Your tokens are burned immediately

  2. USDC is reserved for you

  3. Wait for leader to close positions or funds to return

  4. Click "Claim" when available

  5. Receive your USDC


Pricing Mechanism

Bonding Curve (Constant Product AMM)

Price is determined by the x*y=k formula (like Pump.fun / Uniswap):

Price Impact

Large trades move the price:

  • Buying pushes price UP

  • Selling pushes price DOWN

Price Bounds

Limit
Value

Max Premium

+100% (price up to 2x NAV)

Max Discount

-50% (price down to 0.5x NAV)

Max Single Buy

1% of vault


For Developers

Buy Function

Parameter
Description

usdcAmount

USDC to spend (6 decimals)

minTokensOut

Minimum tokens expected (slippage protection)

Buy Flow:

  1. Validate usdcAmount >= minDepositUsdc (default 5 USDC)

  2. Get smoothed NAV for price protection

  3. Transfer USDC from buyer to vault

  4. Deduct trading fee (1%)

  5. Calculate tokens via constant product:

  6. Check slippage: tokensOut >= minTokensOut

  7. Check max buy limit (90% of virtual tokens)

  8. Update bonding curve reserves

  9. Mint vault tokens to buyer

  10. Update entry record (for performance fee)

  11. Transfer fee to treasury

  12. Trigger auto-rebalance

  13. Update TWAP NAV

Sell Function

Parameter
Description

tokens

Vault tokens to sell (18 decimals)

minUsdcOut

Minimum USDC expected (slippage protection)

Sell Flow:

  1. Validate balance and no existing pending sell

  2. Get smoothed NAV

  3. Calculate performance fee (if profitable)

  4. Calculate USDC via constant product:

  5. Calculate exit fee (time-based)

  6. Cap by available liquidity

  7. Check slippage: netUsdcOut >= minUsdcOut

  8. Update bonding curve reserves

  9. Burn tokens

  10. Mint performance fee to leader (if any)

  11. Transfer USDC or create pending sell

  12. Update TWAP NAV

  13. Trigger auto-rebalance

Claim Pending Sell

Claim Flow:

  1. Check pending sell exists

  2. Verify EVM balance covers amount

  3. Transfer USDC to user

  4. Clear pending sell record


View Functions

Get Prices

Calculate Trade

Check Liquidity


Example: Buy via ethers.js

Example: Sell via ethers.js


Events


Data Structures

Pending Sell

Entry Record (Performance Fee)

Purchase Info (Exit Fee)


  • VaultCore - Full token contract reference

  • Pricing Mechanism - Detailed pricing math

  • Fund Creation - Create your own vault

  • Contract Addresses - Deployed contracts

Last updated