Uniswap V3 - How to derive the curve of real reserves
48
246
1,629
Why is spot price = Y / X in Uniswap?
25
200
1,358
Math for vault. How much shares to mint? How much amount to withdraw?
11
121
684
Uniswap V3 liquidity delta Drawn with excalidraw.com/ More DeFi notes github.com/t4sk/notes
23
127
620
Gas comparisons of ++ before, after and += 1 Solidity 0.8.10
16
41
540
Synthetix Staking Rewards contract math and algorithm
15
70
497
GM Some math about Uniswap V3 TWAP and geometric mean
11
70
447
Constant product AMM math XY = K
9
73
396
CSAMM - Constant sum automated market maker More notes github.com/t4sk/notes/tree/m…
10
84
385
I’m excited to join the @cyfrin family to create educational content for Cyfrin Updraft. Our vision of a secure, on-chain world begins with great developer education. I look forward to supporting more developers to learn, grow, and thrive in smart contract development.
34
21
384
10,631
Uniswap V3 - How to calculate liquidity of a single position Draw with excalidraw.com/
5
53
343
Added more math explanations to staking rewards
8
55
319
Took me several months to understand Uniswap V3 fee algorithm. Here we go😃 Part 1 - How to calculate fee? More notes github.com/t4sk/clamm/tree/m… Drawn with excalidraw.com/
5
46
291
25,589
Uniswap V3 algorithm to get next tick More diagrams github.com/t4sk/clamm/tree/m… Drawn with excalidraw.com/
1
36
267
29,200
Fast Fourier Transform explained Used in ZKSTARK Notes and Python code🐍 github.com/t4sk/notes?tab=re… 1. Intro 2. Definitions 3. Algorithm 4. Tree example 5. Butterfly example 1 6. Butterfly example 2 7. Bit reversal - optimization
10
33
286
13,034
Adding liquidity to Uniswap V2, what is the change in liquidity?👇 Liquidity delta for Uniswap V3 will be explained in the future. Drawn with excalidraw.com/ More notes github.com/t4sk/notes/tree/m…
6
37
247
Uniswap V3 - How to calculate ETH price from sqrtPriceX96 Reference uniswapv3book.com/docs/miles… Drawn with excalidraw.com/ More notes github.com/stakewithus/notes
4
37
213
How to calculate amount of tokens to add for a Uniswap V3 position Example from here atiselsts.github.io/pdfs/uni…
11
41
221
DAI Stablecoin System Contract architecture (some functions are omitted) Notes github.com/t4sk/notes Drawn with excalidraw.com/
9
23
194
13,056
Gas-less token transfer diagram More notes github.com/stakewithus/notes… Drawn with excalidraw.com/
10
31
213
26,972
Tornado Cash Hack - How to deploy different contracts at the same address Notes github.com/stakewithus/notes References nitter.app/storming0x/status/1660… nitter.app/samczsun/status/166001… ethereum.stackexchange.com/q… Drawn with excalidraw.com/
On 2023/05/20 at 07:25:11 UTC, Tornado Cash governance effectively ceased to exist. Through a malicious proposal, an attacker granted themselves 1,200,000 votes. As this is more than the ~700,000 legitimate votes, they now have full control. openchain.xyz/trace/ethereum…
6
46
196
26,926
Flash accounting in Uni V4 makes flash loans with 0% fees possible Flash loan 100 USDC PoolManager.unlock └YourContract.unlockCallback ├PoolManager.take(USDC, 100) ├PoolManager.sync(USDC) ├USDC.transfer(PoolManager, 100) └PoolManager.settle()
9
19
203
12,969
Uniswap V3 Just In Time Liquidity More notes github.com/stakewithus/notes Drawn with excalidraw.com
9
35
197
26,321
Uniswap V3 fee algorithm - part 1 More notes github.com/stakewithus/notes Drawn with excalidraw.com/
3
26
186
15,293
Thank you @Optimism and every voter for RetroPGF🤩 Tweet below to suggest YouTube topics I should cover or new features for solidity-by-example.org/ vyper-by-example.org/
29
8
163
8,818
RAI - How is RAI price stabilizied? More notes github.com/stakewithus/notes Drawn with excalidraw.com
11
31
165
31,318
What is and when to use geometric mean?
6
20
160
Constant product AMM arbitrage profit More notes github.com/stakewithus/notes Drawn with excalidraw.com
1
16
145
22,895
How interest (stability fee) is calculated when you borrow DAI on Maker Drawn with excalidraw.com
16
141
13,202
Uniswap V3 fee algorithm - part 5 Fee growth above equation Video piped.video/watch?v=4XCVXFfG… Code github.com/t4sk/clamm Drawn with excalidraw.com
1
13
140
11,507
Exponential moving average for irregular intervals Code github.com/stakewithus/notes… Drawn with excalidraw.com/
2
16
141
16,363
I spent 10 minutes looking for Uniswap V4 ETH/USDT pool address💀 It doesn't exist. All V4 pools are in a single contract. Here is how to get pool info. 1. Get pool id (Hover next to ETH/USDT) 2. Call StateView.getSlot0 + paste pool id etherscan.io/address/0x7ffe4…
6
8
137
8,174
How does EVM store negative numbers? Two's complement Notes github.com/stakewithus/notes Drawn with excalidraw.com/
1
26
129
How (a&b) + (a^b)/2 calculates the average (a&b)*2 + (a^b) = a + b Hence (a&b) + (a^b)/2 = (a + b)/2 Why (a&b)*2 + (a^b) = a + b a&b = 1s both in a and b a^b = 1s exclusively in a or b (a&b)*2 1s are in both a and b so multiply by 2 code github.com/t4sk/notes/blob/m…
10
14
120
10,990
Find most significant bit using binary search Code solidity-by-example.org/bitw… Drawn with excalidraw.com/
2
14
121
Uniswap V3 fee algorithm - part 6 Calculate fee growth inside when both ticks were not initialized Video piped.video/watch?v=eDEKDABx… Code github.com/t4sk/clamm Drawn with excalidraw.com
3
17
120
15,070
If you're having problem minting USDC on Foundry using deal. Here is the temporary fix👇 Steps to manually mint USDC 1. Get masterMinter 2. Prank masterMinter and call configureMinter 3. Call mint
3
12
102
6,585
Rust example of calculating create2 address for EVM contracts Example usage of - Threads - Channels - Arc github.com/t4sk/hello-rust/t…
5
9
120
8,020
Arbitrage ETH on Uniswap V3 RETH/ETH pool 1. Swap ETH to rETH on Uniswap V3 2. Burn rETH on RocketPool to redeem ETH Why it works? - rETH generally increases in value over time - Increase in value of rETH is not reflected on Uniswap pool unless an arbitraguer steps in
10
8
112
7,538
Uniswap V3 fee algorithm - part 3 Fee growth inside ticks - overview More notes github.com/stakewithus/notes Drawn with excalidraw.com
1
16
111
18,942
Uniswap V2 and V3 spot price examples Correct from previous tweet
1
16
110
Where do you declare Solidity structs? Contract, interface or separate file?
28
7
100
32,161
Simple estimate of minimum liquidation price for a perpetual long position (L - 1) / L * p0 >= p_liq L = leverage = 5 p0 = entry price = $3424 p_liq = liqudation pric e= 2739 actual liquidation price = 2759
1
3
109
4,244
Why use DEX when you can swap DAI/USDC 1 to 1 with MakerDAO DssLitePSM? Currently 0% fee on swaps Contract etherscan.io/address/0xf6e72… Code example github.com/t4sk/notes/blob/m…
5
5
104
6,523
Uniswap V3 fee algorithm - part 5 Fee growh initialize part 0 Some equations for fee inside Video piped.video/yfJBQA3GoBA Code github.com/t4sk/clamm Drawn with excalidraw.com
2
17
100
13,002
My First Month as a Smart Contract Auditor piped.video/AtTb_BpFZkM via @YouTube
5
8
96
11,442
evm.storage was nice, now it's gone evm.codes/contract is an alternative that show storage layout evm.codes/contract?address=0…
2
5
101
7,882
EVM storage layout examples solidity-by-example.org/evm/… Examples - sstore - sload - slot - offset - bitmasking - storage layouts for different data types
17
91
4,814
Why does Uniswap V3 call this variable slot0?🤔 Because it's the first state variable which is store in the 0th slot of the storage.💡 github.com/Uniswap/v3-core/b…
4
8
94
Rust made me worse at JS. I keep forgetting to add "return"💀
9
2
87
4,259
Idea for making solidity contracts more secure. 1. Sprinkle your code with asserts 2. Stripe it away with the compiler for production build Example (not tested) Failing asserts crash the program in unit and fuzz tests. When PROD = true, compiler + optimizer removes Dev.check
7
4
92
5,217
Deploy simple contract to zkSync 2.0 testnet 1. Compile contract 2. Bridge Goerli ETH to zkSync 3. Deploy contract github.com/t4sk/hello-l2/tre… Message me for Goerli Testnet ETH
4
14
83
Funny scam🤣 Watch out 1. Create Github PR with scam message 2. Tag targets 3. Scam message will be emailed to targets from GitHub Be careful not to click on any link💀 @github
17
9
85
7,661
"this" disables the warning "Function mutability can be restricted to pure" Confusing code😵‍💫
3
8
61
4,905
Some interesting crypto jobs BGD labs - smart contract engineer cryptocurrencyjobs.co/engine… Nethermind - Security Apprenticeship cryptojobslist.com/jobs/secu… Tokemak - Senior Quantitative Developer cryptojobslist.com/jobs/seni… CoinGecko - Internship cryptojobslist.com/jobs/inte…
5
6
86
8,879
Can you spot the bug? I actually made this mistake For simplicity, some code (state variables, modifiers, events, etc..) are removed
11
7
83
10,526
Uniswap V3 fee algorithm - part 2 - Fee growth More notes github.com/stakewithus/notes Drawn with excalidraw.com
1
9
81
7,232
Uniswap V3 fee algorithm - part 2 Fee growth inside Code github.com/t4sk/clamm Video piped.video/WcAYDKYUcHM Drawn with excalidraw.com/
11
77
5,884
Algorithm to approximate decimal with binary More notes github.com/stakewithus/notes Drawn with excalidraw.com/
1
11
75
Otter scan has a nice feature to view transaction trace🤩 sepolia.otterscan.io/tx/0x07…
5
7
68
7,417