Hammer Finance
Published in

Hammer Finance

Balancer Yield Aggregator

Introduce Hammer Finance and our yield aggregator of Balancer

We love to use Balancer for providing liquidity to earn trading fees and mining rewards. However, it lacks a yield aggregator to help us claim the rewards automatically and re-invest into the pool to maximize the yield, also save gas for everyone. Therefore, we decide to build one!

Introduce Balancer

The Balancer is an AMM platform for programmable liquidity pools. The total TVL is about $520M according to DeFi Pulse. There are many pools on Balancer and BAL/WETH 80/20 is one of the biggest pools with about $47M liquidity. If you provide liquidity into a pool, you can earn the trading fees.

Balancer also provides a liquidity mining program with the rewards of their governance token — BAL. Every week, 145,000 BAL are distributed where 45,000 BAL is distributed to the prioritized BAL stakes, and 100,000 BAL is then distributed to all liquidity providers per weighted sum of liquidity. To calculate the weights there are 5 factors to consider: Fee factor, Ratio factor, Wrap factor, Cap factor, and BAL staking boost. For detail please refer to this article by Andy from our team.

Balancer Yield Aggregator

Let me introduce the aggregator (vault) we build at the beginning and how we solve the critical problems.

First Vault for “BAL/WETH 80/20

Our first vault will accept BPT for the “BAL/WETH 80/20” pool since it is the biggest pool with BAL as liquidity. Here is how it works:

  1. Users deposit their BPT into our vault in return for hBPT (Hammer BPT).
  2. We trigger the smart contract of the vault to claimed the distributed BAL for all depositors and supplied it back to the pool every week.
  3. After step 2, the total BPT held by the vault is increased so the price of hBPT also increases.

The expected APY will be about 120% and the APY without our vault is only about 80%. Since transaction aggregated thus the gas fee is minimized.

Claim BAL with Merkle Proof

The balance of distributed BAL that can be claimed by BPT holders is not on-chain. The balancer team calculates the result and put it on IPFS every week. When you want to claim your BAL through their smart contract you need to provide the Merkle Proof of the result.

However, you don’t need to worry about this. Our team will get the result from IPFS and calculate the Merkle Proof, and use it to trigger the smart contract of the vault. We will cover the gas fee.

Introduce Fair Rate

Since Balancer distributes mining reward (BAL) on a weekly basis. It’s possible that a user can join the vaults just before the harvest and gain the previous week’s reward without contributing anything.

To prevent this arbitrage, we introduce a “Fair Rate” which is about 1 week’s APY (1.5% at the beginning) and it is charged when users withdraw from the vault. The charged rate will stay in the vault and re-invest into the strategy. We believe this Fair Rate can protect us from arbitrage and reward long-term users.


Our design of the contracts is based on the Yearn Vault contracts. It inherited legacy Vault-Controller-Strategy architecture. Please check our Github repo and docs for details. The strategy contract is still under audit, so please use it at your own risk. We have launched the beta version on mainnet: https://hammer.finance!

Hammer Finance

Hammer Finance aimed to create cutting-edge yield aggregators on Balancer and other AMM. Hammer Protocol bases on the codebase of Yearn Protocol. We are building more vaults on Balancer and we will have vault integrate with the leveraged token to hedge the price fluctuation of BAL. We are also designing our token economics and insurance mechanism.

Our team is experienced in blockchain development. We built Dapp Pocket which is a pro crypto wallet app with 110k download users and about 20k WAU. We also built an open-source project “Ethereum Wallet SDK” which was granted by Ethereum Foundation.

👉 Try our beta version on mainnet now: https://hammer.finance

Please feel free to leave any feedback to me on Twitter or by email. Thank you!



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store