Giter Club home page Giter Club logo

Comments (22)

JKorf avatar JKorf commented on May 30, 2024

The BitfinexSocketClient options has a OrderActionConfirmationTimeout property which defaults to 30 seconds. You can try to up this if you see this error and see if this helps. If you still get the error could you provide Debug logging?

from bitfinex.net.

henningms avatar henningms commented on May 30, 2024

Does not work.

2018/06/28 09:34:42:810 | Info | Going to place order
2018/06/28 09:34:42:815 | Debug | Sending [0,"on",null,{"type":"MARKET","symbol":"tLTCUSD","amount":"0.2"}]
2018/06/28 09:34:42:953 | Debug | Received message: [0,"n",[1530171283894,"on-req",null,null,[13782448862,null,27283855334,"tLTCUSD",null,null,0.2,0.2,"MARKET",null,null,null,null,null,null,null,78.627,null,null,null,null,null,null,0,null,null,null,null,null,null,null,null],null,"SUCCESS","Submitting market buy order for 0.2 LTC."]]
2018/06/28 09:34:42:958 | Debug | Processing [0,"n",[1530171283894,"on-req",null,null,[13782448862,null,27283855334,"tLTCUSD",null,null,0.2,0.2,"MARKET",null,null,null,null,null,null,null,78.627,null,null,null,null,null,null,0,null,null,null,null,null,null,null,null],null,"SUCCESS","Submitting market buy order for 0.2 LTC."]]
2018/06/28 09:34:42:963 | Debug | Received message: [0,"pu",["tLTCUSD","ACTIVE",0.2,78.627,0,null,null,null,null,null]]
2018/06/28 09:34:42:965 | Debug | Processing [0,"pu",["tLTCUSD","ACTIVE",0.2,78.627,0,null,null,null,null,null]]
2018/06/28 09:34:42:965 | Debug | Received message: [0,"oc",[13782448862,null,27283855334,"tLTCUSD",1530171283876,1530171283894,0,0.2,"MARKET",null,null,null,0,"EXECUTED @ 78.627(0.2)",null,null,78.627,78.627,null,null,null,null,null,0,0,0,null,null,"API>BFX",null,null,null]]
2018/06/28 09:34:43:014 | Debug | Processing [0,"oc",[13782448862,null,27283855334,"tLTCUSD",1530171283876,1530171283894,0,0.2,"MARKET",null,null,null,0,"EXECUTED @ 78.627(0.2)",null,null,78.627,78.627,null,null,null,null,null,0,0,0,null,null,"API>BFX",null,null,null]]
2018/06/28 09:34:43:014 | Debug | Received message: [17,"te",[262813046,1530171283886,0.2,78.627]]
2018/06/28 09:34:43:065 | Debug | Received message: [0,"te",[262813046,"tLTCUSD",1530171283886,13782448862,0.2,78.627,null,null,-1]]
2018/06/28 09:34:43:077 | Debug | Received message: [17,"tu",[262813046,1530171283886,0.2,78.627]]
2018/06/28 09:34:43:085 | Debug | Received message: [0,"tu",[262813046,"tLTCUSD",1530171283886,13782448862,0.2,78.627,"MARKET",78.627,-1,-0.0314508,"USD"]]
2018/06/28 09:34:43:089 | Debug | Processing [17,"te",[262813046,1530171283886,0.2,78.627]]
2018/06/28 09:34:43:103 | Debug | Processing [0,"te",[262813046,"tLTCUSD",1530171283886,13782448862,0.2,78.627,null,null,-1]]
2018/06/28 09:34:43:107 | Debug | Processing [17,"tu",[262813046,1530171283886,0.2,78.627]]
2018/06/28 09:34:43:113 | Debug | Processing [0,"tu",[262813046,"tLTCUSD",1530171283886,13782448862,0.2,78.627,"MARKET",78.627,-1,-0.0314508,"USD"]]
2018/06/28 09:34:43:148 | Debug | Received message: [0,"pu",["tLTCUSD","ACTIVE",0.2,78.627,0,0,null,null,null,null]]
2018/06/28 09:34:43:164 | Debug | Processing [0,"pu",["tLTCUSD","ACTIVE",0.2,78.627,0,0,null,null,null,null]]

