This guide provides a technical overview for developers looking to integrate with the Phoenix On-Chain Orderbook, a hyper-efficient DEX built on Phoenix on Solana. We will focus on its architecture and how to interact with it programmatically.
Step 1: Understanding the Fully On-Chain Architecture
Unlike hybrid models, Phoenix is a pure on-chain protocol.
Mechanism: Both the order book state and the matching engine are implemented as on-chain Solana programs. There is no off-chain sequencer or relayer.
Advantage: This provides maximum transparency and censorship resistance. Every action—placing a Phoenix Limit Orders, canceling an order, or executing a trade—is a Solana transaction.
Step 2: Interacting with the Market
To Trade on Phoenix programmatically, you will use the official Phoenix API or SDK.
Loading the Market: Your application must first load the state of the desired market from the on-chain account. This will give you the current book of bids and asks.
Placing Orders: To place an order, you will construct a transaction that calls the place_limit_order instruction on the Phoenix program. You'll specify the market, price (as ticks), quantity, and side (buy/sell).
Cancellations: Similarly, cancel_order is an on-chain instruction that removes your order from the book.
Step 3: Market Making and Fees
Phoenix is designed for efficiency, making it ideal for a Phoenix Market Maker.
Phoenix Trading Fees: The protocol has a simple maker-taker fee model. Makers (who place limit orders that are filled) often receive rebates, while takers (who execute against existing orders) pay a small fee. This incentivizes a deep and liquid order book.
Step 4: Security and Performance
The question "Is Phoenix Safe?" is answered by its radical transparency. Because everything is on-chain, every action is verifiable. The protocol's performance is a testament to Solana's high throughput, which makes a fully on-chain orderbook possible.
For all SDK documentation, program addresses, and market IDs, refer to the Full Official Documentation.
Top comments (0)