Exploring Bonding Curves: Differentiating Primary and Secondary Automated Market Makers

PAMMs & SAMMs: Key DeFi Tools for Dynamic Token Supply and Decentralized Exchange

This piece provides a comparison of two different applications of bonding curves that serve important functions in token ecosystems. It will introduce bonding curves as the core mechanism of Automated Market Makers (AMMs), and explore the basics of Primary Automated Market Makers (PAMMs*) and Secondary Automated Market Makers (SAMMs*), as well as the differences between the two. This article is part of a larger effort to clarify and define the bonding curve design space to enable the responsible application of these tools.

The Bonding Curve Research Group (BCRG), in an initial collaboration with the Token Engineering Commons, aims to further the research, development, and education around the topic of bonding curves, particularly in their use as dynamic issuance mechanisms for cryptographic tokens, and as tools for less volatile and more sustainable token economies.

*Note: The terms SAMM and PAMM were originally coined by researchers at Gyroscope, an algorithmic stablecoin built using these mechanisms.

Bonding Curves: An Overview

Bonding curves have been a fascinating topic of discussion over the past few years in the Web3 space. Their application in DeFi products such as decentralized exchanges has revolutionized token liquidity and facilitated the mass trading of small-cap tokens in a way that was previously impossible before the introduction of these new mechanisms. In short, the crypto ecosystem would not be where it is today without the help of bonding curves. Although many token ecosystems leverage the benefits of these tools, oftentimes how they work or why they’re so important remains a mystery to most users.

So what is a bonding curve? A bonding curve is a mathematical encoding of the relationship between two or more tokenized assets. Launched via smart contracts running on top of a blockchain, the first and most basic bonding curves allow those assets to be traded against one another, with the bonding curve defining their exchange rate. A popular example of a bonding curve equation is ‘X * Y = K’, which has an ‘Invariant K’ that defines the exchange price between token X and token Y. The ‘curve’ defines how that price changes as the amount of either token increases or decreases in supply. As we’ll see, bonding curves can be applied in different contexts and configurations to provide key infrastructure for projects deploying a token economy.

A graph of two tokens related via different bonding curves. Different ‘shapes’ of bonding curves can result in different properties of the mechanism, which can be helpful for different contexts and use cases.
A graph of two tokens related via different bonding curves. Different ‘shapes’ of bonding curves can result in different properties of the mechanism, which can be helpful for different contexts and use cases.

Since bonding curves are not much more than a mathematical function, it can be difficult to grasp how they could have such a huge impact on token ecosystems. But when these mathematical relationships are encoded into smart contracts, they lay the economic foundations for new tools that can address some of the major challenges of distributed economic systems, such as bootstrapping small economies, providing necessary exchange liquidity, and facilitating demand-responsive dynamic token supply. By embedding bonding curves in smart contracts, we can create novel and intentional market structures with customizable design spaces.

Applying Bonding Curves to Market Design

Most bonding curves in use today are embedded into Automated Market Makers like Uniswap, Balancer, or Curve, whose main function is to facilitate the exchange of existing tokens via ‘liquidity pools’. These mechanisms can be considered Secondary AMMs (or SAMMs) since their purpose is to facilitate secondary market exchange between tokens already in existence. Much has been written about this application of bonding curves, and many different invariant functions have been experimented with for a wide range of purposes.

A diagram of a basic Automated Market Maker, as experienced by a trader exchanging between two assets. AMMs make use of various types of bonding curves to price tokens relative to each other.
A diagram of a basic Automated Market Maker, as experienced by a trader exchanging between two assets. AMMs make use of various types of bonding curves to price tokens relative to each other.

Another use case for bonding curves is in the direct issuance (minting) and redemption (burning) of a token. These mechanisms can be considered Primary AMMs (or PAMMs), since they are the ‘source’ of token issuance when reserve assets are deposited and the ‘sink’ for token redemption when reserve assets are withdrawn from the bonding curve. PAMMs enable dynamic supply token ecosystems and could be considered as a ‘supply discovery’ mechanism for a token deployed using these tools.

PAMMs address some of the key challenges of token design today, such as projects having to guess how many tokens their system will require throughout its entire lifetime. By allowing dynamic token supply according to market demand, PAMMs not only simplify early-stage decision-making but could also serve as a continuous fundraising tool for productive projects, with protocol-owned liquidity by default.

We’ll dive briefly into these two use cases for bonding curves to understand the benefits they offer to token ecosystems and briefly explore how they can be combined to provide a range of critical infrastructure for token ecosystems of all sizes.

SAMMs as Price Discovery Mechanisms: Initial Product-Market Fit

The rise of decentralized finance (DeFi) has led to the development of AMM platforms like Uniswap, Balancer, and Curve, which replaced traditional order book trading with asynchronous exchange via ‘liquidity pools’. These liquidity pools allow token holders to act as ‘liquidity providers’ by depositing select tokens into a smart contract so that traders could easily swap between the pooled assets according to the pricing algorithm set by the bonding curve.