from bitfinex.net.

JKorf avatar JKorf commented on May 30, 2024

That's really weird. So you're placing a market order and you get a notification that it's accepted. So far so good.

But then you get a pu (position update) for that order, and an oc - (order cancel). The oc message however says that it is successfully executed. That seems really strange to me..

from bitfinex.net.

henningms avatar henningms commented on May 30, 2024

Yeah.

Placing a Margin Market order which turns it into a position or adds to an already open position hence the pu message. Is there documentation anywhere on Bitfinex with response messages? Does the oc stand for order canceled?

from bitfinex.net.

JKorf avatar JKorf commented on May 30, 2024

Yes, https://docs.bitfinex.com/v2/docs/abbreviations-glossary lists all response types and clearly states oc is order canceled.

from bitfinex.net.

henningms avatar henningms commented on May 30, 2024

Interesting. Although, all non Exchange types will result in a position getting created, updated or deleted, not sure how that fits in with your logic.

from bitfinex.net.

henningms avatar henningms commented on May 30, 2024

You might have to... look for the Executed message perhaps? It shows up in Order History @ Bitfinex as an successful margin order.. :S

from bitfinex.net.

JKorf avatar JKorf commented on May 30, 2024

I guess that's what I'll end up doing. Even though it feels wrong.. But then again, this isn't the first time the Bitfinex API suprises me.

from bitfinex.net.

JKorf avatar JKorf commented on May 30, 2024

Expect a fix later today

from bitfinex.net.

henningms avatar henningms commented on May 30, 2024

Ok, thanks!

from bitfinex.net.

JKorf avatar JKorf commented on May 30, 2024

Can you check that it is fixed in 1.0.17?

from bitfinex.net.

henningms avatar henningms commented on May 30, 2024

It worked. Thanks 💃

from bitfinex.net.

henningms avatar henningms commented on May 30, 2024

Hi, reopening this again as I seem to not get a confirmation using latest version.

2018/07/27 13:55:44:717 | Info | Going to place order
2018/07/27 13:55:44:740 | Debug | Sending [0,"on",null,{"type":"MARKET","symbol":"tLTCUSD","amount":"0.2421454083176947757128155457","price":"0"}]
2018/07/27 13:55:44:881 | Debug | Received message: [0,"n",[1532692544212,"on-req",null,null,[14794517580,null,42944146312,"tLTCUSD",null,null,0.2421454,0.2421454,"MARKET",null,null,null,null,null,null,null,82.609,null,null,null,null,null,null,0,null,null,null,null,null,null,null,null],null,"SUCCESS","Submitting market buy order for 0.2421454 LTC."]]
2018/07/27 13:55:44:884 | Debug | Processing [0,"n",[1532692544212,"on-req",null,null,[14794517580,null,42944146312,"tLTCUSD",null,null,0.2421454,0.2421454,"MARKET",null,null,null,null,null,null,null,82.609,null,null,null,null,null,null,0,null,null,null,null,null,null,null,null],null,"SUCCESS","Submitting market buy order for 0.2421454 LTC."]]
2018/07/27 13:55:44:898 | Debug | Received message: [30,"te",[273260055,1532692544197,0.2421454,82.59]]
2018/07/27 13:55:44:901 | Debug | Processing [30,"te",[273260055,1532692544197,0.2421454,82.59]]
2018/07/27 13:55:44:918 | Debug | Received message: [0,"oc",[14794517580,null,42944146312,"tLTCUSD",1532692544185,1532692544206,0,0.2421454,"MARKET",null,null,null,0,"EXECUTED @ 82.59(0.2421454)",null,null,82.609,82.59,null,null,null,null,null,0,0,0,null,null,"API>BFX",null,null,null]]
2018/07/27 13:55:44:921 | Debug | Received message: [0,"pu",["tLTCUSD","ACTIVE",0.2421454,82.59,0,null,null,null,null,null]]
2018/07/27 13:55:44:947 | Debug | Received message: [0,"te",[273260055,"tLTCUSD",1532692544197,14794517580,0.2421454,82.59,null,null,-1,null,null,null]]
2018/07/27 13:55:44:950 | Debug | Received message: [0,"pu",["tLTCUSD","ACTIVE",0.2421454,82.59,0,0,null,null,null,null]]
2018/07/27 13:55:44:953 | Debug | Received message: [0,"tu",[273260055,"tLTCUSD",1532692544197,14794517580,0.2421454,82.59,"MARKET",82.609,-1,-0.03999758,"USD"]]
2018/07/27 13:55:44:921 | Debug | Processing [0,"oc",[14794517580,null,42944146312,"tLTCUSD",1532692544185,1532692544206,0,0.2421454,"MARKET",null,null,null,0,"EXECUTED @ 82.59(0.2421454)",null,null,82.609,82.59,null,null,null,null,null,0,0,0,null,null,"API>BFX",null,null,null]]
2018/07/27 13:55:44:956 | Debug | Received message: [30,"tu",[273260055,1532692544197,0.2421454,82.59]]
2018/07/27 13:55:44:988 | Warning | Did not find a placed order for Market

