On-chain Analysis
What is On-chain analysis and how does it work?
The blockchain is in general a more or less decentralized database, where all nodes agree on the "correct" state of the database. This state is then used to transfer values or execute smart contracts.
So whenever you make a transaction on the blockchain, this state changes and your transaction is stored as a in a new block, together with lots of other transactions. This blocks and transactions are visible for anyone.
In OrbAnalytics terms, any state changing transaction is an event.
OrbAnalytics works by scanning all major EVM-compatible blockchains (Ethereum, Binance Smart Chain,...) and their L2s (Arbitrum, Polygon, ...) for new blocks, their transactions and parses all this data into an internal event datastructure.
Example: Lets say, someone swaps 1 Ether for 1.000 $ORB token on Uniswap v3 Arbitrum. To do so, he has to call various state changing smart contract functions like approve or swap with different parameters like the amount he wants to approve or swap. Each of this calls alters the blockchain state, when it gets included in a block. Each of this calls also can emit events which are stored in the transaction logs. You can find this logs in the Events tab for the Uniswap Pair contract like here for the $ORB token ( https://arbiscan.io/address/0xa1817696a22253dab86023d252209d6ec02d2822#events)
Smart contracts can't access this data, but external tools can. So OrbAnalytics parses all new blocks on the monitored blockchains for this event logs, parses them and that way knows, whats happening.
OrbAnalytics knows about all transactions, swaps, all new created pairs, all new token, every new smart contract, etc. in realtime.
Ok and just to give you a few numbers, on a kind of busy blockchain like BSC with a block time of ~3 seconds there where like 15.9 million transactions per day max around the end of 2021 and during the following months 2022/2023 it ranges between 3 and 4 million transactions per day.
Now imagine there are like 20-50 more or less busy blockchains and you see, we are talking about a lot of data and events here.
To handle all this data we are using very powerful servers and a hopefully smart software architecture. I don't want to bore you with all the details, but we love to talk about this stuff, so just contact us for more details.
Broadly speaking we are using a so called distributed message queue and a distributed task queue. So we are running lots of servers, scanning all the chains and gathering all the data, and writing it into a single database. And based on the events (what happened on chain) we can execute tasks, again on many different servers.
Example: We see the swap event and its added to our message queue and then one of our workers pulls out the event, and updates the locally monitored liquidity pools and allows you to automatically execute limit order transactions or stop losses. This automated transaction execution creates a new task in our task queue and gets executed (OrbTrader handles all trading related tasks). All of this happens in less then a second.
This is a very fast and scalable way to handle big amounts of real time events. On a single high end server, we can handle around 300.000/events per second. So that is already a lot faster than all current blockchains combined and we could easily just attach another server and increase our capabilities if necessary.
It is also very easy for us to add new blockchains. We started with the most used ones, but will add more over time.
To check out, the upcoming features of OrbAnalytics, also check our Roadmap here.
OrbAnalytics On-Chain Events
Currently our primary goal is to enable our users to execute trades extrem fast and easy with the lowest possible fees. Additionally we want to help our users to detect possible scams.
Therefore we monitor the following events right now on all supported chains and decentralized exchanges:
Token Creation events: Whenever there is a new Token, OrbAnalytics knows about it
PairCreation events: Whenever a new trading pair like $ORB/wETH is available on a decentralized exchange, you can immediately trade it.
Mint events: This event is emitted when liquidity is added to a liquidity pool (Pair contract). Sometimes this happens after the PairCreation event, and sometimes it might be a valuable trading signal depending on the situation.
Burn events: When liquidity is removed again from a trading pair, the Burn event is emitted. This is actually an interesting one, because rugpulls, where 100% of the liquidity is removed, happen like this. OrbTrader can use this data to maybe protect you from that, details will be added in that section.
Swap events: DEX swaps influence the available liquidity reserves for a trading pair and so the price you get for your token. By monitoring the swap events, we can reliable execute pending orders like stop losses or take profits just milliseconds after the event happened.
Transfer events: A transfer event happens when you send ERC20 token from one wallet to another. There are millions of them, so we filter them and only monitor the relevant ones. For example a big transfer wallet from an early investor in a project, might be a valuable trading signal.
We monitor a few more events, but those are only for internal tests of new features for now.
OrbAnalytics On-Chain Data
Besides monitoring and parsing the event data we also analyze static on chain data. Some examples are:
Smart contract constants: when creating a new token, you upload the smart contract to the blockchain and set some values during the contract initialization like the name, the symbol, the decimals or the total supply. This are just examples, probably anyone can relate to. OrbAnalytics monitors a lot more things down to the bytecode level but we go into more detail of that after finishing our research.
Token Distribution and Holders: This is valuable to make better investment decisions.
Smart contract functions: Are there any malicious functions? Anti whale functions? Mint functions? Are transfers pausable?
Last updated