Releases: choice-exchange/aggregation_contract
v1.0.0
DEX Aggregator v1.0.0 - Initial Stable Release
We are thrilled to announce the first stable release of the DEX Aggregator Smart Contract! This is a powerful, flexible, and gas-optimized smart router for the Injective ecosystem, designed to provide users with the best possible swap rates by splitting and routing trades across multiple decentralized exchanges.
This v1.0.0 release marks a major milestone, delivering a feature-complete and robust contract ready for integration and production use.
What is the DEX Aggregator?
The DEX Aggregator acts as a meta-layer on top of the existing DeFi landscape. Instead of swapping on a single DEX, users can submit a complex "route" to this contract. The contract then executes the route, which can involve:
- Splitting a single asset across multiple DEXs in parallel to reduce price impact.
- Chaining swaps together in a multi-hop path (e.g., INJ -> USDT -> ATOM).
- Combining splits and hops into sophisticated, multi-stage routes.
The contract intelligently handles the complexities of asset types (Native vs. CW20) and ensures the final, aggregated output is sent back to the user seamlessly.
✨ Key Features
- Sophisticated Route Planning: Execute complex multi-stage routes involving both parallel splits (
Stage.splits) and sequential hops (Split.path). - Extensible DEX Support: The generic
Operationenum allows for routing across any DEX that exposes a standard swap interface, including both AMMs and Orderbooks. - Seamless Asset Handling: The contract abstracts away the differences between Native and CW20 tokens. Users can start a swap with either, and the contract manages the intermediate assets.
- Automatic Asset Normalization: The contract's most powerful feature. It can automatically convert between the Native and CW20 representations of the same token between stages, enabling extremely complex routes that would otherwise be impossible (e.g., receiving a mix of Native and CW20 SHROOM from Stage 1, unifying them, and using them as input for Stage 2).
- Admin-Controlled Fee Structure: A flexible, admin-controlled mechanism to set percentage-based fees on swaps that occur on specific DEX pools, creating a path for monetization.
What's Included in This Release
This release provides all the necessary components for developers to integrate and deploy the contract:
- Optimized Wasm Binary: A compiled, stripped, and optimized version of the contract is available as
dex_aggregator.wasm. - JSON Schema: A complete JSON schema of all
Instantiate,Execute, andQuerymessages and their responses is located in theschema/directory. This is crucial for front-end development and generating type-safe client libraries. - Usage Examples: The
examples/directory contains JSON files demonstrating how to structure common messages, including route execution and admin actions.
Getting Started
Building the Contract
To build the contract and reproduce the included Wasm binary, run the following command from the project root:
./build_release.shRun tests
cargo test