cart-shoppingBuying and Selling Baskets

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.

2 swaps in one transaction
5 transactions bundled into one atomic transaction by jito bundles

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

Last updated