I made a code because I want to fix the tokens and the price that can be exchanged.
ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー
let PAR7Id = base58’2UDVrBQuBpyVayA8giH4NjPE5F31WxkD7CzMvNRzZXHh’
let Price = 1000
match tx {
case e : ExchangeTransaction =>
e.sellOrder.assetPair.priceAsset == PAR7Id && e.price == Price
|| throw(“Now you can only exchange swap PAR7 ! Thank you for your patience.”)
case _ => true
}
ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー
This code made all exchanges impossible. Is something wrong?
Help me. thank you for reading()
Maybe i was wrong about counter-order hard things.
Look close to that pair you want to trade, for example, if you trade in your_asset_ID/WAVES, then you assetId would be always e.sellOrder.assetPair.amountAsset and e.buyOrder.assetPair.amountAsset.
Another thing to notice is price. Price in exchanges is different. It contains difference in decimals multiplied by fixed value 100000000.
For example, if you trade your_asset_ID with 0 decimals versus WAVES (8 decimals), selling your 1 token for 1 WAVES gets the price equal to 10000000000000000 ( = 100000000 (1 WAVES with 8 decimals versus your 1 token with 0 decimals ) * 100000000 (fixed multiply value)).
By the way, if you have any problem with understanding there is always a straight way of throwing debug information about all problematic variables.