Strata

Strata คือ protocol สำหรับปล่อยขาย tokens บน Solana. เราสามารถใช้ Strata เพื่อปล่อยขาย fungible token ใดๆ ไม่ว่าจะเป็น social tokens หรือ dao และ gamefi tokens. เราสามารถใช้ strata ร่วมกับอะไรก็ตามที่มีการคิดราคาแบบ fixed price mechanics เพื่อให้ได้ dynamic pricing mechanics ตัวอย่างเช่น Metaplex CandyMachine.

สำหรับข้อมูลเชิงลึกไปดูได้ ที่นี่. และเราสามารถ ใช้ gui ได้ที่ Strata Launchpad

วิธีสร้าง fully managed token

fully-managed Strata token คือ token ที่มีการจัดการ liquidity โดย protocol ข้อได้เปรียบคือเราสามารถเปิดการ trade token ได้ในทันทีโดยไม่ต้องมี pools หรือ liquidity providers. โดยที่ fully-managed token นั้นก็คือ spl token ทั่วไปกับ metaplex token metadata และ associated bonding curve. ซึ่ง bonding curve จะจัดการเรื่อง liquidity, pricing, และ supply ของ 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()}`
  );
})();

วิธี buy และ 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,
  });
})();

วิธี bootstrap liquidity

Strata สามารถขาย tokens โดยที่เราสามารถควบคุม supply เองได้ ซึ่งมันจะมีประโยชน์สำหรับการทำ liquidity bootstrapping ก่อนจะ list token ของเราบน dex เราสามารถอ่านเพิ่มเติมได้ ที่นี่open in new window หรือปล่อย token ของเราเองได้ที่ 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,
      },
    });
})();

แหล่งข้อมูลอื่น

Last Updated:
Contributors: Todsaporn Banjerdkit