Balancer
Balancer V1
Balancer V1
  • Home
  • Getting Started
    • Use Cases
    • FAQ
  • Core Concepts
    • Protocol
      • Background
      • Glossary
      • Pool Lifecycle
      • Limitations
      • Math
        • Exponentiation
    • BAL Governance Token
      • BAL for Gas
    • Liquidity Mining
      • Exchange Listing
      • Liquidity Mining Estimates API
    • Security
      • Audits
      • Bug Bounty
  • Smart Contracts
    • Exchange Proxy
    • Smart Order Router
      • Development & Examples
    • Smart Pools
      • Overview
      • Configurable Rights Pool
      • Component Libraries
        • Rights Manager
      • Smart Pool Templates
      • Liquidity Bootstrapping FAQ
    • On Chain Registry
    • Interfaces
    • Addresses
  • API
    • Migration to Version 1.0
    • Events
    • API Index
    • UML Docs
  • Guides
    • Interact via Etherscan
    • Using the SOR
    • Creating a Shared Pool
    • Creating a Smart Pool
    • CRP Tutorial
      • Liquidity Bootstrapping Example
    • Smart Pool Use Cases
      • Liquidity Bootstrapping Pool
      • Swing Trading Pool
      • Smart Treasury
      • Perpetual Synthetic Pool
      • Investors' Club
      • Experimental
    • Testing on Kovan
    • Hackathons
      • Hacking & Testing
      • Judging
      • Ideas
Powered by GitBook
On this page
  • AMMs in Ethereum
  • Further Reading

Was this helpful?

  1. Core Concepts
  2. Protocol

Background

PreviousProtocolNextGlossary

Last updated 4 years ago

Was this helpful?

Automated Market Makers (AMMs) have been around in some form for as long as trades could be automated, starting in the traditional financial markets. AMMs are essentially automated agents, controlled by algorithms, that define rules for matching buyers and sellers to facilitate trades. Usually AMMs are continuously active in both directions of a trading pair. The liquidity provider's profit comes from the spread between buy and sell prices.

Smart contract platforms like Ethereum have brought AMMs to a whole new level. They have, for the first time in history, combined the trading algorithms with custody of the underlying assets. This has led to interesting new features like atomic trading (sometimes incorporating ), instant feedback loops for correcting prices offered by an AMM, and more.

AMMs in Ethereum

Alan Lu from was the first in the Ethereum community to propose the simplest version of an AMM: a "pool," containing two tokens (let's call them A and B), in which the token prices are derived internally, using only the token balances, according to the simple invariant formula: balance(A) * balance(B) = (constant) k, most commonly written as x*y=k.

Martin Köppelmann and Vitalik Buterin also promoted this idea, which Hayden Adams eventually implemented on .

The "price curve," which can be steeper or gentler based on the choice of constant, defines the price of B in terms of A as the slope of the curve at the point defined by their relative balances. At any given time, we can represent the pool's current composition as a point on that curve.

The pool assets also have external market prices, so we can plot this "point" on the curve as well. If the external market prices diverge from the "internal" prices in either direction, these points will start to "move" away from each other along the curve. In response, arbitrageurs will buy or sell from the pool, trading against the market, changing the relative balances (and therefore prices), until the points converge again and balance is restored.

Balancer is essentially a generalization of the constant product rule to pools containing two or more tokens. In addition, Balancer Pools assign relative weights to each token, to accommodate pools of tokens with significantly different valuations. The weights represent the proportion of each token in the total pool. This flexibility greatly expands the utility of these pools, and allows for many interesting strategies and use cases, as we shall see.

Further Reading

(Gnosis / Alan Lu)

(Vitalik Buterin)

(Medium article)

/ (CMU academic papers)

Euler: The simplest exchange and currency
Decentralized Exchanges as Prediction Markets
Building a Decentralized Exchange in Ethereum
On Path Independence
Uniswap AMM
Improving front-running resistance of AMMs
Advanced AMMs
Practical AMMs
flash loans
Gnosis
Uniswap
V. Buterin, "On Path Independence" (linked below)