[Mod] Global Item Exchange [global_exchange]

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

[Mod] Global Item Exchange [global_exchange]

by Byakuren » Thu Feb 25, 2016 22:55

Provides a server-wide item-trading exchange, where you can post buy and sell orders.

License: GPLv3 (Textures CC-BY-SA)
Mod Dependencies: none
Non-Mod Dependencies: lsqlite3 (You can install this with luarocks.)
Code: https://github.com/minetest-mods/global_exchange
Download: https://github.com/minetest-mods/global ... master.zip

Nodes:
  • ATM - (global_exchange:exchange) - Used by players to view their account information and wire monies.
  • Exchange (global_exchange:exchange) - Used by players to search and post orders.
  • Digital Mailbox (global_exchange:mailbox) - Used by players to claim items sent to buy orders.

Process for selling items:
  • Player A posts a sell order to the exchange. The exchange takes the player's items to hold.
  • If there are any buy orders with a price at least as big, then Player A gets the available amount of his order filled. The bought items are sent to the inboxes of the buyers, and Player A's account is credited.
  • Any remaining items will remain as a sell order on the exchange, until the order is filled or canceled.

Process for buying items:
  • Player A posts a buy order to the exchange. The exchange takes the player's credits to hold.
  • If there are any sell orders with a price at least as low, then Player A gets the available amount of his order filled, and the items are injected straight into his inventory. The seller's accounts are credited.
  • Any remaining amount will remain as a buy order on the exchange, until the order is filled or canceled.

I am currently testing this mod on my server.

Crafting:
+ Spoiler


Using the Exchange:
+ Spoiler


Buying/Selling Items:
+ Spoiler
Last edited by Byakuren on Sat Jul 30, 2016 01:37, edited 16 times in total.
Every time a mod API is left undocumented, a koala dies.
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

Re: [Mod] Global Exchange [global_exchange]

by Byakuren » Fri Feb 26, 2016 04:32

Ok, it's functional now, but I probably need to add something to display a summary of market prices, otherwise it's hard to tell what people are selling/buying.

EDIT: Implemented
Every time a mod API is left undocumented, a koala dies.
 

Mwamba
Member
 
Posts: 19
Joined: Fri Feb 26, 2016 06:55
GitHub: mwambanatanga

Re: [Mod] Global Exchange [global_exchange]

by Mwamba » Fri Feb 26, 2016 07:14

