Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multiple auction simulation #610

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

KirillDogadin-std
Copy link
Contributor

Closes # .

Checklist:

  • issue number linked above after pound (#)
    • replace "Closes " with "Contributes to" or other if this PR does not close the issue
  • issue checkboxes are all addressed
  • manually checked my feature / not applicable
  • wrote tests / not applicable
  • attached screenshots / not applicable

@KirillDogadin-std
Copy link
Contributor Author

KirillDogadin-std commented Jul 11, 2023

Currently multi-auction creation fails for AAVE token (and probably some other tokens ?? )


> [email protected] hardhat:simulations
> npx hardhat --network testnetwork --config local.hardhat.config.ts run ./simulations/index.ts

✔ Select Simulation › Create multiple collateral auctions
✔ Block number to fork from … 17669454
✔ Number of vaults to create per collateral type … 2
Forking at the block "17669454"
New RPC endpoint has started on http://localhost:8545
Using wallet with:
	 - public key: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
	 - private key: 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
✔ Select the collateral symbols to add to the VAT. › AAVE-A
Step "Reset blockchain fork" is successfully completed

✔ Press Enter to proceed to the next step "Create the vaults" …
Duplicate definition of File (File(bytes32,uint256), File(bytes32,bytes32,uint256), File(bytes32,bytes32,address))
Duplicate definition of File (File(bytes32,uint256), File(bytes32,bytes32,uint256), File(bytes32,bytes32,address))
Minimum collaterals amount to open vault: [{"c":"1531.90774"}]
Balance slot is 0x0, language format is solidity, contract address is 0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9
Wallet has 1531.90774 AAVE
Transaction is preparing to be mined...
Transaction is pending to be mined...
Transaction was mined into block "17669458"
Deposit 1531.91 AAVE-A to the VAT
Transaction is preparing to be mined...
Transaction is pending to be mined...
Transaction was mined into block "17669460"
Vault #30784: depositing  1531.91 AAVE-A in exchange for 10732.34303 DAI
Transaction is preparing to be mined...
Transaction is pending to be mined...
Transaction was mined into block "17669461"
Vault #30784: contans 1531.91 AAVE-A, 10732.34303 DAI of debt
Created Vault id: 30784
Balance slot is 0x0, language format is solidity, contract address is 0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9
Wallet has 1531.90774 AAVE
Transaction is preparing to be mined...
Transaction is pending to be mined...
Transaction was mined into block "17669462"
Deposit 1531.91 AAVE-A to the VAT
Transaction is preparing to be mined...
Transaction error: "Error: VM Exception while processing transaction: reverted with reason string SafeMath: subtraction overflow (cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ])"

/Users/kirilldogadin/work/unified-auctions-ui/core/node_modules/@ethersproject/logger/src.ts/index.ts:261
        const error: any = new Error(message);
                           ^
Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (error={"reason":"Error: VM Exception while processing transaction: reverted with reason string 'SafeMath: subtraction overflow'","code":"UNPREDICTABLE_GAS_LIMIT","method":"estimateGas","transaction":{"from":"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266","maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x59682f00"},"maxFeePerGas":{"type":"BigNumber","hex":"0x59682f02"},"to":"0x24e459F61cEAa7b1cE70Dbaea938940A7c5aD46e","data":"0x3b4da69f0000000000000000000000007e53c88acda877af095d729d3faf7b3e5ced6d4f0000000000000000000000000000000000000000000000530b7d95228b75c000","type":2,"accessList":null},"error":{"reason":"processing response error","code":"SERVER_ERROR","body":"{\"jsonrpc\":\"2.0\",\"id\":91,\"error\":{\"code\":-32603,\"message\":\"Error: VM Exception while processing transaction: reverted with reason string 'SafeMath: subtraction overflow'\",\"data\":{\"message\":\"Error: VM Exception while processing transaction: reverted with reason string 'SafeMath: subtraction overflow'\",\"data\":\"0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001e536166654d6174683a207375627472616374696f6e206f766572666c6f770000\"}}}","error":{"code":-32603,"data":{"message":"Error: VM Exception while processing transaction: reverted with reason string 'SafeMath: subtraction overflow'","data":"0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001e536166654d6174683a207375627472616374696f6e206f766572666c6f770000"}},"requestBody":"{\"method\":\"eth_estimateGas\",\"params\":[{\"type\":\"0x2\",\"maxFeePerGas\":\"0x59682f02\",\"maxPriorityFeePerGas\":\"0x59682f00\",\"from\":\"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\",\"to\":\"0x24e459f61ceaa7b1ce70dbaea938940a7c5ad46e\",\"data\":\"0x3b4da69f0000000000000000000000007e53c88acda877af095d729d3faf7b3e5ced6d4f0000000000000000000000000000000000000000000000530b7d95228b75c000\"}],\"id\":91,\"jsonrpc\":\"2.0\"}","requestMethod":"POST","url":"http://localhost:8545"}}, tx={"data":"0x3b4da69f0000000000000000000000007e53c88acda877af095d729d3faf7b3e5ced6d4f0000000000000000000000000000000000000000000000530b7d95228b75c000","to":{},"maxFeePerGas":{"type":"BigNumber","hex":"0x59682f02"},"maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x59682f00"},"from":"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266","type":2,"nonce":{},"gasLimit":{},"chainId":{}}, code=UNPREDICTABLE_GAS_LIMIT, version=abstract-signer/5.6.2)
    at Logger.makeError (/Users/kirilldogadin/work/unified-auctions-ui/core/node_modules/@ethersproject/logger/src.ts/index.ts:261:28)
    at Logger.throwError (/Users/kirilldogadin/work/unified-auctions-ui/core/node_modules/@ethersproject/logger/src.ts/index.ts:273:20)
    at /Users/kirilldogadin/work/unified-auctions-ui/core/node_modules/@ethersproject/abstract-signer/src.ts/index.ts:301:31
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Promise.all (index 7)

