hackquest logo

farmenta

Deposit a Uniswap LP position NFT as collateral and borrow USDG against it. The position stays whole, stays in range, and keeps collecting its trading fees while the loan is open.

视频

项目图片 1
项目图片 2
项目图片 3
项目图片 4

技术栈

React
Next
Solidity

描述

Farmenta is a lending protocol on Robinhood Chain (chain id 4663). It lets a liquidity provider borrow USDG against a Uniswap v4 liquidity position without closing the position and selling what is inside it.

Think of a pawn shop that accepts a working vending machine. You hand over the machine, you receive cash, and the machine keeps selling drinks for you while it sits in the shop. In Farmenta the machine is your liquidity position, the cash is USDG, and the drinks money is the trading fees your position keeps earning.

The problem

Capital in a Uniswap v4 position is locked. A provider who needs liquidity has to close the position, stop earning fees, and often sell at a bad moment. Existing lending markets take fungible tokens, not a position that has a price range, two assets and uncollected fees.

How Farmenta solves it

- The collateral is the position itself. Farmenta takes custody of the NFT issued by Uniswap's own PositionManager. There is no wrapper token.

- The position stays productive. While the loan is open the borrower can collect fees, add liquidity, or remove part of it. Each action is checked so the loan stays safe afterwards.

- Positions are valued at the oracle price, not the pool price. In the Blue-chip market the price comes from Chainlink, so moving the pool price does not change what a position is worth. A borrow is rejected if the pool price is more than 2% away from Chainlink.

- Going out of range does not trigger liquidation. Only the health factor does.

- Two isolated markets. Blue-chip (ETH and tokenized stocks) and Meme. Each holds its own USDG, so a loss in the Meme market cannot reach Blue-chip lenders.

- Meme collateral with an on-chain price. Meme tokens have no Chainlink feed, so Farmenta records its own 30 minute average price on-chain and borrows against the lower of that and the current price.

- Partial liquidations. A liquidator repays part of an unhealthy loan and receives a slice of the position's liquidity plus a bonus. A helper contract does the flash loan, the liquidation and the swap in one transaction, so a liquidator needs no capital.

- Every pool is reviewed before it is listed, each with its own loan to value, liquidation threshold and debt cap.

What is live today

- Contracts deployed on Robinhood Chain mainnet: two markets, the collateral policy, the price oracle, the TWAP recorder, the position valuer and the interest rate model.

- Six pools listed: ETH/USDG, META/USDG and NVDA/USDG in Blue-chip, and CASHCAT/USDG, PONS/USDG and AI/USDG in Meme.

- A web app for the full flow: supply and withdraw USDG, deposit a position with one signature, borrow, repay and withdraw collateral, with a portfolio page and a transaction history.

- An indexer, a backend API and a liquidation bot running in production.

- Public documentation with worked examples, a risk section and a guide for liquidators.

- The owner is a timelock contract: every admin call waits two days. A guardian can pause at once and cannot undo.

How it is built

- Contracts: Solidity with Foundry, upgradeable markets behind a timelock, lender shares as ERC-4626 vault tokens, integrated with Uniswap v4 (PositionManager, Permit2, UniversalRouter), Chainlink price feeds and Morpho flash loans.

- Indexer: Ponder.

- Backend: NestJS on Bun, with Postgres.

- Keeper: a price recorder for meme pools and a liquidation bot with Telegram alerts.

- Frontend: Next.js, wagmi, viem and RainbowKit. Its on-chain flows are tested against a fork of the deployed contracts, with no mocks standing in for a contract.

Links

- App: https://www.farmenta.fun

- Documentation: https://docs.farmenta.fun

- Source code: https://github.com/farmenta-defi

- Blue-chip market: 0x89e20D2bBBbF52Bf8036bF8efd94C81C8386116B

- Meme market: 0x01540c8aA1c13d50dA85406dCa012F9f41169927

- CollateralPolicy: 0x032f7c4744B6f043F92a94C8e257c5A843D544e0

- All addresses: https://docs.farmenta.fun/docs/reference/addresses

Parameters:

Pool

Market

Max LTV

Liquidation threshold

Debt cap

ETH/USDG

Blue-chip

65%

75%

25,000 USDG

META/USDG

Blue-chip

50%

65%

25,000 USDG

NVDA/USDG

Blue-chip

50%

65%

25,000 USDG

CASHCAT/USDG

Meme

30%

40%

3,000 USDG

PONS/USDG

Meme

30%

40%

3,000 USDG

AI/USDG

Meme

30%

40%

3,000 USDG

本次黑客松进展

deployed mainnet

融资状态

-

队长
SSinggih Brilian Tara
项目链接
部署生态
RobinhoodRobinhood
赛道
DeFiOther