Flash Exercise
Last updated
Was this helpful?
Last updated
Was this helpful?
It is a contract to exercise ACO tokens without sending the amount required to exercise besides the ACO tokens. You send only the ACO tokens and the collateral to be obtained on exercise is partially used to buy the asset and pay the writers the expected amount, the user exercising receives the remaining amount (intrinsic value) This functionality on a unique transaction is possible due to . It is only possible to flash exercise an ACO token whether there is the respective pair underlying / strike asset on Uniswap V2.
ACOFlashExercise.sol
is deployed at on the Ethereum mainnet.
function uniswapFactory() external view returns(address);
The Uniswap V2 factory address.
function uniswapRouter() external view returns(address);
The Uniswap V2 router address.
function weth() external view returns(address);
The WETH address used on Uniswap V2.
function getUniswapPair(address acoToken) external view returns(address);
Function to get the Uniswap V2 pair for an ACO token.
acoToken
Address of the ACO token.
function getExerciseData(address acoToken, uint256 tokenAmount, address[] calldata accounts) external view returns(uint256, uint256);
Function to get the required amount of collateral to be paid to Uniswap V2 as the first return and the expected amount to exercise the ACO token as the second return.
acoToken
Address of the ACO token.
tokenAmount
Amount of tokens to be exercised.
function getEstimatedReturn(address acoToken, uint256 tokenAmount) external view returns(uint256);
acoToken
Address of the ACO token.
tokenAmount
Amount of tokens to be exercised.
function flashExercise(address acoToken, uint256 tokenAmount, uint256 minimumCollateral, uint256 salt) external;
Function to flash exercise ACO tokens. No asset is required to exercise the ACO token because the own collateral redeemed is used to fulfill the terms of the contract. The transaction sender will receive the remaining collateral.
acoToken
Address of the ACO token.
tokenAmount
Amount of tokens to be exercised.
minimumCollateral
The minimum amount of collateral accepted to be received on the flash exercise.
salt
A random number used to calculate the start index of the array of accounts to be exercised.
function flashExerciseAccounts(address acoToken, uint256 tokenAmount, uint256 minimumCollateral, address[] calldata accounts) external;
Function to flash exercise ACO tokens using a list of accounts to be exercised. No asset is required to exercise the ACO token because the own collateral redeemed is used to fulfill the terms of the contract. The transaction sender will receive the remaining collateral.
acoToken
Address of the ACO token.
tokenAmount
Amount of tokens to be exercised.
minimumCollateral
The minimum amount of collateral accepted to be received on the flash exercise.
accounts
The array of addresses to try to exercise and get collateral from.
accounts
The array of addresses to be exercised. Whether the array is empty the exercise will be considered as executed using the methods or .
Function to get the estimated collateral to be received through a flash exercise using the methods or .