import {
GlamClient,
WSOL,
nameToChars,
StateAccountType
} from "@glamsystems/glam-sdk";
// Initialize the GLAM client
const glamClient = new GlamClient();
// Build a mint model
const mintModel = {
name: nameToChars("GLAM Tokenized Vault Demo"),
symbol: "gtvdSOL",
baseAssetMint: WSOL,
maxCap: new BN(1000_000_000_000), // 1000 SOL max cap
minSubscription: new BN(1_000_000_000), // 1 SOL min subscription
minRedemption: new BN(100_000_000), // 0.1 share min redemption
lockupPeriod: new BN(0), // no lockup period on new shares
feeStructure: {
vault: {
subscriptionFeeBps: 10,
redemptionFeeBps: 20,
},
manager: {
subscriptionFeeBps: 10,
redemptionFeeBps: 20,
},
management: {
feeBps: 10,
},
performance: {
feeBps: 2000,
hurdleRateBps: 500,
hurdleType: { hard: {} },
},
protocol: {
baseFeeBps: 0, // will be overwritten in program with 1
flowFeeBps: 0, // will be overwritten in program with 2000
},
},
notifyAndSettle: {
model: { continuous: {} },
permissionlessFulfillment: false, // only manager can fulfill
subscribeNoticePeriodType: { soft: {} },
subscribeNoticePeriod: new BN(0), // not needed for a vault that allows instant subscription
subscribeSettlementPeriod: new BN(0), // not needed for a vault that allows instant subscription
subscribeCancellationWindow: new BN(0), // not needed for a vault that allows instant subscription
redeemNoticePeriodType: { soft: {} },
redeemNoticePeriod: new BN(0), // not set
redeemSettlementPeriod: new BN(0), // not set
redeemCancellationWindow: new BN(0), // not set
timeUnit: { slot: {} },
padding: [0, 0, 0],
}
}
// Create the tokenized vault
const txSig = await glamClient.mint.initialize(
mintModel,
StateAccountType.TOKENIZED_VAULT,
{ simulate: true },
);