Integration Overview
Evix supports three integration patterns depending on your environment and requirements.
Integration Methods
SDK Integration
Use the TypeScript or Rust SDK to build and execute swaps from your backend or bot. Best for most use cases.
Best for: Trading bots, backends, automation
Direct Contract Call
Call IEvix.swap() directly from another smart contract. No SDK needed — just the interface.
Best for: On-chain protocols, smart accounts
Calldata Encoding
Use the SDK to encode swap calldata without executing it. Feed the calldata into your own transaction pipeline.
Best for: Custom signers, smart account batching, relay systems
Comparison
| Capability | SDK Integration | Direct Contract | Calldata Encoding |
|---|---|---|---|
| Simulation | simulateSwap() | eth_call | Manual |
| Execution | swap() | Contract-to-contract | Your pipeline |
| Language | TypeScript, Rust | Solidity | TypeScript, Rust |
| Wallet required | Yes (for execution) | N/A (contract) | No |
| Complexity | Low | Medium | Medium |
Typical Flow
Regardless of the integration method, the recommended execution flow is:
- Set
minAmountOut— The integrator determines the acceptable minimum output (from their own pricing, oracle, or optionally via the SDK'ssimulateSwap()). - Execute — Submit the swap transaction with a tight deadline and your
minAmountOut. - Handle errors — Check for deadline, slippage, or pair-related reverts.
Guides
- Basic Swap — End-to-end swap execution
- Bot Integration — Process trade signals with slippage control
- Smart Account — Calldata encoding for smart account batching