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

sol-orderly-backend

v0.0.1

Published

Readme

Solana Orderly Network Backend Adapter

This package is based on the Orderly JS SDK’s Solana Adapter. It enables seamless USDC deposits and withdrawals on the Orderly Network from Node.js backend applications. While optimized for Raydium perpetual markets, it also supports other Orderly-compatible brokers.

The official Orderly SDK is primarily frontend-focused — this library bridges the gap for backend integration.


Table of Contents


Features

  • Deposit USDC into Orderly Network vaults for Solana brokers
  • Withdraw USDC from Orderly Network vaults back to your wallet
  • Optimized for Raydium perpetual markets (compatible with other brokers)
  • Built for Node.js backends (no wallet adapter UI required)
  • Works on devnet and mainnet
  • Handles Solana connection setup and transaction confirmation automatically

Installation

Install via npm:

npm install sol-orderly-backend
npm install @solana/web3.js bs58 dotenv @solana/spl-token

Usage Examples

Deposit USDC

☘️ Before using, ensure you have created an Orderly account with your Solana wallet, and you have created a key, ✓ Deposit USDC into an Orderly Network vault for trading on a Solana broker:

import { Keypair, Connection } from '@solana/web3.js';
import bs58 from 'bs58';
import { DefaultSolanaWalletAdapter }  from 'sol-orderly-backend/neuron1.backend.adapter.js';
// or require
// const { DefaultSolanaWalletAdapter } = require('sol-orderly-backend/neuron1.backend.adapter.js');
const solanaAdapter = new DefaultSolanaWalletAdapter();

// Load wallet from environment variable
const secret = process.env.SOLANA_SECRET_KEY;
const wallet = Keypair.fromSecretKey(bs58.decode(secret));

// Connect to Solana devnet
const connection = new Connection('https://api.devnet.solana.com', 'confirmed');

const depositData = {
  accountId: 'your-orderly-account-id',
  brokerId: 'raydium',   // Broker ID
  tokenAmount: 1.23,     // Amount in USDC
};

async function deposit() {
  try {
    const txSig = await solanaAdapter.depositUSDC(
      'devnet', // network can be either in [ 'devnet', 'mainnet']
      connection,
      {
        payerWallet: wallet,
        from: 'YourSolanaWalletAddress', // you wallet address from where you want to transfer USDC
        data: depositData,
      }
    );
    console.log('Deposit confirmed:', txSig);
  } catch (error) {
    console.error('Deposit failed:', error.message);
  }
}

deposit();

Withdraw USDC

Withdraw USDC from an Orderly Network vault back to your Solana wallet:

import { Keypair } from '@solana/web3.js';
import { DefaultSolanaWalletAdapter }  from 'sol-orderly-backend/neuron1.backend.adapter.js';
// or require
// const { DefaultSolanaWalletAdapter } = require('sol-orderly-backend/neuron1.backend.adapter.js');
const solanaAdapter = new DefaultSolanaWalletAdapter();

const withdrawData = {
  brokerId: 'raydium', // Orderly broker you registered with
  amount: 2.5,                         // Amount in USDC , Remember that withdrawal fee is 1 USDC
  orderlyAccountId: 'your-orderly-id', // 
  orderlyPublic: 'your-orderly-public', // Your public key with ed25519: prefix
};

async function withdraw() {
  try {
    const txSig = await solanaAdapter.withdrawUSDC(
      'devnet', // network can be either in [ 'devnet', 'mainnet']
      {
        receiverWallet: wallet,
        data: withdrawData,
        receiver: 'YourSolanaWalletAddress', // your wallet address
      }
    );
    console.log('Withdrawal confirmed:', txSig); // withdrawal transaction result
  } catch (error) {
    console.error('Withdrawal failed:', error.message);
  }
}

withdraw();

Security Notes

Your Solana secret key is highly sensitive — anyone with access can control your funds. Follow best practices:

  • Never hardcode secret keys in source code.
  • Use secure storage methods:
    • .env file with dotenv (SOLANA_SECRET_KEY=your-key)
    • JSON keypair (id.json) generated via solana-keygen new
    • Secure vaults such as AWS KMS or hardware wallets
  • Add .env to .gitignore to prevent accidental commits
  • Avoid logging sensitive data
  • See Solana Documentation for secure key management

Disclaimer

This is an unofficial, community-maintained library for integrating Solana USDC deposits and withdrawals with the Orderly Network.

It is provided as-is with no guarantees or warranties. For mission-critical systems, validate functionality thoroughly or wait for an official SDK update.

Issues and contributions are welcome — please open a GitHub issue.