Имя Фамилия
Имя Фамилия

Reputation: 11

Implementations with price restriction

I have one question about asset script: It is possible to create token with script which allow to trade on WavesDex only for 1 usd? If sombody want to trade minimum or maximum of > 1< usd script will block this operation

Upvotes: 1

Views: 50

Answers (1)

Who Is John Galt
Who Is John Galt

Reputation: 11

Yes, you can. You should get something like this:

let tokenId = base58'token id here'
match tx {
  case ex : ExchangeTransaction =>
    let selectedToken = ex.sellOrder.assetPair.priceAsset == tokenId || ex.sellOrder.assetPair.amountAsset == tokenId
    let selectedPrice = ex.price == your_price_here
    selectedToken && selectedPrice
  case _ => true
}

Upvotes: 1

Related Questions