hackquest logo

Synapse Yield

A non-custodial yield optimizer using Account Abstraction and Delegation. It offers automated, secure asset rebalancing for maximum returns and one-click swap, transfer, and stake via Smart Accounts

Videos

Description

Project Name

  • Synapse Yield


Tagline

  • Maximize Your DeFi Yield on Monad with an Autonomous Agent & Non-Custodial Automation


Description (Extended Judge-Focused Version)

Synapse Yield is a full-stack consumer dApp built on the Monad Testnet that addresses the core barriers to mainstream DeFi adoption—complexity, gas inefficiency, and security risk.
It delivers a “set-it-and-forget-it” DeFi experience by assigning each user a personal autonomous agent that manages and optimizes yields entirely on-chain.


🔹 Architecture Overview

A tri-layer architecture designed for scalability, transparency, and trust:


1. Consumer Experience Layer (Mass Adoption)

  • Built with Next.js App Router, TypeScript, Tailwind CSS, and Framer Motion for a sleek, production-grade UI.

  • Abstracts all Web3 complexity—users authenticate via SIWE (Sign-In With Ethereum) + Iron Session.

  • Upon login, a MetaMask Smart Account (ERC-4337) is automatically provisioned.

  • Powered by Permissionless.js and Pimlico Paymaster for gas-sponsored, one-click actions such as:

    • Staking

    • Swapping

    • Fund management


2. Automation Layer – “The AI Agent” (Core Innovation)

  • Implements a non-custodial keeper system for autonomous portfolio management.

  • Users grant scoped access by signing a single EIP-712 delegation using the MetaMask Delegation Toolkit.

  • Delegations are tightly scoped (defined in src/lib/delegation.ts) to specific methods like deposit, execute, and redeem on whitelisted DeFi protocols (e.g., PancakeSwap Router, Kintsu, Magma).

  • The keeper agent (keeper.ts), triggered via FastCron, runs persistently and:

    • Queries users with automationEnabled: true from MongoDB.

    • Performs on-chain multicalls to get Smart Account balances.

    • Uses a decision function (determineRebalanceAction) to detect imbalance.

    • Executes delegated swaps automatically to rebalance portfolios.

  • Current demo performs a 50/50 asset rebalance, while the mainnet version will integrate adaptive yield strategies using protocol APYs and market data.


3. Trust & Transparency Layer (Powered by Envio)

  • Since automation requires verifiability, Synapse Yield integrates an Envio Indexer as a real-time trust layer.

  • The Envio Indexer tracks and streams actions from integrated protocols (Kintsu, Magma, etc.).

  • Data is queried via Apollo Client (GraphQL) to power the /activity feed.

  • UI clearly differentiates manual vs. automated keeper actions, ensuring full user visibility.

  • This creates a transparent bridge between autonomy and accountability, key to user confidence and adoption.


Tech Stack

  • Core Blockchain: Monad Testnet

  • AA & Delegation: MetaMask Delegation Toolkit, Permissionless.js, Pimlico (Bundler & Paymaster)

  • Frontend: Next.js (App Router), React, TypeScript, Tailwind CSS, Framer Motion

  • Web3 Libraries: Viem, Wagmi, RainbowKit

  • Backend & Database: Next.js API Routes, MongoDB, Mongoose

  • Automation (AI Agent): FastCron (triggering Node.js keeper script via API endpoint)

  • Authentication: SIWE (Sign-In With Ethereum), Iron Session

  • Data Indexing (Transparency Layer): Envio (real-time activity feed for integrated protocols)


GitHub Repositories


Live Deployment

Progress During Hackathon

Built during: MetaMask Smart Accounts × Monad Dev Cook Off Scope: Entire platform (frontend + backend + automation) developed within the hackathon 🧠 Concept & Architecture Ideated a non-custodial automated yield optimizer for simplified DeFi. Designed full-stack architecture on Monad Testnet using ERC-4337 Smart Accounts and MetaMask Delegation Toolkit. 🔐 Core AA & Security Implemented ERC-4337 Smart Account creation & management with permissionless.js and Pimlico bundler/paymaster. Integrated MetaMask Delegation Toolkit for secure, scoped delegations (no key exposure). Added SIWE + Iron Session for secure user authentication. 💻 Full-Stack Development Built frontend with Next.js (App Router), React, TypeScript, Tailwind CSS. Designed a 3D-animated landing page using Framer Motion. Created all app pages: Dashboard, Onboarding, Fund Management, Staking, Swapping, Yield Optimizer. ⚙️ Backend & Automation Developed Next.js API routes for transactions, sessions, and DB interactions. Wrote keeper script (/src/scripts/keeper.ts) for automated yield rebalancing. Configured automation to run every 5 minutes using FastCron Jobs. Integrated MongoDB for secure data storage. Connected Envio indexer for a real-time activity feed. 🚀 Deployment Deployed full-stack app (frontend, backend, and automation) to Vercel for live demonstration.

Tech Stack

Next
React
Web3
Ethers
Envio
MetaMask Delegation Toolkit
Node
permissionless.js
Team LeaderAAakash Mandal
Sector
DeFiInfraOther

Builders Also Viewed