@paraswap/dex-lib 4.7.11-native.5 → 4.7.11-native.7
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/build/dex/balancer-v3/balancer-v3-pool.js +2 -2
- package/build/dex/balancer-v3/balancer-v3-pool.js.map +1 -1
- package/build/dex/balancer-v3/getOnChainState.d.ts +2 -1
- package/build/dex/balancer-v3/getOnChainState.js +44 -30
- package/build/dex/balancer-v3/getOnChainState.js.map +1 -1
- package/build/dex/idle-dao/idle-dao.d.ts +1 -0
- package/build/dex/idle-dao/idle-dao.js +23 -11
- package/build/dex/idle-dao/idle-dao.js.map +1 -1
- package/build/dex/maker-psm/maker-psm.d.ts +4 -41
- package/build/dex/maker-psm/maker-psm.js +40 -143
- package/build/dex/maker-psm/maker-psm.js.map +1 -1
- package/build/dex/native/native.d.ts +0 -1
- package/build/dex/native/native.js +0 -8
- package/build/dex/native/native.js.map +1 -1
- package/build/executor/types.d.ts +1 -2
- package/build/executor/types.js +0 -1
- package/build/executor/types.js.map +1 -1
- package/package.json +1 -1
- package/build/abi/PendleRouterStatic.json +0 -19
- package/build/abi/apex-defi/ApexDefiFactory.abi.json +0 -1749
- package/build/abi/apex-defi/ApexDefiRouter.abi.json +0 -1120
- package/build/abi/apex-defi/ApexDefiToken.abi.json +0 -229
- package/build/abi/apex-defi/ApexDefiWrapper.abi.json +0 -92
- package/build/abi/apex-defi/ApexDefiWrapperFactory.abi.json +0 -1107
- package/build/abi/pangolin-v3/PangolinV3StateMulticall.abi.json +0 -796
- package/build/abi/pendle/pendle-deployer.abi.json +0 -520
- package/build/abi/pendle/pendle-oracle.abi.json +0 -413
- package/build/abi/ring-v2/few-wrapped-token.json +0 -587
- package/build/abi/ring-v2/ring-v2-factory.json +0 -125
- package/build/abi/ring-v2/ring-v2-pool.json +0 -461
- package/build/abi/ring-v2/ring-v2-router.json +0 -332
- package/build/abi/stabull/stabull-curve.json +0 -738
- package/build/abi/stabull/stabull-router.json +0 -76
- package/build/abi/uniswap-v4/hooks/SpotDynamicFeeManager.json +0 -26
- package/build/abi/uniswap-v4/hooks/SpotHook.json +0 -54
- package/build/abi/uniswap-v4/hooks/SpotPolicyManager.json +0 -45
- package/build/abi/uniswap-v4/hooks/cabalcoin-hook.abi.json +0 -682
- package/build/abi/uniswap-v4/hooks/fee-hook.abi.json +0 -1335
- package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying-factory.d.ts +0 -29
- package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying-factory.js +0 -153
- package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying-factory.js.map +0 -1
- package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying.d.ts +0 -40
- package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying.js +0 -323
- package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying.js.map +0 -1
- package/build/dex/aave-pt-to-underlying/config.d.ts +0 -3
- package/build/dex/aave-pt-to-underlying/config.js +0 -24
- package/build/dex/aave-pt-to-underlying/config.js.map +0 -1
- package/build/dex/aave-pt-to-underlying/constants.d.ts +0 -2
- package/build/dex/aave-pt-to-underlying/constants.js +0 -6
- package/build/dex/aave-pt-to-underlying/constants.js.map +0 -1
- package/build/dex/aave-pt-to-underlying/types.d.ts +0 -24
- package/build/dex/aave-pt-to-underlying/types.js +0 -3
- package/build/dex/aave-pt-to-underlying/types.js.map +0 -1
- package/build/dex/aave-pt-to-usdc/aave-pt-to-usdc.d.ts +0 -39
- package/build/dex/aave-pt-to-usdc/aave-pt-to-usdc.js +0 -244
- package/build/dex/aave-pt-to-usdc/aave-pt-to-usdc.js.map +0 -1
- package/build/dex/aave-pt-to-usdc/config.d.ts +0 -3
- package/build/dex/aave-pt-to-usdc/config.js +0 -47
- package/build/dex/aave-pt-to-usdc/config.js.map +0 -1
- package/build/dex/aave-pt-to-usdc/constants.d.ts +0 -2
- package/build/dex/aave-pt-to-usdc/constants.js +0 -6
- package/build/dex/aave-pt-to-usdc/constants.js.map +0 -1
- package/build/dex/aave-pt-to-usdc/types.d.ts +0 -22
- package/build/dex/aave-pt-to-usdc/types.js +0 -3
- package/build/dex/aave-pt-to-usdc/types.js.map +0 -1
- package/build/dex/apex-defi/apex-defi-factory.d.ts +0 -26
- package/build/dex/apex-defi/apex-defi-factory.js +0 -53
- package/build/dex/apex-defi/apex-defi-factory.js.map +0 -1
- package/build/dex/apex-defi/apex-defi-pool.d.ts +0 -55
- package/build/dex/apex-defi/apex-defi-pool.js +0 -247
- package/build/dex/apex-defi/apex-defi-pool.js.map +0 -1
- package/build/dex/apex-defi/apex-defi-wrapper-factory.d.ts +0 -57
- package/build/dex/apex-defi/apex-defi-wrapper-factory.js +0 -250
- package/build/dex/apex-defi/apex-defi-wrapper-factory.js.map +0 -1
- package/build/dex/apex-defi/apex-defi.d.ts +0 -97
- package/build/dex/apex-defi/apex-defi.js +0 -1021
- package/build/dex/apex-defi/apex-defi.js.map +0 -1
- package/build/dex/apex-defi/config.d.ts +0 -4
- package/build/dex/apex-defi/config.js +0 -138
- package/build/dex/apex-defi/config.js.map +0 -1
- package/build/dex/apex-defi/types.d.ts +0 -32
- package/build/dex/apex-defi/types.js +0 -3
- package/build/dex/apex-defi/types.js.map +0 -1
- package/build/dex/apex-defi/utils.d.ts +0 -46
- package/build/dex/apex-defi/utils.js +0 -133
- package/build/dex/apex-defi/utils.js.map +0 -1
- package/build/dex/miro-migrator/miro-migrator-state.d.ts +0 -27
- package/build/dex/miro-migrator/miro-migrator-state.js +0 -89
- package/build/dex/miro-migrator/miro-migrator-state.js.map +0 -1
- package/build/dex/stabull/config.d.ts +0 -3
- package/build/dex/stabull/config.js +0 -177
- package/build/dex/stabull/config.js.map +0 -1
- package/build/dex/stabull/stabull-pool.d.ts +0 -46
- package/build/dex/stabull/stabull-pool.js +0 -113
- package/build/dex/stabull/stabull-pool.js.map +0 -1
- package/build/dex/stabull/stabull.d.ts +0 -55
- package/build/dex/stabull/stabull.js +0 -286
- package/build/dex/stabull/stabull.js.map +0 -1
- package/build/dex/stabull/types.d.ts +0 -21
- package/build/dex/stabull/types.js +0 -3
- package/build/dex/stabull/types.js.map +0 -1
- package/build/dex/uniswap-v3/forks/pangolin-v3/utils.d.ts +0 -4
- package/build/dex/uniswap-v3/forks/pangolin-v3/utils.js +0 -56
- package/build/dex/uniswap-v3/forks/pangolin-v3/utils.js.map +0 -1
- package/build/dex/uniswap-v4/hooks/cabalcoin-hook/cabalcoin-hook-pool.d.ts +0 -7
- package/build/dex/uniswap-v4/hooks/cabalcoin-hook/cabalcoin-hook-pool.js +0 -28
- package/build/dex/uniswap-v4/hooks/cabalcoin-hook/cabalcoin-hook-pool.js.map +0 -1
- package/build/dex/uniswap-v4/hooks/cabalcoin-hook/types.d.ts +0 -0
- package/build/dex/uniswap-v4/hooks/cabalcoin-hook/types.js +0 -2
- package/build/dex/uniswap-v4/hooks/cabalcoin-hook/types.js.map +0 -1
- package/build/dex/uniswap-v4/hooks/fee-hook/fee-hook-pool.d.ts +0 -7
- package/build/dex/uniswap-v4/hooks/fee-hook/fee-hook-pool.js +0 -28
- package/build/dex/uniswap-v4/hooks/fee-hook/fee-hook-pool.js.map +0 -1
- package/build/dex/uniswap-v4/hooks/fee-hook/types.d.ts +0 -0
- package/build/dex/uniswap-v4/hooks/fee-hook/types.js +0 -2
- package/build/dex/uniswap-v4/hooks/fee-hook/types.js.map +0 -1
- package/build/dex/uniswap-v4/hooks/index.d.ts +0 -1
- package/build/dex/uniswap-v4/hooks/index.js +0 -9
- package/build/dex/uniswap-v4/hooks/index.js.map +0 -1
- package/build/dex/uniswap-v4/hooks/spot.d.ts +0 -15
- package/build/dex/uniswap-v4/hooks/spot.js +0 -109
- package/build/dex/uniswap-v4/hooks/spot.js.map +0 -1
- package/build/dex/uniswap-v4/hooks/template.d.ts +0 -150
- package/build/dex/uniswap-v4/hooks/template.js +0 -104
- package/build/dex/uniswap-v4/hooks/template.js.map +0 -1
- package/build/dex/usdc-transmuter/usdc-transmuter-pool.d.ts +0 -26
- package/build/dex/usdc-transmuter/usdc-transmuter-pool.js +0 -75
- package/build/dex/usdc-transmuter/usdc-transmuter-pool.js.map +0 -1
- package/build/dex/usual/usual-usdc-usdc.d.ts +0 -17
- package/build/dex/usual/usual-usdc-usdc.js +0 -59
- package/build/dex/usual/usual-usdc-usdc.js.map +0 -1
- package/build/dex/yo/config.d.ts +0 -3
- package/build/dex/yo/config.js +0 -21
- package/build/dex/yo/config.js.map +0 -1
- package/build/dex/yo/types.d.ts +0 -13
- package/build/dex/yo/types.js +0 -3
- package/build/dex/yo/types.js.map +0 -1
- package/build/dex/yo/yo-pool.d.ts +0 -13
- package/build/dex/yo/yo-pool.js +0 -26
- package/build/dex/yo/yo-pool.js.map +0 -1
- package/build/dex/yo/yo.d.ts +0 -39
- package/build/dex/yo/yo.js +0 -248
- package/build/dex/yo/yo.js.map +0 -1
- package/build/implementations/api-paraswap-sdk.d.ts +0 -25
- package/build/implementations/api-paraswap-sdk.js +0 -102
- package/build/implementations/api-paraswap-sdk.js.map +0 -1
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StabullConfig = void 0;
|
|
4
|
-
const constants_1 = require("../../constants");
|
|
5
|
-
exports.StabullConfig = {
|
|
6
|
-
Stabull: {
|
|
7
|
-
[constants_1.Network.MAINNET]: {
|
|
8
|
-
router: '0x871af97122d08890193e8d6465015f6d9e2889b2',
|
|
9
|
-
quoteCurrency: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
10
|
-
pools: {
|
|
11
|
-
'0xe37d763c7c4cdd9a8f085f7db70139a0843529f3': {
|
|
12
|
-
tokens: [
|
|
13
|
-
{
|
|
14
|
-
address: '0xda446fad08277b4d2591536f204e018f32b6831c',
|
|
15
|
-
decimals: 18,
|
|
16
|
-
}, // NZDS
|
|
17
|
-
{
|
|
18
|
-
address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
19
|
-
decimals: 6,
|
|
20
|
-
}, // USDC
|
|
21
|
-
],
|
|
22
|
-
},
|
|
23
|
-
'0x865040f92ac6cca1b9683c03d843799d8e6d1282': {
|
|
24
|
-
tokens: [
|
|
25
|
-
{
|
|
26
|
-
address: '0xdb25f211ab05b1c97d595516f45794528a807ad8',
|
|
27
|
-
decimals: 2,
|
|
28
|
-
}, // EURS
|
|
29
|
-
{
|
|
30
|
-
address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
31
|
-
decimals: 6,
|
|
32
|
-
}, // USDC
|
|
33
|
-
],
|
|
34
|
-
},
|
|
35
|
-
'0xc1a195fdb17da5771d470a232545550a7d264809': {
|
|
36
|
-
tokens: [
|
|
37
|
-
{
|
|
38
|
-
address: '0x2c537e5624e4af88a7ae4060c022609376c8d0eb',
|
|
39
|
-
decimals: 6,
|
|
40
|
-
}, // TRYB
|
|
41
|
-
{
|
|
42
|
-
address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
43
|
-
decimals: 6,
|
|
44
|
-
}, // USDC
|
|
45
|
-
],
|
|
46
|
-
},
|
|
47
|
-
'0x402878106b88b41fad1200b47e998c8effd0d887': {
|
|
48
|
-
tokens: [
|
|
49
|
-
{
|
|
50
|
-
address: '0x86b4dbe5d203e634a12364c0e428fa242a3fba98',
|
|
51
|
-
decimals: 18,
|
|
52
|
-
}, // 1GBP
|
|
53
|
-
{
|
|
54
|
-
address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
55
|
-
decimals: 6,
|
|
56
|
-
}, // USDC
|
|
57
|
-
],
|
|
58
|
-
},
|
|
59
|
-
'0x01e4013c478d7f02112c3cf178f2771c842edbd0': {
|
|
60
|
-
tokens: [
|
|
61
|
-
{
|
|
62
|
-
address: '0xc08512927d12348f6620a698105e1baac6ecd911',
|
|
63
|
-
decimals: 6,
|
|
64
|
-
}, // GYEN
|
|
65
|
-
{
|
|
66
|
-
address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
67
|
-
decimals: 6,
|
|
68
|
-
}, // USDC
|
|
69
|
-
],
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
[constants_1.Network.POLYGON]: {
|
|
74
|
-
router: '0x0c1f53e7b5a770f4c0d4bef139f752eeb08de88d',
|
|
75
|
-
quoteCurrency: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
|
|
76
|
-
pools: {
|
|
77
|
-
'0xdcb7efaca996fe2985138bf31b647efcd1d0901a': {
|
|
78
|
-
tokens: [
|
|
79
|
-
{
|
|
80
|
-
address: '0xfbbe4b730e1e77d02dc40fedf9438e2802eab3b5',
|
|
81
|
-
decimals: 18,
|
|
82
|
-
}, // NZDS
|
|
83
|
-
{
|
|
84
|
-
address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
|
|
85
|
-
decimals: 6,
|
|
86
|
-
}, // USDC
|
|
87
|
-
],
|
|
88
|
-
},
|
|
89
|
-
'0xf80b3a8977d34a443a836a380b2fce69a1a4e819': {
|
|
90
|
-
tokens: [
|
|
91
|
-
{
|
|
92
|
-
address: '0xe111178a87a3bff0c8d18decba5798827539ae99',
|
|
93
|
-
decimals: 2,
|
|
94
|
-
}, // EURS
|
|
95
|
-
{
|
|
96
|
-
address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
|
|
97
|
-
decimals: 6,
|
|
98
|
-
}, // USDC
|
|
99
|
-
],
|
|
100
|
-
},
|
|
101
|
-
'0x55bdf7f0223e8b1d509141a8d852dd86b3553d59': {
|
|
102
|
-
tokens: [
|
|
103
|
-
{
|
|
104
|
-
address: '0x4fb71290ac171e1d144f7221d882becac7196eb5',
|
|
105
|
-
decimals: 6,
|
|
106
|
-
}, // TRYB
|
|
107
|
-
{
|
|
108
|
-
address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
|
|
109
|
-
decimals: 6,
|
|
110
|
-
}, // USDC
|
|
111
|
-
],
|
|
112
|
-
},
|
|
113
|
-
'0x509aacb7746166252ecb0d62bfba097cc9731e20': {
|
|
114
|
-
tokens: [
|
|
115
|
-
{
|
|
116
|
-
address: '0xdc3326e71d45186f113a2f448984ca0e8d201995',
|
|
117
|
-
decimals: 6,
|
|
118
|
-
}, // XSGD
|
|
119
|
-
{
|
|
120
|
-
address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
|
|
121
|
-
decimals: 6,
|
|
122
|
-
}, // USDC
|
|
123
|
-
],
|
|
124
|
-
},
|
|
125
|
-
'0xce0abd182d2cf5844f2a0cb52cfcc55d4ff4fcba': {
|
|
126
|
-
tokens: [
|
|
127
|
-
{
|
|
128
|
-
address: '0x4ed141110f6eeeaba9a1df36d8c26f684d2475dc',
|
|
129
|
-
decimals: 4,
|
|
130
|
-
}, // BRZ
|
|
131
|
-
{
|
|
132
|
-
address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
|
|
133
|
-
decimals: 6,
|
|
134
|
-
}, // USDC
|
|
135
|
-
],
|
|
136
|
-
},
|
|
137
|
-
'0x3d4436ba3ae7e0e6361c83ab940ea779cd598206': {
|
|
138
|
-
tokens: [
|
|
139
|
-
{
|
|
140
|
-
address: '0xc2132d05d31c914a87c6611c10748aeb04b58e8f',
|
|
141
|
-
decimals: 6,
|
|
142
|
-
}, // USDT
|
|
143
|
-
{
|
|
144
|
-
address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
|
|
145
|
-
decimals: 6,
|
|
146
|
-
}, // USDC
|
|
147
|
-
],
|
|
148
|
-
},
|
|
149
|
-
'0xa52508b1822ca9261b33213b233694f846abd0ed': {
|
|
150
|
-
tokens: [
|
|
151
|
-
{
|
|
152
|
-
address: '0x8f3cf7ad23cd3cadbd9735aff958023239c6a063',
|
|
153
|
-
decimals: 18,
|
|
154
|
-
}, // DAI
|
|
155
|
-
{
|
|
156
|
-
address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
|
|
157
|
-
decimals: 6,
|
|
158
|
-
}, // USDC
|
|
159
|
-
],
|
|
160
|
-
},
|
|
161
|
-
'0x1233003461f654cf1c0d7db19e753badef05a87f': {
|
|
162
|
-
tokens: [
|
|
163
|
-
{
|
|
164
|
-
address: '0x87a25dc121db52369f4a9971f664ae5e372cf69a',
|
|
165
|
-
decimals: 6,
|
|
166
|
-
}, // PHPC
|
|
167
|
-
{
|
|
168
|
-
address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
|
|
169
|
-
decimals: 6,
|
|
170
|
-
}, // USDC
|
|
171
|
-
],
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
};
|
|
177
|
-
//# sourceMappingURL=config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/dex/stabull/config.ts"],"names":[],"mappings":";;;AAEA,+CAA0C;AAE7B,QAAA,aAAa,GAA4B;IACpD,OAAO,EAAE;QACP,CAAC,mBAAO,CAAC,OAAO,CAAC,EAAE;YACjB,MAAM,EAAE,4CAA4C;YACpD,aAAa,EAAE,4CAA4C;YAC3D,KAAK,EAAE;gBACL,4CAA4C,EAAE;oBAC5C,MAAM,EAAE;wBACN;4BACE,OAAO,EAAE,4CAA4C;4BACrD,QAAQ,EAAE,EAAE;yBACb,EAAE,OAAO;wBACV;4BACE,OAAO,EAAE,4CAA4C;4BACrD,QAAQ,EAAE,CAAC;yBACZ,EAAE,OAAO;qBACX;iBACF;gBACD,4CAA4C,EAAE;oBAC5C,MAAM,EAAE;wBACN;4BACE,OAAO,EAAE,4CAA4C;4BACrD,QAAQ,EAAE,CAAC;yBACZ,EAAE,OAAO;wBACV;4BACE,OAAO,EAAE,4CAA4C;4BACrD,QAAQ,EAAE,CAAC;yBACZ,EAAE,OAAO;qBACX;iBACF;gBACD,4CAA4C,EAAE;oBAC5C,MAAM,EAAE;wBACN;4BACE,OA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2
|
-
import { Log, Logger } from '../../types';
|
|
3
|
-
import { StatefulEventSubscriber } from '../../stateful-event-subscriber';
|
|
4
|
-
import { IDexHelper } from '../../dex-helper/idex-helper';
|
|
5
|
-
import { PoolState } from './types';
|
|
6
|
-
export declare class StabullEventPool extends StatefulEventSubscriber<PoolState> {
|
|
7
|
-
readonly parentName: string;
|
|
8
|
-
protected network: number;
|
|
9
|
-
protected dexHelper: IDexHelper;
|
|
10
|
-
readonly poolAddress: string;
|
|
11
|
-
protected addressesSubscribed_: string[];
|
|
12
|
-
handlers: {
|
|
13
|
-
[event: string]: (event: any, state: DeepReadonly<PoolState>, log: Readonly<Log>) => DeepReadonly<PoolState> | null;
|
|
14
|
-
};
|
|
15
|
-
logDecoder: (log: Log) => any;
|
|
16
|
-
constructor(parentName: string, network: number, dexHelper: IDexHelper, poolAddress: string, addressesSubscribed_: string[], logger: Logger);
|
|
17
|
-
/**
|
|
18
|
-
* The function is called every time any of the subscribed
|
|
19
|
-
* addresses release log. The function accepts the current
|
|
20
|
-
* state, updates the state according to the log, and returns
|
|
21
|
-
* the updated state.
|
|
22
|
-
* @param state - Current state of event subscriber
|
|
23
|
-
* @param log - Log released by one of the subscribed addresses
|
|
24
|
-
* @returns Updates state of the event subscriber after the log
|
|
25
|
-
*/
|
|
26
|
-
protected processLog(state: DeepReadonly<PoolState>, log: Readonly<Log>): DeepReadonly<PoolState> | null;
|
|
27
|
-
/**
|
|
28
|
-
* The function generates state using on-chain calls. This
|
|
29
|
-
* function is called to regenerate state if the event based
|
|
30
|
-
* system fails to fetch events and the local state is no
|
|
31
|
-
* more correct.
|
|
32
|
-
* @param blockNumber - Blocknumber for which the state should
|
|
33
|
-
* should be generated
|
|
34
|
-
* @returns state of the event subscriber at blocknumber
|
|
35
|
-
*/
|
|
36
|
-
generateState(blockNumber: number): Promise<DeepReadonly<PoolState>>;
|
|
37
|
-
/**
|
|
38
|
-
* Handles a transfer event and updates the pool state accordingly.
|
|
39
|
-
*
|
|
40
|
-
* @param event - The transfer event object containing details about the transfer.
|
|
41
|
-
* @param state - The current state of the pool.
|
|
42
|
-
* @param log - The log object containing additional information about the event.
|
|
43
|
-
* @returns The updated pool state if the transfer involves the pool, otherwise null.
|
|
44
|
-
*/
|
|
45
|
-
handleTransfer(event: any, state: DeepReadonly<PoolState>, log: Readonly<Log>): DeepReadonly<PoolState> | null;
|
|
46
|
-
}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StabullEventPool = void 0;
|
|
4
|
-
const utils_1 = require("../../utils");
|
|
5
|
-
const stateful_event_subscriber_1 = require("../../stateful-event-subscriber");
|
|
6
|
-
const utils_2 = require("../../lib/tokens/utils");
|
|
7
|
-
const decoders_1 = require("../../lib/decoders");
|
|
8
|
-
class StabullEventPool extends stateful_event_subscriber_1.StatefulEventSubscriber {
|
|
9
|
-
parentName;
|
|
10
|
-
network;
|
|
11
|
-
dexHelper;
|
|
12
|
-
poolAddress;
|
|
13
|
-
addressesSubscribed_;
|
|
14
|
-
handlers = {};
|
|
15
|
-
logDecoder;
|
|
16
|
-
constructor(parentName, network, dexHelper, poolAddress, addressesSubscribed_, logger) {
|
|
17
|
-
super(parentName, poolAddress.toLowerCase(), dexHelper, logger);
|
|
18
|
-
this.parentName = parentName;
|
|
19
|
-
this.network = network;
|
|
20
|
-
this.dexHelper = dexHelper;
|
|
21
|
-
this.poolAddress = poolAddress;
|
|
22
|
-
this.addressesSubscribed_ = addressesSubscribed_;
|
|
23
|
-
this.logDecoder = (log) => utils_2.erc20Iface.parseLog(log);
|
|
24
|
-
this.addressesSubscribed = addressesSubscribed_;
|
|
25
|
-
this.poolAddress = poolAddress.toLowerCase();
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* The function is called every time any of the subscribed
|
|
29
|
-
* addresses release log. The function accepts the current
|
|
30
|
-
* state, updates the state according to the log, and returns
|
|
31
|
-
* the updated state.
|
|
32
|
-
* @param state - Current state of event subscriber
|
|
33
|
-
* @param log - Log released by one of the subscribed addresses
|
|
34
|
-
* @returns Updates state of the event subscriber after the log
|
|
35
|
-
*/
|
|
36
|
-
processLog(state, log) {
|
|
37
|
-
try {
|
|
38
|
-
const event = this.logDecoder(log);
|
|
39
|
-
if (event.name in this.handlers) {
|
|
40
|
-
return this.handlers[event.name](event, state, log);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
catch (e) {
|
|
44
|
-
(0, utils_1.catchParseLogError)(e, this.logger);
|
|
45
|
-
}
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* The function generates state using on-chain calls. This
|
|
50
|
-
* function is called to regenerate state if the event based
|
|
51
|
-
* system fails to fetch events and the local state is no
|
|
52
|
-
* more correct.
|
|
53
|
-
* @param blockNumber - Blocknumber for which the state should
|
|
54
|
-
* should be generated
|
|
55
|
-
* @returns state of the event subscriber at blocknumber
|
|
56
|
-
*/
|
|
57
|
-
async generateState(blockNumber) {
|
|
58
|
-
let calldata = [
|
|
59
|
-
{
|
|
60
|
-
target: this.addressesSubscribed[0],
|
|
61
|
-
callData: utils_2.erc20Iface.encodeFunctionData('balanceOf', [
|
|
62
|
-
this.poolAddress,
|
|
63
|
-
]),
|
|
64
|
-
decodeFunction: decoders_1.uint256ToBigInt,
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
target: this.addressesSubscribed[1],
|
|
68
|
-
callData: utils_2.erc20Iface.encodeFunctionData('balanceOf', [
|
|
69
|
-
this.poolAddress,
|
|
70
|
-
]),
|
|
71
|
-
decodeFunction: decoders_1.uint256ToBigInt,
|
|
72
|
-
},
|
|
73
|
-
];
|
|
74
|
-
const data = await this.dexHelper.multiWrapper.tryAggregate(true, calldata, blockNumber);
|
|
75
|
-
return {
|
|
76
|
-
reserves0: data[0].success ? data[0].returnData : 0n,
|
|
77
|
-
reserves1: data[1].success ? data[1].returnData : 0n,
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Handles a transfer event and updates the pool state accordingly.
|
|
82
|
-
*
|
|
83
|
-
* @param event - The transfer event object containing details about the transfer.
|
|
84
|
-
* @param state - The current state of the pool.
|
|
85
|
-
* @param log - The log object containing additional information about the event.
|
|
86
|
-
* @returns The updated pool state if the transfer involves the pool, otherwise null.
|
|
87
|
-
*/
|
|
88
|
-
handleTransfer(event, state, log) {
|
|
89
|
-
const from = event.args.from.toLowerCase();
|
|
90
|
-
const to = event.args.to.toLowerCase();
|
|
91
|
-
// Check if pool is involved in the transfer
|
|
92
|
-
if (from !== this.poolAddress && to !== this.poolAddress) {
|
|
93
|
-
return null;
|
|
94
|
-
}
|
|
95
|
-
// Determine which token this is
|
|
96
|
-
const eventTokenAddress = log.address.toLowerCase();
|
|
97
|
-
const isToken0 = eventTokenAddress === this.addressesSubscribed[0].toLowerCase();
|
|
98
|
-
const value = event.args.value.toBigInt();
|
|
99
|
-
const reserveKey = isToken0 ? 'reserves0' : 'reserves1';
|
|
100
|
-
const currentReserve = state[reserveKey];
|
|
101
|
-
// Pool is sending tokens (decrease) or receiving tokens (increase)
|
|
102
|
-
const isFromPool = from === this.poolAddress;
|
|
103
|
-
const newReserve = isFromPool
|
|
104
|
-
? currentReserve - value
|
|
105
|
-
: currentReserve + value;
|
|
106
|
-
return {
|
|
107
|
-
...state,
|
|
108
|
-
[reserveKey]: newReserve,
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
exports.StabullEventPool = StabullEventPool;
|
|
113
|
-
//# sourceMappingURL=stabull-pool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stabull-pool.js","sourceRoot":"","sources":["../../../src/dex/stabull/stabull-pool.ts"],"names":[],"mappings":";;;AAEA,uCAAiD;AACjD,+EAA0E;AAG1E,kDAAoD;AACpD,iDAAqD;AAErD,MAAa,gBAAiB,SAAQ,mDAAkC;IAY3D;IACC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AAM,QAAQ,GACZ,iBAAiB,KAAK,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QAElE,MAAM,KAAK,GAAW,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;QAClD,MAAM,UAAU,GAAG,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC;QACxD,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC;QAEzC,mEAAmE;QACnE,MAAM,UAAU,GAAG,IAAI,KAAK,IAAI,CAAC,WAAW,CAAC;QAC7C,MAAM,UAAU,GAAG,UAAU;YAC3B,CAAC,CAAC,cAAc,GAAG,KAAK;YACxB,CAAC,CAAC,cAAc,GAAG,KAAK,CAAC;QAE3B,OAAO;YACL,GAAG,KAAK;YACR,CAAC,UAAU,CAAC,EAAE,UAAU;SACzB,CAAC;IACJ,CAAC;CACF;AAnID,4CAmIC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { Token, Address, ExchangePrices, PoolPrices, AdapterExchangeParam, PoolLiquidity, Logger, DexExchangeParam } from '../../types';
|
|
2
|
-
import { SwapSide, Network } from '../../constants';
|
|
3
|
-
import { IDex } from '../../dex/idex';
|
|
4
|
-
import { IDexHelper } from '../../dex-helper/idex-helper';
|
|
5
|
-
import { StabullData } from './types';
|
|
6
|
-
import { SimpleExchange } from '../simple-exchange';
|
|
7
|
-
import { ethers } from 'ethers';
|
|
8
|
-
export declare class Stabull extends SimpleExchange implements IDex<StabullData> {
|
|
9
|
-
readonly network: Network;
|
|
10
|
-
readonly dexKey: string;
|
|
11
|
-
readonly dexHelper: IDexHelper;
|
|
12
|
-
protected poolIface: ethers.utils.Interface;
|
|
13
|
-
protected routerIface: ethers.utils.Interface;
|
|
14
|
-
protected routerAddress: string;
|
|
15
|
-
protected quoteCurrency: string;
|
|
16
|
-
private pools;
|
|
17
|
-
private poolsConfig;
|
|
18
|
-
readonly hasConstantPriceLargeAmounts = false;
|
|
19
|
-
readonly needWrapNative = true;
|
|
20
|
-
readonly isFeeOnTransferSupported = false;
|
|
21
|
-
static dexKeysWithNetwork: {
|
|
22
|
-
key: string;
|
|
23
|
-
networks: Network[];
|
|
24
|
-
}[];
|
|
25
|
-
logger: Logger;
|
|
26
|
-
constructor(network: Network, dexKey: string, dexHelper: IDexHelper, poolIface?: ethers.utils.Interface, routerIface?: ethers.utils.Interface, routerAddress?: string, quoteCurrency?: string);
|
|
27
|
-
getAdapters(side: SwapSide): {
|
|
28
|
-
name: string;
|
|
29
|
-
index: number;
|
|
30
|
-
}[] | null;
|
|
31
|
-
getPoolIdentifiers(srcToken: Token, destToken: Token, side: SwapSide, blockNumber: number): Promise<string[]>;
|
|
32
|
-
getPricesVolume(srcToken: Token, destToken: Token, amounts: bigint[], side: SwapSide, blockNumber: number, limitPools?: string[]): Promise<null | ExchangePrices<StabullData>>;
|
|
33
|
-
getCalldataGasCost(poolPrices: PoolPrices<StabullData>): number | number[];
|
|
34
|
-
getAdapterParam: (srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: StabullData, side: SwapSide) => AdapterExchangeParam;
|
|
35
|
-
updatePoolState(): Promise<void>;
|
|
36
|
-
getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
|
|
37
|
-
/**
|
|
38
|
-
* Retrieves the decentralized exchange (DEX) parameters for a swap operation.
|
|
39
|
-
*
|
|
40
|
-
* @param srcToken - The address of the source token.
|
|
41
|
-
* @param destToken - The address of the destination token.
|
|
42
|
-
* @param srcAmount - The amount of the source token to swap.
|
|
43
|
-
* @param destAmount - The desired amount of the destination token.
|
|
44
|
-
* @param recipient - The address of the recipient.
|
|
45
|
-
* @param data - Additional data required for the swap.
|
|
46
|
-
* @param side - The side of the swap (SELL or BUY).
|
|
47
|
-
* @param options - Options for global tokens.
|
|
48
|
-
* @param executorAddress - The address of the executor.
|
|
49
|
-
* @returns A promise that resolves to the DEX exchange parameters.
|
|
50
|
-
*/
|
|
51
|
-
getDexParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, recipient: string, data: StabullData, side: SwapSide, options: {
|
|
52
|
-
isGlobalSrcToken: boolean;
|
|
53
|
-
isGlobalDestToken: boolean;
|
|
54
|
-
}, executorAddress: string): Promise<DexExchangeParam>;
|
|
55
|
-
}
|