Skip to main content

Get started

Installation

Example: accept deposits from any chain

Your app takes one asset on one network; your users pay with what they already hold on another. One intent swaps and delivers it: here USDT on Arbitrum in, USDC on Base out, to the address your app credits. The pair is two chain keys and two token symbols, so any other EVM source chain works the same way. A non-EVM source needs that chain’s wallet provider and may need extra steps first, such as a Stellar trustline. The runnable script, with the quote, deadline and settlement steps, is apps/node/src/any-chain-deposit.ts. The core of it:
  • dstAddress is whoever gets credited. Use the user’s own address on your network, or an address your app controls.
  • swapWithApproval approves the token if needed. That is one signature on a wallet that supports batched calls, and two (approve, then swap) otherwise, including the private-key EvmWalletProvider the script uses.
  • Credit only after delivery. Poll sodax.swaps.getStatus until it reports SOLVED or FAILED (NOT_FOUND can come back for the first polls). On SOLVED, call sodax.swaps.waitForIntentDelivery with the destination chain and the fill_tx_hash, and credit only once it succeeds.
The same flow as a compiled, tested recipe: accept any token on Base. Without code: the swap widget. Over plain HTTP: the Swaps API.

Local Installation

Package can be locally installed by following this steps:
  1. Clone this repository to your local machine.
  2. cd into repository folder location.
  3. Execute pnpm install command in your CLI to install dependencies.
  4. Execute pnpm run build to build the packages.
  5. In your app repository package.json file, define dependency named "@sodax/sdk" under "dependencies". Instead of version define absolute path to your SDK repository "file:<sdk-repository-path>" (e.g. "file:/Users/dev/.../operation-liquidity-layer/packages/sdk"). Full example: "@sodax/sdk": "file:/Users/dev/operation-liquidity-layer/sdk-new/packages/sdk".

Local Development

How to setup local development
  1. Clone repository.
  2. Make sure you have Node.js v18+ and corresponding npm installed on your system.
  3. Execute pnpm install command (from root of the project) in your CLI to install dependencies.
  4. Make code changes.
    1. Do not forget to export TS files in same folder index.ts.
    2. Always import files using .js postfix.

Functional Modules inside the SDK

Swaps (Solver) - Cross-chain intent-based swaps
  • EVM (Sonic, Ethereum, Arbitrum, Avalanche, Base, BSC, Optimism, Polygon, HyperEVM, Lightlink, Redbelly, Kaia, Hedera, Robinhood) ✅
  • Sui ✅
  • Stellar ✅
  • ICON ✅
  • Solana ✅
  • Injective ✅
  • NEAR ✅
  • Stacks ✅
  • Bitcoin ✅
Lend / Borrow (Money Market)- Cross-chain lending and borrowing
  • EVM (Sonic, Ethereum, Arbitrum, Avalanche, Base, BSC, Optimism, Polygon, HyperEVM, Lightlink, Redbelly, Kaia, Hedera, Robinhood) ✅
  • Sui ✅
  • Stellar ✅
  • ICON ✅ (bnUSD only)
  • Solana ✅
  • Injective ✅
  • NEAR ✅
  • Stacks ✅
  • Bitcoin ✅ (BTC only)
  • Tron ✅ (USDT only)
Bridge- Cross-chain token bridging
  • EVM (Sonic, Ethereum, Arbitrum, Avalanche, Base, BSC, Optimism, Polygon, HyperEVM, Lightlink, Redbelly, Kaia, Hedera, Robinhood) ✅
  • Sui ✅
  • Stellar ✅
  • ICON ✅
  • Solana ✅
  • Injective ✅
  • NEAR ✅
  • Stacks ✅
  • Bitcoin ✅
  • Tron ✅
Migration- Token migration (ICX, bnUSD, BALN)
  • ICX / wICX → SODA: source chain ICON only
  • BALN → SODA: source chain ICON only
  • bnUSD: between legacy chains (ICON, Sui, Stellar) and the new bnUSD on any other supported chain
Leverage Yield- Leveraged-yield vaults on the Sonic hub Leverage Yield APR- Steady-state APR for those vaults Staking- SODA token staking
  • EVM (Sonic, Ethereum, Arbitrum, Avalanche, Base, BSC, Optimism, Polygon, HyperEVM, Lightlink, Redbelly, Kaia, Hedera, Robinhood) ✅
  • Sui ✅
  • Stellar ✅
  • Solana ✅
  • Injective ✅
  • NEAR ✅
  • Stacks ✅

Tooling Modules inside the SDK

Backend API- SODAX backend data and submit-tx endpoints Intent Relay API- Relayer API endpoint documentation Swaps API- Standalone @sodax/swaps-api HTTP client

AI agent docs

AI-readable docs for @sodax/sdk (and the other @sodax/* packages) are shipped via @sodax/skills — a separate npm package bundling Claude-Code SKILL.md files and a long-form knowledge tree. Recommended: skills CLI — from your project root:
npm + AGENTS.md pointer (fallback for web chats, or when you prefer a devDependency over the CLI):
Then point your agent at node_modules/@sodax/skills/AGENTS.md. See docs/ai-integration-guide.md for all install modes and per-tool wiring.

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Commands


License


Support