Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edgy trading engine #198

Closed
dexX7 opened this issue Nov 10, 2014 · 5 comments
Closed

Edgy trading engine #198

dexX7 opened this issue Nov 10, 2014 · 5 comments
Labels

Comments

@dexX7
Copy link

dexX7 commented Nov 10, 2014

Very first: is it just me or does a trade only work, if one of the pairs is TMSC? This was intended as interface restriction, but the trading engine should accept it.

Here two cases with matches that do not match:


A1 offers 10.00000000 TMSC for  2.00000000 TDiv1
A2 offers  3.75000000 TDiv1 for 15.00000000 TMSC

10.0 TMSC trade for 2.0 BTC TDiv1. The update:

A2 offers 1.25000000 TDiv1 for 5.00000000 TMSC
A1 approaches with 5.00000000 TMSC for 1.25000000 TDiv1

Result: no match, yet straight from the getorderbook_MP(2) + getorderbook_MP(2147483653):

[{
  'property_owned': 2,
  'property_desired': 2147483653,
  'amount_original': '5.00000000',
  'amount_desired': '1.25000000'
}]
[{
  'property_owned': 2147483653,
  'property_desired': 2,
  'amount_original': '1.25000000',
  'amount_desired': '5.00000000'
}]

One Satoshi more is sufficient (A1 offers 5.00000001 TMSC for 1.25000000 TDiv1). Not the first time.

This example is actually from OmniLayer/spec#173 (comment) route C.


A1 offers 100 TIndiv1 for 200.00000000 TMSC
A2 offers 600.00000000 TMSC for 300 TIndiv1

No match. Selling 400.0 TMSC for 200 TIndiv1, or 800.0 ... or ... works well. Only 600.0 for 300 is edgy.


Then there is:

A1 offers 20 Indiv1 for 10 Indiv2
A2 offers 12 Indiv2 for 17 Indiv1

Outcome with divisible units seems to be around 8.5 trade for 17.0.

When using indeed indivisible units, then: 17 trade for 8 (you probably should round up, see: OmniLayer/spec#170 (comment)) with a leftover reserve.

However it seems the desired result is actually: A1 is served and 20 Indiv1 trade for 10 Indiv2. A2 has a leftover and still desired 2 Indiv2 more. Not sure what happens with that, but see here: OmniLayer/spec#289 (comment)

@dexX7
Copy link
Author

dexX7 commented Dec 9, 2014

I'm going to reevaluate this and the trades mentioned here, once the trading engine is working again, so to speak.

@m21
Copy link

m21 commented Jan 30, 2015

Metadex Item

@dexX7
Copy link
Author

dexX7 commented Jan 30, 2015

@m21: maybe start to use labels here to tag issues/PRs?

@m21 m21 added the MetaDex label Jan 30, 2015
@m21
Copy link

m21 commented Jan 30, 2015

Good idea thanks Dexx :)

@dexX7
Copy link
Author

dexX7 commented Apr 15, 2015

This should be converted into a spock test, and any follow up discussed in OmniLayer#9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants