diff --git a/src/tx-builder/config/index.ts b/src/tx-builder/config/index.ts index 5135b756..59777280 100644 --- a/src/tx-builder/config/index.ts +++ b/src/tx-builder/config/index.ts @@ -10,7 +10,6 @@ import { } from '../types'; export const DEFAULT_NULL_VALUE_ON_TX = BigNumber.from(0).toHexString(); -export const POLYGON_DEFAULT_GAS = BigNumber.from('1000000'); export const DEFAULT_APPROVE_AMOUNT = constants.MaxUint256.toString(); export const MAX_UINT_AMOUNT = '115792089237316195423570985008687907853269984665640564039457584007913129639935'; @@ -157,7 +156,7 @@ export const enabledNetworksByService: EnabledNetworksType = { Network.mumbai, ], faucet: [Network.kovan], - liquiditySwapAdapter: [Network.kovan, Network.mainnet], + liquiditySwapAdapter: [Network.mainnet, Network.polygon], repayWithCollateralAdapter: [Network.kovan, Network.mainnet], aaveGovernanceV2: [Network.kovan, Network.mainnet], ltaMigrator: [Network.kovan, Network.mainnet], diff --git a/src/tx-builder/config/v2/addresses.ts b/src/tx-builder/config/v2/addresses.ts index 463e1d93..d6521bf2 100644 --- a/src/tx-builder/config/v2/addresses.ts +++ b/src/tx-builder/config/v2/addresses.ts @@ -50,7 +50,7 @@ export const commonContractAddressBetweenMarketsV2: CommonConfigType = { LEND_TO_AAVE_MIGRATOR: '', WETH_GATEWAY: '0xbEadf48d62aCC944a06EEaE0A9054A90E5A7dc97', FAUCET: '', - SWAP_COLLATERAL_ADAPTER: '', + SWAP_COLLATERAL_ADAPTER: '0x35784a624D4FfBC3594f4d16fA3801FeF063241c', REPAY_WITH_COLLATERAL_ADAPTER: '', FLASHLIQUIDATION: '', INCENTIVES_CONTROLLER: '0x357d51124f59836ded84c8a1730d72b749d8bc23', diff --git a/src/tx-builder/utils/gasStation.ts b/src/tx-builder/utils/gasStation.ts index ddd10c5d..a117c082 100644 --- a/src/tx-builder/utils/gasStation.ts +++ b/src/tx-builder/utils/gasStation.ts @@ -1,8 +1,9 @@ import { BigNumber } from 'ethers'; -import { POLYGON_DEFAULT_GAS } from '../config'; import { transactionType, Configuration, Network } from '../types'; const DEFAULT_SURPLUS = 30; // 30% +// polygon gas estimation is very off for some reason +const POLYGON_SURPLUS = 60; // 60% export const estimateGas = async ( tx: transactionType, @@ -24,7 +25,7 @@ export const estimateGasByNetwork = async ( const { network } = config; if (network === Network.polygon) { - return POLYGON_DEFAULT_GAS; + return estimatedGas.add(estimatedGas.mul(POLYGON_SURPLUS).div(100)); } return estimatedGas.add(