Video thumbnail

PiggyBank

Invest using scattered assets; Convert all scattered assets into a single token.

PiggyBank

Created At

ETHGlobal Taipei

Project Description

This project aims to solve the problem that we noticed recently: there isn’t a widely adopted application that can convert multiple scattered tokens into a single type of token at once, but some people do have this kind of need.

This project has two main functions: Swap&Deposit in USDC, Swap muti-type of tokens into one. The gas fee in every transaction will be paid by our team.

Swap&Deposit in USDC: First, user uses SCA to send a batch operation by using Circle API. We also enable the gas station function on Circle API to make sure that our users' gas fees are paid by our team. Next, 1inch portal API help us to send approve and swap calldata. Once the swap has completed, USDCs will be deposit into our PiggyBank, and interact with Yearn DeFi protocal to help our users earn interests. Users can redeem their tokens at anytime, but while redeeming we will take away 10% of the interest they earned as commission. All of the smart contract deploys on Polygon POS, and we uses Curvegrid's Multibaas to monitor events on polygon.

Swap muti-type of tokens into one: First, as same as last model, we use 1inch portal API and Circle API to batch operation. Next, users can redeem their chosen tokens immmediately, but before that, we will take away 0.1% as commission, the exact value is refer to the formula. Our team plans to deposit the commission into our PiggyBank account to earn more profit.

How it's Made

We built a smart contract wallet based on Circle’s Modular Smart Contract Account (MSCA), enabling batched transactions in a single execution flow. By integrating Circle API, we seamlessly handled wallet creation, gas abstraction, and payment routing—allowing users to interact with DeFi without holding native tokens.

To power DeFi functionality, we integrated the 1inch API to fetch token balances, metadata, live prices, and execute optimal token swaps. This allowed us to consolidate complex actions like approval, swap, and deposit into one streamlined transaction.

For yield generation, we developed a custom ERC-4626 vault that interacts directly with DeFi protocols. The vault is deployed on Polygon mainnet, providing scalability and low-cost operations.

We used MultibasS to listen to on-chain events, enabling real-time transaction history and notification delivery. This event-driven design gives users instant feedback and transparency.

The most challenging yet critical part was integrating all these moving parts—Circle MSCA, 1inch, MultibasS—into a unified system, ensuring every component worked flawlessly together. Bringing off-chain APIs and on-chain logic into one seamless flow wasn’t just technically complex—it was the key to delivering a truly automated, gas-efficient DeFi experience.

background image mobile

Join the mailing list

Get the latest news and updates