[Mod] Global Item Exchange [global_exchange]

Byakuren
Member
 
Posts: 814
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

[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: 814
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

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: 814
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

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: 814
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

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: 814
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

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: 814
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

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
Location: Argentina
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: 814
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

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
Location: Argentina
GitHub: Dragonop
IRC: Dragonop
In-game: Dragonop
 

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
(366.57 KiB) Not downloaded yet
 

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

User avatar
SaKeL
Member
 
Posts: 651
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 :(
 

skiphoppy
Member
 
Posts: 16
Joined: Sat Jun 10, 2017 01:50

Re: [Mod] Global Item Exchange [global_exchange]

by skiphoppy » Sun Jun 11, 2017 00:38

Great mod, but installation on Windows is so far impossible for me, and I'm observing some issues once installed under Linux. Primarily, I'm seeing the same problem SaKeL reported: income never shows up. Once I tweaked the interval and added some debugging statements it showed up for awhile. It looks like there's a bug in the payout check routine - if payout isn't made and the routine returns, the minetest.after() function is never called to set the timer up for the next check.

I'd also like to see the other changes that were suggested here - the credits system is yet another currency beyond minegeld; it would be nice to be able to exchange for any item pairs but that's probably too much.

I may fork this and take it a bit further...
 

User avatar
lisacvuk
Member
 
Posts: 274
Joined: Sat Jul 19, 2014 11:52
Location: Serbia, Užice
GitHub: lisacvuk
IRC: lisac
In-game: lisacvuk

Re: [Mod] Global Item Exchange [global_exchange]

by lisacvuk » Sun Jun 11, 2017 17:20

Interesting mod. Reminds me of WoW's auction house system.
It's lisac, not lisa.
400 character limit? Am I writing a book?
Administrator on Craig's server. Minetest player.
"The enemy pales when they see the face of Dazzle!" ~ Dazzle obviously.
I live in Serbia.
Steam | OpenDOTA
My mods:
Tool ranks
I appreciate donations in TF2 items. :)
 

skiphoppy
Member
 
Posts: 16
Joined: Sat Jun 10, 2017 01:50

Re: [Mod] Global Item Exchange [global_exchange]

by skiphoppy » Tue Jun 13, 2017 00:10

I found a newer version with some updates and bug fixes:

https://github.com/nybble41/global_exchange

I haven't tried that fork, yet, but I have done some local tinkering and bugfixing on my own system. Getting the currency payout to work is a good first step.
 

User avatar
bhree
Member
 
Posts: 66
Joined: Tue Jun 19, 2018 07:45
GitHub: bhree
In-game: bhree

Re: [Mod] Global Item Exchange [global_exchange]

by bhree » Sun Sep 02, 2018 11:54

Tried from the link above, works nicely but selecting item to buy can be faster if search feature exist.

[edit] After comparing with the original, the second version doesn't offer regular payout which I really like more than if regular payout exist. The reason is that by generating money without support from real treasure (even default:dirt in survival mode worth a value), can cause something like inflation. The decision goes to admin to control money/credit circulation. This sounds almost like real economy.
 


Return to Mod Releases



Who is online

Users browsing this forum: Exabot [Bot] and 5 guests