Others such as ETH-A work

@KirillDogadin-std
Copy link
Contributor Author

alright. I've noticed that for some collaterals it's also the case that the repetitive vault creations also result in an error.

With this many errors i've decided to introduce a functionality where it creates the vaults that it can create and then reports on the vaults that were not created successfully.

@KirillDogadin-std
Copy link
Contributor Author

KirillDogadin-std commented Jul 12, 2023

Overview of the collaterals that do not work properly with this simulation

@LukSteib pls indicate which collaterals that are listed as failing in this post are offboarded already (or provide source so that i can do this myself). See table below for the summary.

Running for multiple collaterals

# Terminal 1, /core/ dir
npm run hardhat
# Terminal 2, /core/ dir
# 1.
npm run hardhat:simulations
# 2.
# Select multiple auction simulation,
# select number of auctions per type (here it will be 3),
# select (pressing space) the collateral types to create auctions for

First batch

  • Number of auctions per collateral: 3
  • Input types:
    MANA-A, MATIC-A, PAXUSD-A, RENBTC-A, RETH-A, TUSD-A, UNI-A, UNIV2AAVEETH-A, UNIV2DAIETH-A, UNIV2DAIUSDC-A, UNIV2DAIUSDT-A, UNIV2ETHUSDT-A, UNIV2LINKETH-A, UNIV2UNIETH-A, UNIV2USDCETH-A, UNIV2WBTCDAI-A, UNIV2WBTCETH-A, USDC-A, USDC-B, USDT-A, WBTC-A, WBTC-B, WBTC-C, WSTETH-A, WSTETH-B, YFI-A, ZRX-A
  • Failures
