@paraswap/dex-lib 2.16.3-rfq-direct.0 → 2.16.3
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/abi/DirectSwap.json +970 -0
- package/build/config.js +2 -2
- package/build/dex/aave-v3/tokens/arbitrum.json +20 -20
- package/build/dex/aave-v3/tokens/avalanche.json +44 -20
- package/build/dex/aave-v3/tokens/fantom.json +30 -30
- package/build/dex/aave-v3/tokens/optimism.json +18 -18
- package/build/dex/aave-v3/tokens/polygon.json +60 -42
- package/build/dex/generic-rfq/generic-rfq.d.ts +4 -8
- package/build/dex/generic-rfq/generic-rfq.js +0 -39
- package/build/dex/generic-rfq/generic-rfq.js.map +1 -1
- package/build/dex/generic-rfq/types.d.ts +1 -17
- package/build/dex/generic-rfq/types.js +1 -6
- package/build/dex/generic-rfq/types.js.map +1 -1
- package/build/dex/index.js +3 -1
- package/build/dex/index.js.map +1 -1
- package/build/dex/maverick-v1/config.js +1 -1
- package/build/dex/maverick-v1/config.js.map +1 -1
- package/build/dex/paraswap-limit-orders/types.d.ts +6 -7
- package/build/dex/quickswap/config.js +8 -0
- package/build/dex/quickswap/config.js.map +1 -1
- package/build/dex/quickswap/spiritswap-v3.d.ts +6 -0
- package/build/dex/quickswap/spiritswap-v3.js +19 -0
- package/build/dex/quickswap/spiritswap-v3.js.map +1 -0
- package/build/dex/{test-aave-v3 → test-dex}/config.d.ts +1 -1
- package/build/dex/{test-aave-v3 → test-dex}/config.js +3 -3
- package/build/dex/test-dex/config.js.map +1 -0
- package/build/dex/{test-aave-v3/test-aave-v3-pool.d.ts → test-dex/test-dex-pool.d.ts} +3 -3
- package/build/dex/{test-aave-v3/test-aave-v3-pool.js → test-dex/test-dex-pool.js} +7 -7
- package/build/dex/test-dex/test-dex-pool.js.map +1 -0
- package/build/dex/{test-aave-v3/test-aave-v3.d.ts → test-dex/test-dex.d.ts} +8 -8
- package/build/dex/{test-aave-v3/test-aave-v3.js → test-dex/test-dex.js} +7 -7
- package/build/dex/test-dex/test-dex.js.map +1 -0
- package/build/dex/{test-aave-v3 → test-dex}/types.d.ts +1 -1
- package/build/dex/{test-aave-v3 → test-dex}/types.js.map +1 -1
- package/build/dex/uniswap-v3/config.js +4 -0
- package/build/dex/uniswap-v3/config.js.map +1 -1
- package/build/dex/woo-fi-v2/woo-fi-math.d.ts +16 -0
- package/build/dex/woo-fi-v2/woo-fi-math.js +137 -0
- package/build/dex/woo-fi-v2/woo-fi-math.js.map +1 -0
- package/package.json +3 -3
- package/src/config.ts +2 -2
- package/src/dex/generic-rfq/generic-rfq.ts +2 -70
- package/src/dex/generic-rfq/types.ts +1 -26
- package/src/dex/index.ts +3 -1
- package/src/dex/maverick-v1/config.ts +1 -1
- package/src/dex/paraswap-limit-orders/types.ts +9 -11
- package/src/dex/quickswap/config.ts +9 -0
- package/src/dex/quickswap/quickswap-e2e.test.ts +94 -0
- package/src/dex/quickswap/spiritswap-v3.ts +19 -0
- package/src/dex/uniswap-v3/config.ts +4 -0
- package/tests/constants-e2e.ts +2 -2
- package/tests/utils-e2e.ts +2 -2
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/misc.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/.vscode/launch.json +0 -21
- package/build/abi/AugustusRFQRouter.abi.json +0 -1248
- package/build/dex/aave-v3/tokens/mainnet.json +0 -44
- package/build/dex/balancer-v2/VirtualBoostedPool.d.ts +0 -79
- package/build/dex/balancer-v2/VirtualBoostedPool.js +0 -382
- package/build/dex/balancer-v2/VirtualBoostedPool.js.map +0 -1
- package/build/dex/test-aave-v3/config.js.map +0 -1
- package/build/dex/test-aave-v3/test-aave-v3-pool.js.map +0 -1
- package/build/dex/test-aave-v3/test-aave-v3.js.map +0 -1
- package/compare-quotes.ts +0 -12
- package/fetch-rfq-quotes.ts +0 -148
- package/src/abi/AugustusRFQRouter.abi.json +0 -1248
- /package/build/dex/{test-aave-v3 → test-dex}/types.js +0 -0
package/fetch-rfq-quotes.ts
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { genericRFQAuthHttp } from './src/dex/generic-rfq/security';
|
|
2
|
-
import { Fetcher } from './src/lib/fetcher/fetcher';
|
|
3
|
-
import { RFQConfig, RatesResponse } from './src/dex/generic-rfq/types';
|
|
4
|
-
import { validateAndCast } from './src/lib/validators';
|
|
5
|
-
import { pricesResponse } from './src/dex/generic-rfq/validators';
|
|
6
|
-
import { DummyRequestWrapper } from './src/dex-helper/dummy-dex-helper';
|
|
7
|
-
import fs from 'fs';
|
|
8
|
-
|
|
9
|
-
var log4js = require("log4js");
|
|
10
|
-
var logger = log4js.getLogger();
|
|
11
|
-
|
|
12
|
-
const GENERIC_RFQ_URL = 'http://proxy.staging.paraswap.io/knreserve/1';
|
|
13
|
-
const GENERIC_RFQ_ACCESS_KEY = 'LE2FofwCKRKujSgcjf4kPgQkb7fn6vTiJtAY9EjC';
|
|
14
|
-
const GENERIC_RFQ_SECRET_KEY = 'VVRLa0tjRVVEUXBUQ3dwM2dSZll3OEVGYnRuZk01ampudjVTQmtvaA==';
|
|
15
|
-
const GENERIC_RFQ_MAKER_ADDRESS = '0x807cf9a772d5a3f9cefbc1192e939d62f0d9bd38';
|
|
16
|
-
const GENERIC_RFQ_PATH_TO_OVERRIDE = 'knreserve/1';
|
|
17
|
-
|
|
18
|
-
const pathToRemove = GENERIC_RFQ_PATH_TO_OVERRIDE;
|
|
19
|
-
const authHttp = genericRFQAuthHttp(pathToRemove);
|
|
20
|
-
|
|
21
|
-
const buildConfigForGenericRFQ = (): RFQConfig => {
|
|
22
|
-
const url = GENERIC_RFQ_URL;
|
|
23
|
-
|
|
24
|
-
const secret = {
|
|
25
|
-
secretKey: Buffer.from(GENERIC_RFQ_SECRET_KEY, 'base64').toString(
|
|
26
|
-
'binary',
|
|
27
|
-
),
|
|
28
|
-
accessKey: GENERIC_RFQ_ACCESS_KEY,
|
|
29
|
-
domain: 'paraswap',
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const pathToRemove = GENERIC_RFQ_PATH_TO_OVERRIDE;
|
|
33
|
-
|
|
34
|
-
return {
|
|
35
|
-
maker: GENERIC_RFQ_MAKER_ADDRESS,
|
|
36
|
-
tokensConfig: {
|
|
37
|
-
reqParams: {
|
|
38
|
-
url: `${url}/tokens`,
|
|
39
|
-
method: 'GET',
|
|
40
|
-
},
|
|
41
|
-
secret,
|
|
42
|
-
intervalMs: 1000 * 60 * 60 * 10, // every 10 minutes
|
|
43
|
-
dataTTLS: 1000 * 60 * 60 * 11, // ttl 11 minutes
|
|
44
|
-
},
|
|
45
|
-
pairsConfig: {
|
|
46
|
-
reqParams: {
|
|
47
|
-
url: `${url}/pairs`,
|
|
48
|
-
method: 'GET',
|
|
49
|
-
},
|
|
50
|
-
secret,
|
|
51
|
-
intervalMs: 1000 * 60 * 60 * 10, // every 10 minutes
|
|
52
|
-
dataTTLS: 1000 * 60 * 60 * 11, // ttl 11 minutes
|
|
53
|
-
},
|
|
54
|
-
rateConfig: {
|
|
55
|
-
reqParams: {
|
|
56
|
-
url: `${url}/prices`,
|
|
57
|
-
method: 'GET',
|
|
58
|
-
},
|
|
59
|
-
secret,
|
|
60
|
-
intervalMs: 1000 * 60 * 60 * 1, // every 1 minute
|
|
61
|
-
dataTTLS: 1000 * 60 * 60 * 1, // ttl 1 minute
|
|
62
|
-
},
|
|
63
|
-
firmRateConfig: {
|
|
64
|
-
url: `${url}/firm`,
|
|
65
|
-
method: 'POST',
|
|
66
|
-
secret,
|
|
67
|
-
},
|
|
68
|
-
blacklistConfig: {
|
|
69
|
-
reqParams: {
|
|
70
|
-
url: `${url}/blacklist`,
|
|
71
|
-
method: 'GET',
|
|
72
|
-
},
|
|
73
|
-
secret,
|
|
74
|
-
intervalMs: 1000 * 60 * 60 * 10,
|
|
75
|
-
dataTTLS: 1000 * 60 * 60 * 11,
|
|
76
|
-
},
|
|
77
|
-
pathToRemove,
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
const config = buildConfigForGenericRFQ();
|
|
82
|
-
|
|
83
|
-
export default async (): Promise<string> => {
|
|
84
|
-
return new Promise((resolve, reject) => {
|
|
85
|
-
|
|
86
|
-
const handleRatesResponse = (resp: RatesResponse) => {
|
|
87
|
-
// console.log('resp.prices', resp.prices);
|
|
88
|
-
// console.log(JSON.stringify(resp.prices['UNI/USDT'].asks));
|
|
89
|
-
fs.writeFileSync(
|
|
90
|
-
'/Users/tudor/Documents/paraswap/augustus-rfq/findings/WETHUSDT-rfq-asks-response.txt',
|
|
91
|
-
JSON.stringify(resp.prices['WETH/USDT'].asks),
|
|
92
|
-
{encoding:'utf8',flag:'w'}
|
|
93
|
-
);
|
|
94
|
-
resolve(JSON.stringify(resp.prices['WETH/USDT'].asks));
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
const httpRequest = new DummyRequestWrapper();
|
|
98
|
-
const rateFetcher = new Fetcher<RatesResponse>(
|
|
99
|
-
httpRequest,
|
|
100
|
-
{
|
|
101
|
-
info: {
|
|
102
|
-
requestOptions: config.rateConfig.reqParams,
|
|
103
|
-
caster: (data: unknown) => {
|
|
104
|
-
return validateAndCast<RatesResponse>(data, pricesResponse);
|
|
105
|
-
},
|
|
106
|
-
authenticate: authHttp(config.rateConfig.secret),
|
|
107
|
-
},
|
|
108
|
-
handler: handleRatesResponse,
|
|
109
|
-
},
|
|
110
|
-
config.rateConfig.intervalMs,
|
|
111
|
-
logger,
|
|
112
|
-
);
|
|
113
|
-
|
|
114
|
-
rateFetcher.fetch(true);
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// import fs from 'fs';
|
|
119
|
-
|
|
120
|
-
// const handleRatesResponse = (resp: RatesResponse) => {
|
|
121
|
-
// console.log('[handleRatesResponse]');
|
|
122
|
-
// console.log(JSON.stringify(resp.prices['WETH/USDT'].bids));
|
|
123
|
-
// fs.writeFileSync(
|
|
124
|
-
// '/Users/tudor/Documents/paraswap/augustus-rfq/rfq-quotes.txt',
|
|
125
|
-
// JSON.stringify(resp.prices['WETH/USDT'].bids),
|
|
126
|
-
// {encoding:'utf8',flag:'w'}
|
|
127
|
-
// );
|
|
128
|
-
// };
|
|
129
|
-
|
|
130
|
-
// const httpRequest = new DummyRequestWrapper();
|
|
131
|
-
// const rateFetcher = new Fetcher<RatesResponse>(
|
|
132
|
-
// httpRequest,
|
|
133
|
-
// {
|
|
134
|
-
// info: {
|
|
135
|
-
// requestOptions: config.rateConfig.reqParams,
|
|
136
|
-
// caster: (data: unknown) => {
|
|
137
|
-
// return validateAndCast<RatesResponse>(data, pricesResponse);
|
|
138
|
-
// },
|
|
139
|
-
// authenticate: authHttp(config.rateConfig.secret),
|
|
140
|
-
// },
|
|
141
|
-
// handler: handleRatesResponse,
|
|
142
|
-
// },
|
|
143
|
-
// config.rateConfig.intervalMs,
|
|
144
|
-
// logger,
|
|
145
|
-
// );
|
|
146
|
-
|
|
147
|
-
// rateFetcher.fetch(true);
|
|
148
|
-
// console.log('hello');
|