How to Implement off chain Keepers for Decentralize Perpetual Exchanges like GMX.io? - ethereum

I'm attempting to clone gmx.io. I understand most of the on-chain and Dex concepts, but I'm stumped on how to establish an off-chain. Keepers they did not opensource the code for that, so could you kindly assist me in determining what the specific usage of the keepers was and how I would implement keepers?
I've included some relevant articles below.
https://gmxio.gitbook.io/gmx/contracts
https://gmx-io.notion.site/gmx-io/GMX-Technical-Overview-47fc5ed832e243afb9e97e8a4a036353
https://medium.com/perpdex/gmx-research-9da560f1e447
https://liamhieuvu.com/how-gmx-limit-order-and-long-short-work
I tried developing a basic listener that monitors the price of the token 24 hours a day, seven days a week, and temporarily stores all orders, and when any order limit price matches the asset price, I call the smartcontract function to start a position.
But it isn't working or performing as expected, so I wanted to find out exactly what I needed to accomplish, what tools and services I required, and how I would implement it in accordance with the standards.

Related

Is there an API that has a basic maintenance schedule for a vehicle?

I am working on a side project and was looking to see if there are any API's that given a vehicle's year, make, and model, it would show sort of a timeline for that vehicle's maintenance. For example, how often to change oil, when to change transmission fluid, etc.
Does anyone know of any API's that have this sort of information? I was going to end up trying to create a basic timeline that works with every car, but I thought it would be better to be more accurate with the chosen vehicle model.

why can I only get 250 rows (/shoe transactions) of stockx data when accessing their API?

I have tried to gather data directly from the API of stockx which seemed possible according to an article from Jan 2019: https://medium.com/#thewillmundy/stockx-sneaker-data-in-three-simple-steps-8977d0016b80 . I am thereby able to get a request url which gives me some transactions in JSON-format.
I have tried changing the parameters within the request url (limit as well as page), which is possible, but only for the latest 250 transactions (due to high volume of sales for some shoes, I can thereby only receive the sales history for the last few days)...
My Goal: getting the whole sales history (often several thousand transactions) - in the article mentioned above, thats possible
Could it be a restriction from stockx?
or is there a way?
Would be so so grateful for help!!!
Best regards, Marvin
I think the API will only give you the 250 most recent sales because that's all the product webpage itself will allow you to load when you click view all sales. Any sales further back in time aren't directly accessible from the product page, and we're essentially requesting the same data that page can request using the link it would use. I guess those are stored and accessed in a different way internally.
I'm guessing StockX changed its API since that article is a little old. I would try to contact StockX about their API via email, but I don't think they're really continuing developer support:
https://twitter.com/stockx/status/1000004306844647424?lang=en
It's pretty disappointing because I was also looking to work with the sales data but what can you do :/

Google Maps: how can I get the exact date of a Google review for a business I don't own?

I'd like to explore patterns of Google reviews for a specific business (that I do not own). It would be useful to get the exact date of a review, rather than just the "3 months ago" or "1 year ago" approximation that you get via the web interface.
Does anyone know a way to do this? Here are the options I've explored so far:
I tried "manually" scraping the review list HTML (e.g. from a page like this), but it does not contain any review timestamp that I could recognise, other than the approximated relative date (e.g. "1 year ago").
The Google "My Business" API does seem to provide exact review dates, but to use this API, you need to own the business for which you're retrieving the reviews.
The Google Places API does expose review dates, but only for 5 reviews per place. According to this API feature request, this limitation remains in place even if you pay for Premium data access.
Results from party review analysis tool Reviewshake contain an absolute date field, but it is derived from the approximate relative date. So it erroneously makes it seem like most past reviews occurred exactly on this day each month, or exactly on this day on previous years!
Any help much appreciated!
The unix timestamp you're referring to can be easily converted from you first bullet point; what occurs when you view the reviews is Google's ReviewService is polled and the date comes in a unix format, that unix format is processed by a date/time function in the JS file on maps that returns the duration in length resulting in a week ago, a month ago, etc.
There is no known interface other than some of what you've already looked at; the closest you've got in your first point is the direct maps URL however you would need to rip the JS feed and convert the timestamps where you can make sense of them.
There aren't many sources that can do this but I can recommend you try https://www.reviewsmaker.com/api/demo/google/ or sign up free at reviewsmaker.com and add the business as a listing and you'll be able to crawl the results; otherwise you'll be stuck scraping the same data.
If you find another way please do share your results!

