DeFi Features have arrived to AdEx
We’re very excited to announce that the new ADX token has gained support for flash loans on the Ethereum mainnet!
The contract has been deployed and funded on Mainnet and Goerli after a successfully conducted audit last week.
Here are the addresses:
This pool contains 2 million ADX tokens. Future pools with more liqudity will be added at a later point in time.
What are flash loans?
In Ethereum, transactions can perform multiple actions at once in an atomic manner. Atomic means that either the whole transaction succeeds, therefore applying all these actions on the blockchain, or it fails, which does not change the blockchain at all: essentially as if nothing happened.
This is how flash loans work: within one Ethereum transaction, you borrow, perform some actions, and as long as you return the same amount by the end of the transaction, it’s valid and it will succeed. Otherwise, the whole transaction will revert, meaning that it will be as if you never borrowed the funds.
What’s the use case of ADX flash loans?
If the price diverges significantly, anyone can, in a single Ethereum transaction, do the following:
- Borrow ADX from the flash loans contract;
- Sell the ADX on the higher priced pair;
- Use the proceeds to buy ADX on the lower priced pair;
- Return the ADX to the flash loan contract, keeping the additional ADX as profit.
If the transaction is structured in a way that prevents the flash loan contract from taking the loan back, it will be an invalid transaction, therefore it won’t be accepted by Ethereum nodes won’t make any changes to the blockchain state.
This enables anyone to arbitrage the ADX markets without permission or liquidity, which is beneficial for ADX markets, as it ensures a consistent price between them and therefore better UX for traders.
Token economics: Where do the tokens come from?
The new tokens were created as part of the token upgrade, and specifically allocated for this built-in flash lending pool.
While the 2 million ADX in the flash loans contract will be reflected in the total supply, they are permanently locked in the contract and cannot be taken out, ever.
Another way to look at this is to imagine that the ADX token smart contract can issue a loan within the context of an Ethereum transaction, only if it’s possible to take it back within the same transaction.
In the future, if there’s demand, a larger flash lending pool will be created, potentially with a small fee payable in ADX that will be automatically burnt, therefore deflating the supply.
How can I use this?
If you are a developer, head over to our protocol repository here: .
Have a look at the following resources: