TypeScript SDK for Neutral Trade vaults.
📚 Documentation
# npm
npm install @neutral-trade/sdk
# yarn
yarn add @neutral-trade/sdk
# pnpm
pnpm add @neutral-trade/sdk
# bun
bun add @neutral-trade/sdk
All dependencies are bundled with the SDK, so no additional peer dependencies are required.
import { NeutralTrade, VaultId } from '@neutral-trade/sdk'
// Initialize the SDK
const sdk = await NeutralTrade.create({
rpcUrl: 'YOUR_RPC_URL_HERE'
})
// Get user balance for specific vaults
const balances = await sdk.getUserBalanceByVaultIds({
vaultIds: [VaultId.solnl, VaultId.btcnl],
userAddress: 'YOUR_WALLET_ADDRESS'
})
console.log(balances)
The SDK supports both Drift and Bundle vault types. Use the VaultId enum to reference vaults:
import { VaultId } from '@neutral-trade/sdk'
// Drift Vaults
VaultId.solnl // SOL Neutral Long
VaultId.btcnl // BTC Neutral Long
VaultId.jlpdnv1 // JLP DN V1
// Bundle Vaults
VaultId.hlfundingarb // HL Funding Arbitrage
VaultId.alpdn // ALP DN
See the documentation for the complete list of available vaults.
Check out the examples directory for more usage examples.