Strata

Strata is a protocol for launching tokens built on Solana. You can use Strata to launch any kind of fungible token, ranging from social tokens to dao and gamefi tokens. You can also compose strata with anything that uses fixed price mechanics to get dynamic pricing mechanics, for example the Metaplex CandyMachine.

More in-depth docs are available here. You can also use the gui at Strata Launchpad

How to create a fully managed token

A fully-managed Strata token is a token where the liquidity is managed by the protocol. The upshot is that you immediately get a tradeable token, with no need for pools or liquidity providers. A fully-managed token is a normal spl token with metaplex token metadata and an associated bonding curve. The bonding curve manages the liquidity, pricing, and supply of that token.

Press </> button to view full source
import {
  SplTokenBonding,
  ExponentialCurveConfig,
} from "@strata-foundation/spl-token-bonding";
import * as anchor from "@project-serum/anchor";
import { NATIVE_MINT } from "@solana/spl-token";

(async () => {
  const provider = anchor.getProvider();
  const tokenBondingSdk = await SplTokenBonding.init(provider);

  // Price = 0.01 * sqrt(Supply)
  const curve = await tokenBondingSdk.initializeCurve({
    config: new ExponentialCurveConfig({
      c: 0.01,
      b: 0,
      pow: 1,
      frac: 2,
    }),
  });
  const { tokenBonding, baseMint, targetMint } =
    await tokenBondingSdk.createTokenBonding({
      curve,
      baseMint: NATIVE_MINT,
      targetMintDecimals: 2,
      buyBaseRoyaltyPercentage: 5,
      buyTargetRoyaltyPercentage: 5,
    });

  console.log(
    `You can use ${baseMint.toBase58()} to buy ${targetMint.toBase58()} using the bonding curve at address ${tokenBonding.toBase58()}`
  );
})();

How to buy and sell a token

Press </> button to view full source
import { SplTokenBonding } from "@strata-foundation/spl-token-bonding";
import * as anchor from "@project-serum/anchor";

(async () => {
  const provider = anchor.getProvider();
  const tokenBondingSdk = await SplTokenBonding.init(provider);
  await tokenBondingSdk.buy({
    tokenBonding: new PublicKey("..."),
    baseAmount: 0.01, // Amount of the baseMint from create token to use for this purchase.
    slippage: 0.05,
  });
  await tokenBondingSdk.buy({
    tokenBonding: new PublicKey("..."),
    desiredTargetAmount: 0.01, // Purchase instead using the amount of targetMint you want to receive
    slippage: 0.05,
  });
})();
Press </> button to view full source
import { SplTokenBonding } from "@strata-foundation/spl-token-bonding";
import * as anchor from "@project-serum/anchor";

(async () => {
  const provider = anchor.getProvider();
  const tokenBondingSdk = await SplTokenBonding.init(provider);
  await tokenBondingSdk.sell({
    tokenBonding: new PublicKey("..."),
    targetAmount: 0.01, // Amount of the targetMint to sell off
    slippage: 0.05,
  });
})();

How to bootstrap liquidity

Strata can also sell tokens where you would like to manually manage the supply. This can be useful for liquidity bootstrapping before listing your token on a dex. You can read more about these hereopen in new window or launch your own at Strata Launchpad

Press </> button to view full source
import { MarketplaceSdk } from "@strata-foundation/marketplace-sdk";
import * as anchor from "@project-serum/anchor";

(async () => {
  const provider = anchor.getProvider();
  const marketplaceSdk = await MarketplaceSdk.init(provider);
  const { tokenBonding, targetMint } =
    await marketplaceSdk.createLiquidityBootstrapper({
      baseMint: NATIVE_MINT,
      startPrice: 0.05,
      minPrice: 0.01,
      interval: 5 * 60 * 60,
      maxSupply: 100,
      bondingArgs: {
        targetMintDecimals: 0,
      },
    });
})();

Other Resources

Last Updated:
Contributors: Noah Prince