Deep dives|Updated Oct 30, 2026|12 min read
What It Really Takes to Distribute Rewards at Scale
"Why not build a rewards system in-house instead of using Merkl?" It's one of the first questions we hear, and now that AI can write thousands of lines of code in minutes, we hear it more than ever.
But writing the code was never the hard part. What takes real work is building and running the infrastructure around it: computing every allocation without a single error, streaming rewards without delays, keeping it secure against people actively looking for a flaw, preventing users from gaming it, and maintaining it as it scales.

In short
- A rewards system is not a smart contract. It is an indexing, computation and distribution infrastructure that has to get every allocation right, for every user and every position, at all times, even for a single campaign on a single chain.
- In-house systems struggle on four fronts: coverage across chains and protocols, fast payouts, scale for partners building on top, and paying every user the right amount, safely, despite bugs, gaming and attacks.
- Building in-house means a dedicated team to build, secure and maintain the system, time taken away from your core product. With Merkl, a campaign goes live in minutes, with no maintenance, in front of 200,000+ LPs a month on the Merkl App.
- Teams like Morpho, Aave, Compound, Robinhood, Ethena Pay and Sky run their incentive programs through Merkl so they can focus on their core product.
Building is easy now. Running it safely isn't.
Ask an AI coding agent for a rewards contract and you will get one in minutes. It will compile, pass a few tests, and distribute tokens on a testnet. That is the part that was never really hard.
A production rewards system is infrastructure, and the contract is only the last piece of it. Here is the gap between a quick in-house build and a real incentive system:
| What a quick in-house build does | What a real incentive system needs |
|---|---|
| Read balances | Index every deposit, withdrawal, swap and transfer that affects eligibility, with no missed blocks and correct handling of reorgs |
| Apply the formula | Recompute positions continuously: who held what, for how long and in which range, every time the state changes |
| Find the holder | Reward the people behind every vault, pool and lending market holding your token, not the contracts themselves |
| Take a snapshot | Track every balance change over time. With a daily snapshot, users can deposit just before it and leave right after |
| Send the tokens | Cover the edge cases: blacklisted addresses, smart contract wallets, campaigns that change mid-way, tokens that rebase, budgets that need topping up |
| Deploy the contract | Ship updates without breaking a system that already controls real funds |
AI makes writing each piece faster. It does not make the whole system correct, and it does not stay on call when a chain halts or a vault upgrades its contracts.
Coverage: follow liquidity wherever it goes
Your users don't keep your token in one place. It sits in lending markets, vaults, liquidity pools and wallets, often on several chains. Each of those venues stores balances its own way, and rewarding the people behind them means understanding every one.
In-house, this is the slowest part to build. Every new chain means new indexing, new RPC providers, new deployments and new audits. Every new campaign type means new attribution logic: a lending market, a concentrated liquidity range, a vault or a points program each needs its own rules. And every time your token lands somewhere new, the work starts again.
Merkl has spent years on this layer:
- Chains: 60+ chains, EVM and non-EVM.
- Protocols: Thousands of protocols integrated, from lending markets and vaults to liquidity pools.
- Beneficial holders: When a vault, a pool or a lending market holds the liquidity you reward, Merkl identifies the users behind it and rewards them directly.
- New venues: When your token lands somewhere new, the integration usually exists already. When it does not, Merkl adds it.
Speed: fast payouts are what users want, and the hardest to get right
LPs want to see their rewards grow within hours, at the rate they were shown. Waiting weeks erodes trust, and users notice.
Fast is hard to do in-house. Every update means recomputing every position, checking the result and publishing it without errors. Most in-house systems end up paying weekly or monthly, for technical reasons rather than business ones. And when a computation stalls or a chain has an issue, rewards arrive late. Users say so on social media, and a program meant to thank your community ends up generating complaints about your brand.
With Merkl, rewards are recomputed continuously, so users see them grow within hours, not at the end of the month. If a safety check fails or a data feed has an issue, distribution pauses instead of paying out wrong numbers, and nothing is lost: rewards catch up at the next cycle.
Scale: build for everyone who builds on top of you
Rewards only work if people see them. Run them alone and you reach your own community. The goal for most teams is wider distribution: wallets, aggregators and other protocols showing your rewards to their own users.
That changes what you need to build. For wallets, aggregators and other protocols to show your rewards, they need an API they can integrate once and trust: every balance correct, always available and loading instantly, on launch day and on the day usage triples. Few teams build that for a single program, and few partners integrate a one-off system.
Merkl already runs it:
- Reach: Rewards distributed through Merkl appear on the Merkl App, used by 200,000+ LPs a month, and in partner frontends like Morpho's, which together reach 5M+ users.
- Traffic: The Merkl API answers millions of requests a day from partner apps, protocol frontends and the Merkl App, while computation keeps running.
- Volume: $1.8B+ distributed across 60+ chains, through 50,000+ campaigns for 1,000+ companies.
- Peaks: Merkl handled a $634M USDC refund for Stable and Hourglass, with $500M claimed within the first 20 hours. Read the case study.
Accuracy and gaming: every allocation has to be right
Two things go wrong most often with in-house rewards systems: a calculation error that pays out the wrong amounts, and users who find a way to game the rules. Neither requires a sophisticated attack.
Compound, 2021: a calculation bug with no way to stop it
In September 2021, Compound's Proposal 62 upgraded the Comptroller, the contract that distributes COMP rewards. A bug in the new logic started sending far more COMP than intended to some users. The reported cause was a comparison operator missing an "=" sign in two places.
The exposure was capped at 280,000 COMP, around $80M at the time. The real problem was what came next: there was no mechanism to pause distribution, and any fix had to go through a 7-day governance process while the faulty logic kept running.
In 2021, a bug in Compound's in-house rewards contract put up to $80M of COMP at risk. Today, Compound distributes its rewards through Merkl.
Gaming: the risk most in-house systems miss
The simplest way to distribute rewards is a daily snapshot: check balances once a day and pay out accordingly. It is also the easiest system to game.
We have seen wallets move hundreds of millions of dollars into a single address for less than 30 minutes around the snapshot time, then put everything back. Every night, the snapshot credits them for capital that spends the rest of the day elsewhere.
Concentrated liquidity pools have their own version. Just-in-time liquidity providers add a large position right before a big swap and pull it right after. A system that rewards fees earned or positions at a given moment pays them as if that liquidity had been there all along.
No contract is exploited and no key is stolen. The rewards system simply pays for liquidity it never gets, and this works just as well against a single campaign on a single chain.
Proving you are right
Getting allocations right is not enough: you also have to prove it. "Why did I get less than expected?" is a question every rewards program receives, and someone has to answer it with data. That means building analytics and support tooling on top of the computation itself.
Merkl's engine reconstructs each participant's exact position from onchain events and rewards the area under the curve: how much they held, multiplied by how long. There is no snapshot to time, and capital parked for a few minutes earns a few minutes of rewards. The engine also checks its results against onchain values and, if they diverge by more than 1%, reads each position directly onchain to correct them. No distribution pays out before it has been checked against these results.
Merkl computes offchain and settles onchain. Computing offchain is what makes any rule possible: eligibility lists, custom formulas, partner attribution, all changed without redeploying a contract. Paying out onchain is what keeps it verifiable: every payout is an onchain transaction, so anyone can check who received what. Read why Merkl runs offchain.
Why AI does not change the picture
These failures are ordinary: one wrong operator, one snapshot taken at a predictable time. They are exactly the kinds of mistakes that slip through generated code, because the code looks right and runs. A model writing your rewards logic will not design a way to halt a faulty distribution unless you know to ask for one.
And the same tools are available to the people looking for flaws. Every rewards contract holding real funds is a target, and finding a bug is getting faster for attackers too.
Security: a payout engine is a target
The biggest hacks in crypto did not hit smart contract protocols. They hit bridges and exchanges: infrastructure built to move money programmatically, where the attack surface is every server, key and process, not one contract. A rewards system sits in the same risk category, and it becomes a bigger target as the amounts it distributes grow.
Merkl is built from that starting point:
- Checks before every payout: Every update is checked by systems that run separately from the computation engine, before any reward can be paid out. A faulty update is stopped, not paid, in hours rather than after a week of governance: the circuit breaker Compound did not have.
- Payouts match what was computed: Only what the engine computed and the checks approved can be paid out, nothing more.
- Non-custodial for users: LPs never deposit their funds with Merkl, and Merkl never holds their keys. They keep using the protocols they already trust.
Each of these layers is covered in detail in Merkl's security model.
Teams that switched, and teams that went straight to Merkl
Building the first version of a rewards system is a one-off project. Everything after it is a permanent line in your engineering budget: a dedicated team to own the indexers, the computation engine and the contracts, reachable when something breaks on a weekend. That ongoing cost is far higher than distributing through Merkl. Every week spent maintaining a rewards system is a week not spent on your roadmap.
Some of the largest companies in DeFi learned this firsthand.
Morpho: from in-house to Merkl
Morpho first built its own rewards system. As the protocol grew across markets and chains, it became clear that keeping that system running would take a large team working on it full time, and the team moved its distribution to Merkl.
"Working with Merkl has been a real relief for our team. Instead of spending time and resources maintaining a complex in-house reward system, we can now focus fully on building the best lending experience." Merlin Egalite, cofounder of Morpho
Since then, Morpho has run 750+ campaigns through Merkl, distributing over $20M in rewards across 8 chains. Read the Morpho case study.
Morpho is not alone. Other teams started with their own system and moved to Merkl:
- Aave followed the same path. Its in-house setup, run by a small team, could not keep up with demand from the protocols building on Aave. It now runs its incentive programs through Merkl, and over $65M in rewards have been distributed to Aave users through Merkl. Read the Aave case study.
- Compound distributed COMP through its own Comptroller contract and now runs its rewards through Merkl.
- Euler started developing its own rewards contracts before choosing Merkl.
Others skipped the in-house step and went straight to Merkl:
- Robinhood wanted to avoid building and maintaining this machinery internally, with the requirement that not a single token reach the wrong address. Read the Robinhood case study.
- Ethena Pay runs daily distributions without any in-house infrastructure. Read the Ethena Pay case study.
- Sky chose Merkl so the rewards on its vaults would show up directly in the Morpho app, with the APR displayed where depositors already are. Read the Sky case study.
The pattern is the same each time. Distributing rewards is critical, but it is not what these teams sell. Every engineer working on rewards infrastructure is an engineer not working on the product.
Key takeaways
- AI lowers the cost of writing a rewards contract, not the cost of running a rewards system safely.
- Running a rewards system means covering every chain and venue where your liquidity sits, paying fast, being reliable enough for partners to integrate, and getting every allocation right against bugs, gaming and attacks.
- An in-house system adds permanent costs: a dedicated team, new work for every chain and campaign type, integrations and LP support.
- Merkl computes every allocation from onchain data, checks each update before it pays out, and pauses rather than pays when something looks wrong.
Launch your next campaign without building the infrastructure
FAQs
How hard is it to build a rewards distribution system?
Writing a distribution contract is straightforward. The hard part is the infrastructure behind it: following your token across chains, vaults and pools, computing every allocation correctly and fast, serving balances that partners can integrate and trust, preventing users from gaming the rules and keeping the whole system secure. Even for a single campaign on a single chain, that work never stops once the system is live.
Can AI build a secure rewards contract?
AI can generate a working rewards contract quickly, but working is not the same as secure. Generated code can carry the same small errors behind past incidents, such as a wrong comparison operator. It also will not add safeguards like a way to halt a faulty distribution unless you know to ask for them.
What are the main risks of in-house incentive distribution?
The main risks are calculation errors that overpay users, snapshot-based allocations that users can game, delayed distributions that turn a rewards program into public complaints, and infrastructure that becomes a target as the amounts it moves grow. Without checks that can stop a payout, a faulty distribution can keep running until a fix is deployed, sometimes days later.
How fast does Merkl distribute rewards?
Merkl recomputes rewards continuously, so users see them grow within hours rather than at the end of the month. If a safety check fails, distribution pauses instead of paying out wrong numbers, and rewards catch up at the next cycle.
How much does it cost to maintain an in-house rewards system?
The main cost is engineering time, and it recurs. A team has to maintain indexers, computation logic and contracts, add support for each new chain and campaign type, integrate with frontends, audit every significant change, and build the analytics and support needed to answer LP questions. For most teams, that is a permanent team working on infrastructure instead of the core product, at a far higher cost than distributing through Merkl.
Why did Morpho switch to Merkl?
Morpho first built its own rewards system. As the protocol expanded across markets and chains, the team realized that maintaining it would require a large team working on it full time. Moving to Merkl let the team stop maintaining that system and focus on lending. Morpho has since run 750+ campaigns through Merkl, distributing over $20M in rewards across 8 chains.
Related articles

Deep dives|Nov 9, 2026|10 min read
Is Merkl Safe? Inside Merkl's Security Model
How Merkl secures reward distribution: non-custodial design, dispute periods, audited contracts and layered infrastructure controls.
Read more →
Deep dives|Oct 26, 2026|8 min read
How Much TVL Will Your Incentives Bring?
How much TVL can an incentive budget attract? Learn how to estimate it, what liquidity costs on Merkl today, and how to turn a TVL target into a budget.
Read more →
Deep dives|Oct 23, 2026|9 min read
How to Turn Incentives Into Lasting Liquidity
Liquidity retention starts with your product. Learn what makes LPs stay, when DeFi incentives are worth it, and how to turn rewards into lasting TVL.
Read more →