Exchange Market
Overview
A user can create an exchange offer. Also, any user can select a suitable offer and exchange its mosaics for others using ProximaX Exchange Market. The market always has the ProximaX permanent offer for buying and selling any official mosaic.
Note
There is a possibility to exchange any mosaic to XPX and vice versa. For example, you can exchange XPX to SO or SM, but there is no possibility to exchange SO to SM or vice versa. It is possible in two-step exchange: SO to XPX and after XPX to SM.
Exchange
The exchange mechanism involves two types of actors with the following intentions:
- The Seller offers to sell M SO for N XPX. The formed price will be equal to M/N.
- The Buyer is interested in buying M SO at a price of no more than XPX per SO.
SellOffer
Any user (in this case, the Seller) may have mosaics, so it can offer the price and sell mosaics. After creating the sellOffer, the specified number of mosaics is deducted from the Seller’s account. As long as this offer exists, any Buyer can agree with the offer and buy mosaics. When the sellOffer time expires, unsold mosaics are returned to the Seller’s account.
BuyOffer
The process of buying is similar to the sellOffer process. The only difference is the transaction type buyOffer instead of sellOffer
Note
If any user creates sellOffer, the other interested users cannot buy less than 1 mosaic (SellOffer Example). In another case, when the user creates buyOffer and another interested user transfers more than the cost of 1 mosaics, it gets 1 mosaic anyway (BuyOffer Example).
SellOffer Example
If 1 XPX cost 5 SO and Buyer transfers less than 5 SO, he will get nothing.
BuyOffer Example
If 1 XPX cost 5 SO and Seller transfers more than 5 and less than 10 SO he gets 1 XPX anyway.
Note Any user can create an exchange offer with a max duration of 10 days. But ProximaX can create offers with unlimited duration.
Schemas
AddExchangeOfferTransaction
Announces a new exchange offer transaction.
Version: 0x01
Entity type: 0x415D
Property | Type | Description |
---|---|---|
AddOffer | array(OfferWithDuration, count) | A new offer that will be announced |
ExchangeOfferTransaction
Announces an exchange transaction.
Version: 0x01
Entity type: 0x425D
Property | Type | Description |
---|---|---|
confirmations | array(MatchedOffer, count) | Exchange offer confirmations |
RemoveExchangeOfferTransaction
Announces a new remove exchange offer transaction.
Version: 0x01
Entity type: 0x435D
Property | Type | Description |
---|---|---|
removeOffers | array(OfferMosaic, count) | Offers that will be removed |
OfferWithDuration
Property | Type | Description |
---|---|---|
Offer | Offer | Extends offer. |
Duration | uint64 | The duration of the offer. |
MatchedOffer
Property | Type | Description |
---|---|---|
Offer | Offer | Extends offer. |
Owner | 32 bytes | The owner of the matched offer. |
OfferMosaic
Name | Value | Description |
---|---|---|
MosaicId | UnresolvedMosaicId | Mosaic id of the offer. |
OfferType | OfferType | Offer type. |
Offer
Property | Type | Description |
---|---|---|
Mosaic | UnresolvedMosaic | Mosaic for exchange. |
Cost | uint64 | Sum of XPX suggested to be paid for mosaic. |
Type | OfferType | Offer type. |
Offer types
Enumeration: uint8
Name | Value |
---|---|
SellOffer | 0 |
BuyOffer | 1 |