Bitcoin Forum
May 02, 2024, 06:42:42 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to solve the trade collision?  (Read 479 times)
Injective (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 1


View Profile
June 04, 2020, 04:12:27 AM
 #1

Within an exchange, there are two parties: makers and takers.

Makers submit make orders which specify an offer to a specified amount of one token for another amount of another token.

Takers view the exchange orderbook (which is solely comprised of make orders) and exchange tokens by filling make orders.

A trade collision occurs when multiple takers attempt to take the same make order at the same time.

If there any way to help on solving this problem?
1714632162
Hero Member
*
Offline Offline

Posts: 1714632162

View Profile Personal Message (Offline)

Ignore
1714632162
Reply with quote  #2

1714632162
Report to moderator
1714632162
Hero Member
*
Offline Offline

Posts: 1714632162

View Profile Personal Message (Offline)

Ignore
1714632162
Reply with quote  #2

1714632162
Report to moderator
1714632162
Hero Member
*
Offline Offline

Posts: 1714632162

View Profile Personal Message (Offline)

Ignore
1714632162
Reply with quote  #2

1714632162
Report to moderator
I HATE TABLES I HATE TABLES I HA(╯°□°)╯︵ ┻━┻ TABLES I HATE TABLES I HATE TABLES
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714632162
Hero Member
*
Offline Offline

Posts: 1714632162

View Profile Personal Message (Offline)

Ignore
1714632162
Reply with quote  #2

1714632162
Report to moderator
1714632162
Hero Member
*
Offline Offline

Posts: 1714632162

View Profile Personal Message (Offline)

Ignore
1714632162
Reply with quote  #2

1714632162
Report to moderator
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
June 04, 2020, 04:19:18 AM
 #2

As an assumtion and how exchanges look to do it from my perspective is that you have a server that handles trades and holds the database, the user obtains a lock on the database when they submit a market order and the lock is removed from the db after.

Either that, or orders take a while to complete so they might batch orders each second and compute them all at once with the average price credited to all of them. As in a snapshot gets taken of what the user wants the server to do and then the action is performed across all the user interactions for that amount of time.
pawanjain
Hero Member
*****
Offline Offline

Activity: 2674
Merit: 713


Nothing lasts forever


View Profile
June 04, 2020, 04:45:37 AM
 #3

Even though you say 'at the same time' there might be a difference of a few seconds or milliseconds in the take orders placed by the takers.
So the exchange might be approving the take orders on first come first serve basis.
So the one who placed the take order first would receive the tokens first followed by the laterals.

If we talk about the rarest possibility of multiple take orders getting placed at the exact same milli second then the exchange can fill all those take orders in the same ratio as the amount given by those takers.

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits.
..........UNLEASH..........
THE ULTIMATE
GAMING EXPERIENCE
DUELBITS
FANTASY
SPORTS
████▄▄█████▄▄
░▄████
███████████▄
▐███
███████████████▄
███
████████████████
███
████████████████▌
███
██████████████████
████████████████▀▀▀
███████████████▌
███████████████▌
████████████████
████████████████
████████████████
████▀▀███████▀▀
.
▬▬
VS
▬▬
████▄▄▄█████▄▄▄
░▄████████████████▄
▐██████████████████▄
████████████████████
████████████████████▌
█████████████████████
███████████████████
███████████████▌
███████████████▌
████████████████
████████████████
████████████████
████▀▀███████▀▀
/// PLAY FOR  FREE  ///
WIN FOR REAL
..PLAY NOW..
mk4
Legendary
*
Offline Offline

Activity: 2758
Merit: 3830


Paldo.io 🤖


View Profile
June 04, 2020, 05:17:29 AM
 #4

I'm not an expert concerning exchange software, but I'm going to assume it comes down to better, well-optimized software and faster servers. It's very very unlikely for two takers to execute the same orders at the same exact time down to the microsecond anyway, and the exchange should be giving the order to the first one who executed the order.

Of course there are other factors like latency, but that's mostly on the end-user side.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
NeuroticFish
Legendary
*
Offline Offline

Activity: 3654
Merit: 6371


Looking for campaign manager? Contact icopress!


View Profile
June 04, 2020, 10:10:45 AM
 #5

A trade collision occurs when multiple takers attempt to take the same make order at the same time.

If there any way to help on solving this problem?

From what I see, it could be done either with lock on the table / records, either by keeping in memory a synchronized time-ordered list of operations "to be made".

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
Piston
Member
**
Offline Offline

Activity: 102
Merit: 10


View Profile
June 05, 2020, 09:30:42 AM
 #6

There are two general types of collisions in physics: elastic and inelastic. An inelastic collisions occurs when two objects collide and do not bounce away from each other. Momentum is conserved, because the total momentum of both objects before and after the collision is the same. Any macroscopic collision between objects will convert some of the kinetic energy into internal energy and other forms of energy, so no large scale impacts are perfectly elastic.
mk4
Legendary
*
Offline Offline

Activity: 2758
Merit: 3830


Paldo.io 🤖


View Profile
June 05, 2020, 10:18:37 AM
 #7

@Piston LMAO. This is actually the first time I've actually laughed at a plagiarized reply. Did you seriously reply with copy-pasted content from a freakin physics website LOL. At least try staying on topic!

Archived: https://archive.is/7N5ba
Plagiarized from:


█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
btccoffee
Sr. Member
****
Offline Offline

Activity: 516
Merit: 250


kingcasino.io


View Profile
June 05, 2020, 01:26:17 PM
 #8

Trade collision I think this case is very rare specially if there is a good trade volume in that particular exchanger. And if that gonna happen then i think the both parties will not yet get there token orders until there is one another order to fill the empty part of there order to make it enough and they can both get there orders at the same time.


                                          ██
                                        ████
                                        ██████        ██
                                    ████████      ████    █████
                        ████      ██████        ███        ███
                        ████        ██████████████████
                ███      ████████████████████████
          ██████      ███████████████████████
                █████████████████████████████
                    ███████████████████████████
                      ███████████████████████████
                      ████████████████████    █████
                      █████████████████████    ██████
                      █████████████████████    ███████
                    ████  ██████████████                      ██
                  ███  ██████████████          ██████       █
            ████      ███        ███████
        ████          ██  ████████████                                 █████
    ████████      ██  ████  ████  ██                         ████████
█████████  ████████    ████████                   ███            ███
    ██████    ██████        ██  █████       █████████
    ██████  ██████    ██  █  ████████████████████         ███
    ██  ███  █████    ██      ██████████████████     ████████
    █  ████  ████    ███      █████████████████     ████
      ██  ██  ████  █████    ██████████████████
      ██████  ███  ██████  ████████████████████                █
      ███  ██    ██  ██████      ███    ██████████████████████
      ███████    ██  ██████      ███      ████████████████████
      █████                ███████            ██  ████████████████
      ███████    ██      ████████          ██      ████████████
      ████████████    ██████████    ████    ██████    ██
        ██████████████    ███████████████    █████    █
        ███████████████████████████████    ███
          ███████████████████████████████  ██
            ███  ██████████████████████████  █
              ██      █████    █████████████████
                            █████            ██████████
                                                        ███████
                                                            ████
                                                              ██
                                                              ██
KingCasino


















Powered by,
Gozie51
Hero Member
*****
Offline Offline

Activity: 2478
Merit: 621


Leading Crypto Sports Betting & Casino Platform


View Profile
June 05, 2020, 09:52:25 PM
 #9

Trade collision I think this case is very rare specially if there is a good trade volume in that particular exchanger. And if that gonna happen then i think the both parties will not yet get there token orders until there is one another order to fill the empty part of there order to make it enough and they can both get there orders at the same time.

I don't think is rare but I think it does not bother me because I just understand that someone else has seen what I have seen, or want what I want.... Maybe in also trying to win the lady to your side too lol.
But it also happens on the forum here when you sending message too and someone also is trying to send too at same time on same thread plus signature campaign thread for application  Shocked. It is rush or maybe collision as op called it.

..Stake.com..   ▄████████████████████████████████████▄
   ██ ▄▄▄▄▄▄▄▄▄▄            ▄▄▄▄▄▄▄▄▄▄ ██  ▄████▄
   ██ ▀▀▀▀▀▀▀▀▀▀ ██████████ ▀▀▀▀▀▀▀▀▀▀ ██  ██████
   ██ ██████████ ██      ██ ██████████ ██   ▀██▀
   ██ ██      ██ ██████  ██ ██      ██ ██    ██
   ██ ██████  ██ █████  ███ ██████  ██ ████▄ ██
   ██ █████  ███ ████  ████ █████  ███ ████████
   ██ ████  ████ ██████████ ████  ████ ████▀
   ██ ██████████ ▄▄▄▄▄▄▄▄▄▄ ██████████ ██
   ██            ▀▀▀▀▀▀▀▀▀▀            ██ 
   ▀█████████▀ ▄████████████▄ ▀█████████▀
  ▄▄▄▄▄▄▄▄▄▄▄▄███  ██  ██  ███▄▄▄▄▄▄▄▄▄▄▄▄
 ██████████████████████████████████████████
▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄
█  ▄▀▄             █▀▀█▀▄▄
█  █▀█             █  ▐  ▐▌
█       ▄██▄       █  ▌  █
█     ▄██████▄     █  ▌ ▐▌
█    ██████████    █ ▐  █
█   ▐██████████▌   █ ▐ ▐▌
█    ▀▀██████▀▀    █ ▌ █
█     ▄▄▄██▄▄▄     █ ▌▐▌
█                  █▐ █
█                  █▐▐▌
█                  █▐█
▀▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▀█
▄▄█████████▄▄
▄██▀▀▀▀█████▀▀▀▀██▄
▄█▀       ▐█▌       ▀█▄
██         ▐█▌         ██
████▄     ▄█████▄     ▄████
████████▄███████████▄████████
███▀    █████████████    ▀███
██       ███████████       ██
▀█▄       █████████       ▄█▀
▀█▄    ▄██▀▀▀▀▀▀▀██▄  ▄▄▄█▀
▀███████         ███████▀
▀█████▄       ▄█████▀
▀▀▀███▄▄▄███▀▀▀
..PLAY NOW..
AakZaki
Legendary
*
Offline Offline

Activity: 2310
Merit: 1076


zknodes.org


View Profile WWW
June 08, 2020, 05:35:06 AM
 #10

A very rare occurrence for today's exchange platforms that already have good technology and servers. Who is fast and first takes the order even though it is only a few seconds apart, the winner will get the order.
But it will be different if we use Decentralized Exchange like Forkdelta or Etherdelta. I once sold a number of orders placed by someone, but someone took the order first and I couldn't take it. But the order still appears. This might be the problem of the server not responding directly to incoming and outgoing orders or there is a delay of the order.
bitgolden
Legendary
*
Offline Offline

Activity: 2786
Merit: 1128


Leading Crypto Sports Betting & Casino Platform


View Profile
June 08, 2020, 03:17:38 PM
 #11

A trade collision occurs when multiple takers attempt to take the same make order at the same time.

If there any way to help on solving this problem?
I just wonder is this really a problem needs to be addressed?

Usually I do see a catchy price to trade with (and I am not sure how many other people are competing with me for the same order), still I go for placing order and if I am first then I will get my order executed otherwise my order will go "pending". Then I do assume that some other trader took that order and I am not lucky enough. I guess this is how usually all traders do assume and move-on to next best available prices. I mean there is no need to complex things rather than just going with what we have in practice for years.

One probable solution if you still look for addressing it:
It could be solved by being milli-second level of accuracy. Orders are being matched based on first-in, first-served. So, being more accurate in terms of time this could be easily solved. After milli-seconds, you may go for accuracy seeking in nano-second levels.

..Stake.com..   ▄████████████████████████████████████▄
   ██ ▄▄▄▄▄▄▄▄▄▄            ▄▄▄▄▄▄▄▄▄▄ ██  ▄████▄
   ██ ▀▀▀▀▀▀▀▀▀▀ ██████████ ▀▀▀▀▀▀▀▀▀▀ ██  ██████
   ██ ██████████ ██      ██ ██████████ ██   ▀██▀
   ██ ██      ██ ██████  ██ ██      ██ ██    ██
   ██ ██████  ██ █████  ███ ██████  ██ ████▄ ██
   ██ █████  ███ ████  ████ █████  ███ ████████
   ██ ████  ████ ██████████ ████  ████ ████▀
   ██ ██████████ ▄▄▄▄▄▄▄▄▄▄ ██████████ ██
   ██            ▀▀▀▀▀▀▀▀▀▀            ██ 
   ▀█████████▀ ▄████████████▄ ▀█████████▀
  ▄▄▄▄▄▄▄▄▄▄▄▄███  ██  ██  ███▄▄▄▄▄▄▄▄▄▄▄▄
 ██████████████████████████████████████████
▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄
█  ▄▀▄             █▀▀█▀▄▄
█  █▀█             █  ▐  ▐▌
█       ▄██▄       █  ▌  █
█     ▄██████▄     █  ▌ ▐▌
█    ██████████    █ ▐  █
█   ▐██████████▌   █ ▐ ▐▌
█    ▀▀██████▀▀    █ ▌ █
█     ▄▄▄██▄▄▄     █ ▌▐▌
█                  █▐ █
█                  █▐▐▌
█                  █▐█
▀▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▀█
▄▄█████████▄▄
▄██▀▀▀▀█████▀▀▀▀██▄
▄█▀       ▐█▌       ▀█▄
██         ▐█▌         ██
████▄     ▄█████▄     ▄████
████████▄███████████▄████████
███▀    █████████████    ▀███
██       ███████████       ██
▀█▄       █████████       ▄█▀
▀█▄    ▄██▀▀▀▀▀▀▀██▄  ▄▄▄█▀
▀███████         ███████▀
▀█████▄       ▄█████▀
▀▀▀███▄▄▄███▀▀▀
..PLAY NOW..
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!