project screenshot 1
project screenshot 2
project screenshot 3

Defi Simplify

Building, Executing, and Sharing Cross-Chain Trading Strategies Made Simple

Defi Simplify

Created At

ETHGlobal Bangkok

Winner of

Coinbase Developer Platform - CDP SDK Pool Prize

Prize Pool

Polygon - Best Cross-Chain Application using AggLayer 1st place

Project Description

DeFi Simplify - Comprehensive Cross-Chain DeFi Platform

Project Overview

DeFi Simplify is an advanced DeFi platform that combines multiple key innovations:

  1. Visual Strategy Builder: As seen in the batch component (typescript:frontend/app/batch/page.tsx startLine: 387 endLine: 418), users can create complex DeFi strategies using a visual block-based interface.

  2. Multi-Protocol Integration: The platform integrates with multiple DeFi protocols:

    • PancakeSwap (typescript:frontend/components/pancakeswap/pancakeswap.tsx startLine: 43 endLine: 82)
    • 1inch Cross-Chain
    • Squid Router
    • CoW Protocol
    • Chainlink CCIP
  3. Privacy Features: Integration with Oasis Sapphire for confidential transactions ( typescript:oasis-sapphire-remix-plugin/src/components/SapphireDeployer.tsx startLine: 23 endLine: 68)

Unique Features

  1. Strategy Management:

    • Save and share trading strategies
    • Visual block-based strategy builder
    • Cross-chain execution capabilities
    • Strategy templates
  2. Cross-Chain Operations:

    • Seamless asset transfers across chains
    • Unified liquidity access
    • CCIP integration for secure messaging
    • Support for multiple networks (BSC, Ethereum, Mantle, Base)
  3. DEX Aggregation:

    • Best price routing across DEXes
    • Smart order routing
    • Gas optimization
    • MEV protection
  4. Privacy and Security:

    • Confidential transactions via Oasis Sapphire
    • Secure contract deployment
    • Private strategy execution

Technical Architecture

The project consists of three main components:

  1. Frontend (Next.js):

    • Modern React with Next.js 14
    • TailwindCSS for styling
    • Web3 integration with wagmi and thirdweb
    • Component library with shadcn/ui
  2. Smart Contracts:

    • Hardhat development environment
    • Chainlink CCIP integration
    • Cross-chain messaging capabilities
    • Strategy execution contracts
  3. Oasis Sapphire Plugin:

    • Remix IDE integration
    • Confidential contract deployment
    • Private transaction handling

Recent Updates

  1. Added Merchant Moe DEX Support for Mantle Network
  2. Implemented AI-based Trading Agent
  3. Added XMTP Chat Support for CrossChain Trading
  4. Developed Remix Plugin for Oasis Privacy

How it's Made

Here's a detailed explanation of how DeFi Simplify was built:

Core Architecture

The project is built on three main pillars:

  1. Frontend Layer
  • Built with Next.js 14 using the App Router
  • Styled using TailwindCSS with shadcn/ui components
  • Framer Motion for smooth animations (as seen in HomeScreen.tsx)
  • React Query for efficient data fetching and caching
  1. Blockchain Integration Layer
  • Multiple Web3 libraries (ethers.js, web3.js, wagmi)
  • Custom hooks for blockchain interactions
  • Thirdweb SDK for wallet connections and contract interactions
  • Viem for low-level blockchain operations
  1. Protocol Integration Layer
  • PancakeSwap SDK for DEX operations
  • 1inch Cross-Chain SDK for cross-chain swaps
  • Squid SDK for bridging operations
  • CoW Protocol for MEV protection
  • Chainlink CCIP for cross-chain messaging

Key Technical Features

1. Strategy Builder

The strategy builder is implemented as a block-based system where each block represents a DeFi action. The implementation can be seen in:

This allows users to:

  • Create multi-step DeFi operations
  • Save and load strategies
  • Execute multiple transactions in sequence

2. Cross-Chain Integration

The cross-chain functionality is built using multiple protocols:

  1. PancakeSwap Integration:

  2. 1inch Cross-Chain:

import { PrivateKeyProviderConnector } from "@1inch/cross-chain-sdk"
import Web3 from "web3"
import { Web3Adapter } from '@/lib/web3-adapter'

3. Privacy Features

Integration with Oasis Sapphire for confidential transactions, implemented through a custom Remix plugin.

4. Strategy Storage

Implemented using BNB Greenfield for decentralized storage:

Notable Technical Implementations

  1. Smart Router Integration
  • Custom implementation of multi-DEX routing
  • Gas optimization using batch multicalls
  • Price impact calculations
  1. Cross-Chain Message Passing
  • CCIP integration for secure cross-chain communication
  • Custom message formatting and verification
  • Fallback mechanisms for failed transactions
  1. Strategy Execution Engine
  • Atomic execution of multiple transactions
  • Rollback mechanisms for failed steps
  • Gas estimation and optimization

Development Challenges & Solutions

  1. Cross-Chain State Management
  • Challenge: Maintaining consistent state across chains
  • Solution: Implemented custom hooks and state management using React Query
  1. Transaction Sequencing
  • Challenge: Ensuring proper order of cross-chain transactions
  • Solution: Developed a queue-based system with confirmation checks
  1. Gas Optimization
  • Challenge: High gas costs for multi-step transactions
  • Solution: Implemented batching and multicalls where possible
  1. UI/UX for Complex Operations
  • Challenge: Making complex DeFi operations user-friendly
  • Solution: Developed a visual block-based interface with drag-and-drop functionality

Partner Technologies Integration

  1. Chainlink CCIP: Used for reliable cross-chain messaging
  2. Oasis Sapphire: Implemented for privacy-preserving transactions
  3. BNB Chain: Utilized for core infrastructure and Greenfield storage
  4. PancakeSwap: Integrated for efficient DEX operations
  5. 1inch: Leveraged for cross-chain swaps
  6. CoW Protocol: Implemented for MEV protection

This technical implementation allows DeFi Simplify to provide a comprehensive, user-friendly interface for complex DeFi operations while maintaining security and efficiency across multiple blockchains.

background image mobile

Join the mailing list

Get the latest news and updates