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

@project-serum/serum-dev-tools

v1.0.5

Published

developer tooling suite for building on serum

Downloads

58

Readme

Serum DevTools 🛠️

A developer tooling SDK for building on serum-dex.

Prerequisites

You will need to use the FileKeypair class that extends the Keypair class from @solana/web3.js to provide easy file-based keypair management, which is required for the market making features provided by this package.

const owner = FileKeypair.generate("./scripts/keys/owner.json");

const airdropSig = await connection.requestAirdrop(
  owner.keypair.publicKey,
  10 * LAMPORTS_PER_SOL,
);
await connection.confirmTransaction(airdropSig);

You need to have a serum-dex program deployed on the cluster you wish to interact with.

You can either,

  • Use the serum-dev-tools CLI to deploy the program.

  • use the already deployed serum-dex programs, 9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin on mainnet-beta and DESVgJVGajEgKGXhb6XmqDHGz3VjdgP7rEVESBgxmroY on devnet.

Get Started

yarn add @project-serum/serum-dev-tools

Initialize a Dex

const connection = new Connection("http://localhost:8899", "confirmed");

const dexAddress = new PublicKey(
  "7zo7HCQAZPRb4pYiQQ6fLjC8ssN3E8LkavVs8JUA5NMn",
);

const dex = new Dex(dexAddress, connection);

Create Coin instances for your Market

const baseCoin = await dex.createCoin(
  "SAYA",
  9,
  owner.keypair,
  owner.keypair,
  owner.keypair,
);

const quoteCoin = await dex.createCoin(
  "SRM",
  9,
  owner.keypair,
  owner.keypair,
  owner.keypair,
);

// Fund the FileKeypair object to place orders.

await baseCoin.fundAccount(1000000, owner.keypair, connection);

await quoteCoin.fundAccount(2000000, owner.keypair, connection);

Initialize a Market

const market = await dex.initDexMarket(owner.keypair, baseCoin, quoteCoin, {
  lotSize: 1e-3,
  tickSize: 1e-2,
});

Run a Market Maker

dex.runMarketMaker(market, owner, {
  durationInSecs: 30,
  orderCount: 3,
  initialBidSize: 1000,
  baseGeckoSymbol: "solana",
  quoteGeckoSymbol: "usd",
});

Run a crank

dex.runCrank(market, owner, {
  durationInSecs: 20,
  verbose: true,
});