Can we use mysql with ethereum?

We are thinking of building a dapp for finding salon near me and allowing booking. In such application end users has to be shown the salons which are at a certain distance from their current location. Where would be query that data from. Cause I don't think so that kind of querying is possible in solidity. Do we need to bring in any RDBMS in such a scenario to store salon data so that we can query it easily and booking information can be sent to blockchain.
Is hybrid application the only way out? People are talking about IPFS should be used for storing the images, videos and other data. Is that the solution, if yes then how would we query it from there? Moreover, would it be fast enough?
TL;DR: Short answer: you might, but you shouldn't.
The real question here is what do you need ethereum for in this project?
In Ethereum, each write operation is costly whereas reading data isn't. Write operations are transactions, read are calls.
It means that "uploading" your salon list will cost you money (i.e. gas), but also each data update (opening hours, booking ..).
For the mysql specific part of your question, well Ethereum is not designed for that kind of operation.
Something with an oracle might do the trick but it's truly not designed for. See Ethereum like a way to intermediate transactions between peers that stores every transaction publicly and permanently.
According to the Wikipedia page blockchains are basically a "continuously growing list of records". Ethereum has the possibility to make workers run some code in exchange of gas.
This code (or Smart Contract) only purpose "to facilitate, verify, or enforce the negotiation or performance of a contract" (here contract is a legally binding contract).
From what you described, IMO a simple web application with "standard" SQL is more than enough.
You just have to store the salons' GPS coordinates and do the closest match(es) from the user's GPS coordinates.
You likely want to separate your application into two parts:
- The part which shows the available booking times
- The part which makes a new booking

Office365 REST v1.0 API calendar does not return recurrences

The Microsoft Office team annouced today the availability of a REST API across the Office365 suite, as well as guides for writing apps across the different app ecosystems.
To evaluate the API, I simply wanted to get a listing of my events for today.
The new API seems to be relatively unchanged from the preview API
The basic GET is quite simple:
https://outlook.office365.com/api/v1.0/me/events
This gives back listing of calendar events. To get a specific day, we should be able to use OData Query Parameters.
For example:
https://outlook.office365.com/api/v1.0/me/events?$filter=End gt 2014-10-28 and Start lt 2014-10-29
This gives a much shorter list, but it's not quite right.
There are no recurring events that weren't created in that timeframe.
This seems to be a known issue with the preview (EWS/OData) API:
Office 365 API recurring meetings not always returning
Office 365 API EWS calendar not expanding recurring events
There are some work-arounds mentioned in the above isssues, but there are notes that the API is in flux and that those approaches may not work in the v1.0 release. Furthermore those work-arounds don't seem to still apply, which is why this question is not a duplicate.
So, how can one get all of today's events, including recurrences, via the Office365 REST v1.0 API?
Thanks for your interest in Office 365 REST APIs. You are correct that, in V1.0, GET on events returns single instance meetings and series masters, and doesn't expand series. We have two ways to expand recurrences. We just checked and it looks like that documentation is missing and we will update it ASAP. In the meantime, here is the info that should unblock you:
CalendarView: You can use this API to get list of all events (single instances and occurrences of series) for a given timeframe. Timeframe is specified in UTC, so you have to ask for the right times based on your user's time zone. Time zone support is high on our priority list and will be coming soon. Here is an example request to fetch list of events for October 1-31 PDT:
https://outlook.office365.com/api/v1.0/Me/CalendarView/?startDateTime=2014-10-01T07:00:00Z&endDateTime=2014-11-01T07:00:00Z
Please note: We are in the process of fixing a bug where navigating the "next" link in the response doesn't work, but a fix is already on its way.
Instances of a Specific Meeting Series: You can use this API to expand a specific meeting series for a specified time period. Once again, times are in UTC. Here is an example to expand a specific meeting series to get list of instances for October 1-31 PDT:
https://outlook.office365.com/api/v1.0/Me/Events('AAMkA...')/instances?startDateTime=2014-10-01T07:00:00Z&endDateTime=2014-11-01T07:00:00Z
Please let me know if you have any questions or need more info.
Thanks,
Venkat