Damien Gonot
Home Blog Notes About

Ethereum

Homepage / Notes / Computer Science / Blockchain / Cryptocurrencies / Ethereum

What is L2?

Rollup?

Smart Contracts

https://ethereum.org/en/developers/tutorials/

Intro

Smart contracts are a type of Ethereum account. This means they have a balance and they can send transactions over the network. However they're not controlled by a user, instead they are deployed to the network and run as programmed. User accounts can then interact with a smart contract by submitting transactions that execute a function defined on the smart contract. Smart contracts can define rules, like a regular contract, and automatically enforce them via the code.

High gas costs? Should check how expensive…

Smart contracts alone cannot get information about "real-world" events because they can't send HTTP requests. This is by design as relying on external information could jeopardise consensus, which is important for security and decentralization.

Languages

https://ethereum.org/en/developers/docs/smart-contracts/languages/

more advanced: Yul, intermediate to the EVM cheatsheet Solidity vs Vyper: https://reference.auditless.com/cheatsheet/

Anatomy

https://ethereum.org/en/developers/docs/smart-contracts/anatomy/

https://ethereum.org/en/developers/docs/security/

Resources

Tutorials

https://ethereum.org/en/developers/tutorials/ https://learnxinyminutes.com/docs/solidity/

Interactive Tutorials

https://cryptozombies.io/ https://ethernaut.openzeppelin.com/ https://vyper.fun/

Infrastructure

https://infura.io/: Ethereum node; have account and keys https://dashboard.alchemyapi.io/: Ethereum node; have account

Local Dev Env

https://ethereum.org/en/developers/local-environment/ https://openzeppelin.com/sdk/ interacting with smart contracts in the CLI https://hardhat.org/ compile, deploy, test, and debug your Ethereum software https://www.trufflesuite.com/ tools for smart contracts https://www.trufflesuite.com/ganache local copy of an Ethereum blockchain https://framework.embarklabs.io/ all-in-one for dapps https://eth-brownie.readthedocs.io/en/stable/deploy.html Python-based, better than the rest? https://github.com/gakonst/foundry new (Dec 2021), very fast

Foundry

https://onbjerg.github.io/foundry-book/index.html forge init {project} to start a new project

Misc

https://github.com/tintinweb/smart-contract-sanctuary lists all smart contracts on Etherscan? https://twitter.com/zapper_fi/status/1327035284677128192?s=09 explain why "Approve DAI", "Enable USDC"

Technical Notes

Ethereum accounts

https://ethereum.org/en/developers/docs/accounts/#an-account-examined

Ethereum accounts have four fields:

Your private key is what you use to sign transactions, so it grants you custody over the funds associated with your account. You never really hold cryptocurrency, you hold private keys – the funds are always on Ethereum's ledger.

Ethereum clients

https://ethereum.org/en/developers/docs/nodes-and-clients/#clients GETH: https://geth.ethereum.org/docs/ Go's Ethereum implementation OpenEthereum: https://github.com/openethereum/openethereum Rust Trinity: https://trinity.ethereum.org/ Python

Ethereum transactions

https://ethereum.org/en/developers/docs/transactions/#whats-a-transaction

A submitted transaction includes the following information:

Ethereum node types

https://ethereum.org/en/developers/docs/nodes-and-clients/#node-types

In fact, clients can run 3 different types of node - light, full and archive. There are also options of different sync strategies which enables faster synchronization time. Synchronization refers to how quickly it can get the most up-to-date information on Ethereum's state.

Full node

Light node

Archive node

Proto-Danksharding

https://notes.ethereum.org/@vbuterin/proto_danksharding_faq

Protocols

Lending

https://compound.finance https://app.aave.com

DEXs (Decentralized Exchanges)

AMM

Uniswap
V1

ERC20 <> ETH

V2

ERC20 <> ERC20

V3

Can add single assets as liquidity Will use a Layer-2

Concentraded liquidity

Will be possible to concentrade liquidity in a specific range

Non-fungible liquidity

