Decode Protocol Documentation
Advanced cross-chain platform for decentralized trading with intelligent liquidity aggregation, built-in bridge, and best rates guaranteed across 8 blockchains.
Key Features
Discover all the capabilities of our platform
Smart Aggregation
Real-time analysis of multiples DEXs to find the best rates...
Cross-Chain Native
Swap between different blockchains without intermediaries...
Gas Optimization
Automatic reduction of transaction fees...
Advanced Security
Non-custodial architecture with multiple audits...
Analytics & Reporting
Complete dashboard with real-time analytics...
API & Integration
Complete RESTful API with SDKs for all major languages...
Swap Engine
Multi-DEX Liquidity Aggregator
What is a Swap Aggregator?
A swap aggregator is a protocol that pools liquidity from multiple DEX platforms to offer users the best possible price for their trades.
Fees per trade: 0.25%
Configuration Parameters
- Slippage Tolerance - default 0.5%
- Deadline - default 20 minutes
- Max Gas Price - default 150 Gwei
Our swap engine analyzes prices across all DEXs simultaneously and chooses the optimal path based on liquidity, fees, and slippage.
Cross-Chain Bridge
Cross-Chain Bridge Aggregator
What is a Cross-Chain Aggregator?
A cross-chain aggregator is a protocol that enables asset transfers between different blockchains using the most efficient bridges.
Advanced Security
- Non-custodial architecture
- Regular security audits
- MEV attack protection
| Source Network | Destination Network | Estimated Time | Estimated Fees |
|---|---|---|---|
| Ethereum | Polygon | 2-5 min | $0.50 - $2.00 |
| Polygon | Arbitrum | 3-7 min | $0.30 - $1.50 |
| Arbitrum | Optimism | 5-10 min | $0.40 - $2.00 |
| BSC | Avalanche | 10-20 min | $1.00 - $5.00 |
Supported Networks
Complete multi-chain connectivity
| Network | Chain ID | Type | RPC | Explorer | Status |
|---|---|---|---|---|---|
| Ethereum | 1 | Mainnet | https://eth.llamarpc.com | Etherscan | Live |
| Polygon | 137 | L2 | https://polygon-rpc.com | Polygonscan | Live |
| BSC | 56 | Mainnet | https://bsc-dataseed.binance.org | BscScan | Live |
| Arbitrum | 42161 | L2 | https://arb1.arbitrum.io/rpc | Arbiscan | Live |
| Optimism | 10 | L2 | https://mainnet.optimism.io | Optimistic Etherscan | Live |
| Avalanche | 43114 | Mainnet | https://api.avax.network/ext/bc/C/rpc | Snowtrace | Live |
| Base | 8453 | L2 | https://mainnet.base.org | BaseScan | Live |
| Gnosis | 100 | Sidechain | https://rpc.gnosischain.com | Gnosisscan | Live |
| Fantom | 250 | Mainnet | https://rpc.ftm.tools | FTMScan | Offline |
| Linea | 59144 | L2 | https://rpc.linea.build | Lineascan | Offline |
| zkSync Era | 324 | L2 | https://mainnet.era.zksync.io | zkSync Explorer | Offline |
| Scroll | 534352 | L2 | https://rpc.scroll.io | Scrollscan | Offline |
| Moonbeam | 1284 | Parachain | https://rpc.api.moonbeam.network | Moonscan | Offline |
| Cronos | 25 | Mainnet | https://evm.cronos.org | Cronoscan | Offline |
We regularly add new blockchains. Contact us if you would like to see a specific network added to our platform.
Quick Start
Get an API token and make your first request in 2 minutes
Register & Get Your API Token
Create an account and obtain a Bearer token. The free plan gives you 100 000 calls/month.
curl -X POST https://api.decode.bet/api/register \
-H "Content-Type: application/json" \
-d '{"email":"user@example.com","password":"yourpassword"}'
# Response: {"success":true,"token":"free_abc123...","plan":"free",...}Approve the Smart Contract
Mandatory – Before any swap or bridge, you must authorize the Decode smart contract to spend your ERC‑20 tokens. Without this approval, the API will return an error.
Use the address 0X_TONSC as the spender. This address is the same across all supported chains.
// Example approval from a smart contract
IERC20(token).approve(0X_TONSC, amount);
Replace tokenAddress with the address of the token you want to swap and amount with the amount in wei.
A single approval per token is enough for unlimited use (if you approve type(uint256).max).
Test a Swap Quote
Call the /swap/quote endpoint with your token and the required query parameters.
curl "https://api.decode.bet/swap/quote?fromToken=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2&toToken=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48&amount=1.0&network=1&recipient=0xRecipient&slippage=0.5" \
-H "Authorization: Bearer YOUR_TOKEN"Test a Bridge Quote
Use /bridge/quote to move assets across chains.
curl "https://api.decode.bet/bridge/quote?fromToken=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48&toToken=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48&amount=1000&networkIn=1&networkOut=137&recipient=0xRecipient" \
-H "Authorization: Bearer YOUR_TOKEN"You now have the basics. Explore the full API reference below for all parameters and response fields.
API Reference
Complete documentation of our REST API
/api/registerCreate a new account and receive a Bearer token. All subsequent API calls must include the token in the Authorization header.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| string | Yes | Your email address | |
| password | string | Yes | Password (min 8 characters) |
curl -X POST https://api.decode.bet/api/register \
-H "Content-Type: application/json" \
-d '{"email":"your@email","password":"strongpassword"}'Use POST /api/login with the same credentials to retrieve your token.
/swap/quoteGet the best price for a swap on a single chain. The API aggregates liquidity from all supported DEXs and returns the optimal execution data.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| fromToken | string | Yes | Source token address (e.g. 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 for WETH) |
| toToken | string | Yes | Destination token address (e.g. 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 for USDC) |
| amount | string | Yes | Amount to swap (in wei or token decimals) |
| network | integer | Yes | Chain ID (1=Ethereum, 137=Polygon, …) |
| recipient | string | Yes | Address that will receive the output tokens |
| slippage | float | Yes | Slippage tolerance in % (e.g. 0.5) |
curl "https://api.decode.bet/swap/quote?fromToken=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2&toToken=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48&amount=1000000000000000000&network=1&recipient=0xYourAddress&slippage=0.5" \
-H "Authorization: Bearer YOUR_TOKEN"/bridge/quoteGet a quote for a cross-chain bridge between two networks.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| fromToken | string | Yes | Token address to bridge (e.g. 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 for USDC) |
| toToken | string | Yes | Token address to receive on the destination chain (must be same as fromToken for bridge) |
| amount | string | Yes | Amount to bridge (in wei or token decimals) |
| networkIn | integer | Yes | Source chain ID |
| networkOut | integer | Yes | Destination chain ID |
| recipient | string | Yes | Address that will receive the tokens on the destination chain |
curl "https://api.decode.bet/bridge/quote?fromToken=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48&toToken=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48&amount=1000000000&networkIn=1&networkOut=137&recipient=0xYourAddress" \
-H "Authorization: Bearer YOUR_TOKEN"SDKs & Libraries
Integration examples with different languages
async function getSwapQuote() {
const token = "YOUR_TOKEN";
const params = new URLSearchParams({
fromToken: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
toToken: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
amount: "1000000000000000000",
network: 1,
recipient: "0xYourAddress",
slippage: 0.5
});
const response = await fetch(
`https://api.decode.bet/swap/quote?${params}`,
{
headers: { Authorization: `Bearer ${token}` }
}
);
return response.json();
}FAQ
Frequently Asked Questions
What are the fees?
Our platform charges 0.25% on each swap. Gas fees are paid directly to the blockchain.
Is it secure?
Yes, we are non-custodial: your funds remain in your wallet.
What is the execution time?
Swaps on the same blockchain take less than 30 seconds. Cross-chain bridges take between 2 and 10 minutes.
Can I integrate the API into my app?
Absolutely! Our RESTful API is designed for easy integration.
How do I get an API key?
Sign up via POST /api/register to receive a Bearer token.
Are there rate limits?
Yes, limits depend on your plan (from 20 req/min up to 600 req/min).
Contact & Support
We're here to help
Technical Support
Email: support@Decode.bet
Response Time: Under 24h