-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for optimization tab on Aave V3 strategies. (#3207)
* Add support for optimization tab on Aave V3 strategies. This commit introduces the "isOptimizationTabEnabled" method to the Aave V3 strategy. This method checks if the optimization tab is enabled for the specific strategy type and network. This check is needed to separate the availability of the optimization tab based on the vault, as the feature is not yet supported on all vaults. Further, it adds the feature toggles for "AUTO_BUY" and "AUTO_SELL" features under the Aave protocol in the automation feature map. * λ two new functions: get-triggers, setup-trigger (#3263) * Add new lambdas and local development guide This commit introduces two new lambda functions, 'get-triggers' and 'setup-trigger', and updates the documentation to include a guide for local development. Modifications were made in 'build.mjs' and 'install.mjs' files to accommodate the new lambdas, and necessary testing configurations and package-lock.json files were added. A significant part of the change went into updating the README with new instructions for creating a new lambda and to detail instructions for local development using AWS SAM and Docker. * Adjust Autobuy view * Remove duplicates * missing labels * some changes * add loading changes * don't check the use MaxBuyPrice * steps * changes in lambdas * changes in error handling
- Loading branch information
1 parent
8f81404
commit c5331ec
Showing
141 changed files
with
13,286 additions
and
266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,3 +68,7 @@ NOTIFICATIONS_HOST_GOERLI="" | |
|
||
RPC_GATEWAY= | ||
GROOVE_WIDGET_ID= | ||
|
||
# Triggers | ||
GET_TRIGGERS_URL="" | ||
SETUP_TRIGGER_URL="" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ coverage | |
.vercel | ||
jest.config.js | ||
setup.js | ||
lambdas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nodeLinker: node-modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,51 @@ | ||
[ | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "contract AccountGuard", | ||
"name": "_guard", | ||
"type": "address" | ||
} | ||
], | ||
"inputs": [{ "internalType": "contract AccountGuard", "name": "_guard", "type": "address" }], | ||
"stateMutability": "nonpayable", | ||
"type": "constructor" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"internalType": "address", | ||
"name": "_target", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "bytes", | ||
"name": "_data", | ||
"type": "bytes" | ||
} | ||
{ "indexed": false, "internalType": "address", "name": "sender", "type": "address" }, | ||
{ "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } | ||
], | ||
"name": "execute", | ||
"outputs": [ | ||
{ | ||
"internalType": "bytes32", | ||
"name": "", | ||
"type": "bytes32" | ||
} | ||
"name": "FundsRecived", | ||
"type": "event" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "address", "name": "_target", "type": "address" }, | ||
{ "internalType": "bytes", "name": "_data", "type": "bytes" } | ||
], | ||
"name": "execute", | ||
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], | ||
"stateMutability": "payable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "guard", | ||
"outputs": [ | ||
{ | ||
"internalType": "contract AccountGuard", | ||
"name": "", | ||
"type": "address" | ||
} | ||
], | ||
"outputs": [{ "internalType": "contract AccountGuard", "name": "", "type": "address" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "owner", | ||
"outputs": [{ "internalType": "address", "name": "", "type": "address" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "address", | ||
"name": "_target", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "bytes", | ||
"name": "_data", | ||
"type": "bytes" | ||
} | ||
{ "internalType": "address", "name": "_target", "type": "address" }, | ||
{ "internalType": "bytes", "name": "_data", "type": "bytes" } | ||
], | ||
"name": "send", | ||
"outputs": [], | ||
"stateMutability": "payable", | ||
"type": "function" | ||
} | ||
}, | ||
{ "stateMutability": "payable", "type": "receive" } | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
blockchain/transaction-fee/get-ethereum-transaction-fee.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import BigNumber from 'bignumber.js' | ||
import { getNetworkContracts } from 'blockchain/contracts' | ||
import { getRpcProvider, NetworkIds } from 'blockchain/networks' | ||
import { getGasPrice } from 'blockchain/prices' | ||
import { ChainlinkPriceOracle__factory } from 'types/ethers-contracts' | ||
|
||
export interface EthereumTransactionFee { | ||
fee: string | ||
feeUsd: string | ||
ethUsdPrice: string | ||
} | ||
|
||
export async function getEthereumTransactionFee( | ||
args: { estimatedGas: string } | undefined, | ||
): Promise<EthereumTransactionFee | undefined> { | ||
if (!args) { | ||
return undefined | ||
} | ||
const { chainlinkPriceOracle } = getNetworkContracts(NetworkIds.MAINNET) | ||
const provider = getRpcProvider(NetworkIds.MAINNET) | ||
|
||
const gasPrice = await getGasPrice() | ||
|
||
const fee = gasPrice.maxFeePerGas.multipliedBy(args.estimatedGas) | ||
|
||
const priceOracleContract = ChainlinkPriceOracle__factory.connect( | ||
chainlinkPriceOracle.ETHUSD.address, | ||
provider, | ||
) | ||
|
||
const ethUsdPrice = await priceOracleContract | ||
.latestAnswer() | ||
.then((res) => new BigNumber(res.toString())) | ||
|
||
return { | ||
fee: fee.toString(), | ||
feeUsd: fee.dividedBy(ethUsdPrice).toString(), | ||
ethUsdPrice: ethUsdPrice.toString(), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.