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 🙏

© 2026 – Pkg Stats / Ryan Hefner

adrena-client

v1.10.0

Published

Adrena Client for interacting with Adrena Protocol

Readme

Adrena Client

JavaScript/TypeScript client library for interacting with the Adrena Protocol.

Installation

npm install adrena-client
# or
yarn add adrena-client

Usage

Initialization

To start using the Adrena client, you first need to initialize it:

import { AdrenaClient } from 'adrena-client';

// Initialize the client
const client = await AdrenaClient.initialize(
  wallet, // Wallet instance
  process.env.SOLANA_RPC_URL // RPC URL
);

Loading User Positions

To fetch user positions:

const positions = await client.loadUserPositions(
  new PublicKey(userAddress),
  positionAddresses?.map((address) => new PublicKey(address))
);

Trading Operations

Opening Long Position

To open a long position with swap:

const result = await client.openOrIncreasePositionWithSwapLong({
  owner: publicKey, // Owner's public key
  collateralMint: collateralToken.mint, // Collateral token mint
  mint: targetToken.mint, // Target token mint
  price: new BN(entryPrice), // Entry price
  collateralAmount: new BN(collateralAmount), // Collateral amount
  leverage: leverageValue, // Leverage value
  notification: {}, // Notification config
  referrer: referrerAddress // Optional referrer address
});

Opening Short Position

To open a short position with swap:

const result = await client.openOrIncreasePositionWithSwapShort({
  owner: publicKey,
  collateralMint: collateralToken.mint,
  mint: targetToken.mint,
  price: new BN(entryPrice),
  collateralAmount: new BN(collateralAmount),
  leverage: leverageValue,
  notification: {},
  referrer: referrerAddress
});

Closing Positions

To close a long position:

const result = await client.closePositionLong({
  position: positionData,
  price: exitPrice,
  notification: {}
});

To close a short position:

const result = await client.closePositionShort({
  position: positionData,
  price: exitPrice,
  notification: {}
});

Position Management

Adding Collateral

To add collateral to an existing position:

const result = await client.addCollateralToPosition({
  position: positionData,
  addedCollateral: new BN(collateralAmount),
  notification: {}
});

User Profile Management

Initialize User Profile

const result = await client.initUserProfile({
  nickname: "trader_name",
  notification: {}
});

Edit User Profile

const result = await client.editUserProfile({
  nickname: "new_trader_name",
  notification: {}
});

Staking Operations

Get Staking Statistics

const stakingStats = await client.getStakingStats();

Get User Staking Account

const userStaking = await client.getUserStakingAccount({
  owner: publicKey,
  stakedTokenMint: tokenMint
});

Liquidity Operations

Add Genesis Liquidity

const result = await client.addGenesisLiquidity({
  amountIn: liquidityAmount,
  minLpAmountOut: new BN(minLpAmount),
  notification: {}
});

Get Add Liquidity Amount and Fee

const result = await client.getAddLiquidityAmountAndFee({
  amountIn: new BN(amount),
  token: tokenData
});

Features

  • TypeScript support
  • Solana Web3.js integration
  • Anchor Program support
  • Complete transaction management
  • Notification system integration
  • Position management
  • User profile system
  • Staking operations
  • Liquidity management

License

MIT