Steem Monsters Tech Talk - Part 4.5 - Monster Market DEX Protocol Updates

in #steemmonsters6 years ago (edited)

Awesome logo design by @mrgodby

Monster Market DEX Protocol Updates

I feel a bit like a broken record here, but I am once again floored by the amazing response to the Monster Market and the volume of cards being bought and sold in the first week! I have gotten a LOT of feedback from the community since the launch - which is awesome! - and I'm excited to announce that the protocol updates to enable a good portion of that feedback have now been implemented!

This update is primarily focused on updates to the Monster Market DEX Protocol itself, so this post will be of most interest to those of you who are interested in building your own Steem Monsters market. No changes have been made the Monster Market user interface on the SteemMonsters.com website yet, but the framework is now in place so look for some changes coming in the near future!

Multiple Market Items in a Single Transaction

The "sm_market_sell" custom_json operation now accepts an array of objects which will allow multiple market items to be published in a single transaction, as compared to before where you had to publish a separate custom_json for each. An example of listing four cards for sale as separate market items in the same transaction is as follows:

[
  { cards: ['C-PCPBW2W82O'], currency: 'USD', price: 0.1, fee_pct: 200 },
  { cards: ['C-6T8XB86ZTS'], currency: 'USD', price: 0.2, fee_pct: 200 },
  { cards: ['C-AF13N9GX6O'], currency: 'USD', price: 0.15, fee_pct: 200 },
  { cards: ['C-AF13N9GX6O'], currency: 'USD', price: 0.15, fee_pct: 200 }
]

With multiple market items in a single transaction, we can no longer use just the transaction ID to uniquely identify a market item. To address this, the unique identifier for market items will now be in the format: [trx_id]-[index].

In the example above, four market item records will be created with the following IDs (assuming 52c7dd26be685e281bf2097dd17db5dce265b851 is the transaction ID containing the custom_json operation):

52c7dd26be685e281bf2097dd17db5dce265b851-0
52c7dd26be685e281bf2097dd17db5dce265b851-1
52c7dd26be685e281bf2097dd17db5dce265b851-2
52c7dd26be685e281bf2097dd17db5dce265b851-3

If you wish to purchase one of these market items, you will need to use the full identifier including the index at the end in your transfer memo, for example:

sm_market_sale:52c7dd26be685e281bf2097dd17db5dce265b851-2

The index portion will be required even if there is only one market item included in the transaction (it will just be 0 in that case) and the identifier for market items published before this update will remain the same, without an index at the end.

You can always get a full listing of active market items using the steemmonsters.com/market/for_sale API endpoint.

Please note that there are limitations to the size of a single custom_json transaction, so if you try to publish a transaction with hundreds of market items, it will likely fail. Unfortunately you will have to split it up into multiple smaller transactions in that case.

Multiple Cancellations in a Single Transaction

In addition to listing multiple items for sale in a single transaction, you can now also cancel multiple active sales in a single transaction.

The "sm_cancel_sell" custom_json operation now accepts an array property called "trx_ids" (vs the old string property "trx_id"). "trx_ids" is just a simple array of market item transaction IDs to cancel. To cancel all of the market items from the "sm_market_sell" example used above, you can publish an "sm_market_cancel" transaction with the following JSON:

{ "trx_ids": ["52c7dd26be685e281bf2097dd17db5dce265b851-0", "52c7dd26be685e281bf2097dd17db5dce265b851-1", "52c7dd26be685e281bf2097dd17db5dce265b851-2", "52c7dd26be685e281bf2097dd17db5dce265b851-3"] }

It is important to note that for both sell and cancel transactions, if any of the items in the array have an error, the entire transaction will fail. Please see the transaction history section below for more information on how to check if a transaction failed and what the errors were.

Bug Fixes

Two important bugs were fixed in this update as well. The first being that if two purchase transactions for the same market item came in the same block through the market on steemmonsters.com, then both purchases would be passed through to the seller even though obviously only one of the buyers would actually get the card.

The fact that this happened numerous times shows just how quickly people were jumping on certain card sales! In any event, it has been fixed now so that the second transaction will be refunded as intended.

If anyone had this happened where they purchased a card on the market and didn't receive the card or a refund, please let me know!

The second bug that was fixed was just a messaging issue where if you were in the process of buying a card through the market on steemmonsters.com, and before you were able to complete the payment someone else purchased the same card before you, it would show a "Purchase completed!" message.

While technically the message is correct in that the purchase was completed, it was a confusing experience for many players. That message has now been changed to reflect the fact that someone else has just purchased this card.

Steem Monsters Transaction History

In the past, a custom_json transaction would be posted to the @steemmonsters account on the Steem blockchain that confirmed all actions that had taken place. This includes gifting cards/packs, combining cards, purchasing packs, and selling/cancelling market items.

These transactions were unnecessary for the functioning of the system, but were just posted as a way for any third parties to be able to easily verify that a transaction was correct and was processed, as well as to easily keep track of the state of the system by querying the transaction history of the @steemmonsters account.

This resulted in a lot of unneeded data being stored on the blockchain and taking up space, so I decided to stop doing that. If you want to confirm if a transaction was correct and was processed you can make the following API call:

https://steemmonsters.com/transactions/lookup?trx_id=6df3d5a990452343ef03b7b738fce765a63fa352

This will return all of the details about the transaction, including whether it was processed successfully, or if there were any errors. The response for the transaction in the example above is:

{
  "trx_info": {
    "id": "6df3d5a990452343ef03b7b738fce765a63fa352",
    "block_id": "01740ec08f9d90a750ffa33e0989847ba983e304",
    "prev_block_id": "01740ebfa6228b5d820dd598986f250f6388f60c",
    "type": "sm_sell_cards",
    "player": "thomasgutierrez",
    "data": "[{\"cards\":[\"C-0JNBAA06DC\"],\"currency\":\"USD\",\"price\":\"0.12\",\"fee_pct\":200}]",
    "success": true,
    "error": null,
    "block_num": 24383168,
    "created_date": "2018-07-21T23:33:33.914Z"
  }
}

If there were any problems with the transaction, like if someone tried to sell a card that they didn't own or one that was already listed for sale, the "success" property would be "false" and the "error" property would contain a description of the problem.

If you were previously getting the transaction history of the @steemmonsters account to keep track of the current state of the system, you can now use the following API call instead:

https://steemmonsters.com/transactions/history?from_block=24383333

This will return a list of all Steem Monsters transactions that occurred after the block specified in the "from_block" property. Note that it will return a maximum of 1,000 records.

Thank You For Your Support!

To everyone who has supported me, I want to sincerely thank you. That really gives me the motivation to keep doing this day in and day out and to know that I'm making the right decision devoting so much of my time and energy to the Steem platform.

I'm not sure if anyone is following all of this, but thank you for reading it anyway! I'm very much looking forward to continued feedback from the community to continue to make Steem Monsters better!


Banner art by @nateaguila ...except I just added the Steem Monsters logo in the middle :-)

Sort:  

I Just Became Your 6000th Follower!

WooHoo!

Screen Shot 2018-08-03 at 3.18.30 AM.png

That's awesome, thanks! I better get off my butt and post more :-)

MAT, This is awesome! I had no idea that you were the developer behind Steem Monsters until today. I started a podcast called the "blockchain gaming podcast." So far I have interviewed the COO of World of Ether and one of the developers working on Axie Infinity. I would LOVE to get you on the podcast!! let me know if thats something we can make happen :)

That's great, I would love to come on the podcast! Hit me up on Discord (https://discord.gg/CAFJRjY) and hopefully we can set something up.

Hey Matt. It’s Mello. I have not kept up with Steemit lately, but I have been hearing very great things about you and SteemMonsters from Paula and Dave from Newbieresteemday. Sounds like you are super busy and rightfully so. Keep up the great work buddy. I will get caught up with your new game very shortly. You’re going to make me do something I hate to do...spend money, haha. I gotta show my suppprt though. All the best with the development. Take care.

hmm it's good, If anyone wants this movie Hotel transilvania 3 download link visit here : https://steemit.com/drac/@farro2/hotel-transilvania-3-vacaciones-de-verano-film-complet

@yabapmatt ,sir what are terms if I want to add myself on steembottracker . Will you pls send me link

I got in touch with the guy who made the new Steem Monster's logo he's very talented, he's going to help me with a project!

@yabapmatt, First of all i want to really congratulate you for the development of the Steemmonsters and for sure it's an great concept which is already spreading the effective fever and i am also holding the cards and waiting for the Steemmonsters Battle.

And as we know that, gaming community is #1 community in this world and card game can increase the enthusiasm because this is for all age and that also launched on the Steem Blockchain.

And in my opinion, for sure Steemmonsters will going to play an vital role in the growth of the Steem Blockchain, and also more and more users will be attracted towards the Steemmonsters game and inturn towards the Steem Blockchain.

And i think that the new update of Account Creation from the Steemmonsters website is really vital decision and in my opinion that will invite more users to join the Steemit Platform for sure and this update is really appreciable.

And great to see your all development updates and these stuff truly reflecting that you are engaged in the process of more developments and improvements to provide the effectivity to the platform. So, keep up the great job and i want to wish you the good luck for the upcoming projects.

Wishing you an great day and stay blessed. 🙂

thank you for your sharing and i like it !
I want to share with you about "Short space of time to Phú Yên in Vietnam"
https://steemit.com/travel/@colorme/short-space-of-time-to-phu-yen-in-vietnam

Kindly, i want to give you an advice and that is, never share your Blog Post Links until author is advising you to share, otherwise sharing links can be considered as SPAM. Always comment relating to post excluding links and in that way you can receive upvote and possibly author can visit your blog to check your posts. Stay blessed. 🙂

thank you - I don't know this is SPAM... Sorry

Welcome and good luck. 🙂

can you please upvote and following together to sharing infomation ? <3
thank you !

To listen to the audio version of this article click on the play image.

Brought to you by @tts. If you find it useful please consider upvoting this reply.

hello sir
can u please upvote my just any one post
please sir

https://steemit.com/@raviyadav3597

This is good update about steem monsters. Thanks for sharing good update.
Take care, have a nice day.

Super logo design.that displayed is amazing party design

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.033
BTC 64160.97
ETH 3145.28
USDT 1.00
SBD 3.86