Search projects, hackathons, sponsors and tech

    ← All projects

    LIKWID V2

    Uniswap V1 enabled crypto's first permissionless spot trading at ETH DevCon 4 Prague, 2018. Likwid unlocked crypto's first permissionless margin trading and lending on Uniswap V4 at ETHDenver2025.

    Demo

    About

    The problem it solves **xy=k eats spot trading (x+x')(y+y')=k will eat all defi** --- **V1: Margin trading protocol** 1. No Leverage for Long-Tail Assets due to reliance on permissioned oracles. - Solution(referred to as S): Trade any token (even meme/rugpull coins) with leverage from Day 1. 2. Without permissionless shorting tools, scams will always exist - S: Permissionless shorting for all tokens, enabling market self-policing. Free short selling powers the world's strongest financial market(U.S., Muddy Waters vs. Luckin Coffee). 3. Low LP Earnings, LPs earn only trading fees. - S: Quadruple yield: trading fees, margin interest, liquidation penalties, dynamic fees. 4. flash loan attacks and price manipulation in margin trading - S: mitigate flash loan attacks and price manipulation by implementing dynamic fees and [truncated price](https://goo.su/RpkzUWw) introduced by Uniswap in Sep. 2023 5. User willingness to lend(e.g., willingness to lend x but not y) - S: mitigate by structured liquidity 6. Delayed liquidations -S: mitigate by a dual liquidation model --- **V2: Unified Swap & Lending by (x+x’)*(y+y’)=k (ETHDenver 2025)** Problems Solved: 1. Inefficient Capital Use, Isolated protocols force fragmented liquidity. - S: Shared liquidity pools for swaps and lending. 2. No Lending for Long-Tail Assets, Aave/Compound exclude 99% of tokens. - S: Lend/borrow any token, even new launches. 3. Overcomplicated Lending Code, Aave’s 15k+ lines vs. Uniswap V2’s simplicity. - S: By directly implementing the lending model through (x+x’)*(y+y’)=k, a streamlined lending just like Uniswap V2 contracts is achieved. 4. In V1, (x+x’)*(y+y’)=k may face liquidity shortages when borrowable tokens are fully utilized. - Solution: ERC6909 will become a new DeFi primitive, addressing the liquidity depth issue through lending (x'->x in LP) and enabling free circulation of x' and y' tokens. This ensures sufficient liquidity while maintaining price alignment between the LP and external markets. User Interaction and Data Flow **1. User Interaction Overview:** LIKWID offers a seamless, decentralized platform where users can borrow and lend tokens without the need for oracles. The platform integrates token swapping and borrowing into one unified experience. Users interact with LIKWID through a web interface, connecting their wallets and interacting with smart contracts to manage their assets. --- **2. Key User Interactions:** Likwid has five types of users: Borrowers, Lender, LPers, margin trading traders, swapper, and keepers. Since the Borrowers functionality will be implemented during ETHDenver, we will focus only on the Borrowers for now. Borrowers (done in ethdenver2025) -Choose LP pools -Deposit collateral to borrow assets from the liquidity pool. -Repayment --- **3. Data Flow:** 1. **User Action:** - The user initiates an action (deposit, borrow, swap, etc.) via the front-end UI (web interface). 2. **Frontend Interaction:** - The frontend communicates with the Web3 wallet (e.g., MetaMask), asking for transaction approvals (such as deposit, borrow, or swap). 3. **Smart Contract Interaction** 4. **Transaction Confirmation** 5. **Liquidity Pool & Borrowing Limits Calculation** The project architecture and development process **1. Architecture:** V2 Modules (Added During ETHDenver 2025): **Borrow:** Allows users to borrow xTokens directly from LP pools, with debt recorded as x'Tokens (ERC6909) in the LP pool. Integrates seamlessly with V1’s liquidity infrastructure. **Borrowing Position:** Records User Positions: Tracks borrowed amounts, collateral ratios, and liquidation thresholds. Liquidation Status: Flags undercollateralized loans and triggers liquidations. **Inherited V1 Modules:** Liquidation & Repayment: Inherits V1’s battle-tested liquidation engine. Interest Model: Uses V1’s dynamic interest rate framework. **V1 Core Modules:** Swap, Margin & Liquidation, Margin Position, Interest Model, LP, Repayment & Liquidation, x'Token (ERC6909), Dynamic Fees, Truncated Price **2. Development Process:** - **Phase 1: Smart Contract Development & Testing** - Developed core smart contracts ERC-20 and ERC-6909 for token borrowing, lending, and collateral management. - Deployed contracts on the testnet and conducted rigorous testing for security vulnerabilities, gas optimization, and functional accuracy. - Integrated DEX protocols for swapping. - **Phase 2: Frontend & Backend Development** - Developed the frontend interface for users to interact with the platform, using modern web technologies like React and Web3.js. - Built the backend infrastructure to manage the interactions between smart contracts, user wallets, and DEX protocols. - Implemented robust API services for monitoring contract performance and transaction data. **3. Development Tools and Deployment Process** **Contract Development Tools**: Foundryup + VSCode **Deployment Process**: (1)Add a `.env` file in the project root directory and include `PRIKEY="private key"`. (2)Run the following command in the project root directory: ```bash forge script script/DeployAll.s.sol --broadcast --rpc-url https://ethereum-sepolia.publicnode.com --private-key $PRIKEY --sig "run(uint256)" 11155111 Product Integrations LIKWID is a decentralized lending and borrowing platform built on top of the Uniswap v4 protocol, leveraging the latest advancements in automated market makers (AMMs) and decentralized liquidity. By integrating with Uniswap v4, LIKWID enhances its core functionality, offering users a unified experience that combines token borrowing, lending, and swapping in one seamless protocol. --- **1. Uniswap v4 Integration Overview:** Uniswap v4 serves as the backbone of LIKWID’s token swapping mechanism, enabling high liquidity and efficient token exchanges. The integration with Uniswap v4 ensures that LIKWID users can easily swap tokens as part of the borrowing process, without needing to navigate between separate platforms. Additionally, Uniswap v4’s modular architecture provides significant benefits for liquidity management and protocol flexibility, allowing LIKWID to adapt and scale in response to changing market conditions. --- **2. How LIKWID Leverages Uniswap v4:** - **Liquidity Pools:** LIKWID uses Uniswap v4’s liquidity pools to facilitate the swapping of tokens within the platform. When a user wants to borrow a token, they may need to swap their collateral for the required borrowing asset. By integrating directly with Uniswap v4, LIKWID allows seamless on-chain swaps of any ERC-20 token, using the AMM model to ensure liquidity for less common, long-tail tokens. - **Routing of Token Swaps:** Through Uniswap v4's enhanced routing functionality, LIKWID can efficiently find the best price for token swaps by connecting to various liquidity pools. This dynamic routing ensures that users always get the best rates when borrowing tokens, especially when dealing with illiquid or exotic assets. - **Efficient Borrowing & Lending:** When users borrow tokens, the underlying collateral is automatically handled within the Uniswap v4 pools, creating a direct connection between the user’s deposited liquidity and the available bo Key differentiators and uniqueness of the project ### **1. Oracle-Free & Permissionless Lending for All Tokens** - **Traditional DeFi Lending (Aave, Compound)**: - Requires **centralized oracles** to price assets, limiting support to "whitelisted" tokens (e.g., ETH, USDC). - Excludes **long-tail and newly launched tokens** (e.g., memes, new stablecoins). - **Likwid.fi V2**: - **No oracles needed** — prices derive directly from AMM liquidity pools. - **Truly permissionless**: Any token (even rugpull coins) can be borrowed/lent **from Day 1**. - Solves the **long-tail liquidity gap** in DeFi. --- ### **2. Simplified Architecture, Uncompromised Security** - **Traditional DeFi Lending**: - Complex codebases (e.g., Aave: 10k+ lines) due to oracle integration, governance, and collateral management. - **Likwid.fi V2**: - The principle of lending is (x+x’)*(y+y’)=k so the contract code architecture is as simple as Uniswap V2. --- ### **3. Increased capital efficiency** - **Traditional DeFi Lending**: - low capital efficiency due to over-collateralized - **Likwid.fi V2**: - Since deposited funds can participate in leveraged trading with up to 5x leverage, the capital utilization rate is significantly higher compared to traditional over-collateralized DeFi projects. This increased capital efficiency directly translates to higher interest income for Lenders. --- ### **4. Dual Liquidation Mechanisms** - **Traditional DeFi Lending**: - Relies on a single liquidation method vulnerable to MEV and market volatility. - **Likwid.fi**: - **Swap-based liquidation** - **Repayment-based liquidation** ### **5. An Immutable liq. price based on smart contracts** - **Traditional DeFi Lending**: [Centralized oracles often become the subject of jokes due to intervention](https://goo.su/bURuf) - **Likwid.fi**: The truncated price used for liquidation marking is generated by the Uniswap hook contract and is immutable, ensuring strong consistency and maintainability. Trade-offs and shortcuts while building During ETHDenver, our originally designed V2 version included both deposit and lending functionalities. Currently, we have only implemented the lending feature, while the deposit functionality requires modifications and updates to the ERC6909 contract. Implementing the deposit feature forcefully could potentially affect the stability of the current version. Over the next week or so, we will continue iterating on our contract features and aim to build a high-availability V2 version. Here is another underlying technical problem, a general description of how to solve arbitrage: 1. Attack Simulation on Liquidation Mechanics: During simulated attack testing on the liquidation process, we observed that leveraging yToken as collateral to long xToken artificially inflates xToken's price. Subsequent dumping of yToken generates more xToken than direct yToken selling, creating arbitrage opportunities. 2. Dynamic Fee Framework Mitigation: To counter this arbitrage, we implemented a unified dynamic fee framework that adjusts fees based on market volatility and collateral usage, disincentivizing price manipulation via leveraged longs. 3. Liquidity Manipulation Loophole: Further analysis revealed attackers could exploit liquidity manipulation: Add large liquidity to reduce dynamic fees→ Leveraged long xToken (artificially inflating price) → Remove liquidity -> dumping of yToken maximize arbitrage profits. 4. Address-Based Liquidity Restrictions: To prevent fee manipulation, we enforced same-blockchain-address restrictions, prohibiting users from adding/removing liquidity within the same address in a single block. 5. Multi-Address Attack Vector: - Attackers bypassed initial restrictions via LP token transfers: Add liquidity → Transfer LP tokens to Address B → Leveraged long xToken → Address B removes liquidity. - Final Solution: Expanded restrictions to block liquidity additions, removals, and transfers within the same address in a single block. Additional Features **V1(Done before ETHDenver2025):** The first fully permissionless, Oracle-less, margin trade protocol based on Uniswap V4 xy=k,unlocked crypto's first permissionless spot trading at ETH DevCon 4 Prague, 2018. (x+x')*(y+y')=k unlocked crypto's first permissionless margin trading and lending on Uniswap V4 at ETHDenver2025. - Truncated Price The first implementation uses [truncated price](https://blog.uniswap.org/uniswap-v4-truncated-oracle-hook) proposed by uniswap labs as the liq.price to prevent flash loan attacks and price manipulation. - Structured Liquidity Users can freely choose the tokens that can be borrowed - Dual liquidation mechanism Swap-based liquidation mechanism and repayment-based liquidation mechanism. - Dynamic fee Implementing the Swap-based liquidation mechanism will cause the fee to change, and liquidation penalties will be sent to LPs. **V2 has been fully built for this hackathon** Unify the two core DeFi products: swap and lending, into a single protocol by (x+x')*(y+y')=k based on Uniswap V4