project screenshot 1
project screenshot 2
project screenshot 3

Synapse Treasury

Agentic DAO Treasury Manager: A system that allows a DAO to manage its treasury funds autonomously

Synapse Treasury

Created At

Agentic Ethereum

Project Description

Core Concept Synapse-Treasury is a next-generation decentralized autonomous organization (DAO) that integrates human governance with AI-powered autonomous agents to optimize treasury management. The system creates a symbiotic relationship where:

  • Human members participate through ETH deposits and proposal voting
  • AI agents act as proactive stewards, analyzing market conditions and executing DeFi strategies
  • Smart contracts enforce trustless collaboration between all parties
  1. Membership & Governance ETH Deposit = Membership: Users become DAO members by depositing ETH into the treasury. Deposits are converted to WETH for protocol consistency Members receive 100 voting power (non-transferable) Members can create proposals for treasury actions

Autonomous Agent Members: 3 pre-deployed AI agents with 50 voting power each Agents use LLMs + on-chain data to generate proposals Agents vote on proposals using algorithmic assessments

  1. Treasury Management Dual-Layer Architecture: Liquid Assets: Directly controlled by the DAO DeFi Positions: Automated deposits/withdrawals via Aave

Autonomous Rebalancing: Dedicated agent monitors asset allocations Triggers swaps via Uniswap when thresholds are breached Example: Maintains 30% WETH, 40% Stablecoins, 30% Altcoins

  1. Proposal System Proposal Types: Type Initiator Example Actions DEFI_DEPOSIT Agent "Deposit 100 ETH to Aave at 4.2% APY" DEFI_WITHDRAW Member "Withdraw 50 ETH from Aave for liquidity" AGENT_ADDITION Member "Deploy new risk-analysis agent"

Voting Mechanics: Quorum: 20% of total voting power required Majority: YES > NO votes Agent Voting: AI agents auto-vote based on treasury health metrics

Smart Contract Stack SynapseProposals.sol Manages membership and voting Processes proposal lifecycle (create → vote → execute) Enforces quorum/majority rules

Treasury.sol Holds ERC20/WETH assets Interfaces with Aave/Uniswap Implements autonomous rebalancing Agent Infrastructure

On-Chain: Pre-configured agent addresses with voting rights Off-Chain: LLM-powered analysis engine (Node.js)

Monitors: Aave interest rates Token price volatility (Chainlink) Liquidity pool ratios

How it's Made

I built this project as a decentralized treasury management and governance system that integrates several cutting-edge protocols and tools from the Ethereum ecosystem. The core idea is to maintain a treasury that can automatically rebalance assets and enable community-driven proposals to manage funds. Here’s how it all fits together:

Technologies and Tools Smart Contracts in Solidity: I developed two primary smart contracts:

Treasury.sol: This contract manages funds across multiple assets (WETH, USDC, DAI, etc.) and interacts with external protocols. It uses: Aave Integration: Deposits and withdrawals to earn yield while tracking principals. Uniswap Integration: For executing token swaps during rebalancing. Chainlink Price Feeds: To get up-to-date asset values. OpenZeppelin’s ReentrancyGuard: To protect against reentrancy attacks. Internal accounting via mappings to track token balances, yield generated, and asset configurations. SynapseProposals.sol: This contract provides a governance layer. Authorized proposers and agents can create proposals (for investments, DEFI deposits/withdrawals, etc.), vote on them, and, if approved, trigger treasury actions. It ensures that proposals adhere to rules like minimum quorum and majority votes before executing treasury actions. Development Environment: I used Hardhat as my primary development and testing framework. Hardhat allows me to compile, test, and deploy contracts seamlessly. I configured Hardhat to use the latest Solidity version (0.8.20) along with optimization settings (including the viaIR pipeline) to help mitigate EVM stack issues.

RPC and Deployment Infrastructure: I use Infura as my RPC provider, which gives me reliable access to the Sepolia testnet. Environment variables in a .env file (kept out of version control via .gitignore) hold sensitive details like the RPC URL, private key, and Etherscan API key.

AgentKit from Coinbase: For the rebalancing automation, I integrated Coinbase’s AgentKit. The agent continuously monitors treasury allocations by querying functions like getWethAllocation() and getTotalValue(). When the ETH (WETH) allocation falls outside predefined thresholds, it triggers an action that calls checkAndRebalance() on the Treasury contract.

Additional Tools: I also used OpenZeppelin libraries, Chainlink contracts, and Uniswap’s v2-periphery package to provide robust implementations of standard functionalities, such as ERC20 interactions and secure swapping methods.

Treasury Management: The Treasury contract keeps an internal ledger (using mappings) of the assets held, their yield, and deposits made into Aave. It uses Chainlink oracles for accurate pricing and Uniswap for performing token swaps during rebalancing operations.

Governance Through Proposals: The SynapseProposals contract allows authorized users to create proposals for treasury actions. Votes are tallied based on pre-assigned voting power, and once a proposal meets the quorum and majority criteria, it triggers treasury functions (like depositing into Aave or executing fund transfers).

Automated Rebalancing via AgentKit: Coinbase AgentKit monitors treasury allocations on a regular interval. When imbalances are detected (e.g., ETH allocation deviates from a target range), it automatically triggers the Treasury’s rebalancing function. This integration automates what would otherwise be a manual process, saving time and reducing the chance of human error.

One particularly interesting (and hacky) aspect is the use of an internal mapping (tokenBalances) to track asset holdings across multiple protocols. This allows the contract to compute asset values and perform rebalancing calculations even when funds are spread between on-chain balances and external protocols like Aave.

background image mobile

Join the mailing list

Get the latest news and updates