This post explains the Stellar DEX pricing limitation for indivisible tokens and the solution we use on the Litemint NFT marketplace.
Issuing Indivisible Tokens on Stellar
The smallest amount for an asset issued on Stellar is called a stroop and is equal to one ten-millionth or 0.0000001. Therefore, we can issue 1 stroop of an asset to ensure that it is indivisible (e.g. as part of the requirements for NFTs).
Stellar DEX Price Limit
However, such small amounts may cause issues on the Stellar DEX because Stellar Core internally uses INT32 (see Stellar-ledger-entries.x) for the fractional representation of prices and the INT32 type can only store values between -2,147,483,648 to 2,147,483,647 (inclusive).
The maximum price for an offer on the SDEX is 2,147,483,647, so when selling 1 stroop, the offer price goes out of bounds if the quote asset amount exceeds ~214.7 (2,147,483,647 × 0.0000001 ≈ 214.7).
For example, if you are trading NFT/USD, the maximum amount of USD you can get is 214.7 (i.e. selling at a price of 214.7 / 0.0000001), if you are trading NFT/XLM, the maximum amount of XLM will be 214.7 XLM and so on.
Therefore, this limitation may be an issue for many trading pairs.
Path Payments
Stellar provides a powerful feature called Path Payment. Path payments are used for cross-currency payments through SDEX offers. Since the source and destination of path payments can be the same, it is an extremely versatile tool (although some have abused the feature on the SDEX, leading to the Surge Pricing implementation).
The Litemint NFT marketplace leverages path payments to circumvent this limitation and allows sellers and buyers to choose their payment currency independently.
Solution
By self-issuing a synthetic asset, we fully control the ask price for an NFT. The synthetic asset acts as an intermediary — the NFT is priced against the synthetic, and the synthetic is priced against the quote asset.

Synthetic asset method for NFT pricing on Stellar
We issue 2 units of the synthetic asset for spam protection. If someone attempts to partially fill the offer, they cannot affect the NFT liquidity — and with generous spammers, we could even receive our ask price without selling the NFT.
From the seller and buyer viewpoint, the setup is fully transparent. The seller can choose any price without worrying about SDEX limitations.
Example Implementation
| |
The bid and offer functions creates a bid and sell offer respectively with both automatically switching to the synthetic asset method when the price exceeds the SDEX limit.
Any questions or comments, feel free to reach out.