From where crypto on-chain data are coming from? - cryptography

I am pretty new to the topic and I would like to understand or if you could re-direct me to the proper source of knowledge about on-chain data, where are they coming from?
How such websites as Glassnode or CryptoQuant are able to deliver such a sophisticated charts about wallets, transactions, exchanges, market indicators etc. ?
Are all of those data publicly available on the blockchain and those companies are running kind of "queries" to get such data?
I am just wondering how it works under the hood, to be able to get such on-chain data?
I would very grateful for brief explanation or simply re-direction to good source of knowledge.
Best Regards 🙏

As the name "on-chain analysis" suggests, the base data are collected from blockchains. Most analytics companies combine the blockchain data with their own knowledge. Sometimes it's combined with public data that are just complicated to filter out. And sometimes they're using non-public data that they got from exchanges and other sources (possibly for this specific purpose of combining with other data and reselling the combined product, but not reselling the raw data).
Example: Exchange X has
cold wallets A, B and C - All of this is published by the exchange.
hot wallets D, E, F and G - Part of this is public knowledge, part is info from the exchange directly to the analytics company.
user deposit wallets H, I, J, K, L, ... - The exchange told the analytics company and keeps them updated on new and removed deposit addresses (in exchange for some fee). Part of the agreement might be that the analytics company can't share these addresses, just the combined amount.
The analytics company can watch transactions coming from/to these wallets (this is the public blockchain data) and make a sum of how much crypto has arrived to or left from the exchange.

Related

Binance API transaction history

I am trying to display a users transaction history in binance, including fund deposits and withdrawals as well as buying and selling of different crypto's. Does anyone know which binance API endpoints I would use to do this? It seems quite complicated in comparison to other trading platforms.
Thanks
This is the link to the docs: https://binance-docs.github.io/apidocs/spot/en/#withdraw-history-supporting-network-user_data
I can see the Wallet endpoints "Withdraw" and "Deposit", but this won't cover crypto trading will it?, The account trade list call would be ideal, but it requires a symbol input which I'm not sure how I would obtain dynamically.
I would also like this endpoint to provide me with the data so I can get the avg buy price for a crypto
Currently this is not supported. See: https://dev.binance.vision/t/fetch-all-account-orders/279/3
This is the route you're looking for to get the user trade history. The big downside is that you have to specify the exchange symbol, you cannot get the history of the account with just one request:
https://binance-docs.github.io/apidocs/spot/en/#account-trade-list-user_data
Get your account information first. You can then extract non-zero balances from here to get symbols for transactions. You can then loop through each currency pair and get its transaction history. This seems to be the most optimistic way we can get right now
You can also try to use caching. For example, you can remember balance for a particular coin, and if it has not changed by the next launch, then it is likely (but not 100%) that no transactions were made with it
You can also connect to WebSocket, but this is still a terrible crutch and requires a DOS attack to get the necessary data
Please note that here the balances for Savings wallet have LD prefix added to their ticker. For example, BTC in the Savings wallet is labeled as LDBTC

How to get historic Bitcoin Price Index using coinbase or any other open source API

I would like to get a history of the bitcoin price.
For example I would like to be able to provide a start_date and end_date for a search/filter.
Are there any open source and trusted api with almost accurate prices for this?
I have noticed that coinbase only returns the spot/current price and I cannot pass more params to filter
curl https://api.coinbase.com/v2/prices/spot?currency=USD
I have also used coindesk but the prices are not accurate.
https://api.coindesk.com/v1/bpi/historical/close.json?start=2019-08-10&end=2020-08-11&currency=zar
bitcom.com does not provide historical prices, it is wallet and kinda banking services.
API for pro.bitcom.com, (crypto exchange) provides to historical prices.
https://docs.pro.coinbase.com/#get-historic-rates
I would recommend you to use the CoinMarketCap API if what you want are historical prices.
There are also libraries like ccxt where you can probably find this information as well.
However you have keep in mind that due to the number of exchanges these prices are approximations, and there is not sucha thing as a "unique" price for bitcoin.

Amadeus Web Services - Fair Quote API

I am trying to find the equivalent of FQP/FQD/FQN queries in the Amadeus SOAP service (Flight) API, but couldn't find one. I checked the API documents as well with no luck. There is command cryptic API to call the GDS commands, but the response is raw data as in the terminal, not a structured one. I need structured data response to precess data in the system.
Is there any SOAP APIs available to get the fare details and the rules?
Thanks
This is a question best sent to Amadeus directly! It's hard to know exactly what you are after without more information. Also Amadeus offer a wide variety of doing basically the same thing and your business can be better off using one or the other - its really impossible to tell without background information.
Check out these webservice calls:
Fare_PricePNRWithBookingClass
The function Fare_PricePNRWithBookingClass is used to price itineraries.
It can return one or several fare recommendations for the passenger(s) and for the itinerary of the active PNR. Only booking classes present in the flight segment of the PNR are considered.
After calling Fare_PricePNRWithBookingClass function, the system keeps the recommendations stored internally for three minutes in a dedicated context. This context can be used to create a TST by using Ticket_CreateTSTFromPricing.
Fare_PricePNRWithLowerFares
The function Fare_PricePNRWithLowerFares is used to display the lowest available fare for a given itinerary.
"Lowest available" means that this fare is applicable in a booking class where there are still enough seats available for the passengers of the PNR. This class might not be the one currently present in the flight segment of the PNR. In this case, rebooking might be necessary.
It can return one or several fare recommendations for the passenger(s) and for the itinerary of the active PNR.
After calling Fare_PricePNRWithLowerFares function, the system keeps the recommendations stored internally for three minutes in a dedicated context. This context can be used to create a TST by using Ticket_CreateTSTFromPricing. Please not that in case rebooking is required, it must be done (for example, using Air_RebookAirSegment) before TST creation.
Fare_InformativeBestPricingWithoutPNR
The InformativeBestPricingWithoutPNR function provided in the Fare interface is used to price informatively an itinerary without any PNR. If a PNR exists, it is neither taken into account nor updated. No pricing record (TST) is created to store the results.
Fare_QuoteItinerary
The QuoteItinary transaction (FQP) quotes fares for passenger types without existing reservations (PNR). Pricing is executed according to the principles of IATA resolutions as well as according to specific user requirements, if industry conform or individual.
Most likely there are more options available (that I don't know about).
Documentation available at https://webservices.amadeus.com/ - login required.

Stock purchases and stock quote data

I apologize for being rather vague here, but I'm working on a project involving stock data and stock purchases. I'm sure I'm going to end up having to get a broker involved, but I was wondering if anyone knows of any documentation on the underlying technology involved with existing trading sites, as well as the channels through which systems like google finance get their information.
Note that I already know of the APIs from yahoo and tdameritrade that send out the data, I'm interested in the channels through which that data travels to them in the first place.
They're most likely getting the data feeds from one or more of the usual suspects (ie, Reuters, Bloomberg and the like). You've probably noticed that the feeds on the publically accessible websites are delayed by 15-20 minutes compared to the real time feeds. Keep that in mind in your application, if you need proper up to date/real time market data it'll cost you a fair penny.
Those firms trading directly on the exchanges obviously have access to the data from the actual exchange - that's what you (have to) use in real time and algorithmic trading. However, the above mentioned companies (and I'm sure there are a few more, these are just the ones that most people are familiar with) are usually the data providers for those trading via intermediaries.
For reference data on stocks (as opposed to actual stock quote data), Mergent ( http://www.mergent.com ) is one of the data suppliers and has been collecting the data for decades. It has a set of APIs at http://www.mergent.com/servius

Passing money from a customer to a 3rd party directly (Paypal Payments Pro)

Let us assume that there are three parties. Organization X, which provides a SaaS, organization Y, which is using the X's service, and Consumer Z which is using X's service to make purchase from Y. This is similar to something like EBay for instance in a way. Now I would like to have Y and Z directly transfer money between them while also transfering funds between X and Z. The example would be X charges and covenience fee of some sort to Z and Y actually charges for the service.
We are currently using website payments pro, but I would prefer not to have every single 3rd party (Y corporation) to need to use it. Does anyone have any ideas?
The reason this would be done is to handle liability issues more directly.
I would actually recommend against doing what you're suggesting. In effect, you want to broker a deal between two parties, acting as the channel. This is similar to Amazon's affiliate program, I believe. Is this a correct description?
First off, if you're trying to bring liability issues closer to you, you should probably plan on being a big organization. I say this because you will need plenty of attorneys, and a serious anti-fraud department. It's a lot of overhead -- Paypal spends a ton on this kind of thing. Are you sure your company can handle that kind of responsibility? After all, if doing anti-fraud isn't your core competency, it's a difficult and dangerous field to dabble in...
It's not a good idea to allow customers to transfer money between each other. They trust you, but you should not assume that they can trust each other (WRT bank account information, the only way I can think of to directly transfer money between them). Plus, it might take too long for the money to clear.
I would recommend that your company (Org X) accept the credit information from Z. Then on a monthly / by request basis, you pay Company Y. You can take your fees directly from the info from Z; you can "handle liability issues more directly", and it's a pattern that's been done before (amazon affiliates, ebay, etc.) Also, it fits it more with the structure of the payment industry, rather than trying to force a new model (X->Z transaction combined with Y->Z transaction is just a little odd).