Decode Protocol Documentation

Advanced cross-chain platform for decentralized trading with intelligent liquidity aggregation, built-in bridge, and best rates guaranteed across 8 blockchains.

Multi-Chain Best Rates Secure Gas Optimized Cross-Chain Real-time
8
Blockchains
10+
Integrated DEXs
<2s
Response Time
0.25%
Max Fees
99.9%
Uptime
24/7
Support

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
Smart Optimization

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 NetworkDestination NetworkEstimated TimeEstimated Fees
EthereumPolygon2-5 min$0.50 - $2.00
PolygonArbitrum3-7 min$0.30 - $1.50
ArbitrumOptimism5-10 min$0.40 - $2.00
BSCAvalanche10-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
New Networks

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.

Smart contract address to approve

Use the address 0X_TONSC as the spender. This address is the same across all supported chains.

Solidity
Ethers.js
Python
// 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"
Ready to Go!

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

POST/api/register

Create a new account and receive a Bearer token. All subsequent API calls must include the token in the Authorization header.

Request Body

FieldTypeRequiredDescription
emailstringYesYour email address
passwordstringYesPassword (min 8 characters)
cURL
curl -X POST https://api.decode.bet/api/register \
  -H "Content-Type: application/json" \
  -d '{"email":"your@email","password":"strongpassword"}'
Existing User?

Use POST /api/login with the same credentials to retrieve your token.

GET/swap/quote

Get 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

ParameterTypeRequiredDescription
fromTokenstringYesSource token address (e.g. 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 for WETH)
toTokenstringYesDestination token address (e.g. 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 for USDC)
amountstringYesAmount to swap (in wei or token decimals)
networkintegerYesChain ID (1=Ethereum, 137=Polygon, …)
recipientstringYesAddress that will receive the output tokens
slippagefloatYesSlippage tolerance in % (e.g. 0.5)
cURL
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"
GET/bridge/quote

Get a quote for a cross-chain bridge between two networks.

Query Parameters

ParameterTypeRequiredDescription
fromTokenstringYesToken address to bridge (e.g. 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 for USDC)
toTokenstringYesToken address to receive on the destination chain (must be same as fromToken for bridge)
amountstringYesAmount to bridge (in wei or token decimals)
networkInintegerYesSource chain ID
networkOutintegerYesDestination chain ID
recipientstringYesAddress that will receive the tokens on the destination chain
cURL
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

JavaScript
Python
TypeScript
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

Discord Community

Telegram Group