These novel market structures improved on several aspects of order book trading: they are non-custodial (since no exchange is required to hold funds on users’ behalf), they are asynchronous (since orders from buyers and sellers don’t have to be directly matched, but can instead be routed to the pool), and best of all, fees paid by traders flow not to some intermediating exchange, but back to liquidity providers themselves.

Before Secondary AMMs, the only tokens that had consistent trading volume (and thus exchange liquidity) were Bitcoin, Ethereum, and maybe a small handful of other tokens. Most tokens in existence were barely tradeable and had lots of problems with price discovery due to few trades and thin order books. Decentralized applications like Uniswap provided a platform that enabled SAMMs to be deployed easily, allowing a vast number of small-cap tokens to find some measure of trading liquidity. SAMMs were the first product-market fit moment for bonding curves, providing price discovery and exchange liquidity for the majority of tokens, and we believe there are many more to come.

A Machinations model of a SAMM, where two pools of tokens (Token A and USDC) are traded against each other at prices determined by the bonding curve invariant of the SAMM ‘liquidity pool’. Image by Curious Rabbit.
A Machinations model of a SAMM, where two pools of tokens (Token A and USDC) are traded against each other at prices determined by the bonding curve invariant of the SAMM ‘liquidity pool’. Image by Curious Rabbit.

PAMMs as Supply Discovery Mechanisms: The Power of Dynamic Token Issuance

Imagine you want to run a theme park, but before you can start operations you need to establish how many ride tickets will be needed to meet customer demand in 15 years. Sound impossible? That’s more or less how most tokens are launched today, with developer teams setting pre-defined token issuance schedules, sometimes running for hundreds of years. With Primary AMMs, token ecosystem designers no longer have to guess how many tokens their ecosystem will need, and at what rate of growth.

Unlike SAMMs, PAMMs utilize bonding curves to facilitate the minting and burning of a token, thus providing an automated issuance and redemption mechanism for dynamic token supply. PAMMs are a ‘supply discovery’ tool (compared to the ‘price discovery’ functionality of SAMMs) that addresses several potential incentive misalignments in the design and launch of a token ecosystem. By adjusting token supply according to demand and holding deposited assets in an automated smart contract reserve, the PAMM ensures that every token is backed by a proportional amount of reserve assets supporting its redemption value.

Why Dynamic Token Issuance?

Most tokens deployed today fall on either extreme of the issuance spectrum: from fixed supply on one end, to infinite supply on the other. Each of these issuance paradigms has benefits and drawbacks, and both have been used for different reasons. Fixed supply tokens offer holders some guarantee that the token won’t be diluted through additional issuance — however, the rigidity of a fixed supply may limit the ability of the ecosystem to be able to allocate tokens to address emerging needs of the network. On the other hand, infinite supply tokens can incentivize actions like staking through offering token rewards, but unconstrained supply increases can dilute existing token holders and degrade trust in the token over time if network productivity (and token price) do not grow along with supply.

PAMM bonding curves exist in the middle ground between these two extremes, leveraging the benefits of both sides by giving the flexibility of supply expansion through dynamic issuance, yet constraining that supply expansion to correlate with deposits of reserve assets. This allows PAMMs to provide projects with a flexible token supply that can meet the needs of growing (or shrinking) demand while maintaining token value.

The spectrum of token issuance, from fixed supply on one end to infinite supply on the other, with asset-backed dynamic issuance mechanisms falling somewhere in the middle.
The spectrum of token issuance, from fixed supply on one end to infinite supply on the other, with asset-backed dynamic issuance mechanisms falling somewhere in the middle.

Dynamic issuance enables the token supply to expand as demand grows for a particular service, while still ensuring that every token in supply remains asset-backed in some proportion — a guarantee that is built into the PAMM issuance mechanism itself via the bonding curve invariant.

PAMMs consist of two basic mechanisms:

  1. Fund-to-Mint: Participants deposit reserve assets (such as USDC or ETH) into the PAMM smart contract reserve pool, which in turn mints the appropriate amount of tokens according to the price currently reported by the bonding curve invariant, and sends them onwards to the participant.

  2. Burn-to-Withdraw: Participants can burn some of their tokens, by selling the token to the PAMM and redeeming it for the reserve asset (such as USDC or ETH). This redemption price is defined by the bonding curve invariant.

A Machinations model of a PAMM, where tokens are issued and burned according to the deposit and withdrawal of reserve assets into the Reserve of the PAMM. Image by Curious Rabbit.
A Machinations model of a PAMM, where tokens are issued and burned according to the deposit and withdrawal of reserve assets into the Reserve of the PAMM. Image by Curious Rabbit.

There are several PAMMs deployed and existing in the wild today, although terminology and customization can differ significantly between groups using these tools. The Bonding Curve Research Group has begun a series of case studies of various implementations of PAMM-like tools to understand the benefits and drawbacks of these mechanisms in live deployments. We intend to grow the discourse around best practices of design and configuration of these curves, providing helpful blueprints to others. We aim to establish data structures for analytical modeling and simulation of these new tools, and share lessons learned across implementations.

