If you need a briefer on the SDK and to learn more about how these guides connect to the examples repository, please visit our background page!
Theoretical background
Some of the guides presented here require a bit of theoretical and mathematical background. To get the most out of the advanced guides, we encourage you to take a step back and read a bit about the math and theories behind Ramses. The most complete source of information on Ramses is the Uniswap V3 book. Besides the concepts section of the Docs, the Uniswap V3 whitepaper is a great introduction to the protocol. If you haven’t checked it out yet, it is probably more concise and easier to understand than you would expect.Datatypes in Solidity
Ramses V3 pools make use of a number of Datatypes Solidity offers to efficiently store their state. If you are not familiar with Solidity data types yet, it can help to take a look at the Solidity language reference. For the following guides, it is beneficial to take a look at two of them, which we will outline here. Ticks are stored as a mapping(int24 => Tick.Info). Solidity mappings are very similar to hash maps, such that we can access any Value with their key with just one read operation. TheTick.Info stores the values of the Tick that we need to work with the Pool:
Tick.Info value stored in the pool by its int24 key.
The key of the Tick is usually called its index.
Mappings are not iterable, so if we are trying to fetch all the Ticks stored in a Pool, we can’t just iterate over the mapping.
Instead, we have to know the keys (indices) of the mapping, we will explore how to do that in the Pool data guide.
The second Solidity datatype we need to understand are normal unsigned Integers.
Solidity supports unsigned integer sizes between uint8 and uint256, which are 8 and 256 bits long respectively.
Let’s take a look at the tickBitmap function of a V3 Pool:
tickBitmap function with the input 0 we get a response like:
768 is 0x300 in hex, or ...0000001100000000 in binary. Etherscan displays the uint256 return value as a decimal number.
The actual raw return value are 256 bits, that look something like this:
