google-agents-cli-scaffold
Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.
crane-uniswap
This skill should be used when the user asks about "Uniswap integration", "Uniswap V2 swap", "Uniswap V2 liquidity", "UniswapV2Service", "Uniswap V3", "Uniswap V4", "concentrated liquidity", or needs to interact with Uniswap DEX using Crane's service libraries.
Full skill instructions
Crane provides Uniswap V2, V3, and V4 integration with services, stubs, libraries, and test infrastructure.
| Component | Location | Purpose |
|---|---|---|
UniswapV2Service | v2/services/UniswapV2Service.sol | V2 swap, deposit, withdraw operations |
UniswapV2RouterAwareRepo | v2/aware/UniswapV2RouterAwareRepo.sol | Router dependency injection |
UniswapV2FactoryAwareRepo | v2/aware/UniswapV2FactoryAwareRepo.sol | Factory dependency injection |
TestBase_UniswapV2 | v2/test/bases/TestBase_UniswapV2.sol | Full protocol deployment |
TestBase_UniswapV2_Pools | v2/test/bases/TestBase_UniswapV2_Pools.sol | Pool creation helpers |
UniswapV3Factory | v3/UniswapV3Factory.sol | V3 factory stub |
UniswapV3Pool | v3/UniswapV3Pool.sol | V3 pool implementation |
UniswapV4Utils | v4/utils/UniswapV4Utils.sol | V4 utility functions |
UniswapV4Quoter | v4/utils/UniswapV4Quoter.sol | V4 quote calculations |
Unlike Camelot's directional fees, Uniswap V2 uses a fixed 0.3% fee:
// UniswapV2Service always uses 300 (0.3%) for fee calculations
feePercent = 300;
import {UniswapV2Service} from "@crane/contracts/protocols/dexes/uniswap/v2/services/UniswapV2Service.sol";
import {IUniswapV2Router} from "@crane/contracts/interfaces/protocols/dexes/uniswap/v2/IUniswapV2Router.sol";
import {IUniswapV2Pair} from "@crane/contracts/interfaces/protocols/dexes/uniswap/v2/IUniswapV2Pair.sol";
contract UniswapSwapper {
IUniswapV2Router public router;
function swap(
IUniswapV2Pair pool,
IERC20 tokenIn,
IERC20 tokenOut,
uint256 amountIn
) external returns (uint256 amountOut) {
tokenIn.transferFrom(msg.sender, address(this), amountIn);
amountOut = UniswapV2Service._swap(
router,
pool,
amountIn,
tokenIn,
tokenOut
);
}
}
function _deposit(
IUniswapV2Router router,
IERC20 tokenA,
IERC20 tokenB,
uint256 amountADesired,
uint256 amountBDesired
) internal returns (uint256 liquidity);
function _withdrawDirect(
IUniswapV2Pair pool,
uint256 amt
) internal returns (uint256 amount0, uint256 amount1);
// Swap with pool auto-detection
function _swap(
IUniswapV2Router router,
IUniswapV2Pair pool,
uint256 amountIn,
IERC20 tokenIn,
IERC20 tokenOut
) internal returns (uint256 amountOut);
// Swap exact tokens for tokens
function _swapExactTokensForTokens(
IUniswapV2Router router,
IERC20 tokenIn,
uint256 amountIn,
IERC20 tokenOut,
uint256 minAmountOut,
address recipient
) internal returns (uint256 amountOut);
// Swap tokens for exact tokens
function _swapTokensForExactTokens(
IUniswapV2Router router,
IERC20 tokenIn,
uint256 amountInMax,
IERC20 tokenOut,
uint256 amountOut,
address recipient
) internal returns (uint256 amountIn);
function _swapDeposit(
IUniswapV2Router router,
IUniswapV2Pair pool,
IERC20 tokenIn,
uint256 saleAmt,
IERC20 opToken
) internal returns (uint256 lpAmount);
function _withdrawSwapDirect(
IUniswapV2Pair pool,
IUniswapV2Router router,
uint256 amt,
IERC20 tokenOut,
IERC20 opToken
) internal returns (uint256 amountOut);
(
uint256 knownReserve,
uint256 opposingReserve,
uint256 feePercent,
uint256 unknownFee
) = UniswapV2Service._sortReserves(pool, knownToken);
import {TestBase_UniswapV2} from "@crane/contracts/protocols/dexes/uniswap/v2/test/bases/TestBase_UniswapV2.sol";
contract MyTest is TestBase_UniswapV2 {
function setUp() public override {
super.setUp();
// uniswapV2Factory and uniswapV2Router available
}
function test_swap() public {
address pair = uniswapV2Factory.createPair(
address(tokenA),
address(tokenB)
);
// Add liquidity
UniswapV2Service._deposit(
uniswapV2Router,
tokenA,
tokenB,
1000e18,
1000e18
);
// Execute swap
uint256 amountOut = UniswapV2Service._swap(
uniswapV2Router,
IUniswapV2Pair(pair),
100e18,
tokenA,
tokenB
);
}
}
Crane includes V3 pool and factory stubs with math libraries:
contracts/protocols/dexes/uniswap/v3/
├── UniswapV3Factory.sol
├── UniswapV3Pool.sol
├── UniswapV3PoolDeployer.sol
├── NoDelegateCall.sol
├── interfaces/
│ ├── IUniswapV3Factory.sol
│ ├── IUniswapV3Pool.sol
│ └── pool/
│ ├── IUniswapV3PoolActions.sol
│ └── ...
└── libraries/
├── TickMath.sol
├── SqrtPriceMath.sol
├── SwapMath.sol
├── FullMath.sol
└── ...
Crane includes V4 utilities and quoter:
import {UniswapV4Utils} from "@crane/contracts/protocols/dexes/uniswap/v4/utils/UniswapV4Utils.sol";
import {UniswapV4Quoter} from "@crane/contracts/protocols/dexes/uniswap/v4/utils/UniswapV4Quoter.sol";
// Quote a swap
UniswapV4Quoter.quoteSwap(poolKey, amountIn, zeroForOne);
// Quote a zap (single-token deposit)
UniswapV4ZapQuoter.quoteZap(poolKey, amountIn, token);
contracts/protocols/dexes/uniswap/
├── v2/
│ ├── services/
│ │ └── UniswapV2Service.sol
│ ├── aware/
│ │ ├── UniswapV2RouterAwareRepo.sol
│ │ └── UniswapV2FactoryAwareRepo.sol
│ ├── stubs/
│ │ ├── UniV2Factory.sol
│ │ ├── UniV2Pair.sol
│ │ ├── UniV2Router02.sol
│ │ └── deps/libs/
│ │ ├── Math.sol
│ │ ├── UniswapV2Library.sol
│ │ └── ...
│ └── test/bases/
│ ├── TestBase_UniswapV2.sol
│ └── TestBase_UniswapV2_Pools.sol
├── v3/
│ ├── UniswapV3Factory.sol
│ ├── UniswapV3Pool.sol
│ ├── interfaces/
│ │ └── ...
│ ├── libraries/
│ │ ├── TickMath.sol
│ │ ├── SqrtPriceMath.sol
│ │ └── ...
│ └── test/bases/
│ └── TestBase_UniswapV3.sol
└── v4/
├── interfaces/
│ ├── IHooks.sol
│ └── IPoolManager.sol
├── libraries/
│ └── ...
├── types/
│ ├── Currency.sol
│ ├── PoolId.sol
│ └── PoolKey.sol
└── utils/
├── UniswapV4Utils.sol
├── UniswapV4Quoter.sol
└── UniswapV4ZapQuoter.sol
| Repo | Slot |
|---|---|
| UniswapV2RouterAwareRepo | "protocols.dexes.uniswap.v2.router.aware" |
| UniswapV2FactoryAwareRepo | "protocols.dexes.uniswap.v2.factory.aware" |
references/uniswap-services.md - Detailed patterns and examplesProject scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.
Set up tracing, logging, and monitoring for deployed ADK agents across Cloud Trace, BigQuery, and third-party platforms.
Enterprise Azure infrastructure architect generating Bicep or Terraform from workload descriptions.
Plan and configure production-ready Azure Kubernetes Service clusters with Day-0 and Day-1 best practices.
Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.
Web search, scraping, extraction, crawling, and monitoring via ScrapeGraph AI CLI.
Skill for working with Firebase Hosting (Classic). Use this when you want to deploy static web apps, Single Page Apps (SPAs), or simple microservices. Do NOT use for Firebase App Hosting.
Deploy and manage web apps with Firebase App Hosting. Use this skill when deploying Next.js/Angular apps with backends.
Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".
Build SEO-optimized pages at scale using templates, data, and proven playbook patterns.
Design and build isolated, reusable Convex backend components with clear boundaries and app-facing wrappers.
Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".
Opus.ai: Revolutionize Your Web Experience
Build a no-code AI app in minutes.
An IDE for code migration from legacy to modern frameworks through coding agents.
Automate CGI animation in live-action scenes
Branded artistic QR-code concepts
Launch a website in seconds with AI.
Streamline Your Coding Experience with AI Code Helper
Convert any screenshot or design to clean code.