Pickle Finance UniV3 Jars Powered by Chainlink Keepers

Pickle Finance
4 min readMar 28, 2022

This technical article describes how Pickle Finance has been able to supercharge our capital-efficient liquidity position management Jars with Chainlink Keepers.

What Is Pickle Finance?

Pickle Finance is a yield aggregator that provides users with the ability to auto-compound their LP positions across (as of writing) 9 different chains. Some of these auto-compounding “Jars” also distribute Pickle Finance’s native token “PICKLE,” further boosting users’ rewards. PICKLE can also be locked to earn DILL, which provides holders 45% of the protocol’s revenue, paid out weekly.

How Pickle Finance Uses Chainlink Keepers

We recently released a revolutionary type of Jar, built on top of Uniswap V3’s capital-efficient LP positions. When depositing into a UniswapV3 Pool, users are allowed to set a minimum and maximum price to provide liquidity. Providing a narrower range increases the fees earned, but also means that when prices change, and the current price is outside of the predefined range, users stop earning fees.

Most users do not have time to manually track their positions and constantly adjust them to match ongoing price changes. To solve this, we are using Chainlink Keepers to help automatically rebalance users’ LP positions to help ensure they always remain in range and collect maximum LP fees. This results in Pickle Jars maximizing returns for users without requiring any manual intervention or dependency on centralized scripts.

It is very important for the LP strategy to always be set in the right range to earn fees for the users, which is why we opted to use Chainlink Keepers as a decentralized automation solution featuring unparalleled uptime and reliability guarantees.

Chainlink Keepers enable smart contracts to automate key functions and event-driven tasks in a highly reliable, decentralized, and cost-efficient manner. There is no need for manual intervention, helping us reduce risk for our users and deliver high uptime for consistent service.

How Pickle Finance Integrated Chainlink Keepers

You can automate your smart contracts with Chainlink Keepers in two steps:

  1. Create and deploy a Keeper-compatible contract
  2. Register the contract on the Chainlink Keepers Network to create an Upkeep

After these steps have been completed, Chainlink Keepers will perform the Upkeep job as specified without any further input.

We created a contract designed specifically for Chainlink Keepers to monitor our UNIV3 Jars: https://github.com/pickle-finance/protocol/blob/master/src/polygon/chainlinkKeeper.sol

Keeper-compatible contracts have a checkUpkeep function and a performUpkeep function with the required inputs and outputs expected by Chainlink Keepers.

For more information on how to make a Keeper-compatible contract, read the Chainlink Keepers Developer Documentation.

checkUpkeep Function: checks if the contract requires work to be done.

Chainlink Keepers use a decentralized network to securely monitor the checkUpkeep function off-chain during every block, enabling unmatched cost-efficiency. Chainlink Keepers then initiate an on-chain transaction to execute the smart contract function when predefined conditions are met.

For our use case, Keepers check each of the UniV3 Strategies to see if any of the pool’s current prices are close to the min or max price for our positions.

performUpkeep Function: Performs the work on the contract, if instructed by checkUpkeep().

For this use case, it takes any found strategy from CheckUpkeep and calls rebalance on the strategy.

After writing our Keeper-compatible contract, we simply registered it on the Chainlink Keepers app by following the tutorial here.

Below is a high-level overview of our integration.

Why Pickle Finance Chose Chainlink Keepers

We chose Chainlink Keepers for their decentralization, ease of implementation, and overall time-tested security.

We’re very excited about the opportunity to grow revenue for users without the need for manual management. Decentralized smart contract automation powered by Chainlink Keepers makes life easier for everyone.

About Pickle Finance

Pickle Finance is a yield aggregator that maximizes yield on behalf of users. Users realize the power of compounding, while saving time and money compared to manual yield farming.

Pickle places emphasis on transparency and simplicity when it comes to fees. For our UniswapV3 Jars the fees are:

0% deposit fee
0% withdrawal fee
20% performance fee

About Chainlink

Chainlink is the industry standard for building, accessing, and selling oracle services needed to power hybrid smart contracts on any blockchain. Chainlink oracle networks provide smart contracts with a way to reliably connect to any external API and leverage secure off-chain computations for enabling feature-rich applications. Chainlink currently secures tens of billions of dollars across DeFi, insurance, gaming, and other major industries, and offers global enterprises and leading data providers a universal gateway to all blockchains.

Learn more about Chainlink by visiting chain.link or reading the developer documentation at docs.chain.link. To discuss an integration, reach out to an expert.