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

upers-sdk

v0.0.1

Published

A TypeScript SDK for interacting with the ZO Protocol on Sui Network.

Readme

upers-sdk

A TypeScript SDK for interacting with the ZO Protocol on Sui Network.

Installation

npm install upers-sdk
# or
yarn add upers-sdk

Quick Start

import { API, Network } from 'upers-sdk'
import { SuiClient } from '@mysten/sui/client'

// Initialize the API
const provider = new SuiClient({ url: 'https://sui-rpc.url' })
const api = API.getInstance(
  Network.MAINNET,
  provider,
  'https://api-endpoint',
  'https://price-feed-url'
)

// Example: Get market information
const marketInfo = await api.getMarketInfo()

// Example: Get oracle price for a token
const price = await api.getOraclePrice('sui')

Key Features

Market Operations

// Deposit tokens to get upers
const tx = await api.deposit(
  'sui', // token
  ['coinObjectId'], // coin object IDs
  1000000, // amount
  0 // minimum amount out
)

// Withdraw tokens by burning upers
const tx = await api.withdraw(
  'sui', // token
  ['upersCoinObjectId'], // upers coin object IDs
  1000000, // amount
  0 // minimum amount out
)

// Swap tokens
const tx = await api.swap(
  'sui', // from token
  'usdc', // to token
  BigInt(1000000), // amount
  ['coinObjectId'] // coin object IDs
)

Trading Operations

// Open a position
const tx = await api.openPosition(
  'sui', // collateral token
  'btc', // index token
  BigInt(1000000), // size
  BigInt(100000), // collateral amount
  ['coinObjectId'], // coin object IDs
  true, // long position
  BigInt(100000), // reserve amount
  30000, // index price
  1.5, // collateral price
  0.003 // slippage
)

// Decrease a position
const tx = await api.decreasePosition(
  'positionCapId',
  'sui', // collateral token
  'btc', // index token
  BigInt(500000), // amount to decrease
  true, // long position
  30000, // index price
  1.5, // collateral price
)

// Cancel an order
const tx = await api.cancelOrder(
  'orderCapId',
  'sui',
  'btc',
  true, // long position
  'OPEN_POSITION' // order type
)

Data Queries

// Get position information
const positions = await api.getPositionInfoList(positionCapInfoList, 'ownerAddress')

// Get order information
const orders = await api.getOrderInfoList(orderCapInfoList, 'ownerAddress')

// Get vault information
const vaultInfo = await api.getVaultInfo('sui')

// Get symbol information
const symbolInfo = await api.getSymbolInfo('btc', true) // true for long

// Get market valuation
const valuation = await api.valuateMarket()

Error Handling

The SDK throws errors for invalid operations and network issues. Always wrap API calls in try-catch blocks:

try {
  const marketInfo = await api.getMarketInfo()
} catch (error) {
  console.error('Failed to get market info:', error)
}

Documentation

For detailed API documentation and advanced usage, please refer to the source code and comments.