Skill: prqelt/qelt-dex (version 0.1.0)

--- name: QELT DEX description: Interact with Uniswap v4 pools and liquidity positions on QELT Mainnet. Use when asked about DEX pools, token swaps, liquidity provision, WQELT wrapping/unwrapping, pool state queries, position NFTs, or Uniswap v4 contract addresses. QELT only supports Uniswap V4 — V2/V3 calls revert. read_when: - Querying Uniswap v4 pool state or liquidity on QELT - Checking WQELT token balance or price - Wrapping or unwrapping native QELT to WQELT - Looking up Uniswap v4 contract addresses on QELT - Preparing a token swap via the UniversalRouter on QELT - Adding or removing liquidity via PositionManager on QELT homepage: https://qeltscan.ai metadata: {"clawdbot":{"emoji":"🔁","requires":{"bins":["curl"]}}} allowed-tools: Bash(qelt-dex:*) --- # QELT DEX Skill (Uniswap v4) QELT Mainnet hosts a fully deployed and verified Uniswap v4 instance. All 7 contracts are verified on QELTScan. Only Uniswap V4 is supported — V2/V3 calls route to `UnsupportedProtocol` and revert. **Network:** QELT Mainnet · Chain ID `770` **RPC:** `https://mainnet.qelt.ai` ## Safety - Never request or handle private keys. Write operations require a **pre-signed raw transaction**. - Swaps and liquidity changes are irreversible — confirm parameters with the user first. - Always apply slippage protection (minimum 1% tolerance on `amountOutMin`). - QELT only supports Uniswap V4. V2/V3 calls will revert. - WQELT is the required ERC-20 wrapper for native QELT when trading on the DEX. ## Contract Addresses (Mainnet, Chain ID 770) | Contract | Address | Role | |----------|---------|------| | `PoolManager` | [REDACTED_SECRET] | Core — manages all pools | | `UniversalRouter` | [REDACTED_SECRET] | Swap routing + aggregation | | `PositionManager` | [REDACTED_SECRET] | Liquidity positions as NFTs | | `Permit2` | [REDACTED_SECRET] | Gasless approvals | | `WQELT` | [REDACTED_SECRET] | Wrapped QELT (ERC-20) | | `PositionDescriptor` | [REDACTED_SECRET] | NFT metadata | | `UnsupportedProtocol` | [REDACTED_SECRET] | V2/V3 stub (reverts) | ## Procedure ### Query Contract Addresses Return the table above from memory — no RPC call needed. ### Check WQELT Balance ```bash WQELT=[REDACTED_SECRET] # ADDR must be the 40 hex chars WITHOUT the 0x prefix, left-padded to 32 bytes by the zeros above # Example: address 0xAbCd...1234 → ADDR="abcd...1234" (40 chars, no 0x) ADDR=[REDACTED_SECRET] # balanceOf(address) selector: 0x70a08231 curl -fsSL -X POST https://mainnet.qelt.ai \ -H "Content-Type: application/json" \ -d "{\"jsonrpc\":\"2.0\",\"method\":\"eth_call\",\"params\":[{\"to\":\"$WQELT\",\"data\":\"0x70a08231000000000000000000000000$ADDR\"},\"latest\"],\"id\":1}" ``` Divide hex result by `10^18` for WQELT balance. ### Query Pool State Pool state requires two `eth_call`s to PoolManager using ABI-encoded `getSlot0(bytes32)` and `getLiquidity(bytes32)`. Pool ID = `keccak256(abi.encode(currency0, currency1, fee, tickSpacing, hooks))` ```bash POOL_MANAGER=[REDACTED_SECRET] # getSlot0(bytes32 poolId) — returns sqrtPriceX96, tick, protocolFee, lpFee curl -fsSL -X POST https://mainnet.qelt.ai \ -H "Content-Type: application/json" \ -d "{\"jsonrpc\":\"2.0\",\"method\":\"eth_call\",\"params\":[{\"to\":\"$POOL_MANAGER\",\"data\":\"0x<ABI_ENCODED_getSlot0_POOLID>\"},\"latest\"],\"id\":1}" ``` **Slot0 decode:** `sqrtPriceX96` (current price), `tick` (current tick), `lpFee` (0.3% = 3000). ### Wrap QELT → WQELT ⚠️ Write operation — confirm with user. Requires pre-signed tx calling `deposit()` on WQELT with `value = amount_wei`. ```bash # Submit pre-signed transaction curl -fsSL -X POST https://mainnet.qelt.ai \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["0xSIGNED_TX_HEX"],"id":1}' ``` WQELT `deposit()` selector: `0xd0e30db0` · `withdraw(uint256)` selector: `0x2e1a7d4d` ### Token Swap via UniversalRouter ⚠️ Write operation — confirm with user. Requires pre-signed tx via `UniversalRouter.execute(commands, inputs, deadline)`. Flow: Approve token → Permit2 → Permit2 approve → UniversalRouter → encode `V4_SWAP_EXACT_IN` command → call `execute`. ## Pool Key Structure ``` PoolKey { currency0: address // lower address (or address(0) for native QELT) currency1: address // higher address fee: uint24 // 3000 = 0.3%, 500 = 0.05%, 10000 = 1% tickSpacing: int24 // 60 for 0.3% fee tier hooks: address // address(0) for no hooks } ``` Common fee tiers: | Fee | % | Tick Spacing | Use Case | |-----|---|-------------|---------| | 100 | 0.01% | 1 | Stablecoin pairs | | 500 | 0.05% | 10 | Correlated assets | | 3000 | 0.30% | 60 | Most pairs | | 10000 | 1.00% | 200 | Volatile/exotic | ## WQELT Token - **Address:** [REDACTED_SECRET] - **Ratio:** 1 WQELT = 1 QELT (always, no fee) - **Wrap:** Call `deposit()` with ETH value = QELT amount - **Unwrap:** Call `withdraw(uint256 amount)` to recover native QELT ## UniversalRouter Config ```javascript { permit2: [REDACTED_SECRET], weth9: [REDACTED_SECRET], // WQELT v4PoolManager: [REDACTED_SECRET], v4PositionManager: [REDACTED_SECRET], // V2/V3 addresses all point to UnsupportedProtocol: v2Factory: [REDACTED_SECRET], v3Factory: [REDACTED_SECRET], } ``` ## Common Errors | Error | Cause | Fix | |-------|-------|-----| | `UnsupportedProtocol` | V2/V3 call attempted | Use V4 path only | | Slippage exceeded | Price moved | Increase `amountOutMin` tolerance | | Deadline exceeded | Slow broadcast | Use `now + 1800` seconds | | Permit2 signature expired | Approval timeout | Re-sign with fresh deadline |

path: _meta.json
content: ownerId: YOUR_CLAWHUB_OWNER_ID
slug: qelt-dex
version: 1.0.0
publishedAt: 1741240314488

Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (MEDIUM)