FIFO Queue Explained: How Presello Ensures Fair Token Sales
What Is a FIFO Queue?
FIFO stands for first-in, first-out. It is the same principle used in any fair queue: the person who arrives first gets served first. On Presello, this means the seller who lists their tokens first at a given discount tier will have their listing filled before sellers who list later at the same tier.
This is fundamentally different from how most crypto platforms work. On a typical venue, prices fluctuate constantly and orders can be filled out of sequence based on complex matching algorithms. Presello deliberately avoids this complexity. Fixed discount tiers combined with FIFO ordering create a simple, transparent system where everyone knows exactly where they stand.
When a seller deposits tokens into the vault and selects a discount tier, they are placed at the back of the queue for that tier. Their queue position is visible in their dashboard. As buyers purchase tokens at that tier, the queue advances and sellers are filled in order.
Why FIFO Matters for Sellers
For sellers, the FIFO system provides predictability. When you list tokens at a particular discount tier, you know that no one who lists after you at the same tier will be filled before you. Your position in the queue is guaranteed.
This also creates an interesting strategic decision. Deeper discount tiers (higher percentages off) tend to have shorter queues because fewer sellers are willing to accept a larger discount. Shallower discount tiers (closer to 5%) tend to have longer queues because more sellers want to minimize their discount.
Presello provides AI-powered recommendations to help sellers choose the optimal tier. The system analyzes current queue depths, historical fill rates, and buyer demand patterns to suggest tiers where your listing is most likely to be filled quickly. Of course, the final decision is always yours.
The FIFO system also prevents a common problem in informal peer-to-peer sales: front-running. Since orders are processed strictly in sequence, there is no way for a later seller to jump ahead by offering a slightly better price within the same tier.
How Buyers Interact with the Queue
For buyers, the FIFO queue is mostly invisible. When you purchase tokens at a specific discount tier, the platform automatically fills your order from the front of the queue. You always get the price displayed for that tier, and the tokens come from whichever seller has been waiting longest.
If you are purchasing a large quantity, your order may be filled across multiple sellers. For example, if you want to buy 10,000 tokens at 15% off and the first seller in the queue only has 3,000 tokens, your order will take the first seller's 3,000 tokens and then move to the next seller in line for the remaining 7,000.
This cross-seller filling is handled automatically with database-level row locking to prevent double-spending. Two buyers purchasing at the same time will never receive the same tokens. The system processes each purchase atomically to ensure consistency.
Queue Depth and Buyer Strategy
Queue depth at each discount tier is publicly visible on every project page. This transparency serves both sides of the marketplace.
For buyers, a deep queue at a particular tier means there are many tokens available at that discount. This is useful information because it suggests that sellers are willing to accept that discount level, which may reflect their assessment of the project's prospects.
Conversely, a tier with zero or very few listings means sellers are not willing to sell at that discount. This scarcity information helps buyers understand the current market sentiment for a project.
Presello displays queue depth directly on the tier cards, so you can see at a glance how many tokens are available at each discount level. This is one of the data points that makes the platform more transparent than informal peer-to-peer deals.
Technical Implementation
Under the hood, the FIFO queue is implemented with PostgreSQL row-level locking and atomic transactions. When a purchase is initiated, the system locks the relevant listing rows, verifies availability, processes the payment, updates balances, and commits the transaction as a single atomic operation.
This prevents race conditions that could occur if two buyers try to purchase the same tokens simultaneously. The database guarantees that each token can only be sold once, and the FIFO ordering is maintained even under high concurrent load.
Sellers can cancel their listings and withdraw tokens from the vault at any time, provided those tokens have not already been purchased. Cancellation removes the listing from the queue and triggers a vault withdrawal back to the seller's wallet.
The system also handles partial fills correctly. If a seller has 5,000 tokens listed and a buyer purchases 2,000, the remaining 3,000 stay in the same queue position. The seller does not lose their place for the remaining tokens.
Key Takeaways
- 1FIFO means the earliest seller at each discount tier gets filled first.
- 2Queue position is guaranteed and visible in your seller dashboard.
- 3Deeper discounts typically have shorter queues and faster fills.
- 4Buyers automatically receive tokens from the front of the queue.
- 5Database-level locking prevents double-spending and ensures atomic transactions.