add the crypto anarchist manifest by timothy c. may

This commit is contained in:
writer 2024-10-15 10:48:15 +09:00
parent 2e05fb2bc6
commit b6b2db512f
275 changed files with 4733 additions and 2552 deletions

View file

@ -0,0 +1,43 @@
## oracles
<br>
### tl;dr
<br>
* price oracles are any defi tool showing an asset's price. they can either on or off chain.
* oracles should provide a trustless way of getting extrinsic (off-chain) information, and some key functions such as: collecting data from an off-chain source, transfering the data on-chain with a signed message, and making the data available by putting it in a smart contracts storage.
* oracle exploitation can generate profit opportunities (e.g., through arbitrage or liquidation, multi-block)
<br>
---
### in this dir
<br>
* [twap](twap.md)
* [twamm](twamm.md)
* [chainlink](chainlink.md)
* [cron finance docs on twamm](https://docs.cronfi.com/twamm/)
<br>
---
### links
<br>
* [taking undercollaterized loans for fun an for profit, by samczsun](https://samczsun.com/taking-undercollateralized-loans-for-fun-and-for-profit/)
* [mango markets and the benefits and limitations of oracles](https://blog.kaiko.com/mango-markets-and-the-benefits-and-limitations-of-oracles-753ce6d2a732)
* [dissecting the mango markets exploit, by perpetual protocol](https://perpprotocol.mirror.xyz/WMgIoGMktt_fMVPkfjTxRnSt4qwsWr_Ukub0iq3vW_I)
* [toxic order flow and solutions, by a. nezlobin](https://medium.com/@alexnezlobin/toxic-order-flow-on-decentralized-exchanges-problem-and-solutions-a1b79f32225a)
* [inverse finance resources](https://github.com/go-outside-labs/mev-toolkit/blob/main/MEV_and_trading/protocols/inverse.md)
* [keep3rOracleFactory.sol](https://github.com/keep3r-network/keep3r.network/blob/master/contracts/Keep3rV2OracleFactory.sol)

View file

@ -0,0 +1,24 @@
## chainlink
<br>
### tl; dr
<br>
* a decentralized oracle network consisting of three key smart contracts:
* a reputation contract: keep track of data providers' performance.
* an order-matching contract: selects bids from oracles using the reputation contract.
* an aggregation contract—and an off-chain registry of data providers.
* one of the main challenges with such a decentralized approach is the formulation of the aggregation function.
* chainlink proposes calculating a weighted response, allowing a validity score to be reported for each oracle response.
<br>
---
### resources
<br>
* [fair sequencing services](https://blog.chain.link/chainlink-fair-sequencing-services-enabling-a-provably-fair-defi-ecosystem/)

View file

@ -0,0 +1,29 @@
## twamm designs
<br>
### tl; dr
<br>
* time weighted amm designs prevent sandwich attacks by executing transactions lazily.
* orders are executed as if they were placed between blocks. this way, an attacker would need to straddle blocks in order to take advantage of the victim's slippage tolernace (which is riskier than simply including txs around the victim's).
<br>
---
### resources
<br>
* [twamm, by paradigm](https://www.paradigm.xyz/2021/07/twamm)
* [twamm ref implementation](https://github.com/para-dave/twamm)
* [some properties of twamm](https://github.com/pcaversaccio/reentrancy-attacks)
* [twamm numerical analysis, by cron finance](https://docs.cronfi.com/twamm/research/numerical-analysis#presentation)

View file

@ -0,0 +1,37 @@
## TWAP oracles
### tl; dr
<br>
* an assets time-weighted average price (TWAP) is the measure of an assets average price over a predetermined period of time (any specified duration).
* TWAP trading algorithms seek to optimize average price while executing over a specified time period.
* generally used to execute large orders that are expected to have significant market impact.
<br>
---
### tl; dr oracle attacks
<br>
* on pos ethereum, block builder building successive block might be able to manipulate oracles for multi-block MEV extraction, as proposers know one epoch (32 blocks or 6 minutes and 24 seconds) ahead if they are the next block proposer.
* with mev-boost, an attacker could observe the set of upcoming proposers. if they finds two successive proposers that have both been proposing blocks, then the attacker can anticipate the attack.
* a potential attack vector is on lending protocols, where an attacker can borrow assets that are immediately undercollateralized.
<img width="791" src="https://user-images.githubusercontent.com/1130416/209031792-52d7671e-480e-497b-9736-4e22e1810fab.png">
<br>
___
### resources
* [multi- block MEV by flashbots](https://collective.flashbots.net/t/multi-block-mev/457/2?u=nerolation)
* [statistical analysis on ethereum k-consecutive block proposal](https://alrevuelta.github.io/posts/ethereum-mev-multiblock)
* [uniswap v3 twap oracles](https://uniswap.org/blog/uniswap-v3-oracles)
* [multi-block mev, by chainsecurity](https://chainsecurity.com/oracle-manipulation-after-merge/)