1. Failed to create vault with type MANA-A and amount 147058.823538
2. Failed to create vault with type MANA-A and amount 220588.235307
3. Failed to create vault with type RENBTC-A and amount 26.95
4. Failed to create vault with type RENBTC-A and amount 53.9
5. Failed to create vault with type RENBTC-A and amount 80.85
6. Failed to create vault with type TUSD-A and amount 24750.000011
7. Failed to create vault with type TUSD-A and amount 49500.000022
8. Failed to create vault with type TUSD-A and amount 74250.000033
9. Failed to create vault with type USDC-A and amount 247500.0000011
10. Failed to create vault with type USDC-A and amount 495000.0000022
11. Failed to create vault with type USDC-A and amount 742500.0000033
12. Failed to create vault with type USDT-A and amount 65949.134944
13. Failed to create vault with type USDT-A and amount 98923.702416

Second batch

  • Number of auctions per collateral: 3

  • Input types:
    AAVE-A, BAL-A, BAT-A, COMP-A, CRVV1ETHSTETH-A, ETH-A, ETH-B, ETH-C, GNO-A, GUSD-A, KNC-A, LINK-A, LRC-A

  • Failures

    1. Failed to create vault with type AAVE-A and amount 3063.81548
    2. Failed to create vault with type AAVE-A and amount 4595.72322
    3. Failed to create vault with type GUSD-A and amount 247500.0000011
    4. Failed to create vault with type GUSD-A and amount 495000.0000022
    5. Failed to create vault with type GUSD-A and amount 742500.0000033
    6. Failed to create vault with type KNC-A and amount 451788.5556888
    7. Failed to create vault with type KNC-A and amount 677682.8335332
    

Outcome for all the failed collaterals

Type Partial or Full Failure
MANA-A Partial, Success: 1/3
RENBTC-A Full
TUSD-A Full
USDC-A Full
USDT-A Partial, Success: 1/3
AAVE-A Partial, Success: 1/3
GUSD-A Full
KNC-A Full

AAVE-A Token

Create: 3
Successful: 1
Error:

   1. Failed to create vault with type AAVE-A and amount 3063.81548; Error:
cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (error={"reason":"Error: VM Exception while processing transaction: reverted with reason string 'SafeMath: subtraction overflow'","code":"UNPREDICTABLE_GAS_LIMIT","method":"estimateGas","transaction":{"from":"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266","maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x59682f00"},"maxFeePerGas":{"type":"BigNumber","hex":"0x59682f02"},"to":"0x24e459F61cEAa7b1cE70Dbaea938940A7c5aD46e","data":"0x3b4da69f000000000000000000000000a43d952a71fb8418d42554b853568bf7f04d4bb30000000000000000000000000000000000000000000000a616fb2a4516eb8000","type":2,"accessList":null},"error":{"reason":"processing response error","code":"SERVER_ERROR","body":"{\"jsonrpc\":\"2.0\",\"id\":91,\"error\":{\"code\":-32603,\"message\":\"Error: VM Exception while processing transaction: reverted with reason string 'SafeMath: subtraction overflow'\",\"data\":{\"message\":\"Error: VM Exception while processing transaction: reverted with reason string 'SafeMath: subtraction overflow'\",\"data\":\"0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001e536166654d6174683a207375627472616374696f6e206f766572666c6f770000\"}}}","error":{"code":-32603,"data":{"message":"Error: VM Exception while processing transaction: reverted with reason string 'SafeMath: subtraction overflow'","data":"0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001e536166654d6174683a207375627472616374696f6e206f766572666c6f770000"}},"requestBody":"{\"method\":\"eth_estimateGas\",\"params\":[{\"type\":\"0x2\",\"maxFeePerGas\":\"0x59682f02\",\"maxPriorityFeePerGas\":\"0x59682f00\",\"from\":\"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\",\"to\":\"0x24e459f61ceaa7b1ce70dbaea938940a7c5ad46e\",\"data\":\"0x3b4da69f000000000000000000000000a43d952a71fb8418d42554b853568bf7f04d4bb30000000000000000000000000000000000000000000000a616fb2a4516eb8000\"}],\"id\":91,\"jsonrpc\":\"2.0\"}","requestMethod":"POST","url":"http://localhost:8545"}}, tx={"data":"0x3b4da69f000000000000000000000000a43d952a71fb8418d42554b853568bf7f04d4bb30000000000000000000000000000000000000000000000a616fb2a4516eb8000","to":{},"maxFeePerGas":{"type":"BigNumber","hex":"0x59682f02"},"maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x59682f00"},"from":"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266","type":2,"nonce":{},"gasLimit":{},"chainId":{}}, code=UNPREDICTABLE_GAS_LIMIT, version=abstract-signer/5.6.2)

