Jump to content
Sign in to follow this  
heartbit_io

what is happening when you match your own order ?

Recommended Posts

Hi everyone,

I'm using the getTransactions method from the rippleApi.

It seems that when I pass a buy order matching the price of some of my sell orders it is cancelling all my sell orders

Below is an extract of "OrderbookChanges" from an order.

The problem is that my 12xrp buy order is cancelling a 617xrp sell order, it's not compensating it at all. Am I understanding it right or it's not like it seems ?

 

{
            "direction": "buy",
            "quantity": {
              "currency": "XRP",
              "value": "12"
            },
            "totalPrice": {
              "currency": "BTC",
              "counterparty": "rchGBxcD1A1C2tdxF6papQYZ8kjRKMYcL",
              "value": "0.00105888"
            },
            "sequence": 491,
            "status": "created",
            "makerExchangeRate": "11332.7289211242"
          },
          {
            "direction": "sell",
            "quantity": {
              "currency": "XRP",
              "value": "617"
            },
            "totalPrice": {
              "currency": "BTC",
              "counterparty": "rchGBxcD1A1C2tdxF6papQYZ8kjRKMYcL",
              "value": "0.05444408"
            },
            "sequence": 486,
            "status": "cancelled",
            "makerExchangeRate": "0.00008824"
          }

Share this post


Link to post
Share on other sites

I thought this was in the documentation, but I'm having trouble finding it now. I guess I should revisit and see if I can add it back.

But yeah, Malloy is correct. If you cross your own offers it automatically cancels the old ones.

Share this post


Link to post
Share on other sites
On 1/25/2019 at 6:32 PM, mDuo13 said:

I thought this was in the documentation, but I'm having trouble finding it now. I guess I should revisit and see if I can add it back.

But yeah, Malloy is correct. If you cross your own offers it automatically cancels the old ones.

Almost right! ;)

If you’re autobridging and you cross your own offer it has to be taken, rather than just cancelled.

The reasoning is subtle; for some hints check out https://github.com/ripple/rippled/blob/develop/src/ripple/app/tx/impl/Taker.cpp#L408 (which is remarkably well-commented). If people still have questions, I’m happy to elaborate.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×