WorkflowCredmark Logo

How Curve Factory Contracts Streamline Liquidity Pool Deployment

An overview into Curve factory contracts

Wen-Chiao Su

2023/08/31

Factory contracts are a pattern that DEX protocols use to efficiently manage functionality, governance, and extensibility. They automate the deployment of liquidity pools, enabling quick and efficient pool creation. They also provide transparency into a platform’s liquidity by serving as a comprehensive ledger for deployed pools. For developers building in DeFi, understanding factory contracts is key to fully leveraging the capabilities of on-chain liquidity.

How Factory Contracts Streamline Pool Deployment

At the core of DEXes is the factory contract. These smart contracts allow for easy deployment of liquidity pools. The process is simple: invoke the factory contract with the right parameters to deploy a pool contract.

By doing so, users can freely create a pool for any token pair while the protocol controls the mechanics.

This functionality enables token creators to quickly create pools tailored to their tokens. For DeFi data analysts, factory contracts offer insights into the protocol's deployed pools.

Differing Approaches Among Protocols

DEX protocols use factories differently. Uniswap and QuickSwap have one factory per protocol version. Curve takes a different approach. For each pool version, Curve has two deployment methods.

  1. The registry allows the Curve core team to deploy pools.
  2. The other factory contract is permissionless, allowing anyone to deploy pools.

This balances security with decentralization.


Curve Factory Contracts

Curve's Ethereum mainnet deployment has four factory contracts:

  • StableSwap Registry: a registry of custom StableSwap pool (Curve v1) implementations deployed by Curve Core.
  • StableSwap Factory: a permissionless StableSwap pool (Curve v1) factory.
  • CryptoSwap Registry: a registry of custom CryptoSwap pool (Curve v2) implementations deployed by Curve Core.
  • CryptoSwap Factory: a permissionless CryptoSwap pool (Curve v2) factory.

Curve deployments on other chains may have different configurations.

Aggregating a Comprehensive List

To get a full list of Curve pools, we have to aggregate pools found in all four factories and eliminate duplicates¹. This provides comprehensive coverage while eliminating redundancy between Curve's controlled registries and permissionless factories.

Having the list of all pools in Curve paved the way for us to inquire about one account’s LP positions in Curve.

Final Words

DEX factory contracts enable frictionless liquidity pool creation. Curve’s blended approach, which supports both centralized and decentralized pool creation, addresses conflicting ecosystem needs and enables developers to build faster.

As DeFi continues to grow, it is important to understand foundational design decisions that empower DeFi users and developers.

Footnote

¹ We aren’t sure why duplicates occur, but they do! Our assumption is that sometimes a permissionless pool is recognized by the core team.

About Credmark

Credmark runs a financial modeling platform powered by reliable on-chain data. We curate and manages DeFi data making it available via API and the Snowflake Marketplace around the globe and across industries.

Our community of quants, developers, and modelers actively build models for the DeFi community by leveraging our data API and tools. Join the growing community and together we will advance the next-generation financial system.

copy to clipboard

Sign up for our newsletter for the latest product updates, partnerships, and more.

Ready to get started?

Sign up for our free Token API

Get the latest news

Footer

Credmark logo
DiscordDiscord iconTwitterTelegramTelegram iconYoutubeYouTube iconGitHub

© 2023 Credmark Labs, Inc. All rights reserved.

Products

  • All Products
  • Token API
  • Portfolio API
  • DeFi API
  • Raw Data

Documentation

  • Token API Reference
  • Portfolio API Reference
  • DeFi API Reference
  • Transformation Reference
  • Framework Reference

Resources

  • FAQ
  • Blog
  • Reports
  • Media

About

  • Careers
  • About us
  • Community

Support

  • Status
  • Contact us