Documentation Index
Fetch the complete documentation index at: https://tech.ramses.xyz/llms.txt
Use this file to discover all available pages before exploring further.
Introduction
Developing dApps and interacting with Smart Contracts is quite different from Web2, and at times challenging due to little information on this topic compared to other areas of software development. This developer guide is a quick overview of the space, including references to libraries and guides that are great starting points. Reading this guide should help you identify areas that you might need to learn a bit more about and prepare you for the following Uniswap-specific guides. It is assumed that you know the basics about Ethereum and the blockchain, including some terminology. If you already know how to build dApps and interact with ethersJS etc. you can safely skip this guide.RPCs
The access point to the blockchain are RPC nodes. They are the standardized interface to read data from smart contracts, send transactions and interact with on-chain protocols. RPCs are either full or archival nodes with a (JSON-RPC) interface. To support Ethereum’s decentralization, one can host a node themselves, for example by using one of the implementations listed below:- geth - The original (reference) implementation of the Ethereum protocol
- erigon - A very efficient archival node implementation
- Nethermind - An Ethereum implementation focused on stability
JSON-RPC Standard
RPCs communicate over the JSON-RPC standard. To send requests, you take the RPC URL and make a POST request with a JSON body. See the below example:POST https://mainnet.chainnodes.org/API_KEY
Body:
18163648.
You can find the above examples, including more, in this Postman collection.
To check out all possible RPC requests, head over to the Chainnodes Docs.
Client implementations
As communicating over HTTP with POST requests directly can be quite difficult, especially if you want to properly encode and decode responses and handle failures and exponential backoffs, there are client implementations that can do the heavy lifting for you. These SDKs have developer friendly APIs and internally handle creating the proper RPC requests, sending them to the endpoint you choose and decoding the response for you. Some of the major implementations are listed below:- ethers.js - Javascript/Typescript SDK for NodeJS and the Browser. Used throughout the Ramses Docs.
- wagmi and viem - Javascript/Typescript, great duo for modern Web3 development in the Browser.
- web3js - Javascript/Typescript SDK for NodeJS and the Browser by ChainSafe.
- Web3.swift - Swift SDK for iOS apps and Backends.
- KEthereum - Kotlin SDK for Android development.
- ethers-rs - Rust SDK.
- ethclient - Go SDK, part of geth, the reference Ethereum node implementation.
- web3.py - Python SDK.
Local Development
To simulate RPCs and transactions locally, you can check this guide.Indexers
As RPCs are only a slim abstraction of the data stored in the blockchain, there are certain things that are hard or expensive to access with regular RPC requests. A common example are transactions of a specific Wallet address. Imagine you want to get a list of all transactions that originated from (or to) a specific Wallet. One could think there should be an RPC method calledeth_getTransactionsForWallet or something similar.
But due to the nature of how the data is stored, this RPC method is not feasible, and hence not implemented.
Now, instead of accessing those kind of things by iterating through every block in the blockchain, you can use Indexers, that are
designed to index data like that on the go and provide easy access to it.
TheGraph
A well-known, standardized implementation of indexers is TheGraph. It is used by most major protocols, including Uniswap, to index data and make it accessible to users and dashboards. Using TheGraph, you can either access open subgraphs via the GraphQL querying language, or create your own and deploy it. Throughout the docs you will see how to interact with the Uniswap subgraph to fetch tick data and more without ever touching RPCs. An important note about Indexers though: While they can be helpful, you need to be aware that the ultimate source of truth comes from the RPCs. As reorgs happen and certain issues on indexers arise, there might be certain datapoints that are either not fully up-to-date or even completely wrong on Indexers. If you have a use-case that requires perfectly correct data all the time, use RPCs directly. If you are just doing data visualization or dashboards, use Indexers if they fit your use-case. Some popular subgraphs that you can try to fetch data from the blockchain easily (click on playground to give it a try):Smart Contract Development
Smart contracts are typically developed using the Solidity language. There are VSCode plugins that make the development with Solidity easier. One of them is Juan Blanco’s “Solidity” that you can find over here. You would typically also go for a developer suite with testing, compilation and deployment capabilities:- Foundry - Fast and modern developer tools for smart contract engineers.
- Hardhat - Scriptable, easy and battle-tested JS developer suite for smart contracts.
Blockchain Explorers
Manually gathering information and inspecting data stored in a blockchain is a tedious task. Almost all chains have at least one accompanying block explorer to help visualize addresses, transactions, contracts and more. For Ethereum mainnet, we suggest using Etherscan. You can use Etherscan to inspect contracts, transactions, blocks, and much more. If you are looking to debug a transaction, Tenderly can also be a very helpful tool. In this example of a failed transaction on the Uniswap V2 Router you can easily see why the execution failed and where.The Uniswap development suite
Uniswap offers several SDKs that work together and enable you to easily interact with Ramses The most important SDKs are:- sdk-core: The core of the Uniswap SDKs, defines classes and types shared across all the SDKs
- v2-sdk: An SDK to interact with the Uniswap V2 protocol.
- v3-sdk: Ramses’ fork of the Uniswap V3 SDK, tailored for interacting with Ramses V3 pools.
- router-sdk: Provides abstractions to interact with the (older) SwapRouter contracts.
- universal-router-sdk: Abstracts interactions with the Universal Router.
- smart-order-router: Searches for the most efficient routes for a trade.
- permit2-sdk: Simplifies interactions with Permit2 in JS.
- uniswapx-sdk: SDK for the UniswapX protocol.
