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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@rever22411/amm-commands

v0.3.65

Published

Solana AMM Commands

Downloads

3,031

Readme

Amm (Work In Progress)

Concentrated liquidity market maker (CLMM) program built for the Solana ecosystem.

Concentrated Liquidity Market Maker (CLMM) pools allow liquidity providers to select a specific price range at which liquidity is active for trades within a pool. This is in contrast to constant product Automated Market Maker (AMM) pools, where all liquidity is spread out on a price curve from 0 to ∞. For LPs, CLMM design enables capital to be deployed with higher efficiency and earn increased yield from trading fees. For traders, CLMMs improve liquidity depth around the current price which translates to better prices and lower price impact on swaps. CLMM pools can be configured for pairs with different volatility.

Deploy

prima del deploy su main riaggiustare i padding nei contratti

  • cambiare wallet src/private/admin_wallet.json e ovunque sia hardcodata la publicKey
  • creare un nuovo wallet dedicato alle createPoolFee
  • cambiare wallet src/private/create_pool_fee.json e ovunque sia hardcodata la publicKey
  • cancellare cartella target
  • nel file Anchor.toml decommentare il cluster di dev
  • CONTOLLARE SE NECESSARIO - !!!!!! NUOVO !!!! per le build in DEV dove si include raydium-cp-swap, bisogna aggiungere la feature devnet nel cargo.toml tra le feature di raydium-cp-swap
  • anchor build compila i programmi
  • anchor keys list per recuperare le publicKey dei programmi prima di deployare (dalla cartella target)
  • aggiornare tutte le publicKey vecchie con quelle nuove (sopprattutto Smart Contract declare_id!)
  • anchor deploy deploya i contratti
  • nel file Anchor.toml commentare il cluster di dev e rimettere local
  • fare backup della cartella target/deploy
  • nel file Anchor.toml decommentare il cluster local
  • copiare le cartelle target/idl e target/types rispettivamente in src/program_idl e program_types
  • pubblicare la nuova versione del pacchetto
  • aggiornare il be
  • lanciare lo script con anchor test avendo prima decommentato solamente l'import deploy nel file src/tests/index.ts
  • lo script crea bla bla bla
  • sostituire l'address nella const USDCToken nel file src/config.ts

Squads

nelle istruzioni che usano l'utente per creare account serve circa 0.002 SOL sulla vault di squad usata come utente

Update dello smart contract con firma multisig

  • anchor build -- --features devnet aggiorna il programma buildate .so
  • ./update_idls.sh aggiorna gli idls (json e type)
  • solana program write-buffer target/deploy/amm_bond.so e copiare indirizzo del buffer
  • andare su squad https://devnet.squads.so/connect-squad -> developer -> programs -> seleziona program -> add upgrade inserire indirizzo del buffer e gli altri dati
  • copiare Buffer authority CLI command nel terminale, eseguire e poi cliccare su verify autority
  • selezionare il nuovo upgrade e cliccare Upgrade, aggiungere descrizione e cliccare Initiate Upgrade
  • firmare la transazione con tutti i wallet
  • inviare la transazione

Environment Setup

  1. Install Rust.
  2. Install Solana and then run solana-keygen new to create a keypair at the default location.
  3. install Anchor.

Smart Contracts

Le dimensioni degli account devono essere multiple di 8 Byte se la struct ha dati interni non multipli di 8 Byte (per esempio con un u8 che occupa 1 Byte) la dimensione viene arrotondata per eccesso al primo multiplo

info:

  • la dimensione è scritta nel tooltip nell'IDE VsCode quando metti il cursore sopra il nome della struct
  • per ricavare la dimensione si può usare: mem::size_of::<StructName>()
  • bisogna poi aggiungere 8 Byte di header per l'account

Develop

  • anchor build create contracts target build
  • copy to /tests/src/src/program_types/ the /target/types/* files
  • copy to /tests/src/src/program_idl/ the /target/idl/* files

Description

  • FALSO in PROD e sembra vero in LOCAL: una pool appena creata ha bisogna di una deposit (oltre a quello in creazione) per poter fare swap
  • quando chiudo un account Wsol il contentuto viene swappato in sol e inviato all'account indicato

Publish

  • update package.json version
  • npm i check all package install itself correctly and update lock
  • npm publish --access public publish package over npmjs.com

Testing

You can launch it with command anchor test that launch file specified in package.json

  • clear && anchor test -- --features localnet
  • clear && anchor test -- --features devnet
  • clear && anchor test mainnet