Installation
Install the core Solana stack
Section titled “Install the core Solana stack”pnpm add @stendar/core @stendar/solana @stendar/provider-jupiter @stendar/wallet-coreOptional EVM and cross-chain packages
Section titled “Optional EVM and cross-chain packages”pnpm add @stendar/evm @stendar/provider-oneinch @stendar/provider-aave @stendar/provider-lifi @stendar/wallet-viemCreate .env
Section titled “Create .env”SOLANA_RPC_URL=https://api.mainnet-beta.solana.comWALLET_PRIVATE_KEY=<base58-private-key>
# Optional EVM runtime supportEVM_RPC_URL=https://eth-mainnet.g.alchemy.com/v2/YOUR_KEYEVM_CHAIN_ID=ethereum-mainnetEVM_PRIVATE_KEY=0xYOUR_PRIVATE_KEYONEINCH_API_KEY=<1inch-key>AAVE_SUBGRAPH_URL=https://gateway.thegraph.com/api/YOUR_KEY/subgraphs/id/...LIFI_INTEGRATOR=stendarBEST_EXECUTION=trueLoad env vars in Node.js
Section titled “Load env vars in Node.js”Use Node 22+ built-in env loading so config stays out of source:
process.loadEnvFile?.();
const rpcUrl = process.env.SOLANA_RPC_URL;const privateKey = process.env.WALLET_PRIVATE_KEY;
if (!rpcUrl || !privateKey) { throw new Error('Missing SOLANA_RPC_URL or WALLET_PRIVATE_KEY');}Verify your setup
Section titled “Verify your setup”- Run First swap with
dryRun: true - Then move to First strategy for
StrategyEnginelifecycle