Sounds cool. I would suggest the following changes:
  • no registration -- an account is created automatically at first access (not sure if it's possible)
  • turn buy and sell orders into bids and offers:
    • a player willing to sell stuff has to deposit it at the exchange and write the desired (lowest acceptable) unit price
    • a player willing to buy stuff has to deposit money at the exchange and write the desired product and the desired (highest acceptable) unit price
    • a player willing to take someone else's buying bid, has to transfer the product to the exchange
    • a player willing to accept someone else's selling offer, has to transfer the money to the exchange
  • make all transactions automatic: once A's offer is accepted by B, A gets the product and B gets the money
  • allow partial execution ("I wanna sell 20 of X, but the buyer wants only 5 of X, so the exchange transfers 5 and displays the order for the remaining 15")
  • ATM and exchange nodes joined in an "exchange terminal" or something like that
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

Re: [Mod] Global Exchange [global_exchange]

by Byakuren » Fri Feb 26, 2016 08:30

Mwamba wrote:Sounds cool. I would suggest the following changes:
  • no registration -- an account is created automatically at first access (not sure if it's possible)

This is possible, and not too hard to do. I'll try it out when I have time.
Mwamba wrote:
  • turn buy and sell orders into bids and offers:

When writing this I thought about whether players should respond directly to individual offers or submit orders, and decided that an order system is smoother UI-wise and reduces the friction in making trades. What do you think this system would improve?
Mwamba wrote:
    • a player willing to sell stuff has to deposit it at the exchange and write the desired (lowest acceptable) unit price
    • a player willing to buy stuff has to deposit money at the exchange and write the desired product and the desired (highest acceptable) unit price
    • a player willing to take someone else's buying bid, has to transfer the product to the exchange
    • a player willing to accept someone else's selling offer, has to transfer the money to the exchange
  • make all transactions automatic: once A's offer is accepted by B, A gets the product and B gets the money
  • allow partial execution ("I wanna sell 20 of X, but the buyer wants only 5 of X, so the exchange transfers 5 and displays the order for the remaining 15")

This is currently how it works with buy/sell orders.
Mwamba wrote:
  • ATM and exchange nodes joined in an "exchange terminal" or something like that

This is possible, but I didn't want to have too much clutter in one node. Also with exchange functionality separated from ATMs, it is possible to make ATMs more available than exchanges (though I don't know how useful this is).
Every time a mod API is left undocumented, a koala dies.
 

Mwamba
Member
 
Posts: 19
Joined: Fri Feb 26, 2016 06:55
GitHub: mwambanatanga

Re: [Mod] Global Exchange [global_exchange]

by Mwamba » Fri Feb 26, 2016 10:23

Well, first of all, I have not tested the mod yet. My impression is based on the initial description you provided. What I understood from your description is that the settlement is not automated: users contact each other claiming the products; users use ATMs to transfer money etc. So the "exchange" looks more like a bulletin board.

What I suggest is fully automated centralized settlement. If player A wishes to sell smth, he/she transfers the product to the exchange ("the system"), and the system will hold his/her product until there's a buyer (or until the bid is cancelled). If some player B wishes to buy that product, he/she transfers money to the system, and the system will settle, i.e. will move product from A's to B's account and will move money the other way round. This way the players don't need to contact each other, they don't even need to know whom they traded with. This way separate ATM and billboard become obsolete.

P.S.: Just in case my first comment sounded a bit too critical: I really like the idea behind your mod!
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

Re: [Mod] Global Exchange [global_exchange]

by Byakuren » Fri Feb 26, 2016 17:22

Mwamba wrote:Well, first of all, I have not tested the mod yet. My impression is based on the initial description you provided. What I understood from your description is that the settlement is not automated: users contact each other claiming the products; users use ATMs to transfer money etc. So the "exchange" looks more like a bulletin board.

What I suggest is fully automated centralized settlement. If player A wishes to sell smth, he/she transfers the product to the exchange ("the system"), and the system will hold his/her product until there's a buyer (or until the bid is cancelled). If some player B wishes to buy that product, he/she transfers money to the system, and the system will settle, i.e. will move product from A's to B's account and will move money the other way round. This way the players don't need to contact each other, they don't even need to know whom they traded with. This way separate ATM and billboard become obsolete.

P.S.: Just in case my first comment sounded a bit too critical: I really like the idea behind your mod!


Trading is fully automated, you post buy/sell orders with a max/min prices, and it is automatically filled when someone else posts a matching sell/buy order with a price that works. If a buy order is not immediately filled (by an existing sell order), then when it gets filled later, the items go to an inbox instead, in case the player is not online to collect the items.

I've updated the OP to describe how buying/selling works, maybe that will clarify it a bit.
Every time a mod API is left undocumented, a koala dies.
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

Re: [Mod] Global Exchange [global_exchange]

by Byakuren » Sat Feb 27, 2016 05:15

Added craft recipes for all three nodes; see the OP.
Every time a mod API is left undocumented, a koala dies.
 

Mwamba
Member
 
Posts: 19
Joined: Fri Feb 26, 2016 06:55
GitHub: mwambanatanga

Re: [Mod] Global Item Exchange [global_exchange]

by Mwamba » Sun Feb 28, 2016 03:37

The mod uses an external DB (sqlite3) to store orders, right? So ... it might be possible to do transactions between worlds!!!
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

Re: [Mod] Global Item Exchange [global_exchange]

by Byakuren » Sun Feb 28, 2016 05:16

Mwamba wrote:The mod uses an external DB (sqlite3) to store orders, right? So ... it might be possible to do transactions between worlds!!!


sqlite3 is designed to be run in-process, so the two worlds would have to be running on the same machine so they would both have access to the DB file. If I had thought of this I might have chosen a normal DBMS that works remotely. I guess different backends is something to think about in the future.
Every time a mod API is left undocumented, a koala dies.
 

Dragonop
Member
 
Posts: 1178
Joined: Tue Oct 23, 2012 12:59
GitHub: Dragonop
IRC: Dragonop
In-game: Dragonop

Re: [Mod] Global Item Exchange [global_exchange]

by Dragonop » Sun Feb 28, 2016 05:43

Nice mod, could you post a guide on how to buy/sell and what every button in the "exchange" node does? It's kinda complex and it took some time until I realized how to do anything.
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

Re: [Mod] Global Item Exchange [global_exchange]

by Byakuren » Sun Feb 28, 2016 06:51

Dragonop wrote:Nice mod, could you post a guide on how to buy/sell and what every button in the "exchange" node does? It's kinda complex and it took some time until I realized how to do anything.

Okay, I've added something to the bottom of the OP.
Every time a mod API is left undocumented, a koala dies.
 

Dragonop
Member
 
Posts: 1178
Joined: Tue Oct 23, 2012 12:59
GitHub: Dragonop
IRC: Dragonop
In-game: Dragonop

Re: [Mod] Global Item Exchange [global_exchange]

by Dragonop » Sun Feb 28, 2016 12:45

Thanks, was helpful and cleared some doubts I had.
 

vitalie
Member
 
Posts: 66
Joined: Wed Feb 24, 2016 07:38
GitHub: ciubotaru

Re: [Mod] Global Item Exchange [global_exchange]

by vitalie » Fri Mar 04, 2016 06:07

What about cash withdrawal? It would be nice to combine this with Vanessa's currency mod (or some other popular money).
 

vitalie
Member
 
Posts: 66
Joined: Wed Feb 24, 2016 07:38
GitHub: ciubotaru

Re: [Mod] Global Item Exchange [global_exchange]

by vitalie » Sun May 08, 2016 04:59

Image

If you are interested, please have a look at my repo.
Attachments
1.png
1.png (366.57 KiB) Viewed 2485 times
 

User avatar
mahmutelmas06
Member
 
Posts: 355
Joined: Mon Mar 02, 2015 13:10
GitHub: mahmutelmas06
IRC: mahmutelmas06
In-game: masum

Re: [Mod] Global Item Exchange [global_exchange]

by mahmutelmas06 » Sat May 21, 2016 14:49

+1
My Mods:

Beverage
 

User avatar
SaKeL
Member
 
Posts: 193
Joined: Tue Apr 14, 2015 18:39
GitHub: JurajVajda
IRC: SaKeL
In-game: SaKeL

Re: [Mod] Global Item Exchange [global_exchange]

by SaKeL » Sat Nov 19, 2016 14:39

How do i get money ? after days of playing is my balance still 0 :(
Follow my Collection for more Minetest creations found on my server or join the Community for the latest Server updates and news.

SaKeL
 


Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 63 guests

cron