abstract-smart-order-router-ygg
v1.0.0
Published
Uniswap Smart Order Router with Abstract Chain Support - Fork by YieldGuildGames
Downloads
96
Maintainers
Readme
Abstract Smart Order Router (YGG)
🚀 Uniswap Smart Order Router with Abstract Chain Support
A fork of the official Uniswap Smart Order Router that adds comprehensive support for Abstract mainnet and testnet chains.
✨ Features
- ✅ Abstract Mainnet (Chain ID: 2741) - Full routing support
- ✅ Abstract Testnet (Chain ID: 11124) - Full routing support
- ✅ Native ETH Support - Seamless ETH trading on Abstract
- ✅ Token Support - WETH, USDC, USDT with proper contract addresses
- ✅ Gas Optimization - Optimized gas costs for Abstract chains
- ✅ Full Compatibility - All existing Uniswap router functionality preserved
📦 Installation
npm install abstract-smart-order-router-ygg🚀 Quick Start
import { AlphaRouter } from 'abstract-smart-order-router-ygg';
import { ChainId } from '@uniswap/sdk-core';
import { ethers } from 'ethers';
// Initialize provider for Abstract mainnet
const provider = new ethers.providers.JsonRpcProvider(
'https://api.mainnet.abs.xyz'
);
// Create router instance
const router = new AlphaRouter({
chainId: 2741, // Abstract mainnet
provider: provider,
});
// Get quote for ETH -> USDC trade
const route = await router.route(ethAmount, usdcToken, TradeType.EXACT_INPUT, {
recipient: walletAddress,
slippageTolerance: new Percent(5, 100),
deadline: Math.floor(Date.now() / 1000 + 1800),
});🌐 Supported Chains
| Chain | Chain ID | RPC URL | Explorer | | ---------------- | -------- | --------------------------- | --------------------------- | | Abstract Mainnet | 2741 | https://api.mainnet.abs.xyz | https://abscan.org/ | | Abstract Testnet | 11124 | https://api.testnet.abs.xyz | https://sepolia.abscan.org/ |
📋 Contract Addresses
Abstract Mainnet (2741)
- Quoter V2:
0x728BD3eC25D5EDBafebB84F3d67367Cd9EBC7693 - Multicall:
0x9CA4dcb2505fbf536F6c54AA0a77C79f4fBC35C0 - WETH:
0x3439153EB7AF838Ad19d56E1571FBD09333C2809 - USDC:
0x84A71ccD554Cc1b02749b35d22F684CC8ec987e1 - USDT:
0x0709F39376dEEe2A2dfC94A58EdEb2Eb9DF012bD
Abstract Testnet (11124)
- Quoter V2:
0xdE41045eb15C8352413199f35d6d1A32803DaaE2 - Multicall:
0x84B11838e53f53DBc1fca7a6413cDd2c7Ab15DB8 - WETH:
0x9EDCde0257F2386Ce177C3a7FCdd97787F0D841d - USDC:
0xe4C7fBB0a626ed208021ccabA6Be1566905E2dFc
📖 Usage Examples
Trading on Abstract Mainnet
import { AlphaRouter } from 'abstract-smart-order-router-ygg';
import { ChainId, TradeType, Percent } from '@uniswap/sdk-core';
const router = new AlphaRouter({
chainId: 2741, // Abstract mainnet
provider: abstractProvider,
});
// ETH -> USDC swap
const route = await router.route(
CurrencyAmount.fromRawAmount(Ether.onChain(2741), '1000000000000000000'), // 1 ETH
USDC_ABSTRACT,
TradeType.EXACT_INPUT,
{
recipient: '0x...',
slippageTolerance: new Percent(50, 10_000), // 0.5%
deadline: Math.floor(Date.now() / 1000) + 60 * 20, // 20 minutes
}
);CLI Usage
# Quote on Abstract mainnet
./bin/cli quote \
--tokenIn 0x3439153EB7AF838Ad19d56E1571FBD09333C2809 \
--tokenOut 0x84A71ccD554Cc1b02749b35d22F684CC8ec987e1 \
--amount 1 \
--exactIn \
--chainId 2741 \
--protocols v3 \
--router alpha
# Quote on Abstract testnet
./bin/cli quote \
--tokenIn 0x9EDCde0257F2386Ce177C3a7FCdd97787F0D841d \
--tokenOut 0xe4C7fBB0a626ed208021ccabA6Be1566905E2dFc \
--amount 1 \
--exactIn \
--chainId 11124 \
--protocols v3 \
--router alpha🔧 Development
# Install dependencies
npm install
# Build the package
npm run build
# Run tests
npm test
# Run integration tests
npm run integ-test📄 License
GPL-3.0 - Same as the original Uniswap Smart Order Router
🤝 Contributing
This is a fork maintained by Yield Guild Games.
For Abstract-specific issues, please open an issue in this repository. For general Smart Order Router issues, refer to the original Uniswap repository.
🙏 Acknowledgments
- Original Uniswap Smart Order Router team
- Abstract for providing the L2 infrastructure
- Yield Guild Games for maintaining this fork
⚡ Built for the Abstract ecosystem by Yield Guild Games