from bitfinex.net.

JKorf avatar JKorf commented on May 30, 2024

Hi, I think it's just the logging that's a bit confusing. The on-req message already confirmed the order placing, but the 'oc' message also tries to confirm, but it can't find any pending orders. The logging also only 200ms apart, so I think everything went through just fine. Could you check to see that result of the order placing was successful?

from bitfinex.net.

henningms avatar henningms commented on May 30, 2024

Order gets placed on Bitfinex, but from the socket client I get Success of false and no Order returned in the Data property.

from bitfinex.net.

henningms avatar henningms commented on May 30, 2024

I think I figured out the issue. I use math to calculate amounts etc and this can lead to more than 6 or 8 decimals which Bitfinex strips away resulting in a mismatch between amount in the order request and the order we receive back.

from bitfinex.net.

JKorf avatar JKorf commented on May 30, 2024

So I found the issue, not sure how to fix it yet. You sent an order of amount 0.2421454083176947757128155457. Obviously some sort of calculated amount, and obviously too much digits for Bitfinex to process. So Bitfinex rounds the value to 0.2421454 as we see in the "oc" message.

However in the library I try to match the pending order with the confirmation based on 8 decimals, instead of the 7 returned by Bitfinex.
8 decimals = 0.24214541
7 decimals of BF = 0.2421454
They aren't equal so they don't get matched. The issue for me now is that I don't know how Bitfinex will round. The API documentation states everything gets rounded to 5 significant figures: https://docs.bitfinex.com/v2/docs#section-price-precision
But this is clearly not the case. 7 seems to be an odd number so I'm reluctant to think that is constant for all order either.

from bitfinex.net.

JKorf avatar JKorf commented on May 30, 2024

Ah I just read your response after posting, so yeah that's the issue.

from bitfinex.net.

henningms avatar henningms commented on May 30, 2024

Yeah that's what I found out as well.

What's the ClientOrderId property? Is that something we can set before issuing the order and then match when the order gets back?

from bitfinex.net.

JKorf avatar JKorf commented on May 30, 2024

It is, I was thinking about that as well. Maybe set some default clientOrderId we generate to match the order, or use a client specified one if it is passed as a parameter to the function. Seems reasonable.

from bitfinex.net.

JKorf avatar JKorf commented on May 30, 2024

I've pushed a new version which uses the clientOrderId to match orders, so there should be no more mismatches in that part. Let me know if you have any issues.

from bitfinex.net.

henningms avatar henningms commented on May 30, 2024

Seems to work :D thanks!

Closing for now.

from bitfinex.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.