pie.fun
  • ๐Ÿฅงpie.fun
    • ๐ŸฅงWhat is pie.fun
    • ๐Ÿฝ๏ธHow Baskets Work
      • Basket Structure & Weighting
      • Buying and Selling Baskets
      • Rebalancing
      • Fees
      • SDK
    • ๐Ÿง‘โ€๐ŸณBake Your Own Basket
      • How to Create Basket
      • How to Rebalance
    • ๐Ÿ˜ŽExamples of Live Baskets
      • ๐ŸงบBinance Alphas on Solana ($SOLALPHA)
      • ๐ŸงบTop Solana DeFi by Coingecko ($SOLDEFI)
      • ๐ŸงบTop AI Agents on cookie.fun ($ COOKIEAI)
      • ๐ŸงบSolana Ecosystem Buyback ($SOLBUYBACK)
      • ๐ŸงบSolana DePIN by Messari($SOLDEPIN)
      • Coming soon - Moonshot Basket
    • ๐Ÿง‘โ€๐ŸŒพWhat we envision
    • โ˜˜๏ธHow to Get Started
      • 1๏ธโƒฃQuick Sign up
      • 2๏ธโƒฃDeposit and Withdraw
      • 3๏ธโƒฃBuy and Sell Baskets
      • 4๏ธโƒฃTrack Profit & Loss
      • ๐Ÿ“ฑTrade on your Phone
    • โ‰๏ธFAQ
    • ๐Ÿ“˜Audit Reports
    • ๐Ÿ“„Legal Docs
      • โœ’๏ธTerms of Service
      • โœ’๏ธPrivacy Policy
  • ๐Ÿ”—OFFICIAL LINKS
    • Website
    • X (Twitter)
    • Discord
Powered by GitBook
On this page
  • Key Technical Points
  • 1. integrated Raydium and Jupiter for swapping
  • 2. Atomic swap using Jito Bundles
  • 3. Basket Architecture
  1. pie.fun
  2. How Baskets Work

Buying and Selling Baskets

PreviousBasket Structure & WeightingNextRebalancing

Last updated 27 days ago

Buying (Minting)

  • Your SOL is swapped into the basketโ€™s component tokens via Raydium and Jupiter, according to target weights

  • The tokens are locked in a vault

  • You receive a newly minted basket token representing your position

Selling (Redeeming)

  • Your basket token is burned

  • The underlying tokens are unlocked

  • Theyโ€™re swapped back into SOL

  • Your SOL is returned to your wallet

  • Basket tokens are tradable assets with a dynamic supply.

Key Technical Points

1. integrated Raydium and Jupiter for swapping

  • We integrated Jupiter and Raydium for deep DEX liquidity, so any token tradable onchain can be included in a basket โ€” whether itโ€™s zBTC, JLP, memecoins, LSTs, or LRTs.

We designed pie.fun to have zero limitations when it comes to basket creation.

2. Atomic swap using Jito Bundles

  • Buying a basket involves multiple token swaps executed atomically; all swaps either succeed toghether or fail toghether.

  • But Solana limits transaction size and compute, allowing only 2 swaps per transaction.

  • We solve this with Jito Bundles, which let us group multiple transactions into a single atomic unit.

2 swaps ร— 5 bundled txs = 10 token swaps in one atomic flow

  • This enables large, multi-token baskets โ€” in one seamless user action.

3. Basket Architecture

  • pie.fun uses on-demand minting. When a user swaps into a basket, basket token is minted on the spot.

  • This design ensures:

    • โœ… 100% collateralized baskets

    • โœ… Infinite number of baskets without liquidity constraints

  • Other index protocols often rely on:

    • โŒ DEX-listed baskets โ€” each basket needs its own liquidity pool โ†’ limits the number of baskets and kills flexibility

    • โŒ Synthetic baskets โ€” dependent on external oracles โ†’ introduces risk and complexity

๐Ÿฅง
๐Ÿฝ๏ธ
2 swaps in one transaction
5 transactions bundled into one atomic transaction by jito bundles