ByAUJay
DEX Development Services, Polygon CDK, and FunC TON Development: Choosing a Tech Stack
A Quick Guide for Founders and Product Leaders
If you're a founder or a product leader on the fence about whether to launch a DeFi appchain using Polygon CDK or to go the native route on TON with FunC, you’ve come to the right place! We’re going to explore what each of these options brings to the table, toss in some exciting features you can expect by 2025, point out some practical design patterns, and share some useful implementation playbooks.
Building on Polygon CDK
Polygon CDK is a great option if you're aiming to dive into the vibrant Ethereum ecosystem. Check out some of these key points:
- Scalability: You can take on a huge number of transactions without even flinching.
- Cost-Effectiveness: With lower fees, it’s way easier for more users to join in the fun.
- Interoperability: It fits right in with all those existing Ethereum projects like it was made for them.
Going Native with TON and FunC
On the other hand, if you’re thinking about going with TON, here’s what you should know:
- Speed: With super quick transaction speeds, your app can truly stand out.
- Security: TON offers top-notch security features that are solid for blockchain.
- Future-Ready: Designed with 2025 in mind, FunC equips you with tools that keep you ahead of the curve.
Design Patterns to Consider
When we talk about design patterns, each platform has its own distinct style. Here’s a quick look at what they offer:
Polygon CDK Patterns:
- Modular Architecture: Makes it super simple to upgrade and add new features whenever you need.
- Event-Driven Design: Ensures that your app stays responsive and runs efficiently.
TON Patterns:
- Asynchronous Execution: This feature really helps to cut down on latency, making your app feel snappier and improving the overall user experience.
- Flexible Contract Design: You can create contracts that adapt and evolve along with your app, giving you the freedom to make changes as needed.
Implementation Playbooks
No worries if you're feeling a bit lost on where to kick things off! Here are a couple of playbooks to help you get moving:
- Getting Started with Polygon CDK:
- First up, get your development environment all set up.
- Next, whip up your appchain using the CDK toolkit.
- Don’t forget to connect with existing Ethereum dApps to really boost your app's value.
- Diving into TON with FunC:
- Kick things off by installing the tools you need for FunC.
- Create your app from scratch, keeping speed and scalability in mind.
- Don't forget to tap into the community and resources available for help whenever you need it.
With this guide, you’re all set to make a smart choice about which direction to go for your DeFi project. Whatever you decide, both platforms have their strengths and can steer you toward success in the constantly changing DeFi world!
Who this is for
- Founders of startups and tech leads diving into validating their DeFi product ideas
- Teams focused on innovation in the enterprise space exploring appchains or seamless user flows that integrate smoothly with wallets
- Product managers trying to gauge how fast they can secure liquidity and the operational risks tied to different ecosystems
The decision in one view
- If you're thinking about building an appchain that you can really tweak to your liking--stuff like gas tokens, fee policies, data availability, and the sequencer stack--then Polygon CDK is the way to go. Plus, you get to enjoy smooth cross-chain liquidity and fast interoperability thanks to AggLayer. And with multistack support rolling out in 2025 (that’s OP Stack plus ZK security), things are only going to get easier for adoption. You'll even be able to use existing OP tools! Dive into the details here: (polygon.technology)
- If you're looking for something that’s totally suited for Telegram-driven distribution, go for TON + FunC. It’s got instant USDT settlements on a massive scale, plus those ultra-slim contracts that are perfect for the TVM’s async message model. This setup is ideal for those viral mini-apps, seamless payment experiences, and DeFi solutions that meet users right where they’re already hanging out. Check out more details here: (theblock.co)
Here’s a quick overview of what’s new, some cool tech tools, and reliable strategies for every route you might take.
What’s new in 2025 that changes the calculus
- Polygon CDK Goes Multistack with Native AggLayer Interop: Exciting news! You can now launch OP Stack-based chains (cdk‑opgeth) with ZK-backed security--using pessimistic proofs right on the mainnet, and guess what? No more annoying “superchain tax.” Performance is impressive, hitting 60-100+ Mgas/s (which translates to over 4,700 peak TPS), and it's on a Type‑1 path toward fully verified execution, thanks to SP1 + Plonky3. Dive into the details here.
- AggLayer v0.3 is Here: We’re really pumped to share that AggLayer v0.3 has officially launched! This version is all about giving you a smooth cross-chain experience in under 10 seconds. And guess what? We're also opening up to non-CDK chains, with Polygon PoS connectivity on the horizon. On top of that, we're rolling out an upgraded execution-proof mode, and Katana will be the first to check it out. You can dive deeper into the details here.
- Succinct’s SP1 zkVM: This guy is the core of AggLayer’s pessimistic proofs, and it’s crafted with the fantastic Polygon Plonky3. There are some crucial security updates lined up for 2025 (bringing SP1 Turbo into the mix) that everyone tapping into the prover network should definitely watch out for. For more info, check it out here.
- Stablecoin Rails on TON: Stablecoins are really gaining traction on TON! USDT launched on April 20, 2024, and with the Telegram wallet and mini‑apps jumping in, adoption is soaring to new heights in the crypto world. If you want to dive deeper into this, take a look at the article here.
- TON’s Dev Stack is Evolving: There are some really exciting updates to share! The Blueprint is unifying the FunC/Tact/Tolk workflows, making everything feel more connected. Coming in 2025, Jetton 2.0 will boost wallet placements in shardchains, plus we’ve got mintless airdrops (TEP‑176/177) that simplify and reduce costs for mass distributions. Check out all the details here.
Option A: Build a DEX on a Polygon CDK chain (with AggLayer)
Why teams pick this
- Appchain control with ecosystem liquidity: You can tailor your fees, pick your gas token, set the DA layer, and take charge of the sequencer, all while benefiting from shared interoperability and liquidity via AggLayer. And don’t worry about speed--you're getting quick cross-chain finality supported by pessimistic proofs. Dive into the details here.
- Getting to know Multistack: With OP tools like geth, OP nodes, and EVM libraries, you can enjoy the perks of ZK security along with the bridge model from AggLayer. Curious to learn more? Check out this blog post.
- Reliable RaaS and sequencer choices: With Conduit’s G2 sequencer and cdk-opgeth, getting started is super easy. The added ZK enhancements and smooth integration with AggLayer really make a difference. Check it out here.
Architecture decisions you’ll make (with current best choices)
- Execution stack
- cdk‑opgeth (OP Stack + ZK): If your team is already in the OP groove, this is definitely the way to go. It features a native AggLayer and has a solid roadmap that will eventually lead to full execution proofs via SP1. You can dive into the details here.
- cdk‑erigon: This one’s all about Erigon and it really shines with its state efficiency, boasting about a 90% reduction in storage needs. Super handy for those high-throughput projects that don’t want to deal with a ton of storage. If you want to learn more, check it out here.
- Security and Interoperability
- Exciting news! The AggLayer pessimistic proof is officially live on mainnet! With version 0.3, you can experience chain-agnostic joins and target a cross-chain user experience in under 10 seconds. Just make sure to develop using the SP1 prover network and don’t forget to apply that SP1 Turbo patch! You can dive into the details here.
- Data availability (DA)
- When it comes to data availability, you’ve got some solid options. You can go with Ethereum DA (rollup), check out Polygon CDK Validium with DAC, or even explore modular DA like Celestia. All of these choices are backed by the CDK to help lower those pesky fees. Wanna learn more? Dive in here.
- Policies and Access Control
- In Validium mode, the CDK policies give you the power to handle allow/deny lists and ACLs directly at the mempool layer. This is really useful for phased launches, especially when you're figuring out who gets to deploy or send transactions. If you want to dive into managing these policies, check it out here.
DEX‑specific patterns on CDK
- LVR/MEV Mitigation
- Consider adding batch auctions, dynamic fees, or even MEV redistribution at the AMM level. Some studies from 2024-2025 indicate that auction-based and dynamic-fee models often beat static fees in various markets. Take a look at the details here: arxiv.org.
- Oracle and Compute
- zkOracles, such as HyperOracle, have joined the CDK family, which is a game changer for verifiable compute and indexing. This is especially handy for stuff like on-chain TWAPs, circuit-verified risk checks, or intent settlement. If you want to dive deeper, check it out at polygon.technology.
- Settlement and Stablecoin UX
- Don’t miss AggLayer’s fresh stablecoin setup and its katana-style chain economics designed to make DeFi transactions a breeze. Quick cross-chain transfers and settlements are high on the agenda for 2025. For all the juicy details, take a look at the article on blockworks.co.
- Stack: We're diving into cdk‑opgeth used alongside the Conduit G2 sequencer, AggLayer pessimistic proofs via SP1, modular DA with Celestia, an oracle fueled by HyperOracle, and an intent-based RFQ on Layer 2. Take a look here: (conduit.xyz).
- Why now: Katana, the new project bringing together Polygon and GSR, is launching a DeFi-focused chain that uses an OP-based CDK along with zk finality (SP1). This is all about pooling liquidity and getting the most out of your yield--think of it as your guide if you're looking to dive into appchain-level economics. Check it out for more details at (blockworks.co).
Option B: Build a DEX natively on TON using FunC (and friends)
Why teams pick this
- Distribution: The Telegram Wallet and its mini-apps are racking up billions of sessions within the TON ecosystem. And let’s be real--using USDT on TON feels just like making a regular fiat transaction. You can dive into it here.
- Throughput and Cost: With TVM’s cell tree and async messaging, you’re in for a wallet experience that’s not only wallet-friendly but also lightning fast. Plus, those sharded jettons (since user wallets are essentially contracts) really tie everything together! Check out more details here.
- Mature Wallet/dApp Connect: The TON Connect 2.0 SDKs are simplifying the process of linking wallets and embedded dApps, no matter if you're on your phone or desktop. Check out all the details over on GitHub.
The 2025 TON dev stack
- Languages and tooling
- If you want to dive deep and have low-level control, FunC is your go-to. But if you prefer quicker iterations, Tact/Tolk might be more up your alley. Blueprint is the glue that holds everything together for creating, testing, and deploying. Plus, it includes Sandbox and TypeScript wrappers! Check it out here: (docs.ton.org)
- Tokens and drops
- If you’re diving into fungibles, the Jetton standard (TEP‑74) is where it’s at. With Jetton 2.0, shard placement got a nice upgrade, so things run quicker and smoother. Plus, check out Mintless Jettons (TEP‑176/177)! They’re perfect for those big Merkle airdrops without bogging down the chain. You can learn more over at (beta-docs.ton.org).
- Storage, gas, and fees
- Make sure you know your numbers! Keep track of the flat VM start cost, the per-gas price, and the storage per bit/cell. This way, you can tweak your code and state for better optimization. (docs.ton.org)
FunC patterns that actually matter in production
- Gas‑aware signatures
- When you're checking signatures, it’s often smarter to use
cell_hashorbuilder_hashrather thanslice_hash. This little tweak can seriously cut down your gas costs, dropping them from around 526 to under 100 (and sometimes even down to just 26 when you’re hashing a cell). For more info, take a look here.
- When you're checking signatures, it’s often smarter to use
- Dictionaries and Throughput
- When you tweak a dictionary, it can end up creating a whole bunch of new cells--imagine about 500 gas for every cell write at the TVM level. To keep things running smoothly, aim to keep those hot paths nice and shallow, avoid unbounded loops, and remember to compress your keys. If you want to learn more, check it out here.
- Message Flags for Refunds and Bounce
- When you're dealing with non-bounce situations, don’t forget to use the
0x10flag. And if you need to carry over any leftover gas to the next hop (which is crucial for workflows that involve several contracts), you'll want to use the64flag. You can find more info about this here.
- When you're dealing with non-bounce situations, don’t forget to use the
A tiny FunC snippet you’ll actually use
() send_money(slice addr, int amount) impure inline {
var msg = begin_cell()
.store_uint(0x10, 6) ;; non-bounce
.store_slice(addr)
.store_coins(amount)
.end_cell();
;; 64 => carry remaining gas to recipient
send_raw_message(msg, 64);
}
You’ll notice this pattern popping up in plenty of wallet-to-contract and contract-to-contract transfers. Don’t hesitate to customize it with your own payload and refund logic. For the nitty-gritty, take a look here: (docs.ton.org)
DEX‑specific patterns on TON
- Jetton mechanics
- Pairing the jetton master with individual jetton wallet contracts makes scaling super easy. You can easily check balances with
get_wallet_data(), and you'll also get notifications from the wallet side. For more info, take a look here.
- Pairing the jetton master with individual jetton wallet contracts makes scaling super easy. You can easily check balances with
- AMM Choices You Should Check Out
- STON.fi: This AMM comes with the Omniston aggregator, which blends RFQ and DEX routing seamlessly. It also offers impermanent loss (IL) protection of up to 5.72% (with a capped monthly pool) to keep your liquidity providing experience a bit safer. Take a closer look here.
- DeDust: Their Protocol 2.0 is pretty impressive! It supports both volatile and stable pools, plus you get multi-hop functionality and a TypeScript SDK. Their documentation lays it all out, from how to create a pool to how to deposit or withdraw, and it even dives into the nitty-gritty of CPMM v2. You can find all the info you need here.
Trade‑offs that move the needle
- Time-to-liquidity
- TON: Getting a Jetton listed and creating a pool on DeDust/STON can be done really quickly--like within a few hours! Plus, you can leverage Telegram for getting the word out. For all the nitty-gritty details, check it out here.
- CDK: Appchains offer you a lot of freedom (which is pretty cool), but they come with the responsibility of setting up validators, managing data availability, and moving your liquidity around. AggLayer makes things easier, but it doesn't completely solve everything. Want to dive deeper? Get more info here.
- UX and Reach
- TON: The user experience is really impressive, thanks to those handy embedded flows (mini-apps) and the USDT rails. This setup makes things super simple for retail users. Check out the article here for more details.
- CDK: The wallet experience here is pretty typical for EVMs, but with AggLayer gunning for under 10 seconds, it really smooths out cross-chain interactions, so it feels almost like you’re sticking to one chain while jumping between DeFi platforms. You can get more insights here.
- Security and ops
- CDK: Make sure to keep your SP1 stack updated (Turbo) and stay on top of the AggLayer client versions. Also, consider a solid data availability redundancy. You can grab some helpful tips here.
- TON: It's key to design for async messages, gas refunds, and storage fees. And hey, don’t forget to test for bounce cases and shard-aware flows when things get busy. For more guidance, check out this link here.
Implementation Playbooks
Playbook A -- “Unified DeFi engine” on Polygon CDK
- Week 0-2: Choose Your Stack
- Start off by diving into cdk‑opgeth via Conduit. Don’t forget to enable AggLayer, get yourself some access to the SP1 prover network, and make use of Celestia DA to keep those fees nice and low. You can learn more about it here: (conduit.xyz).
- Week 3-6: Building the chain and establishing policy gates
- Kick things off by getting your devnet up and running with a pessimistic proof client. While you're in the beta phase, be sure to enable Validium policies. This is key for allowing those all-important allowlist deployments. For more details, check it out here: (docs.agglayer.dev).
- Weeks 5-10: Building the DEX Protocol
- Kick things off by creating a concentrated-liquidity AMM and setting up an RFQ vault for those bigger trades. And hey, make sure to include a dynamic fee module to help lower LVR, along with an oracle that uses zk proofs. Want to explore this more? Check it out here: (arxiv.org).
- Week 8-12: Testing AggLayer Integration
- Now’s the moment to check if we’ve nailed that sub-10s cross-chain user experience and the bridging semantics. Don’t forget to keep an eye on the Mgas/s throughput and fee curves while you're at it. For more details, head over to: (agglayer.dev).
- Key Performance Indicators (KPIs) to aim for
- Aim for that sweet spot of a median local inclusion time under 300 ms. You’ll also want cross-chain confirmations to wrap up in under 10 seconds. And don’t forget about those transaction fees--keep them 10-50x lower than L1! If you're using cdk‑erigon, try to trim down the storage footprint as well. For more details, check this out: (outposts.io).
Playbook B -- “Telegram‑native DEX” on TON with FunC
- Week 0-2: Project Scaffold
- Start strong by using Blueprint to create your contracts (either in FunC or Tact) and run some tests in Sandbox. Oh, and make sure to set up Jetton 2.0 for those LP tokens! You can find all the details here: (docs.ton.org)
- Week 2-5: Core AMM + Gas Discipline
- It's time to launch the AMM with signed actions using builder_hash/cell_hash. Just remember to steer clear of those heavy dictionary writes, and pay attention to sizing your state according to the storage price table. If you need further details, check this out: (beta-docs.ton.org)
- Week 4-7: Wallet and dApp UX
- Time to enhance that user experience! Go ahead and integrate the TON Connect SDK into your web or mini-app, and link it up with the STON/DeDust SDKs for any routing or liquidity pool management you might require. For all the nitty-gritty details, take a look here: (github.com)
- Week 6-9: Liquidity Ignition
- Let’s kick off those liquidity pools on DeDust and STON! Consider organizing a mintless airdrop to give users a nice little boost. And don’t forget to set up indexers for
transfer_notification. If you need a hand with this, check out the guide here: (help.dedust.io)
- Let’s kick off those liquidity pools on DeDust and STON! Consider organizing a mintless airdrop to give users a nice little boost. And don’t forget to set up indexers for
- KPI You Can Hit
- Strive for a quick 1-3 second confirmation experience and keep your fees below 1¢ for straightforward swaps (just remember, this can vary based on the network). Also, aim for conversion funnels of over 10% from mini-apps on Telegram in your initial groups. You can dig deeper into this here: (wired.com)
Emerging best practices you should adopt now
- On CDK/AggLayer
- SP1 is a must-have for your project--definitely make the move to SP1 Turbo and keep an eye on those prover and verifier contract versions. And hey, remember to brush up on your incident response just in case the prover network hits a pause. (blog.succinct.xyz)
- Let's talk interoperability. With v0.3 rolling out, you can expect some exciting connections with non-CDK chains like Polygon PoS. It's wise to sort out your bridge assumptions sooner rather than later. (agglayer.dev)
- On TON/FunC
- If you're diving into new tokens, definitely go for Jetton 2.0 with co-shard wallets. And hey, if you’ve got a major distribution in mind, think about switching to mintless (Merkle) drops. It’s a smart way to keep the chain from getting bogged down. (beta-docs.ton.org)
- Don’t forget to prioritize gas refunds! It’s a good idea to always have some unused gas handy along with message flags. Also, take a moment to plan out the
msg_valueneeds for each handler in advance. (answers.ton.org)
- AMM/LVR
- Start thinking about LVR mitigation from the get-go: consider implementing dynamic fees that connect to short-term volatility, batch auctions, or even methods for redistributing MEV. These approaches have been demonstrating some pretty encouraging benefits. (arxiv.org)
Choosing: quick scenarios
- If you're in the fintech scene and already have some OP tools in place, you might want to consider building a chain that aligns with your brand and also tackles cross-chain liquidity programs. That's where CDK (OP config) and AggLayer come into play. Kick things off by launching a policy-gated beta, and once you're ready, you can expand your offering. To dive deeper, check it out here.
- If you're managing a consumer app that's using Telegram to boost growth and you're looking for USD settlement options, your go-to choice is TON along with FunC/Tact. Don't forget to integrate TON Connect and USDT, and make sure to get listed right off the bat on STON/DeDust. You can check out more details here.
- For enterprises getting into RWA trading, the mix of CDK and AggLayer is pretty exciting. They’ve got some solid recent examples of RWA chains, including Lumia, and their flexible DA is tailor-made for your compliance needs. Take a look here.
Brief in‑depth details: cost and performance levers
- TON gas/storage
- Launching flat gas (VM) costs and the price of each gas unit plus storage (per bit/cell) are what really determine your ongoing costs. So, make sure to hash those cells affordably and keep everything organized with sparse states. Check out the details here: (docs.ton.org)
- CDK Throughput and Finality
- You can look forward to around 60-100+ Mgas/s, and the best part? Quick interoperability is possible thanks to pessimistic proofs. Just make sure you pick your data availability and sequencer wisely to meet your latency and service level agreement goals. Also, keep an eye on the horizon for verified execution proofs as SP1/Plonky3 integrations get even better. Check it out here: (outposts.io)
Bottom line
- Thinking about building your DEX on Polygon CDK? You’re in for a real treat! It’s a great choice if you want some independence and chain-level economics that can give you a competitive advantage. And thanks to AggLayer’s emphasis on security and user experience, it’ll feel like your DEX is operating seamlessly on a single chain. For more details, take a look here.
- Considering a project on TON? You definitely want to use FunC! If you're all about distribution, creating a fantastic user experience, and getting that instant USDT settlement, you're in a great spot. Just make sure you're ready to craft some lean, gas-efficient contracts in the TVM’s async model. For more details, check it out here.
If you're ready to get things rolling with a quick discovery sprint at 7Block Labs, we can whip up a proof-of-concept on either stack in just two weeks. You'll walk away with solid metrics on throughput, fee curves, and user conversion--giving you the insights you need to choose your stack with confidence.
Like what you're reading? Let's build together.
Get a free 30-minute consultation with our engineering team.
Related Posts
ByAUJay
Building a Donation-Based Crowdfunding Platform That Gives Tax Receipts
**Summary:** Donation-based crowdfunding that includes tax receipts has become quite the complex puzzle across different regions. You've got to navigate IRS Pub 1771/526 rules, UK Gift Aid declarations, Canada’s CRA receipting, and the new eIDAS/OpenID4VCI wallets--all while keeping everything running smoothly.
ByAUJay
Why 'Full-Lifecycle Advisory' Beats Just Coding
**Summary:** Engineering teams that focus solely on “writing Solidity” often find themselves caught off guard by shifts in protocols, the need for composable security, and the procurement hurdles that are now impacting real ROI. Our full-lifecycle advisory service bridges the gap by connecting EIP-7702 smart accounts, modular decentralized applications (DA), and ZK-based compliance solutions.
ByAUJay
Why Your Project Could Really Use a 'Protocol Economist
Summary: A lot of Web3 teams are missing a crucial player: the “protocol economist.” And you can really see the impact--value slips away through MEV routing, token incentives that are all out of whack, and those sneaky changes to wallets after Pectra that end up messing with the unit economics. In this playbook, we’ll explore what a protocol economist can do to tackle these issues head-on.

