📘 Glossary
0x
0x is the company that created 0x API, 0x Settler smart contracts, and previously 0x Protocol.
0x API
The 0x API is a collection of services and endpoints that sit on top of the 0x Settler contracts. It allows users to access aggregated liquidity from dozens of on-chain and off-chain decentralized exchange networks and across multiple blockchains. It comes with many parameters to customize your requests for your application and your users.
0x Settler
0x Settler are the settlement contracts that settle 0x swaps on the blockchain. It uses Permit2 to perform swaps without any passive allowances to the contract.
Here is a link to the 0x Settler Smart Contracts: https://github.com/0xProject/0x-settler/tree/master/src
Atomically Swapped
Atomically swapped means the entire trade - the Maker’s asset going to the Taker and the Taker's asset going to the Maker - happens within one smart contract interaction.
Automatic Market Maker (AMM)
An Automatic Market Maker (AMM) is the protocol that provides liquidity to the exchange it operates in through automated trading.
These protocols use smart contracts to define the price of digital assets and provide liquidity. Here, the protocol pools liquidity into smart contracts. In essence, users are not technically trading against counterparties – instead, they are trading against the liquidity locked inside smart contracts. These smart contracts are often called liquidity pools.
Examples of AMMs include Uniswap, Sushiswap, Curve, Balancer, Bancor, and many others.
Buys and Sells
When we say “buys” vs “sells” in the context of Swap API, this is what we mean:
- Imagine a user is trading token A for token B.
- Sell: a sell is when the user is specifying the units of token A that they would like to send
- Buy: a buy is when the user is specifying the units of token B that they would like to receive
- In both cases, the user is selling A for B. The terminology of "sells" vs "buys" in our
/swap
endpoint simply means "are you specifying an input amount or an output amount"? - Generally in the UI, a "sell" is triggered when the user sets the field for token A and a "buy" is triggered when the user sets the field for token B. But in both cases, they're going from A → B.
- While these are commonly used terms, "buys" are a less commonly used feature.
Call Data
When you send a transaction to an Ethereum smart contract for execution against a function, you must also send “data” or “call data”. The first four bytes of this call data, also known as the function selector (see below), determine the function, that the rest of the data is run against. The rest of the data is pretty much just the parameters passed to the function.
CFMM
Constant Function Market Makers - another term for Automatic Market Makers (AMMs)
cURL
cURL, often just referred to as "curl", is a command-line tool for getting or sending data including files using URL syntax. It stands for "Client URL" and is widely used for various purposes involving data transfer over a network.
Most operating systems come bundled with curl. Learn more about installing an using curl here.
EOA
Externally Owned Account - this is an “end user” address, which is in contrast to a “smart contract” address.
Function Selector
This is the first 4 bytes of the call data that determine which function in a smart contract the transaction will run against. The function selector is the first 4 bytes of the keccak256
hash of the function signature. Because hashing is only done on the function signature, all contracts that implement the same method (i.e. ERC-20s) have consistent function selectors (i.e. 0xa9059cbb
is always the Transfer function across contracts).
Impermanent Loss (IL)
When the two assets in a pool start to diverge drastically in price (one becomes relatively expensive compared to the other), liquidity pools incur an opportunity cost where they would be better off simply holding each asset, as opposed to providing liquidity to the pool. This is also known as Divergence Loss.
Maker
This is the Supply side of the the ecosystem. Makers create 0x orders, in other words, provide the 0x liquidity. 0x aggregates liquidity across a number of sources including - public DEX liquidity (e.g. Uniswap, Curve, Bancor), Professional MMs, 0x's Open Orderbook, AMM Liquidity Pools. This liquidity is put into the system to be consumed by Takers
Off-chain infrastructure, on-chain settlement
Unlike other decentralized exchanges that function entirely on-chain, 0x does not store orders on the blockchain; instead, orders are stored off-chain and only trade settlement occurs on-chain.
Permit2 Contract
Permit2 is a standard from Uniswap and is the allowance-target (aka spender, aka operator) for any ERC20 traded via 0x's /swap/permit2
endpoints.
0x’s API v2 transactions are settled by the 0x Settler smart contracts. The 0x Settler smart contracts leverage Permit2 & AllowanceHolder to eliminate allowance risk and bake in protection at the ground level.
Read a great explanation of the Permit2 contract and example usage.
Request For Quotes (RFQ)
RFQ stands for Request for Quote. It is a design pattern that allows traders to get real time quotes from Market Makers. We make API calls to Market Makers when they request a price from the 0x API. This source of liquidity is exclusive to 0x, has 0 slippage, and better trade execution.
Slippage
The price difference between when a transaction is submitted and when the transaction is confirmed on the blockchain.
This occurs because AMMs price their assets along bonding curves that are a function of the size of the relative amounts of each asset, and this price can change if the relative trade size is large.
Smart Order Routing
The 0x API helps users get the best price on their swap via Smart Order Routing splits a fill up up across the different sources to maximize the overall return on your swap. Checkout this articlefor details on how it works.
Taker
This is the Demand side of the the ecosystem. Takers fill 0x orders by agreeing to trade their asset for the Maker's asset; in other words, consume the 0x liquidity. Examples of Takers include Metamask, Coinbase, Zapper, dydx, Matcha, etc.