Market Pairs
In order to prevent bad actors from spamming our orderbook, we have come up with the idea of Market Pairs. By default, our orderbook rejects app calls to create new orders unless the underlying assets are already registered as Market Pairs on our Orderbook. To Open a Market users need to pay a fee to register the Market with our Orderbook Smart Contract. This purpose of the fee is two fold:
- It cover’s the minimum balance requirments for storing a market pair in Smart contact memory
- Disincentivizes Bad Actors from opening fictitious Market’s as doing so will result in a material finanical loss to them
Formatting
Market Pairs are composed from the Asset IDs of two ASA’s on the Algorand Blockchain.
We consider Algo to have an Asset ID of 0.
Our sincerest apologies to anyone interested in trading Joe-Coin
Market Pair Example
Storage
Market pairs are stored on-chain in our Orderbook Smart Contract using Box Storage. We create a custom tuple from the sorted Asset ID’s and use that as the Market Key in our Box Storage Map. Fee information and the market pair opener are stored as the corresponding value.