Promising Benefits of Combining PAMMs & SAMMs

Putting the specific mechanisms of PAMMs and SAMMs aside, when they are combined in an ecosystem, these tools can provide even further benefits to a token economy. The simultaneous existence of both primary issuance and secondary exchange markets offers an arbitrage opportunity whenever these markets diverge in value, which — if designed properly — can end up being beneficial for the system overall.

If the price of the token on a SAMM goes above the mint price on the PAMM, any participant can mint new tokens on the PAMM by depositing reserve assets, thus increasing the token supply (and price) on the primary market. They can then sell those tokens on the SAMM for more than they were just bought for, thus decreasing the token price on the secondary market. This action helps to align the two market prices by increasing the token supply in response to demand, and the arbitrageur receives the difference for their corrective action of increasing the token supply.

This also works in the other direction — if a token is trading at a lower price on the SAMM than the burn price on the PAMM, anyone can purchase those lower-priced tokens on the secondary market, and burn them back to the primary market for the underlying reserve assets, again pocketing the price difference. This would also bring the two markets closer in price, and decrease the token supply in response to the lack of demand for that token.

While each of these actions on their own may not seem overly exciting, the resulting systemic effect should interest token designers everywhere. This effect is demonstrated through the token price chart below.

A live example of the PAMM & SAMM interaction effect dampening token price volatility in the Truebit token ecosystem. In this image, the SAMM price for the TRU token is denoted by the blue line, the PAMM price for the same token is denoted by the orange line, and the supply of the token is denoted by the red line. Data and graph created by @banteg, with commentary and notes by Jeff Emmett.
A live example of the PAMM & SAMM interaction effect dampening token price volatility in the Truebit token ecosystem. In this image, the SAMM price for the TRU token is denoted by the blue line, the PAMM price for the same token is denoted by the orange line, and the supply of the token is denoted by the red line. Data and graph created by @banteg, with commentary and notes by Jeff Emmett.

The above chart demonstrates the price volatility-damping effect of PAMMs and SAMMs in a live token ecosystem. As described above, when the token price on the SAMM exceeds the mint price on the PAMM, market participants responded to SAMM demand by depositing reserves on the PAMM (in this case ETH) to increase the token supply, and selling that increased supply into the demand on the SAMM at a profit. These actions not only kept prices aligned between primary and secondary markets but also smoothed out what may otherwise have been a speculative pump into a smoother, steadier price increase. (The same cannot be said for the subsequent price drop, but that is a different design consideration altogether).

In essence, the combination of PAMMs and SAMMs in a token ecosystem can exert a ‘volatility damping’ effect on token price. This has been observed both in models as well as live deployments, although further research is needed around the limitations and potential drawbacks of these effects.

While further exploration of these benefits will have to wait for a subsequent article, the potential of these tools to address some of the key challenges of cryptographic token economies — like a reduction in excessive price volatility — is incredibly promising and deserving of further research.

Conclusion

Bonding curves are already an essential part of the Web3 space, and their importance will only continue to grow. PAMMs and SAMMs have demonstrated their usefulness to large and small token economies alike. Whether it is bootstrapping an early-stage token ecosystem or facilitating the exchange of a mature one, bonding curves in their various forms and functions will continue to play a key role in digital economies moving forward.

The exploration and research of bonding curves is still in its earliest stages. Although much has been written and deployed in the realm of SAMMs (though not often in that name), PAMMs are still fairly nascent and understudied. To build sound digital public infrastructure with the social responsibility required of an engineering discipline, to support Token Engineering research, development, and education — particularly the ongoing study of Bonding Curves.

The Bonding Curve Research Group looks forward to continuing its research with further grant funding from a range of research partners. Our research roadmap includes further case studies and empirical analyses of existing PAMMs, investigations into the relationship between PAMMs and SAMMs, modeling and simulating their interactions, and much more to uncover the benefits of these intriguing curves. Our future publications will touch on the tangible benefits of these new tools for projects and users, a deeper look at some of their existing deployments, and even how they can replicate processes found in nature.

**This ongoing research can greatly advance our understanding of these new tools and their massive potential to address some of the challenges faced by DeFi (and ReFi) in making a long-lasting positive impact on the world.
**

Acknowledgements
This article was written by Jeff Emmett, Jessica Zartler, and Curious Rabbit with input from Jakob Hackel, and with special thanks to the Token Engineering Commons for funding this research.

**About the Bonding Curve Research Group
**The BCRG is dedicated to the research, development, education, and application of Bonding Curves in their various forms. As a collective of multidisciplinary researchers, we are on a mission to empower projects with reliable token ecosystem tooling, creating new collaboration opportunities through Web3 education and token engineering.

Learn more & connect with us on 🐦Twitter | 📌 Notion | 📚 Medium

To support our ongoing research & participate in future BCRG experiments, subscribe & collect this article as an NFT 👇

Subscribe to Bonding Curve Research Group
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.