Contract Details
Tech Stack
Python FastAPI httpx Redis Docker
Chains
Ethereum Optimism Polygon Arbitrum Base
Description
REST API template wrapping multiple DEX aggregators (1inch, 0x, Paraswap, CowSwap) with your own fee layer. FastAPI backend that aggregates quotes, compares across providers, selects the best route, and injects your protocol fee before returning swap calldata.
Features
- ✓ Parallel quote fetching from 4 providers
- ✓ Net-output ranking (amount minus gas cost)
- ✓ Configurable BPS fee injection
- ✓ Redis caching (5s TTL)
- ✓ Multi-chain support (ETH, OP, Polygon, Arbitrum, Base)
- ✓ Docker + docker-compose deployment
- ✓ OpenAPI documentation
- ✓ Python async client example
// SPDX-License-Identifier: MIT pragma solidity ^0.8.24; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /// @title Aggregator API /// @notice REST API wrapping multiple DEX aggregators with your fee. contract AggregatorApi { address public immutable owner; uint256 public constant VERSION = 1; event Initialized(address indexed deployer); constructor() { owner = msg.sender; emit Initialized(msg.sender); } // ... full implementation in purchased package }