2. Failed to create vault with type AAVE-A and amount 4595.72322; Error:
cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (error={"reason":"Error: VM Exception while processing transaction: reverted with reason string 'SafeMath: subtraction overflow'","code":"UNPREDICTABLE_GAS_LIMIT","method":"estimateGas","transaction":{"from":"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266","maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x59682f00"},"maxFeePerGas":{"type":"BigNumber","hex":"0x59682f02"},"to":"0x24e459F61cEAa7b1cE70Dbaea938940A7c5aD46e","data":"0x3b4da69f000000000000000000000000f099c71008172678d4733b6ab1cdca65bac487c20000000000000000000000000000000000000000000000f92278bf67a2614000","type":2,"accessList":null},"error":{"reason":"processing response error","code":"SERVER_ERROR","body":"{\"jsonrpc\":\"2.0\",\"id\":103,\"error\":{\"code\":-32603,\"message\":\"Error: VM Exception while processing transaction: reverted with reason string 'SafeMath: subtraction overflow'\",\"data\":{\"message\":\"Error: VM Exception while processing transaction: reverted with reason string 'SafeMath: subtraction overflow'\",\"data\":\"0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001e536166654d6174683a207375627472616374696f6e206f766572666c6f770000\"}}}","error":{"code":-32603,"data":{"message":"Error: VM Exception while processing transaction: reverted with reason string 'SafeMath: subtraction overflow'","data":"0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001e536166654d6174683a207375627472616374696f6e206f766572666c6f770000"}},"requestBody":"{\"method\":\"eth_estimateGas\",\"params\":[{\"type\":\"0x2\",\"maxFeePerGas\":\"0x59682f02\",\"maxPriorityFeePerGas\":\"0x59682f00\",\"from\":\"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\",\"to\":\"0x24e459f61ceaa7b1ce70dbaea938940a7c5ad46e\",\"data\":\"0x3b4da69f000000000000000000000000f099c71008172678d4733b6ab1cdca65bac487c20000000000000000000000000000000000000000000000f92278bf67a2614000\"}],\"id\":103,\"jsonrpc\":\"2.0\"}","requestMethod":"POST","url":"http://localhost:8545"}}, tx={"data":"0x3b4da69f000000000000000000000000f099c71008172678d4733b6ab1cdca65bac487c20000000000000000000000000000000000000000000000f92278bf67a2614000","to":{},"maxFeePerGas":{"type":"BigNumber","hex":"0x59682f02"},"maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x59682f00"},"from":"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266","type":2,"nonce":{},"gasLimit":{},"chainId":{}}, code=UNPREDICTABLE_GAS_LIMIT, version=abstract-signer/5.6.2)

MANA-A and USD-T token

Create: 3
Successful: 1
Error for both tokens:

  1. Failed to create vault with type MANA-A and amount 149190.110828; Error:
cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (error={"reason":"Error: Transaction reverted without a reason string","code":"UNPREDICTABLE_GAS_LIMIT","method":"estimateGas","transaction":{"from":"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266","maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x59682f00"},"maxFeePerGas":{"type":"BigNumber","hex":"0x59682f02"},"to":"0x0F5D2fB29fb7d3CFeE444a200298f468908cC942","data":"0x095ea7b3000000000000000000000000a6ea3b9c04b8a38ff5e224e7c3d6937ca44c0ef9ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","type":2,"accessList":null},"error":{"reason":"processing response error","code":"SERVER_ERROR","body":"{\"jsonrpc\":\"2.0\",\"id\":88,\"error\":{\"code\":-32603,\"message\":\"Error: Transaction reverted without a reason string\",\"data\":{\"message\":\"Error: Transaction reverted without a reason string\",\"data\":\"0x\"}}}","error":{"code":-32603,"data":{"message":"Error: Transaction reverted without a reason string","data":"0x"}},"requestBody":"{\"method\":\"eth_estimateGas\",\"params\":[{\"type\":\"0x2\",\"maxFeePerGas\":\"0x59682f02\",\"maxPriorityFeePerGas\":\"0x59682f00\",\"from\":\"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\",\"to\":\"0x0f5d2fb29fb7d3cfee444a200298f468908cc942\",\"data\":\"0x095ea7b3000000000000000000000000a6ea3b9c04b8a38ff5e224e7c3d6937ca44c0ef9ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\"}],\"id\":88,\"jsonrpc\":\"2.0\"}","requestMethod":"POST","url":"http://localhost:8545"}}, tx={"data":"0x095ea7b3000000000000000000000000a6ea3b9c04b8a38ff5e224e7c3d6937ca44c0ef9ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","to":{},"from":"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266","type":2,"maxFeePerGas":{"type":"BigNumber","hex":"0x59682f02"},"maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x59682f00"},"nonce":{},"gasLimit":{},"chainId":{}}, code=UNPREDICTABLE_GAS_LIMIT, version=abstract-signer/5.6.2)

2. Failed to create vault with type MANA-A and amount 223785.166242; Error:
cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (error={"reason":"Error: Transaction reverted without a reason string","code":"UNPREDICTABLE_GAS_LIMIT","method":"estimateGas","transaction":{"from":"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266","maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x59682f00"},"maxFeePerGas":{"type":"BigNumber","hex":"0x59682f02"},"to":"0x0F5D2fB29fb7d3CFeE444a200298f468908cC942","data":"0x095ea7b3000000000000000000000000a6ea3b9c04b8a38ff5e224e7c3d6937ca44c0ef9ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","type":2,"accessList":null},"error":{"reason":"processing response error","code":"SERVER_ERROR","body":"{\"jsonrpc\":\"2.0\",\"id\":97,\"error\":{\"code\":-32603,\"message\":\"Error: Transaction reverted without a reason string\",\"data\":{\"message\":\"Error: Transaction reverted without a reason string\",\"data\":\"0x\"}}}","error":{"code":-32603,"data":{"message":"Error: Transaction reverted without a reason string","data":"0x"}},"requestBody":"{\"method\":\"eth_estimateGas\",\"params\":[{\"type\":\"0x2\",\"maxFeePerGas\":\"0x59682f02\",\"maxPriorityFeePerGas\":\"0x59682f00\",\"from\":\"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\",\"to\":\"0x0f5d2fb29fb7d3cfee444a200298f468908cc942\",\"data\":\"0x095ea7b3000000000000000000000000a6ea3b9c04b8a38ff5e224e7c3d6937ca44c0ef9ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\"}],\"id\":97,\"jsonrpc\":\"2.0\"}","requestMethod":"POST","url":"http://localhost:8545"}}, tx={"data":"0x095ea7b3000000000000000000000000a6ea3b9c04b8a38ff5e224e7c3d6937ca44c0ef9ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","to":{},"from":"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266","type":2,"maxFeePerGas":{"type":"BigNumber","hex":"0x59682f02"},"maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x59682f00"},"nonce":{},"gasLimit":{},"chainId":{}}, code=UNPREDICTABLE_GAS_LIMIT, version=abstract-signer/5.6.2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant