@paraswap/dex-lib 3.8.1 → 3.8.3-integral-dex
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/launch.json +9 -49
- package/.vscode/settings.json +2 -1
- package/build/abi/Uncompressor.json +250 -0
- package/build/abi/integral/factory.json +333 -0
- package/build/abi/integral/oracle.json +501 -0
- package/build/abi/integral/pool.json +1041 -0
- package/build/abi/{wombat/pool.json → integral/relayer.json} +720 -473
- package/build/abi/oswap/oswap.abi.json +452 -0
- package/build/config.js +1 -1
- package/build/dex/aave-v1/aave-v1.d.ts +1 -2
- package/build/dex/aave-v1/aave-v1.js +0 -23
- package/build/dex/aave-v1/aave-v1.js.map +1 -1
- package/build/dex/compound.js +1 -1
- package/build/dex/compound.js.map +1 -1
- package/build/dex/curve-v1-factory/config.js +10 -47
- package/build/dex/curve-v1-factory/config.js.map +1 -1
- package/build/dex/curve-v1-factory/curve-v1-factory.d.ts +2 -2
- package/build/dex/curve-v1-factory/curve-v1-factory.js +36 -96
- package/build/dex/curve-v1-factory/curve-v1-factory.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/constants.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/get_dx.js +1 -13
- package/build/dex/curve-v1-factory/price-handlers/functions/get_dx.js.map +1 -1
- package/build/dex/curve-v1-factory/state-polling-pools/custom-pool-polling.d.ts +2 -2
- package/build/dex/curve-v1-factory/state-polling-pools/custom-pool-polling.js +1 -1
- package/build/dex/curve-v1-factory/state-polling-pools/custom-pool-polling.js.map +1 -1
- package/build/dex/curve-v1-factory/state-polling-pools/factory-pool-polling.js +1 -1
- package/build/dex/curve-v1-factory/state-polling-pools/factory-pool-polling.js.map +1 -1
- package/build/dex/curve-v1-factory/state-polling-pools/pool-polling-base.d.ts +3 -4
- package/build/dex/curve-v1-factory/state-polling-pools/pool-polling-base.js +9 -24
- package/build/dex/curve-v1-factory/state-polling-pools/pool-polling-base.js.map +1 -1
- package/build/dex/curve-v1-factory/types.d.ts +4 -20
- package/build/dex/curve-v1-factory/types.js +3 -11
- package/build/dex/curve-v1-factory/types.js.map +1 -1
- package/build/dex/curve-v1-stable-ng/config.js +0 -18
- package/build/dex/curve-v1-stable-ng/config.js.map +1 -1
- package/build/dex/etherfi/etherfi.d.ts +26 -0
- package/build/dex/etherfi/etherfi.js +96 -0
- package/build/dex/etherfi/etherfi.js.map +1 -0
- package/build/dex/index.js +21 -3
- package/build/dex/index.js.map +1 -1
- package/build/dex/integral/config.d.ts +4 -0
- package/build/dex/integral/config.js +20 -0
- package/build/dex/integral/config.js.map +1 -0
- package/build/dex/integral/context.d.ts +40 -0
- package/build/dex/integral/context.js +158 -0
- package/build/dex/integral/context.js.map +1 -0
- package/build/dex/integral/helpers.d.ts +17 -0
- package/build/dex/integral/helpers.js +157 -0
- package/build/dex/integral/helpers.js.map +1 -0
- package/build/dex/integral/integral-factory.d.ts +21 -0
- package/build/dex/integral/integral-factory.js +92 -0
- package/build/dex/integral/integral-factory.js.map +1 -0
- package/build/dex/integral/integral-pool.d.ts +46 -0
- package/build/dex/integral/integral-pool.js +143 -0
- package/build/dex/integral/integral-pool.js.map +1 -0
- package/build/dex/integral/integral-pricing.d.ts +18 -0
- package/build/dex/integral/integral-pricing.js +114 -0
- package/build/dex/integral/integral-pricing.js.map +1 -0
- package/build/dex/integral/integral-relayer.d.ts +39 -0
- package/build/dex/integral/integral-relayer.js +189 -0
- package/build/dex/integral/integral-relayer.js.map +1 -0
- package/build/dex/integral/integral-token.d.ts +24 -0
- package/build/dex/integral/integral-token.js +56 -0
- package/build/dex/integral/integral-token.js.map +1 -0
- package/build/dex/integral/integral.d.ts +41 -0
- package/build/dex/integral/integral.js +377 -0
- package/build/dex/integral/integral.js.map +1 -0
- package/build/dex/integral/types.d.ts +84 -0
- package/build/dex/integral/types.js +9 -0
- package/build/dex/integral/types.js.map +1 -0
- package/build/dex/integral/utils-e2e.d.ts +9 -0
- package/build/dex/integral/utils-e2e.js +131 -0
- package/build/dex/integral/utils-e2e.js.map +1 -0
- package/build/dex/integral/utils.d.ts +17 -0
- package/build/dex/integral/utils.js +94 -0
- package/build/dex/integral/utils.js.map +1 -0
- package/build/dex/oswap/config.d.ts +5 -0
- package/build/dex/oswap/config.js +31 -0
- package/build/dex/oswap/config.js.map +1 -0
- package/build/dex/oswap/oswap-pool.d.ts +51 -0
- package/build/dex/oswap/oswap-pool.js +150 -0
- package/build/dex/oswap/oswap-pool.js.map +1 -0
- package/build/dex/oswap/oswap.d.ts +46 -0
- package/build/dex/oswap/oswap.js +266 -0
- package/build/dex/oswap/oswap.js.map +1 -0
- package/build/dex/oswap/types.d.ts +20 -0
- package/build/dex/oswap/types.js +3 -0
- package/build/dex/oswap/types.js.map +1 -0
- package/build/dex/platypus/platypus.d.ts +1 -2
- package/build/dex/platypus/platypus.js +0 -45
- package/build/dex/platypus/platypus.js.map +1 -1
- package/build/dex/sdai/config.d.ts +11 -0
- package/build/dex/sdai/config.js +21 -0
- package/build/dex/sdai/config.js.map +1 -0
- package/build/dex/sdai/constants.d.ts +2 -0
- package/build/dex/sdai/constants.js +6 -0
- package/build/dex/sdai/constants.js.map +1 -0
- package/build/dex/sdai/scripts/validate-state.js +102 -0
- package/build/dex/sdai/scripts/validate-state.js.map +1 -0
- package/build/dex/sdai/sdai-pool.d.ts +16 -0
- package/build/dex/sdai/sdai-pool.js +85 -0
- package/build/dex/sdai/sdai-pool.js.map +1 -0
- package/build/dex/sdai/sdai.d.ts +51 -0
- package/build/dex/sdai/sdai.js +172 -0
- package/build/dex/sdai/sdai.js.map +1 -0
- package/build/dex/sdai/types.d.ts +21 -0
- package/build/dex/sdai/types.js +11 -0
- package/build/dex/sdai/types.js.map +1 -0
- package/build/dex/sdai/utils.d.ts +4 -0
- package/build/dex/sdai/utils.js +39 -0
- package/build/dex/sdai/utils.js.map +1 -0
- package/build/dex/stable-pool.js +8 -1
- package/build/dex/stable-pool.js.map +1 -1
- package/build/dex/swaap-v1/swaap-v1.d.ts +1 -2
- package/build/dex/swaap-v1/swaap-v1.js +0 -14
- package/build/dex/swaap-v1/swaap-v1.js.map +1 -1
- package/build/dex/uniswap-v3/contract-math/Oracle.js +4 -4
- package/build/dex/uniswap-v3/contract-math/Oracle.js.map +1 -1
- package/build/executor/compressor/Compressor.d.ts +23 -0
- package/build/executor/compressor/Compressor.js +144 -0
- package/build/executor/compressor/Compressor.js.map +1 -0
- package/build/executor/compressor/compress.d.ts +17 -0
- package/build/executor/compressor/compress.js +187 -0
- package/build/executor/compressor/compress.js.map +1 -0
- package/build/executor/compressor/compress_functions/addressSubstitution.d.ts +6 -0
- package/build/executor/compressor/compress_functions/addressSubstitution.js +29 -0
- package/build/executor/compressor/compress_functions/addressSubstitution.js.map +1 -0
- package/build/executor/compressor/compress_functions/addressSubstitutionFromObject.d.ts +10 -0
- package/build/executor/compressor/compress_functions/addressSubstitutionFromObject.js +40 -0
- package/build/executor/compressor/compress_functions/addressSubstitutionFromObject.js.map +1 -0
- package/build/executor/compressor/compress_functions/byteSubstitution.d.ts +11 -0
- package/build/executor/compressor/compress_functions/byteSubstitution.js +64 -0
- package/build/executor/compressor/compress_functions/byteSubstitution.js.map +1 -0
- package/build/executor/compressor/compress_functions/ffSubstitution.d.ts +7 -0
- package/build/executor/compressor/compress_functions/ffSubstitution.js +54 -0
- package/build/executor/compressor/compress_functions/ffSubstitution.js.map +1 -0
- package/build/executor/compressor/compress_functions/findLongestAndSubstitute.d.ts +8 -0
- package/build/executor/compressor/compress_functions/findLongestAndSubstitute.js +67 -0
- package/build/executor/compressor/compress_functions/findLongestAndSubstitute.js.map +1 -0
- package/build/executor/compressor/compress_functions/findLongestAndSubstitute_old.d.ts +8 -0
- package/build/executor/compressor/compress_functions/findLongestAndSubstitute_old.js +61 -0
- package/build/executor/compressor/compress_functions/findLongestAndSubstitute_old.js.map +1 -0
- package/build/executor/compressor/compress_functions/reverseAddressSubstitution.d.ts +6 -0
- package/build/executor/compressor/compress_functions/reverseAddressSubstitution.js +37 -0
- package/build/executor/compressor/compress_functions/reverseAddressSubstitution.js.map +1 -0
- package/build/executor/compressor/compress_functions/searchUnusedBytes.d.ts +9 -0
- package/build/executor/compressor/compress_functions/searchUnusedBytes.js +33 -0
- package/build/executor/compressor/compress_functions/searchUnusedBytes.js.map +1 -0
- package/build/executor/compressor/fetchSaved.js +17 -0
- package/build/executor/compressor/fetchSaved.js.map +1 -0
- package/build/executor/compressor/utils/computeCostL2.d.ts +2 -0
- package/build/executor/compressor/utils/computeCostL2.js +14 -0
- package/build/executor/compressor/utils/computeCostL2.js.map +1 -0
- package/build/executor/compressor/utils/findLongestDuplicatedString.d.ts +2 -0
- package/build/executor/compressor/utils/findLongestDuplicatedString.js +30 -0
- package/build/executor/compressor/utils/findLongestDuplicatedString.js.map +1 -0
- package/build/executor/compressor/utils/getAllIndexes.d.ts +2 -0
- package/build/executor/compressor/utils/getAllIndexes.js +12 -0
- package/build/executor/compressor/utils/getAllIndexes.js.map +1 -0
- package/build/executor/compressor/utils/getByteForAddress.d.ts +2 -0
- package/build/executor/compressor/utils/getByteForAddress.js +14 -0
- package/build/executor/compressor/utils/getByteForAddress.js.map +1 -0
- package/build/executor/compressor/utils/intTo2Bytes.d.ts +2 -0
- package/build/executor/compressor/utils/intTo2Bytes.js +14 -0
- package/build/executor/compressor/utils/intTo2Bytes.js.map +1 -0
- package/build/executor/compressor/utils/intTo3Bytes.d.ts +2 -0
- package/build/executor/compressor/utils/intTo3Bytes.js +18 -0
- package/build/executor/compressor/utils/intTo3Bytes.js.map +1 -0
- package/build/executor/compressor/utils/intToByte.d.ts +2 -0
- package/build/executor/compressor/utils/intToByte.js +10 -0
- package/build/executor/compressor/utils/intToByte.js.map +1 -0
- package/build/generic-swap-transaction-builder.js +3 -1
- package/build/generic-swap-transaction-builder.js.map +1 -1
- package/build/router/simpleswap.js +3 -1
- package/build/router/simpleswap.js.map +1 -1
- package/package.json +2 -2
- package/src/abi/BProtocol.json +1155 -0
- package/src/abi/Jarvis.json +1172 -0
- package/src/abi/MStableAsset.json +1545 -0
- package/src/abi/OneInchLp.json +1304 -0
- package/src/abi/Onebit.json +736 -0
- package/src/abi/Shell.json +1294 -0
- package/src/abi/TraderJoeV2Router.json +50 -0
- package/src/abi/integral/factory.json +333 -0
- package/src/abi/integral/oracle.json +501 -0
- package/src/abi/integral/pool.json +1041 -0
- package/src/abi/integral/relayer.json +1536 -0
- package/src/abi/zrx.v2.json +1967 -0
- package/src/abi/zrx.v3.json +3454 -0
- package/src/abi/zrx.v4.json +2193 -0
- package/src/config.ts +1 -1
- package/src/dex/OneInchLp.ts +84 -0
- package/src/dex/bProtocol/bProtocol-e2e.test.ts +93 -0
- package/src/dex/bProtocol/bProtocol.ts +108 -0
- package/src/dex/bProtocol/types.ts +13 -0
- package/src/dex/curve-v1-factory/config.ts +10 -47
- package/src/dex/curve-v1-factory/curve-v1-factory-e2e.test.ts +16 -92
- package/src/dex/curve-v1-factory/curve-v1-factory-integration.test.ts +5 -125
- package/src/dex/curve-v1-factory/curve-v1-factory.ts +45 -137
- package/src/dex/curve-v1-factory/price-handlers/functions/constants.ts +2 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/get_dx.ts +1 -24
- package/src/dex/curve-v1-factory/state-polling-pools/custom-pool-polling.ts +2 -3
- package/src/dex/curve-v1-factory/state-polling-pools/factory-pool-polling.ts +0 -1
- package/src/dex/curve-v1-factory/state-polling-pools/pool-polling-base.ts +10 -31
- package/src/dex/curve-v1-factory/types.ts +6 -22
- package/src/dex/curve-v1-stable-ng/config.ts +0 -18
- package/src/dex/curve-v1-stable-ng/curve-v1-stable-ng-e2e.test.ts +0 -17
- package/src/dex/index.ts +20 -3
- package/src/dex/integral/config.ts +20 -0
- package/src/dex/integral/context.ts +287 -0
- package/src/dex/integral/integral-e2e.test.ts +86 -0
- package/src/dex/integral/integral-events.test.ts +412 -0
- package/src/dex/integral/integral-factory.ts +146 -0
- package/src/dex/integral/integral-integration.test.ts +221 -0
- package/src/dex/integral/integral-pool.ts +198 -0
- package/src/dex/integral/integral-pricing.ts +190 -0
- package/src/dex/integral/integral-relayer.ts +285 -0
- package/src/dex/integral/integral-token.ts +95 -0
- package/src/dex/integral/integral.ts +523 -0
- package/src/dex/integral/test-artifacts/configs.json +1 -0
- package/src/dex/integral/test-artifacts/logs.json +1 -0
- package/src/dex/integral/test-artifacts/states.json +1 -0
- package/src/dex/integral/types.ts +88 -0
- package/src/dex/integral/utils-e2e.ts +194 -0
- package/src/dex/integral/utils.ts +146 -0
- package/src/dex/jarvis.ts +262 -0
- package/src/dex/mStable.ts +147 -0
- package/src/dex/onebit/onebit.ts +113 -0
- package/src/dex/onebit/types.ts +17 -0
- package/src/dex/shell.ts +84 -0
- package/src/dex/trader-joe-v2.ts +148 -0
- package/src/dex/uniswap-v3/contract-math/Oracle.ts +5 -4
- package/src/dex/zerox/config.ts +31 -0
- package/src/dex/zerox/index.ts +328 -0
- package/src/dex/zerox/order.ts +62 -0
- package/src/dex/zerox/types.ts +82 -0
- package/src/dex/zerox/zerox-e2e.test.ts +110 -0
- package/src/generic-swap-transaction-builder.ts +3 -1
- package/src/router/simpleswap.ts +3 -1
- package/tests/constants-e2e.ts +1 -1
- package/tests/utils-e2e.ts +0 -2
- package/.vscode/tasks.json +0 -15
- package/build/abi/uniswap-v3/AlienBaseV3Router.abi.json +0 -52
- package/build/dex/aave-v2/tokens-avalanche.json +0 -44
- package/build/dex/aave-v2/tokens-mainnet.json +0 -188
- package/build/dex/aave-v2/tokens-polygon.json +0 -44
- package/build/dex/maker-psm/scripts/gem.abi.json +0 -136
- package/build/dex/maker-psm/scripts/validate-state.js +0 -185
- package/build/dex/maker-psm/scripts/validate-state.js.map +0 -1
- package/build/dex/maker-psm/scripts/vat.abi.json +0 -243
- package/build/dex/solidly-v3/scripts/check-event-pool-event.js +0 -53
- package/build/dex/solidly-v3/scripts/check-event-pool-event.js.map +0 -1
- package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.d.ts +0 -17
- package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js +0 -64
- package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js.map +0 -1
- package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.d.ts +0 -17
- package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js +0 -79
- package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js.map +0 -1
- package/src/abi/curve-v1-factory/CurveV1Router.abi.json +0 -331
- package/src/dex/curve-v1-factory/optimizer.ts +0 -61
- /package/build/dex/{solidly-v3/scripts/check-event-pool-event.d.ts → sdai/scripts/validate-state.d.ts} +0 -0
- /package/build/{dex/maker-psm/scripts/validate-state.d.ts → executor/compressor/fetchSaved.d.ts} +0 -0
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"inputs": [],
|
|
4
|
+
"stateMutability": "nonpayable",
|
|
5
|
+
"type": "constructor"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"anonymous": false,
|
|
9
|
+
"inputs": [
|
|
10
|
+
{
|
|
11
|
+
"indexed": false,
|
|
12
|
+
"internalType": "address",
|
|
13
|
+
"name": "previousAdmin",
|
|
14
|
+
"type": "address"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"indexed": false,
|
|
18
|
+
"internalType": "address",
|
|
19
|
+
"name": "newAdmin",
|
|
20
|
+
"type": "address"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"name": "AdminChanged",
|
|
24
|
+
"type": "event"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"anonymous": false,
|
|
28
|
+
"inputs": [
|
|
29
|
+
{
|
|
30
|
+
"indexed": false,
|
|
31
|
+
"internalType": "address",
|
|
32
|
+
"name": "previousAdmin",
|
|
33
|
+
"type": "address"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"indexed": false,
|
|
37
|
+
"internalType": "address",
|
|
38
|
+
"name": "newAdmin",
|
|
39
|
+
"type": "address"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"name": "OperatorChanged",
|
|
43
|
+
"type": "event"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"anonymous": false,
|
|
47
|
+
"inputs": [
|
|
48
|
+
{
|
|
49
|
+
"indexed": false,
|
|
50
|
+
"internalType": "uint256",
|
|
51
|
+
"name": "traderate0",
|
|
52
|
+
"type": "uint256"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"indexed": false,
|
|
56
|
+
"internalType": "uint256",
|
|
57
|
+
"name": "traderate1",
|
|
58
|
+
"type": "uint256"
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"name": "TraderateChanged",
|
|
62
|
+
"type": "event"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"inputs": [],
|
|
66
|
+
"name": "approveStETH",
|
|
67
|
+
"outputs": [],
|
|
68
|
+
"stateMutability": "nonpayable",
|
|
69
|
+
"type": "function"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"inputs": [
|
|
73
|
+
{
|
|
74
|
+
"internalType": "uint256[]",
|
|
75
|
+
"name": "requestIds",
|
|
76
|
+
"type": "uint256[]"
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"name": "claimStETHWithdrawalForETH",
|
|
80
|
+
"outputs": [],
|
|
81
|
+
"stateMutability": "nonpayable",
|
|
82
|
+
"type": "function"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"inputs": [
|
|
86
|
+
{
|
|
87
|
+
"internalType": "uint256[]",
|
|
88
|
+
"name": "requestIds",
|
|
89
|
+
"type": "uint256[]"
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"name": "claimStETHWithdrawalForWETH",
|
|
93
|
+
"outputs": [],
|
|
94
|
+
"stateMutability": "nonpayable",
|
|
95
|
+
"type": "function"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"inputs": [
|
|
99
|
+
{
|
|
100
|
+
"internalType": "uint256",
|
|
101
|
+
"name": "amount",
|
|
102
|
+
"type": "uint256"
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"name": "depositETHForStETH",
|
|
106
|
+
"outputs": [],
|
|
107
|
+
"stateMutability": "nonpayable",
|
|
108
|
+
"type": "function"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"inputs": [
|
|
112
|
+
{
|
|
113
|
+
"internalType": "uint256",
|
|
114
|
+
"name": "amount",
|
|
115
|
+
"type": "uint256"
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
"name": "depositWETHForStETH",
|
|
119
|
+
"outputs": [],
|
|
120
|
+
"stateMutability": "nonpayable",
|
|
121
|
+
"type": "function"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"inputs": [],
|
|
125
|
+
"name": "minimumFunds",
|
|
126
|
+
"outputs": [
|
|
127
|
+
{
|
|
128
|
+
"internalType": "uint256",
|
|
129
|
+
"name": "",
|
|
130
|
+
"type": "uint256"
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
"stateMutability": "view",
|
|
134
|
+
"type": "function"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"inputs": [],
|
|
138
|
+
"name": "operator",
|
|
139
|
+
"outputs": [
|
|
140
|
+
{
|
|
141
|
+
"internalType": "address",
|
|
142
|
+
"name": "",
|
|
143
|
+
"type": "address"
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
"stateMutability": "view",
|
|
147
|
+
"type": "function"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"inputs": [],
|
|
151
|
+
"name": "owner",
|
|
152
|
+
"outputs": [
|
|
153
|
+
{
|
|
154
|
+
"internalType": "address",
|
|
155
|
+
"name": "",
|
|
156
|
+
"type": "address"
|
|
157
|
+
}
|
|
158
|
+
],
|
|
159
|
+
"stateMutability": "view",
|
|
160
|
+
"type": "function"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"inputs": [
|
|
164
|
+
{
|
|
165
|
+
"internalType": "uint256[]",
|
|
166
|
+
"name": "amounts",
|
|
167
|
+
"type": "uint256[]"
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
"name": "requestStETHWithdrawalForETH",
|
|
171
|
+
"outputs": [
|
|
172
|
+
{
|
|
173
|
+
"internalType": "uint256[]",
|
|
174
|
+
"name": "requestIds",
|
|
175
|
+
"type": "uint256[]"
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"stateMutability": "nonpayable",
|
|
179
|
+
"type": "function"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"inputs": [
|
|
183
|
+
{
|
|
184
|
+
"internalType": "uint256",
|
|
185
|
+
"name": "_minimumFunds",
|
|
186
|
+
"type": "uint256"
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
"name": "setMinimumFunds",
|
|
190
|
+
"outputs": [],
|
|
191
|
+
"stateMutability": "nonpayable",
|
|
192
|
+
"type": "function"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"inputs": [
|
|
196
|
+
{
|
|
197
|
+
"internalType": "address",
|
|
198
|
+
"name": "newOperator",
|
|
199
|
+
"type": "address"
|
|
200
|
+
}
|
|
201
|
+
],
|
|
202
|
+
"name": "setOperator",
|
|
203
|
+
"outputs": [],
|
|
204
|
+
"stateMutability": "nonpayable",
|
|
205
|
+
"type": "function"
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"inputs": [
|
|
209
|
+
{
|
|
210
|
+
"internalType": "address",
|
|
211
|
+
"name": "newOwner",
|
|
212
|
+
"type": "address"
|
|
213
|
+
}
|
|
214
|
+
],
|
|
215
|
+
"name": "setOwner",
|
|
216
|
+
"outputs": [],
|
|
217
|
+
"stateMutability": "nonpayable",
|
|
218
|
+
"type": "function"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"inputs": [
|
|
222
|
+
{
|
|
223
|
+
"internalType": "uint256",
|
|
224
|
+
"name": "buyT1",
|
|
225
|
+
"type": "uint256"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"internalType": "uint256",
|
|
229
|
+
"name": "sellT1",
|
|
230
|
+
"type": "uint256"
|
|
231
|
+
}
|
|
232
|
+
],
|
|
233
|
+
"name": "setPrices",
|
|
234
|
+
"outputs": [],
|
|
235
|
+
"stateMutability": "nonpayable",
|
|
236
|
+
"type": "function"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"inputs": [],
|
|
240
|
+
"name": "steth",
|
|
241
|
+
"outputs": [
|
|
242
|
+
{
|
|
243
|
+
"internalType": "contract IERC20",
|
|
244
|
+
"name": "",
|
|
245
|
+
"type": "address"
|
|
246
|
+
}
|
|
247
|
+
],
|
|
248
|
+
"stateMutability": "view",
|
|
249
|
+
"type": "function"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"inputs": [
|
|
253
|
+
{
|
|
254
|
+
"internalType": "uint256",
|
|
255
|
+
"name": "amountIn",
|
|
256
|
+
"type": "uint256"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"internalType": "uint256",
|
|
260
|
+
"name": "amountOutMin",
|
|
261
|
+
"type": "uint256"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"internalType": "address[]",
|
|
265
|
+
"name": "path",
|
|
266
|
+
"type": "address[]"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"internalType": "address",
|
|
270
|
+
"name": "to",
|
|
271
|
+
"type": "address"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"internalType": "uint256",
|
|
275
|
+
"name": "deadline",
|
|
276
|
+
"type": "uint256"
|
|
277
|
+
}
|
|
278
|
+
],
|
|
279
|
+
"name": "swapExactTokensForTokens",
|
|
280
|
+
"outputs": [
|
|
281
|
+
{
|
|
282
|
+
"internalType": "uint256[]",
|
|
283
|
+
"name": "amounts",
|
|
284
|
+
"type": "uint256[]"
|
|
285
|
+
}
|
|
286
|
+
],
|
|
287
|
+
"stateMutability": "nonpayable",
|
|
288
|
+
"type": "function"
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"inputs": [
|
|
292
|
+
{
|
|
293
|
+
"internalType": "uint256",
|
|
294
|
+
"name": "amountOut",
|
|
295
|
+
"type": "uint256"
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"internalType": "uint256",
|
|
299
|
+
"name": "amountInMax",
|
|
300
|
+
"type": "uint256"
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"internalType": "address[]",
|
|
304
|
+
"name": "path",
|
|
305
|
+
"type": "address[]"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"internalType": "address",
|
|
309
|
+
"name": "to",
|
|
310
|
+
"type": "address"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"internalType": "uint256",
|
|
314
|
+
"name": "deadline",
|
|
315
|
+
"type": "uint256"
|
|
316
|
+
}
|
|
317
|
+
],
|
|
318
|
+
"name": "swapTokensForExactTokens",
|
|
319
|
+
"outputs": [
|
|
320
|
+
{
|
|
321
|
+
"internalType": "uint256[]",
|
|
322
|
+
"name": "amounts",
|
|
323
|
+
"type": "uint256[]"
|
|
324
|
+
}
|
|
325
|
+
],
|
|
326
|
+
"stateMutability": "nonpayable",
|
|
327
|
+
"type": "function"
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"inputs": [],
|
|
331
|
+
"name": "token0",
|
|
332
|
+
"outputs": [
|
|
333
|
+
{
|
|
334
|
+
"internalType": "contract IERC20",
|
|
335
|
+
"name": "",
|
|
336
|
+
"type": "address"
|
|
337
|
+
}
|
|
338
|
+
],
|
|
339
|
+
"stateMutability": "view",
|
|
340
|
+
"type": "function"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"inputs": [],
|
|
344
|
+
"name": "token1",
|
|
345
|
+
"outputs": [
|
|
346
|
+
{
|
|
347
|
+
"internalType": "contract IERC20",
|
|
348
|
+
"name": "",
|
|
349
|
+
"type": "address"
|
|
350
|
+
}
|
|
351
|
+
],
|
|
352
|
+
"stateMutability": "view",
|
|
353
|
+
"type": "function"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"inputs": [],
|
|
357
|
+
"name": "traderate0",
|
|
358
|
+
"outputs": [
|
|
359
|
+
{
|
|
360
|
+
"internalType": "uint256",
|
|
361
|
+
"name": "",
|
|
362
|
+
"type": "uint256"
|
|
363
|
+
}
|
|
364
|
+
],
|
|
365
|
+
"stateMutability": "view",
|
|
366
|
+
"type": "function"
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"inputs": [],
|
|
370
|
+
"name": "traderate1",
|
|
371
|
+
"outputs": [
|
|
372
|
+
{
|
|
373
|
+
"internalType": "uint256",
|
|
374
|
+
"name": "",
|
|
375
|
+
"type": "uint256"
|
|
376
|
+
}
|
|
377
|
+
],
|
|
378
|
+
"stateMutability": "view",
|
|
379
|
+
"type": "function"
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"inputs": [
|
|
383
|
+
{
|
|
384
|
+
"internalType": "address",
|
|
385
|
+
"name": "to",
|
|
386
|
+
"type": "address"
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
"internalType": "uint256",
|
|
390
|
+
"name": "amount",
|
|
391
|
+
"type": "uint256"
|
|
392
|
+
}
|
|
393
|
+
],
|
|
394
|
+
"name": "transferEth",
|
|
395
|
+
"outputs": [],
|
|
396
|
+
"stateMutability": "nonpayable",
|
|
397
|
+
"type": "function"
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
"inputs": [
|
|
401
|
+
{
|
|
402
|
+
"internalType": "address",
|
|
403
|
+
"name": "token",
|
|
404
|
+
"type": "address"
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
"internalType": "address",
|
|
408
|
+
"name": "to",
|
|
409
|
+
"type": "address"
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"internalType": "uint256",
|
|
413
|
+
"name": "amount",
|
|
414
|
+
"type": "uint256"
|
|
415
|
+
}
|
|
416
|
+
],
|
|
417
|
+
"name": "transferToken",
|
|
418
|
+
"outputs": [],
|
|
419
|
+
"stateMutability": "nonpayable",
|
|
420
|
+
"type": "function"
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
"inputs": [],
|
|
424
|
+
"name": "weth",
|
|
425
|
+
"outputs": [
|
|
426
|
+
{
|
|
427
|
+
"internalType": "contract IWEth",
|
|
428
|
+
"name": "",
|
|
429
|
+
"type": "address"
|
|
430
|
+
}
|
|
431
|
+
],
|
|
432
|
+
"stateMutability": "view",
|
|
433
|
+
"type": "function"
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
"inputs": [],
|
|
437
|
+
"name": "withdrawal",
|
|
438
|
+
"outputs": [
|
|
439
|
+
{
|
|
440
|
+
"internalType": "contract IStETHWithdrawal",
|
|
441
|
+
"name": "",
|
|
442
|
+
"type": "address"
|
|
443
|
+
}
|
|
444
|
+
],
|
|
445
|
+
"stateMutability": "view",
|
|
446
|
+
"type": "function"
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
"stateMutability": "payable",
|
|
450
|
+
"type": "receive"
|
|
451
|
+
}
|
|
452
|
+
]
|
package/build/config.js
CHANGED
|
@@ -187,7 +187,7 @@ const baseConfigs = {
|
|
|
187
187
|
adapterAddresses: {
|
|
188
188
|
AvalancheAdapter01: '0x745Ec73855CeC7249E5fF4c9DD81cc65b4D297a9',
|
|
189
189
|
AvalancheAdapter02: '0xA10c9a84E72d9DfF424Fe2284B6460784bed407E',
|
|
190
|
-
AvalancheBuyAdapter: '
|
|
190
|
+
AvalancheBuyAdapter: '0x654dE10890f8B2C5bF54E50Af169a7E93165C416',
|
|
191
191
|
},
|
|
192
192
|
uniswapV2ExchangeRouterAddress: '0x53e693c6C7FFC4446c53B205Cf513105Bf140D7b',
|
|
193
193
|
rfqConfigs: {},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Interface } from '@ethersproject/abi';
|
|
2
|
-
import { Token, Address, ExchangePrices, PoolPrices, AdapterExchangeParam, SimpleExchangeParam, PoolLiquidity, Logger
|
|
2
|
+
import { Token, Address, ExchangePrices, PoolPrices, AdapterExchangeParam, SimpleExchangeParam, PoolLiquidity, Logger } from '../../types';
|
|
3
3
|
import { SwapSide, Network } from '../../constants';
|
|
4
4
|
import { IDex } from '../../dex/idex';
|
|
5
5
|
import { IDexHelper } from '../../dex-helper/idex-helper';
|
|
@@ -28,7 +28,6 @@ export declare class AaveV1 extends SimpleExchange implements IDex<AaveV1Data, A
|
|
|
28
28
|
getCalldataGasCost(poolPrices: PoolPrices<AaveV1Data>): number | number[];
|
|
29
29
|
getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: AaveV1Data, side: SwapSide): AdapterExchangeParam;
|
|
30
30
|
getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: AaveV1Data, side: SwapSide): Promise<SimpleExchangeParam>;
|
|
31
|
-
getDexParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, recipient: Address, data: AaveV1Data, side: SwapSide): DexExchangeParam;
|
|
32
31
|
updatePoolState(): Promise<void>;
|
|
33
32
|
getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
|
|
34
33
|
}
|
|
@@ -139,29 +139,6 @@ class AaveV1 extends simple_exchange_1.SimpleExchange {
|
|
|
139
139
|
const swapData = Interface.encodeFunctionData(swapFunction, swapFunctionParams);
|
|
140
140
|
return this.buildSimpleParamWithoutWETHConversion(srcToken, amount, destToken, destAmount, swapData, swapCallee, spender);
|
|
141
141
|
}
|
|
142
|
-
// DEAD
|
|
143
|
-
getDexParam(srcToken, destToken, srcAmount, destAmount, recipient, data, side) {
|
|
144
|
-
const amount = side === constants_1.SwapSide.SELL ? srcAmount : destAmount;
|
|
145
|
-
const [Interface, swapFunction, swapFunctionParams, swapCallee] = (() => {
|
|
146
|
-
if (data.fromAToken) {
|
|
147
|
-
return [this.aContract, AaveV1Functions.redeem, [amount], srcToken];
|
|
148
|
-
}
|
|
149
|
-
return [
|
|
150
|
-
this.aavePool,
|
|
151
|
-
AaveV1Functions.deposit,
|
|
152
|
-
[srcToken, amount, REF_CODE],
|
|
153
|
-
AAVE_LENDING_POOL,
|
|
154
|
-
];
|
|
155
|
-
})();
|
|
156
|
-
const exchangeData = Interface.encodeFunctionData(swapFunction, swapFunctionParams);
|
|
157
|
-
return {
|
|
158
|
-
needWrapNative: this.needWrapNative,
|
|
159
|
-
dexFuncHasRecipient: false,
|
|
160
|
-
exchangeData,
|
|
161
|
-
targetExchange: swapCallee,
|
|
162
|
-
returnAmountPos: undefined,
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
142
|
// This is called once before getTopPoolsForToken is
|
|
166
143
|
// called for multiple tokens. This can be helpful to
|
|
167
144
|
// update common state required for calculating
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aave-v1.js","sourceRoot":"","sources":["../../../src/dex/aave-v1/aave-v1.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA6D;
|
|
1
|
+
{"version":3,"file":"aave-v1.js","sourceRoot":"","sources":["../../../src/dex/aave-v1/aave-v1.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA6D;AAW7D,+CAAoD;AACpD,2EAA6D;AAC7D,uCAAkE;AAIlE,wDAAoD;AACpD,qCAAkD;AAClD,kGAA0E;AAC1E,sEAAyC;AACzC,qCAAsC;AAEtC,MAAM,WAAW,GAAG,GAAG,GAAG,IAAI,CAAC;AAE/B,IAAK,eAGJ;AAHD,WAAK,eAAe;IAClB,sCAAmB,CAAA;IACnB,oCAAiB,CAAA;AACnB,CAAC,EAHI,eAAe,KAAf,eAAe,QAG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E,CAAC;IAC3B,CAAC;IAED,oDAAoD;IACpD,yCAAyC;IACzC,KAAK,CAAC,mBAAmB,CACvB,YAAqB,EACrB,KAAa;QAEb,OAAO,EAAE,CAAC;IACZ,CAAC;;AApLH,wBAqLC;AA9Ke,yBAAkB,GAC9B,IAAA,6BAAqB,EAAC,qBAAY,CAAC,CAAC"}
|
package/build/dex/compound.js
CHANGED
|
@@ -38,7 +38,7 @@ class Compound extends simple_exchange_1.SimpleExchange {
|
|
|
38
38
|
const swapData = (0, utils_1.isETHAddress)(srcToken)
|
|
39
39
|
? this.cethInterface.encodeFunctionData(CompoundFunctions.mint)
|
|
40
40
|
: this.erc20Interface.encodeFunctionData(data.fromCToken ? CompoundFunctions.redeem : CompoundFunctions.mint, [srcAmount]);
|
|
41
|
-
return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, cToken);
|
|
41
|
+
return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, cToken, undefined, undefined, undefined, data.fromCToken);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
exports.Compound = Compound;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compound.js","sourceRoot":"","sources":["../../src/dex/compound.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA6D;AAC7D,4CAAsD;AAGtD,uDAAmD;AACnD,mFAA6C,CAAC,WAAW;AACzD,oCAAwC;AAQxC,IAAK,iBAGJ;AAHD,WAAK,iBAAiB;IACpB,sCAAiB,CAAA;IACjB,kCAAa,CAAA;AACf,CAAC,EAHI,iBAAiB,KAAjB,iBAAiB,QAGrB;AAED,MAAa,QACX,SAAQ,gCAAc;IAMtB,YAAY,SAAqB;QAC/B,KAAK,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QAC7B,IAAI,CAAC,aAAa,GAAG,IAAI,eAAS,CAAC,4BAAsB,CAAC,CAAC;IAC7D,CAAC;IAED,eAAe,CACb,QAAgB,EACh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