LP tokens won't be ERC20 anymore but ERC721 Trading fees no longer automatically reinvested

Flexible fees

0.05% => Stablecoins pairs 0.3% => Standard pairs 1% => Exotic pairs

Oracle

TWAP past 9 days on-chain

Pricing LP positions

https://lambert-guillaume.medium.com/pricing-uniswap-v3-lp-positions-towards-a-new-options-paradigm-dce3e3b50125

Arbitrage

https://github.com/ccyanxyz/uniswap-arbitrage-analysis https://github.com/libevm/subway

Sushiswap
Balancer
Kyberswap
0x
mistX

https://mistx.io/ Gasless swaps, no frontrunners

Futureswap

https://www.futureswap.com/

for stablecoins
Curve

AMM for stablecoins

Conic

https://conic.finance/

Conic Finance is an easy-to-use platform built for liquidity providers to easily diversify their exposure to multiple Curve pools. Any user can provide liquidity into a Conic Omnipool which allocates funds across Curve in proportion to protocol controlled pool weights.

Shells

https://shells.exchange/ Another AMM for stablecoins

Swerve

https://swerve.fi

Orderbook-based

dYdX
L2

Everything is done on L2 No gas fees once coins are deposited on L2 From time to time, L2 is synced to L1

Fulcrum

https://fulcrum.trade

Deversifi

https://deversifi.com

Aggregators

1inch

https://1inch.exchange

CLI Interface: https://github.com/liquiditygoblin/1inch-cli

Matcha

https://matcha.xyz

Dex.guru

https://dex.guru

"Hedge Funds"

Yearn

Automated on-chain hedge fund https://yearn.finance

Stake DAO

https://stakedao.org/

Rari Capital

https://v2.rari.capital

Harvest Finance

https://harvest.finance

Keeper DAO

https://app.keeperdao.com

Formation.fi

https://formation.fi/ Yield farming optimizer

Derivates

https://synthetix.io

Options

Hegic

https://hegic.co

Pods

https://www.pods.finance/

Perpetual Futures

Cap

https://cap.io/

DECENTRALIZED PERPS Trade global markets with low fees, deep liquidity, and up to 100× leverage.

On Arbitrum L2

Alchemix

https://app.alchemix.fi/ Deposit DAI, borrow up to 50% as alUSD Yield on DAI through YFI pays back the loan itself

sideshift

https://sideshift.ai/btc/eth Not sure I understand the appeal?

Pop

https://pop.town/ High-yield staking for ETH and USDC

Fei

New algo stablecoin

<2021-04-07> update: looks like Fei failed miserably… https://rekt.news/fei-rekt/

APWine

https://www.apwine.fi/ The protocol allowing you to trade unrealised yield.

TimeSwap

"Like Uniswap, but for lending & borrowing" https://app.timeswap.io/

Fodl

https://fodl.finance/ Leveraged lending

Euler

https://www.euler.finance/#/ Permissionless crypto lending markets are almost here.

Other Projects

https://zapper.fi: portfolio management https://feed.chain.link: on-chain price reference data https://defirate.com & https://yieldfarming.info: yield rate comparison https://tornado.cash: anonymize ETH transactions

Flash Loans

AAVE, dYdX, Uniswap… Kollateral: https://docs.kollateral.co aggregated pools from different sources Balancer V2: https://twitter.com/fcmartinelli/status/1461777136071716875

Resources

https://defiprime.com/flahloans-comparison https://money-legos.studydefi.com/#/dydx https://github.com/fifikobayashi this guy have some repos using flash loans

Flash Mints

https://docs.makerdao.com/smart-contract-modules/flash-mint-module

MEV

Miner Extracted Value https://www.coindesk.com/ethereum-trading-bot-strategy-miner-extracted-value-research

One can look at the waiting transactions on the Ethereum blockchains and upbid "profitable" transactions so it executes faster.

Flashbots

https://docs.flashbots.net/

Resources

https://noxx.substack.com/p/dex-arbitrage-mathematical-optimisations

Resources

https://www.libevm.com/