Please add Digitex Futures Exchange
ITJusus opened this issue · 8 comments
Would you consider adding Digitex Futures Exchange to Crypto_vba?
I've emailed you some of the details, as well as sent compensation for a job well done assisting me with the last exchange addition we worked on together. I'm hoping that email doesn't get lost in SPAM, so I decided to go ahead and officially submit this request on Github- just in case.
I will admit, from our experience last round, I have already made progress and have been able to get the basic functionality going for this exchange's API over the last 24 hours. But, I'm finally at a sticking point. Here is the barrel of the gun I'm starring down currently...
For the life of me, I can't seem to wrap my mind around how to extract the Bids and Asks data, so that I can insert it into cells in my spreadsheet. It looks to be an array inside of an array.
I'm able to get the value for "symbol" and "updated" just fine (single values) using the following...
For Each Row In json("data")
MsgBox (CStr(json("data")(Row))) 'just for testing
If Row = "bids" Then
OrderbookBidPriceValue = 'HELP!
OrderbookBidSizeValue = 'HELP!
ElseIf Row = "asks" Then
OrderbookAskPriceValue = 'HELP!
OrderbookAskSizeValue = 'HELP!
End If
Next Row
But it fails once it gets to the "bids" and "asks". I tried all kinds of combos that I could think of for trying to get these two sub array data points out in usable fashion, but all of my attempts have failed. I'm thinking it's probably something simple I've overlooked.
As stated in my last exchange request...I'm hoping, with your VBA experience and already having built a template for so many other sites...you could probably whip this out in just a few hours of effort, whereas my VBA-fu is still much weaker and I might spend my life trying to fix this until my wife leaves me.
If you're willing to take on this new project, here are the API specs for Digitex.
Another major issue I'm running into is I read through the entirety of Digitex Futures API documents, but it seems any private requests (such as creating an order) are only available via Websockets based API...rather than the REST based API model I'm accustomed to. From what I can tell...either they aren't providing the syntax for calls necessary to perform private requests to the Websockets API or I simply don't understand it enough to connect the dots.
If you are willing to add this exchange, would you be able to create the typical sample/test subs, in Crypto_VBA, to also include working: Public REST API, Public Websockets API, Private Websockets API, and Public/Private Websockets API Subscription calls/results? I just need that working foundation to start with.
Thank you again.
Hi there,
I have the public API somewhat working, have posted a question with them to see if they have a private REST API, but it doesn't seem that way. If not: I have dipped my toe into websockets through VBA, but that's not really my cup of tea so I'll refrain from that.
If I look at https://github.com/ccxt/ccxt ( a good PHP collection of exchange APIs), I can't find them, so do be careful when trading on this exchange.
For now: If you have that Orderbook data, you could simply do:
Set JsonResult = JsonConverter.ParseJson(TestResult)
'Loop through bids
Set TBids = JsonResult("data")("bids")
For Each Bid In TBids
'Bid(1) = price, Bid(2) = volume
Next Bid
Sure enough that worked. And I know I tried something so similar, at one point, but I must have been slightly off somewhere. Thank you for that. I also appreciate you putting in the request to Digitex for the private REST API.
As far as the exchange goes, they just went live in the last couple a months...so you will find they aren't yet listed on some of those sites you're accustomed to seeing exchanges on. They are just starting to show up partially on CMC (though they have been on CoinPaprika for a while). But, I've been following their project for over a year and all seems on the up-and-up.
Hopefully they will get the private REST API going. I was scratching my head on the websockets angle as well. Thanks again.
While waiting for the Digitex team to reply about the private REST API (which I submitted a request to them about this AM as well)...I was looking to see if they have example code for their websockets API, but all I could find was this:
https://github.com/DigitexOfficial/api-docs/tree/main/examples
If I'm understanding correctly, it requires Python? Definitely over my head if that's the case.
A pity, I just got this back. Will publish the public API part, but for now this seems like a dead end.
Dear sir,
Thanks for reaching out.
Unfortunately we currently only support REST Public, but not private.
Keep eye on our blog post for more updates.
Regards,
Alexey B
Digitex Support Team
Will close this issue for now, if they update their API, do create a new issue.