Understanding Drift Protocol
At the application level, Drift Protocol is a decentralized exchange that supports low slippage, low fees, and minimal price impact on all trades. Drift offers four primary products:
- Spot Trading -
- Perpetuals Trading -
- Borrow & Lend -
- Passive Liquidity Provision -
On-chain exchanges suffer from limitations associated with blockchains. Namely, speed and limited computational capacity on-chain.
Porting over existing off-chain centralised exchange infrastructure onto the blockchain results in an inefficient use of blockchains and disincentivises market-maker participation with unfavourable conditions.
As a result, most onchain orderbooks suffer from:
- slow fills;
- high spreads; and
- low liquidity.
Drift has designed & developed an exchange that is robust, computationally efficient, and incentivises market maker participation, as well as liquidity provision.
Trades on Drift are supported by three liquidity mechanisms:
- Just-in-Time (JIT) Auction Liquidity: provided by market makers prior to each transaction;
- Limit Orderbook Liquidity: provided by our decentralised orderbook (DLOB) made up of limit orders placed by takers that can be filled by makers; and
- AMM Liquidity: provided by Drift's AMM if no makers step in to provide liquidity.
For a more technical breakdown, check out:
All trades (spot and perpetual) that are placed on Drift are routed through a 5-second auction. During this period, market-makers can bid to fill the order at a better price than what the user would otherwise be filled at.
In this sense, market makers are providing 'Just-in-Time Liquidity' as the liquidity is provided just as the order is submitted.
Auctions are run via a Dutch Auction (where the price starts at the best price and moves towards the worst price) and market makers compete amongst themselves to fill user orders.
For a more technical breakdown, check out: .
Drift's AMM (DAMM) is the backstop liquidity provider for trades on the exchange if 1) market orders aren't filled by the JIT and 2) limit orders hit a trigger price that can be filled by the AMM.
The AMM provides a source of constant liquidity for all traders to take from. The AMM is considered constant as liquidity is available based on a constant product formula (x*y=k) balancing the reserves. Drift's AMM features an inbuilt bid-ask spread that adjusts based on inventory held by the AMM.
This also means that, even without external makers, Drift can launch new markets without needing market makers to bootstrap liquidity. All the DAMM needs is a reliable oracle of the perpetual market's spot reference asset. For instance, Drift's SOL-PERP market would refer to a SOL/USD spot oracle for a spot reference. Drift currently uses Pyth for its oracles.
For a more technical breakdown, check out: .
Drift's decentralised orderbook acts as its third source of liquidity.
Users can place orders on app.drift.trade.
Limit orders are orders that trigger and execute on a particular condition. For a full breakdown of what limit orders are, visit: .
Limit orders are placed by users on-chain. A network of Keeper Bots () then sort the on-chain limit orders into an off-chain orderbook and categorise limit orders from oldest to newest, and largest to smallest.
Each Keeper maintains its own orderbook (hence the 'decentralised' aspect) and listens to the market conditions. If the trigger condition of a limit order is met, the Keeper will submit the limit order and fill it against the DAMM. Keepers will also match taker orders with resting limit orders if the conditions are the same.
Keepers are incentivised and will fill the oldest and largest order first. For their work, they are paid a portion of the transaction fee.
The decentralised orderbook acts as a source of 'resting' liquidity as it rests on the orderbook until either a taker takes it, or the requisite market conditions are met and it's filled against the DAMM.
Drift Protocol is a decentralised exchange, meaning:
- all trades are executed on-chain and are completely transparent;
- trading requires a connection to a self-custodied Solana wallet; and
- execution of all trades is facilitated by smart contract technology with no human or third-party input to execute or fill trades.
Decentralisation offers many benefits, including:
- fairness; and
However, decentralisation also means that Drift is susceptible to the same limitations and shortcomings that arise from running on a blockchain, including:
- underlying blockchain risk;
- transaction fees;
- smart contract risk; and
- network congestion.