Skip to content

Tools

The Aspens SDK is a Rust workspace published on crates.io as aspens and source-distributed at github.com/aspensprotocol/sdk.

It ships four pieces:

ComponentPurpose
aspens (lib)Rust library — gRPC client, trading commands, EVM + Solana signing helpers
aspens-cliScripted command-line trading
aspens-replInteractive REPL with command history
aspens-adminStack configuration: chains, tokens, markets, contracts

Library

cargo add aspens

Default features pull the full client runtime (gRPC, RPC submission, tokio). For browser / embedded / offline-signing consumers that only need to build and sign order payloads, drop the client feature:

aspens = { version = "0.4", default-features = false, features = ["evm", "solana"] }

Feature flags (all default-on):

FeatureAdds
evmaspens::evmMidribV3 sol! bindings, EIP-712 hasher, EIP-191 signer
solanaaspens::solana — PDA derivations, instruction builders, borsh payload encoder
clientAspensClient, commands::*, chain_client, executor, RPC submission

Always available regardless of features:

  • aspens::orders::derive_order_id — the canonical SHA-256 derivation the arborter validates against. Use this on the client and pass the result through OrderAuthorization.order_id.
  • aspens::orders::parse_destination_token_bytes32 — the shared cross-chain-token decoder (parity-pinned against the arborter).
  • aspens::wallet::{Wallet, CurveType, load_trader_wallet*} — the curve-agnostic wallet abstraction (Wallet::Evm / Wallet::Solana).

Binaries

All three binaries take --stack <URL> (or read ASPENS_MARKET_STACK_URL from .env) and --env-file <PATH>.

cargo install --locked --git https://github.com/aspensprotocol/sdk \
  aspens-cli aspens-repl aspens-admin

aspens-cli and aspens-repl read TRADER_PRIVKEY (EVM, hex) and TRADER_PRIVKEY_SOLANA (Solana keypair, base58 — only required when trading on Solana chains).

aspens-admin reads ADMIN_PRIVKEY for EIP-712 login and ASPENS_JWT (or --jwt) for authenticated commands.

See the Developer Guide for the command surface and the Operator Guide for the admin workflow.