npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@debridge-finance/alpha-vault

v2.6.0

Published

1. Mint DBR token. 2. Create DLMM pool and deposit 100M DBR tokens with price 1 DBR = 0.05 USDC (this step should be done by Meteora). We should provide them position owner address that is allowed to withdraw funds USDC after crank. 3. Create alpha vau

Downloads

13

Readme

How to create pool and alpha vault for deBridge TGE

  1. Mint DBR token.

  2. Create DLMM pool and deposit 100M DBR tokens with price 1 DBR = 0.05 USDC (this step should be done by Meteora). We should provide them position owner address that is allowed to withdraw funds USDC after crank.

  3. Create alpha vault:

    1. Config (method createProrataConfig()) Params:
    const ix: TransactionInstruction = await AlphaVault.createProrataConfig(
      connection,
      new PublicKey(""), // vault programId
      new PublicKey(""), // admin
      {
        maxBuyingCap: new BN(5_000_000), // 5_000_000 USDC
        index,
        startVestingDuration: new BN(1), // no vesting
        endVestingDuration: new BN(1), // no vesting
        escrowFee: new BN(0),
        individualDepositingCap: new BN(25_000), // 25_000 USDC
      },
    );
    1. Vault (method createPermissionlessVault()) Params:
    const ix: TransactionInstruction =
      await AlphaVault.createPermissionlessVault(
        connection,
        new PublicKey(""), // vault programId
        {
          quoteMint: USDC,
          baseMint: DBR,
          poolAddress: new PublicKey(""), // address from step 2
          poolType: PoolType.DLMM,
          vaultMode: VaultMode.PRORATA,
          config: whitelistedVaultBaseKey,
          whitelistAuthority: helpers.hexToBuffer(signer.address),
        },
        new PublicKey(""), // admin
      );
  4. Users can deposit/withdraw funds in/from vault:

    1. Deposit:
    const signedMessage = await ercSigner.signMessage(
      solAccount.publicKey.toBytes(),
    ); // signed message from back-end
    const { signatureWithoutV, v } = AlphaVault.splitSignature(signedMessage);
    
    const ix: TransactionInstruction = await client.deposit(
      1_000000n, // 1 USDC
      new PublicKey(""), // owner
      new PublicKey(""), // receiver
      signatureWithoutV,
      v,
    );

    For deposit as calldata

    import * as wasm from "@debridge-finance/debridge-external-call";
    
    const signedMessage = await ercSigner.signMessage(
      solAccount.publicKey.toBytes(),
    ); // signed message from back-end
    const { signatureWithoutV, v } = AlphaVault.splitSignature(signedMessage);
    
    // amount not needed - it will use order take amount
    const calldataIxs: CalldataInstruction[] = await client.depositViaCalldata(
      new PublicKey(""), // receiver
      signatureWithoutV,
      v,
    );
    
    const calldata = Buffer.concat(
      calldataIxs.map((cix) => {
        const x = new wasm.ExternalInstructionWrapper(
          0n,
          BigInt(cix.expenses),
          false,
          cix.amountSubstitution ?? [],
          [],
          cix.ix,
        );
        const serialized = x.serialize();
        return serialized;
      }),
    );
    1. Withdrawal
    const ixs: TransactionInstruction[] = await client.withdraw(
      1_000000n, // 1 USDC
      new PublicKey(""), // owner
    );
  5. After pool expiration user can claim token (method claimToken()), withdraw USDC leftovers (method withdrawRemainingQuote()) and close escrow (method closeEscrow()):

const ixs: TransactionInstruction[] = await client.claimToken(
  new PublicKey(""), // owner
);
const ixs2: TransactionInstruction[] = await client.withdrawRemainingQuote(
  new PublicKey(""), // owner
);
const ix3: TransactionInstruction = await client.closeEscrow(
  new PublicKey(""), // owner
);
  1. Crank the vault (tx example)
  2. Admin should withdraw liquidity from pool (method removeLiquidity() from DLMM sdk)