Midas-Protocol / contracts

21 stars 11 forks source link

Investigate failed liquidation #465

Open vminkov opened 1 year ago

vminkov commented 1 year ago

Describe the bug

To Reproduce


Args: [{     "borrower": "0x3F3C783c99D621dD9FE404e3919c79440661d3B8",     "repayAmount": {         "type": "BigNumber",         "hex": "0x03a15717e518767b"     },     "cErc20": "0x059c595f19d6FA9f8203F3731DF54455cD248c44",     "cTokenCollateral": "0x84d3ABf607d7c15ACEC74fED7E4B1576e3EA86c1",     "minProfitAmount": 0,     "flashSwapPair": "0x58F876857a02D6762E0101bb5C46A8c1ED44Dc16",     "exchangeProfitTo": "0x0000000000000000000000000000000000000000",     "uniswapV2RouterForBorrow": "0x10ED43C718714eb63d5aA57B78B54704E256024E",     "uniswapV2RouterForCollateral": "0x10ED43C718714eb63d5aA57B78B54704E256024E",     "redemptionStrategies": [         "0xE1B50506e2fE039ED593FBbde14608559aE97d27"     ],     "strategyData": [         "0x00000000000000000000000010ed43c718714eb63d5aa57b78b54704e256024e0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000e9e7cea3dedca5984780bafc599bd69add087d56000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"     ],     "ethToCoinbase": 0,     "debtFundingStrategies": [],     "debtFundingStrategiesData": [] }] | - Args: [{"borrower":"0x3F3C783c99D621dD9FE404e3919c79440661d3B8","repayAmount":{"type":"BigNumber","hex":"0x03a15717e518767b"},"cErc20":"0x059c595f19d6FA9f8203F3731DF54455cD248c44","cTokenCollateral":"0x84d3ABf607d7c15ACEC74fED7E4B1576e3EA86c1","minProfitAmount":0,"flashSwapPair":"0x58F876857a02D6762E0101bb5C46A8c1ED44Dc16","exchangeProfitTo":"0x0000000000000000000000000000000000000000","uniswapV2RouterForBorrow":"0x10ED43C718714eb63d5aA57B78B54704E256024E","uniswapV2RouterForCollateral":"0x10ED43C718714eb63d5aA57B78B54704E256024E","redemptionStrategies":["0xE1B50506e2fE039ED593FBbde14608559aE97d27"],"strategyData":["0x00000000000000000000000010ed43c718714eb63d5aa57b78b54704e256024e0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000e9e7cea3dedca5984780bafc599bd69add087d56000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"],"ethToCoinbase":0,"debtFundingStrategies":[],"debtFundingStrategiesData":[]}]
-- | --
  | 2022-11-08T18:39:25.985+02:00Copy - Error: Error sending sendTransactionToSafeLiquidator transaction: Failed to estimate gas before signing and sending safeLiquidateToTokensWithFlashLoan transaction: Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (reason="execution reverted: Pancake: LOCKED", method="estimateGas", transaction={     "from": "0x19F2bfCA57FDc1B7406337391d2F54063CaE8748",     "to": "0xc9C3D317E89f4390A564D56180bBB1842CF3c99C",     "value": {         "type": "BigNumber",         "hex": "0x00"     },     "data": "0xf6cd5bbd00000000000000000000000000000000000000000000000000000000000000200000000000000000000000003f3c783c99d621dd9fe404e3919c79440661d3b800000000000000000000000000000000000000000000000003a15717e518767b000000000000000000000000059c595f19d6fa9f8203f3731df54455cd248c4400000000000000000000000084d3abf607d7c15acec74fed7e4b1576e3ea86c100000000000000000000000058f876857a02d6762e0101bb5c46a8c1ed44dc160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010ed43c718714eb63d5aa57b78b54704e256024e00000000000000000000000010ed43c718714eb63d5aa57b78b54704e256024e00000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000003600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000e1b50506e2fe039ed593fbbde14608559ae97d270000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000010ed43c718714eb63d5aa57b78b54704e256024e0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000e9e7cea3dedca5984780bafc599bd69add087d56000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",     "accessList": null }, error={     "reason": "processing response error",     "code": "SERVER_ERROR",

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

vminkov commented 1 year ago

investigate


- Args: [{     "borrower": "0x02E7b714fae84e4BA80f3CDa5508553e7CF5042A",     "repayAmount": {         "type": "BigNumber",         "hex": "0x9c988ac599ec5c"     },     "cErc20": "0x38982105A2F81dc5dBDEA6c131bB4bF5a416513A",     "cTokenCollateral": "0xdB1C2240004a3Fd33BF71B2D66b1662604168eAc",     "minProfitAmount": 0,     "flashSwapPair": "0x58F876857a02D6762E0101bb5C46A8c1ED44Dc16",     "exchangeProfitTo": "0x0000000000000000000000000000000000000000",     "uniswapV2RouterForBorrow": "0x10ED43C718714eb63d5aA57B78B54704E256024E",     "uniswapV2RouterForCollateral": "0x10ED43C718714eb63d5aA57B78B54704E256024E",     "redemptionStrategies": [],     "strategyData": [],     "ethToCoinbase": 0,     "debtFundingStrategies": [],     "debtFundingStrategiesData": [] }] | - Args: [{"borrower":"0x02E7b714fae84e4BA80f3CDa5508553e7CF5042A","repayAmount":{"type":"BigNumber","hex":"0x9c988ac599ec5c"},"cErc20":"0x38982105A2F81dc5dBDEA6c131bB4bF5a416513A","cTokenCollateral":"0xdB1C2240004a3Fd33BF71B2D66b1662604168eAc","minProfitAmount":0,"flashSwapPair":"0x58F876857a02D6762E0101bb5C46A8c1ED44Dc16","exchangeProfitTo":"0x0000000000000000000000000000000000000000","uniswapV2RouterForBorrow":"0x10ED43C718714eb63d5aA57B78B54704E256024E","uniswapV2RouterForCollateral":"0x10ED43C718714eb63d5aA57B78B54704E256024E","redemptionStrategies":[],"strategyData":[],"ethToCoinbase":0,"debtFundingStrategies":[],"debtFundingStrategiesData":[]}] | logs/liquidation-mainnet-56-0/a604eba83f2a4011a23dfea3e96c8bc1
-- | -- | --
  | 2022-11-08T18:24:42.925+02:00Copy - Error: Error sending sendTransactionToSafeLiquidator transaction: Failed to estimate gas before signing and sending safeLiquidateToTokensWithFlashLoan transaction: Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (reason="execution reverted: LIQUIDATE_SEIZE_TOO_MUCH", method="estimateGas", transaction={     "from": "0x19F2bfCA57FDc1B7406337391d2F54063CaE8748",     "to": "0xc9C3D317E89f4390A564D56180bBB1842CF3c99C",     "value": {         "type": "BigNumber",         "hex": "0x00"     },     "data": "0xf6cd5bbd000000000000000000000000000000000000000000000000000000000000002000000000000000000000000002e7b714fae84e4ba80f3cda5508553e7cf5042a000000000000000000000000000000000000000000000000009c988ac599ec5c00000000000000000000000038982105a2f81dc5dbdea6c131bb4bf5a416513a000000000000000000000000db1c2240004a3fd33bf71b2d66b1662604168eac00000000000000000000000058f876857a02d6762e0101bb5c46a8c1ed44dc160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010ed43c718714eb63d5aa57b78b54704e256024e00000000000000000000000010ed43c718714eb63d5aa57b78b54704e256024e00000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",     "accessList": null }, error={     "reason": "processing response error",

- Args: [
{
    "borrower": "0x02E7b714fae84e4BA80f3CDa5508553e7CF5042A",
    "repayAmount": {
        "type": "BigNumber",
        "hex": "0x9c988ac599ec5c"
    },
    "cErc20": "0x38982105A2F81dc5dBDEA6c131bB4bF5a416513A",
    "cTokenCollateral": "0xdB1C2240004a3Fd33BF71B2D66b1662604168eAc",
    "minProfitAmount": 0,
    "flashSwapPair": "0x58F876857a02D6762E0101bb5C46A8c1ED44Dc16",
    "exchangeProfitTo": "0x0000000000000000000000000000000000000000",
    "uniswapV2RouterForBorrow": "0x10ED43C718714eb63d5aA57B78B54704E256024E",
    "uniswapV2RouterForCollateral": "0x10ED43C718714eb63d5aA57B78B54704E256024E",
    "redemptionStrategies": [],
    "strategyData": [],
    "ethToCoinbase": 0,
    "debtFundingStrategies": [],
    "debtFundingStrategiesData": []
}
]
- Args: [{"borrower":"0x02E7b714fae84e4BA80f3CDa5508553e7CF5042A","repayAmount":{"type":"BigNumber","hex":"0x9c988ac599ec5c"},"cErc20":"0x38982105A2F81dc5dBDEA6c131bB4bF5a416513A","cTokenCollateral":"0xdB1C2240004a3Fd33BF71B2D66b1662604168eAc","minProfitAmount":0,"flashSwapPair":"0x58F876857a02D6762E0101bb5C46A8c1ED44Dc16","exchangeProfitTo":"0x0000000000000000000000000000000000000000","uniswapV2RouterForBorrow":"0x10ED43C718714eb63d5aA57B78B54704E256024E","uniswapV2RouterForCollateral":"0x10ED43C718714eb63d5aA57B78B54704E256024E","redemptionStrategies":[],"strategyData":[],"ethToCoinbase":0,"debtFundingStrategies":[],"debtFundingStrategiesData":[]}]  [logs/liquidation-mainnet-56-0/a604eba83f2a4011a23dfea3e96c8bc1](https://eu-central-1.console.aws.amazon.com/cloudwatch/home?region=eu-central-1#logsV2:log-groups/log-group/liquidation-mainnet-56/log-events/logs$252Fliquidation-mainnet-56-0$252Fa604eba83f2a4011a23dfea3e96c8bc1$3Fstart$3D1667924682825$26refEventId$3D37195963364250405781265027515738578962639609309821206548)

2022-11-08T18:24:42.925+02:00

Copy
 - Error: Error sending sendTransactionToSafeLiquidator transaction: Failed to estimate gas before signing and sending safeLiquidateToTokensWithFlashLoan transaction: Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (reason="execution reverted: LIQUIDATE_SEIZE_TOO_MUCH", method="estimateGas", transaction=
{
    "from": "0x19F2bfCA57FDc1B7406337391d2F54063CaE8748",
    "to": "0xc9C3D317E89f4390A564D56180bBB1842CF3c99C",
    "value": {
        "type": "BigNumber",
        "hex": "0x00"
    },
    "data": "0xf6cd5bbd000000000000000000000000000000000000000000000000000000000000002000000000000000000000000002e7b714fae84e4ba80f3cda5508553e7cf5042a000000000000000000000000000000000000000000000000009c988ac599ec5c00000000000000000000000038982105a2f81dc5dbdea6c131bb4bf5a416513a000000000000000000000000db1c2240004a3fd33bf71b2d66b1662604168eac00000000000000000000000058f876857a02d6762e0101bb5c46a8c1ed44dc160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010ed43c718714eb63d5aa57b78b54704e256024e00000000000000000000000010ed43c718714eb63d5aa57b78b54704e256024e00000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "accessList": null
}
, error=
{
    "reason": "processing response error",`