Key Concepts
DeFi - Decentralized finance
Decentralized finance is a blockchain-based form of finance that does not rely on central financial intermediaries such as brokerages, exchanges, or banks to offer traditional financial instruments, and instead utilizes smart contracts on blockchains, the most common being Ethereum.
KYC - Know your customer
The know your customer or know your client guidelines in financial services require that professionals make an effort to verify the identity, suitability, and risks involved with maintaining a business relationship. The procedures fit within the broader scope of a bank's anti-money laundering policy.
Cryptocurrency
Cryptocurrency is a digital asset designed to work as a medium of exchange. It uses cryptographic functions to conduct financial transactions. Through cryptography, also controls and creates new units while verifies the transfer of assets.
What makes cryptocurrency unique is that it is decentralized by nature and not controlled by any central or national bank. Cryptocurrency uses blockchain, which also makes it immune to control or interference by any government.
Cryptocurrency is a digital alternative to money that holds its value based on supply and demand.
Crypto Trading Bot
A bot is simply an automated program that operates on the Internet and performs repetitive tasks more efficiently than humans. By communicating directly with crypto exchanges and placing orders automatically based on your own preset conditions, crypto trading bots offer exceptional speed and efficiency, fewer errors and emotionless trading. In order to trade on an exchange, you must authorize a trading bot to access your account via API keys (Application Program Interface), and access can be granted or withdrawn at any time. Precision, emotionless, higher speed and consistent.
Smart Contract
A smart contract is a computer program or a transaction protocol that is intended to automatically execute, control or document legally relevant events and actions according to the terms of a contract or an agreement. The objectives of smart contracts are the reduction of need in trusted intermediates, arbitrations and enforcement costs, fraud losses, as well as the reduction of malicious and accidental exceptions.
Flash loans
Flash loans are an innovative financial product made possible by the atomic nature of transactions on the Ethereum blockchain. They allow users to borrow large amounts of cryptocurrency from liquidity pools without collateral if the loan is repaid in the same transaction. They are like leverage trades and margin accounts in traditional finance, but without the need to be approved and provide collateral.
Flash swaps and loans both employ “optimistic transfer,” a fascinating technique.
What is Aave?
Aave is a decentralized non-custodial liquidity protocol where users can participate as depositors or borrowers. Depositors provide liquidity to the market to earn a passive income, while borrowers are able to borrow in an over-collateralized (perpetually) or under-collateralized (one-block liquidity) fashion.
The protocol is implemented as a set of smart contracts on top of the Ethereum blockchain. Smart contracts guarantee safety and do not require a middleman.
Flash swaps
Flash swaps allow traders to receive assets and use them elsewhere before paying for (or returning) them later in the transaction. Flash swaps, as done on Uniswap, don’t have flat fees (yet) but rather take a swap fee. This can be seen as a “free” loan compared to a flash loan because the swap fee is taken out of the trading order- we do not have to make a separate payment. Last point of difference: we can pay back flash swaps in either asset we’re exchanging. If we use a flash swap to buy Dai with ETH, we can pay the swap back in either Dai or ETH. This allows us to do more sophisticated operations.
Optimistic Transfer
Both flash loans and flash swaps employ a technique called optimistic transfer. This remarkable DeFi innovation allows a user to take uncollateralized loans or swaps and execute a trade as long as the user pays the service back by the end of the trade. To better understand this mind-bender, let’s take a look at some code.
This is the key to optimistic transfer—it’s 100% dependent on the trade being successful.
Decentralized Exchanges (DEXes)
Decentralized Exchanges (DEXes) like Uniswap and Sushiswap, are cryptocurrency exchanges that use smart contracts to enforce the trading rules, execute trades, and securely handle funds when necessary. They allow us to quickly exchange different cryptocurrencies and stablecoins and may be used as part of flash loan strategies to acquire the assets needed.
Arbitrage
Arbitrage is arguably the main use case for flashloans, which means buying cryptocurrency (or an asset) for a price and selling it for a higher price on a different exchange. The main challenge with arbitrage is that by the time you sell an asset the price of it might have changed, but with flashloans you don’t have that problem. Additionally, with flashloans you don’t have to have the crypto asset, you can just borrow it, therefore the earning coming from the price difference (spread) will be proportional to the amount traded.
Arbitrage trading, independent of flash loans or blockchain, is when you have the same asset with two different prices in two different exchanges. Arbitrage bots are used to identify inefficiencies and price differences across markets.
A few tips
Our program is written in Node.js using the Ethers.js library and incorporating an Infura endpoint. Our arbitrage smart contract is written in Solidity.
Uniswap works on a Factory Model and needs a single smart contract for each token pair.
Uniswap Flash Loan feature is called Flash Swaps
Loans are not based on credit or collateral and there's no need for KYC
Last updated
Was this helpful?