Reading 1.2 Flashcards
What is DeFi? Main 3 elements?
Decentralized Finance - blockchain based financial infrastructure
1) open
2) permission-less
3) interoperable
What is a public blockchain?
Database that allows participants to establish a SHARED UNCHANGABLE LEDGER (record of ownership)
Anyone is free to join and participate in the core activities of the blockchain network.
Anyone can read, write, or audit the ongoing activities on a public blockchain network
KEY Benefit of smart contracts
Security: anyone can independently verify the resulting changes
Which 2 issues do smart contracts mitigate?
1) users cant observe application’s internal logic (DApps)
2) users cant control the execution environment
Ethereum is Largest smart contract platform in terms of:
1) market cap
2) applications
3) development activity
DeFi market size: 2017 vs 2021
2017:
1m smart contracts and 0.1m Ether
2021:
10b smart contracts and 100m Ether
Defi stack:
1) settlement layer - settling the transactions (must ensure that state changes adhere to the rules)
2) asset layer - all assets issued on top of settlement layer and tokens
3) protocol layer - provide a specific set of rules and code that developers use to create smart contracts
4) application layer - user interface
5) aggregation layer - dashboard for execution of DeFi transaction
What is a token?
Representation of an asset that was tokenized on a blockchain
What is TOKENIZATION
Converting a unit of value (eg painting) into tokens that can be transferred on the blockchain
Key Risk of TOKENIZATION
Issuer risk
value of a promise-based token
(e.g., with a promise of interest payments, dividends, or delivery of a good or service) depends on the claim’s credibility.
If an issuer is unwilling or unable to deliver, the token may become worthless or trade at a significant discount.
Stablecoins are also exposed to issuer risk; native digital tokens ( e.g., BTC and ETH) are not
3 backing models for PROMISE BASED TOKENS:
1) no collateral - promise trust base
2) off chain collateral - collateral stored with an escrow service (need to be aware of counterparty risk and external dependencies)
3) on chain collateral - requires OVER-COLLATERALIZATION to offset the price fluctuations
What is Dai?
How much did it grow from early 2020 to mid 2020?
Why?
1) Dai stable coin pegged to USD
2) 100m to 500m
3) because since 2017 it did not fluctuate more than by 5c from 0.95 to 1.05$
Off Chain Collateralized stable coins
1) USDT and USDC (USD backed)
2) DGX - backed by gold
3) WBTC - tokenized version of bitcoin
What is a DAO
Decentralized Autonomous Organization
What is the Governance Token?
1) VOTING TOOL: token that acts as a tool for DAO governance (voting) through smart contracts
2) Traded on exchanges
What is a NFT? Usually built on what standard?
1) Non Fungible Token
2) like a digital certificate of uniqueness
3) ERC-721
Advantages and Disadvantages of centralized crypto exchanges?
Advantage: Relatively Organized
Disadvantage:
1) Need to deposit assets with the exchange
2) They are the single point of attack
Advantage of decentralized crypto exchanges?
Advantage:
Assets are not deposited until trade is complete (done through a smart contract => excludes counterparty credit risk)
Atomic swap
Smart contract that automatically executes specific actions once predetermined rules are met
Decentralized order books exchanges
Use Smart contracts for transaction settlement and host their order books either on chain or off chain
Order book
List of buy and sell orders for a specific token
Pros & cons of on chain ORDER BOOKS
pro: decentralized, stored within the existing infrastructure of the block chain
Con: every action requires a blockchain transaction => slow, costly process. Even more costly in volatile markets because of frequent cancelations
1) how does off chain ORDER BOOKS work
2) Dominant protocol that uses this approach
1) Centralized third party is used for order books. Blockchain used for settlement.
Maker (trade initiator) sends order to relayer and taker (transaction full-filler) selects the order
2) 0x
What is CFMM and how can one use an arbitrage opportunity?
1) Constant Function Market Maker
- Liquidity pool that holds 2 cryptoassets
- Constant Product Model - to withdraw one token the proportional amount of the other token should be deposited
2) because the contract based liquidity pools do not rely on external price feeds (oracles) when market price of an asset changes one can trade the liquidity pool until the price is aligned with the market price
What is a Liquidity pool
1) Digital pile of cryptocurrency locked in a smart contract used for increasing liquidity for trading
The cryptoassets are provided by liquidity providers
popular liquidity pool protocols
UniSwap, Balancer, Curver and Bancor
The earliest implementation of liquidity pool concept was proposed by
1) Hertzog and Benartzi (2017).
2) Adams (2018) simplified the model;
3) Zhang, Chen, and Park (2018) provided a proof of the concept;
4) Martinelli and Mushegian (2019) generalized the concept for cases with more than two tokens and dynamic token weights;
5) Egorov (2019) optimized the idea for stablecoin swaps.
Smart contract based reserve aggregation:
1) mechanism
2) who sets the price
3) most prominent implementation of concept
1) Serves as a gateway between users and liquidity providers: user sends a trade request to the smart contract and it finds the best price and atomic settlement is made
2) The price is set by the liquidity providers
3) Kyber Network (Luu and Velner, 2017)
Possible issues with Smart contract based reserve aggregation and solutions to the issues
1) Limited competition can result in monopolistic pricing
2) centralized control mechanisms: max price, min number of liquidity providers, background checks
Peer to peer (P2P) protocols = OTC protocols
1) how they work
2) uniqueness
3) most popular implementation
1) Parties are connected directly, without 3rd parties => participants query the market who wants to trade a given pair of crypto-assets and then negotiate directly
2) third party cant front run someone, only parties involved in the negotiation can accept the trade
3) Airswap (Oved & Mosites, 2017)
DeFi lending platforms
1) how they work
2) types of loans
1) Borrowers and lenders are not required to identify themselves. The loans are permission-less. Everyone can borrow or lend
2) Flash loans and Fully secured loans
Flash loans:
1) definition
2) how they work
1) Repaid automatically and on chain
2) the borrower receives, uses and repays the funds within the same blockchain transaction.
If the borrower doesn’t repay (i.e. meet a certain requirements) the loan is cancelled = loan is returned to the lender
Mempool definition
Memory pool - waiting room for transactions that have not yet been included in the blockchain
Fully secured loans:
1) how they work
2) types
1) loans secured with collateral that is locked via a smart contract and only released when the debt is repaid
2) 3 types:
- Collateralized debt positions
- Pooled Collateralized debt markets
- P2P collateralized debt markets
Collateralized debt positions (CDPs)
1) how they work
New tokens are issued, backed by collateral
To create the token, the user must lock cryptoassets in a smart contract
Then the user can borrow based on the collateralization ratio
Residual risk
Risk not accounted for
Collateralized debt markets
1) how it works
2) how are lender and borrowers matched
3) Popular protocols
1) existing tokens are lent (to borrow ETH someone else has to lend ETH)
2) P2P matching - lending party only earns interest after a specific agreement with a specific party is made
Pooled Loans - the interest rate is set by the availability of liquidity (more liquidity - smaller interest rate).
3) Aave, Compound, dYdX
P2P matching and Pooled Loans advantages:
1) P2P:
- loans have fixed interest rate
- parties agree on the period of the loan repayment
2) Pooled:
- lenders earn interest from the point of depositing funds in the pool
- can undergo maturity transformation (short term deposits transferred into long term loans)
- can undergo size transformation (small amounts gathered from savers and transforming them into large amounts needed by borrowers)
Decentralized Derivatives
1) how works
2) 2 types of derivative tokens
1) Tokens whose value depend on an external requirement
Usually need oracles for tracking
2) Asset and Event based
Asset based derivative tockens
Extend CDPs => locked collateral is used to issue synthetic tokens that track prices of various assets
Inverse token
Asset based derivative token that providers users with short exposure and price is determined by the inverse of the underlying assets’ performance
Event based derivative tokens
1) how they work
2) most popular implementation
1) The price is a function of any observable variable thats not asset performance
Can be based on observable variable with known potential outcomes, specific timeframe and resolution source.
2) Augur
On chain funds
1) definition
2) how they work
1) Like traditional investment funds - allow users to invest in a basket of cryptoassets
2) do not require a custodian because assets are locked up in a smart contract, users can withdraw/liquidate them at any time
Either not managed (semi automatic trading) or actively managed (in this case the limitations of trading are stipulated in the smart-contract)
When investing into a on chain fund - a token is issued (# according to the % owner) and then when the investor exists - the position is sold and token is burned
Popular examples of on chain fund protocols:
- Set protocol - can build invest funds
- Enzyme Finance (Melon) - can build invest funds, mostly designed for semiautomatic
- Betoken - meritocratic fund of funds
- Yearn Vaults - collective invest pools (actively managed and complex)
4 opportunities of DeFi ecosystem
1) Efficiency & Speed - reduce counterparty credit risk & efficiency of transactions (smart contracts)
2) Transparency
3) Accessibility - any one can use the protocols
4) Composability - ability to build new protocols from existing protocols
6 risks of DeFi ecosystem
1) Smart Contract Execution - only as secure as the smart contract protocol
2) Operational Security - governance tokens and admin keys (ability to change protocols) are often concentrated and result in exposure to malicious actions
3) Dependencies - issues with one of the protocols/contracts can result in multiple protocols and contracts being exposed
4) external data need exposure
5) illicit (illegal) activity
6) Scalability
Yield farming
Liquidity farming - lending crypto assets in order to generate rewards in the form of additional cryptocurrency
2 areas of attention for regulators in relation to DeFi
1) Fiat on ramps and off ramps - to verify the origin of funds when crypto is bought with fiat money and when crypto is sold for fiat money
2) Decentralization theater - to distinguish between truly decentralized protocols and not
Possible solutions to scalability issue
1) Sharding - level 1 scaling solution - spreading computation across P2P network
2) Rollups - Level 2 scaling solution - transactions posted on main chain and computation is off chain
- ZK roll up - zero knowledge - verifiers confirm they have the same info without disclosing the info (validity proof - only accepted if cryptographically confirmed)
- Optimistic rolls ups - transaction is only denied if a valid claim of fraud is reported