Math for constant product AMM (automated market maker).
0:00 - Intro
2:38 - Swap - How many tokens to return in a trade?
5:53 - Add liquidity - How many shares to mint? - Answer
6:20 - Add liquidity - Constraints
11:20 - How many shares to mint?
12:54 - How to measure liquidity?
16:04 - Simplify equation for shares to mint
22:05 - Remove liquidity - How many tokens to withdraw?
Notes
https://github.com/t4sk/notes
#Solidity #SmartContract #Ethereum #スマートコントラクト
Take a course
https://www.smartcontract.engineer/
Follow
https://twitter.com/ProgrammerSmart
https://discord.gg/bt8FK2wkcW
https://t.me/smartcontractprogrammer
https://smartcontractprogrammer.com
Alejandro Munoz-McDonald, Smart Contract Triager at Immunefi, did a presentation on the world's largest bug bounty payouts that were done through Immunefi's ...
tamjid0x01/awesome-smartcontract-hacking: Here we collect and discuss for Smart contract security & Blockchain researches and tools - contributions are welcome.
Here we collect and discuss for Smart contract security & Blockchain researches and tools - contributions are welcome. - tamjid0x01/awesome-smartcontract-hacking: Here we collect and discus...
bt3gl-labs/Blockchain-Development-and-Security: My journey towards becoming a blockchain/DeFi developer and h4x0r - by bt3gl
My journey towards becoming a blockchain/DeFi developer and h4x0r - by bt3gl - bt3gl-labs/Blockchain-Development-and-Security: My journey towards becoming a blockchain/DeFi developer and h4x0r - by...
bt3gl-labs/Blockchains-AMMs-and-MEV: Notes, scripts, code through my journey into stateful blockchains, MEV, DeFi, day trading, DEXs, etc. - by bt3gl
Notes, scripts, code through my journey into stateful blockchains, MEV, DeFi, day trading, DEXs, etc. - by bt3gl - bt3gl-labs/Blockchains-AMMs-and-MEV: Notes, scripts, code through my journey into ...
Read writing from Phan Sơn Tự on Medium. A lucky guy was born in the Age of Cryptocurrency Boom. Every day, Phan Sơn Tự and thousands of other voices read, write, and share important stories on Medium.
The Hitchhiker's Guide to Ethereum - Delphi Digital
Ethereum's roadmap is a lot to keep track of. This is your technical crash-course on everything from danksharding to KZGs to statelessness and so much more.
Solana Smart Contracts: Common Pitfalls and How to Avoid Them
Hey everyone! We're Neodyme, a team of security researchers who have spent the past ~12 months inspecting the internals of the Solana blockchain. Over the course of our research, we discovered and reported several vulnerabilities in the Solana core code, ultimately helping to secure the chain against attackers. A few months ago, we were sponsored by the Solana Foundation to also set up a peer review system for smart contracts that are important for the Solana ecosystem. Since then, we've been working with developers from a range of projects building on Solana to assist them in securing their contracts. We've audited dozens of contracts, using our unique experience with Solana to uncover many exploitable bugs. During these audits, we've discovered intricate vulnerabilities in some of the major projects on the chain, and our reviews helped prevent the potential theft of roughly USD 1 billion worth of assets. However, as Solana is such a rapidly growing ecosystem, we have nowhere near enough capacity to manually audit every new contract to our standards. Instead, we'll be sharing some of the knowledge we've built over the course of our many audits in this blog, in hopes that developers and other auditors will be able to make use of it. In this post, we want to raise awareness about the five most common vulnerabilities in Solana contracts that we keep finding during our audits. We'll keep the vulnerability descriptions short and concise and provide a simplified example as well as a TL;DR for each vulnerability so that you can easily reference them while coding.
In late 2019, I published a post titled “Taking undercollateralized loans for fun and for profit”. In it, I described an economic attack on Ethereum dApps that rely on accurate
In this article we look at type of economic attack on DeFi projects in the form of manipulation of price oracles. On Ethereum, where everything is a smart contract, so too are price oracles. As such…