traders who come to the protocol to avail of the liquidity in order to perform swaps, and.You can skip this section if you already know how Uniswap works. Extra credit to calculate the cost basis and annualized ROI of their contributions to the pool. Objective: Build a connector for Uniswap that can show a liquidity provider their balances and contributions (positions) to the liquidity pool. That's the beauty of our SDK – as long as you understand the data structures on the blockchain, you can query them quite simply using SQL. Note: The rest of this blog post is fairly technical, but you don't have to be a programmer to follow along. Case study: Building a Uniswap connector for LP balances and positions To many devs, this is a glimpse of the future. As a case-study, we'll build a Uniswap integration for liquidity providers that is a simple problem to articulate but hard to solve for without a tool like the Covalent SDK. The best way to understand the SDK is to experience the benefits of an end-product resulting from building with the SDK. Constraints are important for innovation. Any approach that requires a user to write more than 5 lines of code is considered burdensome and gets mercilessly chucked out. Our internal benchmark is highly ambitious – 5 lines of code to pull out a piece of data. It's simple to get account balances through the JSON-RPC (you don't even need an archive node), but anything to do with historical data is very difficult.Īt Covalent, our team has been chipping away at the problem for quite some time now leaving no stone unturned. This is why every Ethereum DeFi portfolio tracker falls short because they hit against one of the above problems. In our opinion, a niche query interface is a mainstream adoption blocker. SQL has been around for 40 years and will be around for the next 40. Hundreds of query languages have come and gone over the years, but nothing has stood the test of time like plain old SQL. It's currently too hard or simply impossible to reconstruct these data structures through the JSON-RPC layer. The most interesting DeFi data is actually the data structures inside the contract state and not visible outside. What you need is a way to batch export the data – which means rethinking the JSON-RPC layer. The JSON-RPC interface is what's known as a "point query" interface, i.e., you can only ask for a single object (block, transaction, etc.) at a time. If you want any kind of historical data, you need to run Geth in a special configuration mode known as "full archive mode" which currently takes up hundreds of gigabytes of storage space and has other special hardware requirements. It has a handy JSON-RPC layer to pull out data. What's the status quo to get blockchain data?Ī blockchain node software like Geth in theory already has the blockchain data. The Challenge with Querying Blockchain Data We will either succeed in solving this problem or die trying. Our team at Covalent from the start has been laser-focused on solving one and only one problem: reading structured data from the blockchain. These kits run completely on the blockchain and therefore only rely on a Web3 node provider like Infura. One of the many features they come with is a way to access structured data (balances and positions) on the blockchain. The above are excellent choices and are general purpose kits to not only read your data but also to modify your data. Over the last few weeks, our friends in the community have released kits to build with DeFi money legos without writing a single line of solidity code. If you're a builder in the space, you are spoilt for choice. We've been dogfooding the SDK internally for the last few months and used it to instrument over 20 DeFi protocols supporting over a dozen customers and thousands of users. Today, we are excited to announce a software development kit (SDK) to query data from the Ethereum blockchain – a problem we've been trying to solve for many years. Blockchain data is messy, disorganized and time-consuming even for an experienced engineer. Introducing Covalent's DeFi SDK – An integrated approach to value your digital assets with 5 lines of codeĭespite all the progress we've made in crypto tooling the last couple of years, one difficult task remains unsolved: extracting data from blockchains.
0 Comments
Leave a Reply. |