@paraswap/dex-lib 2.33.4-balancer-v2-multihop.2 → 2.33.4-base-support.0
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/config.js +26 -0
- package/build/config.js.map +1 -1
- package/build/constants.d.ts +2 -1
- package/build/constants.js +2 -1
- package/build/constants.js.map +1 -1
- package/build/dex/balancer-v2/optimizer.d.ts +0 -1
- package/build/dex/balancer-v2/optimizer.js +21 -29
- package/build/dex/balancer-v2/optimizer.js.map +1 -1
- package/build/dex/pancakeswap-v3/types.d.ts +137 -0
- package/build/dex/pancakeswap-v3/types.js +9 -0
- package/build/dex/pancakeswap-v3/types.js.map +1 -0
- package/build/dex/uniswap-v3/config.js +12 -0
- package/build/dex/uniswap-v3/config.js.map +1 -1
- package/build/dex/weth/config.js +3 -0
- package/build/dex/weth/config.js.map +1 -1
- package/build/web3-provider.d.ts +3 -0
- package/build/web3-provider.js +13 -0
- package/build/web3-provider.js.map +1 -0
- package/package.json +1 -1
- package/src/config.ts +29 -0
- package/src/constants.ts +2 -1
- package/src/dex/balancer-v2/optimizer.ts +23 -38
- package/src/dex/uniswap-v3/config.ts +13 -0
- package/src/dex/weth/config.ts +3 -0
- package/build/abi/algebra/AlgebraFactory-v1_1.abi.json +0 -250
- package/build/abi/api3-proxy.json +0 -46
- package/build/abi/api3-server-v1.json +0 -463
- package/build/abi/quick-perps/fast-price-events.json +0 -70
- package/build/abi/quick-perps/fast-price-feed.json +0 -741
- package/build/abi/quick-perps/reader.json +0 -313
- package/build/abi/quick-perps/vault-price-feed.json +0 -323
- package/build/abi/quick-perps/vault.json +0 -1953
- package/build/abi/quickPerps/fast-price-events.json +0 -70
- package/build/abi/quickPerps/fast-price-feed.json +0 -748
- package/build/abi/quickPerps/reader.json +0 -313
- package/build/abi/quickPerps/vault-price-feed.json +0 -477
- package/build/abi/quickPerps/vault.json +0 -1953
- package/build/abi/woo-fi/WooFeeManager.abi.json +0 -318
- package/build/abi/woo-fi/WooPP.abi.json +0 -548
- package/build/abi/woo-fi/Wooracle.abi.json +0 -260
- package/build/dex/aave-v3/tokens/arbitrum.json +0 -50
- package/build/dex/aave-v3/tokens/avalanche.json +0 -74
- package/build/dex/aave-v3/tokens/fantom.json +0 -62
- package/build/dex/aave-v3/tokens/optimism.json +0 -50
- package/build/dex/aave-v3/tokens/polygon.json +0 -116
- package/build/dex/quick-perps/config.d.ts +0 -11
- package/build/dex/quick-perps/config.js +0 -27
- package/build/dex/quick-perps/config.js.map +0 -1
- package/build/dex/quick-perps/fast-price-feed.d.ts +0 -26
- package/build/dex/quick-perps/fast-price-feed.js +0 -176
- package/build/dex/quick-perps/fast-price-feed.js.map +0 -1
- package/build/dex/quick-perps/pool.d.ts +0 -21
- package/build/dex/quick-perps/pool.js +0 -210
- package/build/dex/quick-perps/pool.js.map +0 -1
- package/build/dex/quick-perps/quick-perps.d.ts +0 -52
- package/build/dex/quick-perps/quick-perps.js +0 -205
- package/build/dex/quick-perps/quick-perps.js.map +0 -1
- package/build/dex/quick-perps/types.d.ts +0 -98
- package/build/dex/quick-perps/types.js +0 -3
- package/build/dex/quick-perps/types.js.map +0 -1
- package/build/dex/quick-perps/usdq.d.ts +0 -15
- package/build/dex/quick-perps/usdq.js +0 -61
- package/build/dex/quick-perps/usdq.js.map +0 -1
- package/build/dex/quick-perps/vault-price-feed.d.ts +0 -43
- package/build/dex/quick-perps/vault-price-feed.js +0 -194
- package/build/dex/quick-perps/vault-price-feed.js.map +0 -1
- package/build/dex/quick-perps/vault-utils.d.ts +0 -8
- package/build/dex/quick-perps/vault-utils.js +0 -41
- package/build/dex/quick-perps/vault-utils.js.map +0 -1
- package/build/dex/quick-perps/vault.d.ts +0 -46
- package/build/dex/quick-perps/vault.js +0 -166
- package/build/dex/quick-perps/vault.js.map +0 -1
- package/build/dex/quickswap/camelot-v3.d.ts +0 -6
- package/build/dex/quickswap/camelot-v3.js +0 -19
- package/build/dex/quickswap/camelot-v3.js.map +0 -1
- package/build/dex/quickswap-v3.d.ts +0 -21
- package/build/dex/quickswap-v3.js +0 -40
- package/build/dex/quickswap-v3.js.map +0 -1
- package/build/dex/test-dex/config.d.ts +0 -4
- package/build/dex/test-dex/config.js +0 -15
- package/build/dex/test-dex/config.js.map +0 -1
- package/build/dex/test-dex/test-dex-pool.d.ts +0 -39
- package/build/dex/test-dex/test-dex-pool.js +0 -63
- package/build/dex/test-dex/test-dex-pool.js.map +0 -1
- package/build/dex/test-dex/test-dex.d.ts +0 -37
- package/build/dex/test-dex/test-dex.js +0 -126
- package/build/dex/test-dex/test-dex.js.map +0 -1
- package/build/dex/test-dex/types.d.ts +0 -6
- package/build/dex/test-dex/types.js +0 -3
- package/build/dex/test-dex/types.js.map +0 -1
- package/build/dex/woo-fi/config.d.ts +0 -4
- package/build/dex/woo-fi/config.js +0 -141
- package/build/dex/woo-fi/config.js.map +0 -1
- package/build/dex/woo-fi/constants.d.ts +0 -5
- package/build/dex/woo-fi/constants.js +0 -20
- package/build/dex/woo-fi/constants.js.map +0 -1
- package/build/dex/woo-fi/types.d.ts +0 -48
- package/build/dex/woo-fi/types.js +0 -3
- package/build/dex/woo-fi/types.js.map +0 -1
- package/build/dex/woo-fi/woo-fi-decimal-math.d.ts +0 -14
- package/build/dex/woo-fi/woo-fi-decimal-math.js +0 -42
- package/build/dex/woo-fi/woo-fi-decimal-math.js.map +0 -1
- package/build/dex/woo-fi/woo-fi-math.d.ts +0 -31
- package/build/dex/woo-fi/woo-fi-math.js +0 -300
- package/build/dex/woo-fi/woo-fi-math.js.map +0 -1
- package/build/dex/woo-fi/woo-fi.d.ts +0 -65
- package/build/dex/woo-fi/woo-fi.js +0 -480
- package/build/dex/woo-fi/woo-fi.js.map +0 -1
- package/build/dex/woo-fi-v2/woo-fi-math.d.ts +0 -16
- package/build/dex/woo-fi-v2/woo-fi-math.js +0 -137
- package/build/dex/woo-fi-v2/woo-fi-math.js.map +0 -1
- package/build/lib/api3-feed.d.ts +0 -26
- package/build/lib/api3-feed.js +0 -82
- package/build/lib/api3-feed.js.map +0 -1
- package/src/dex/balancer-v2/balancer-v2-optimizer.test.ts +0 -226
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.TestDex = void 0;
|
|
27
|
-
const CALLDATA_GAS_COST = __importStar(require("../../calldata-gas-cost"));
|
|
28
|
-
const utils_1 = require("../../utils");
|
|
29
|
-
const simple_exchange_1 = require("../simple-exchange");
|
|
30
|
-
const config_1 = require("./config");
|
|
31
|
-
const test_dex_pool_1 = require("./test-dex-pool");
|
|
32
|
-
class TestDex extends simple_exchange_1.SimpleExchange {
|
|
33
|
-
constructor(network, dexKey, dexHelper, adapters = config_1.Adapters[network] || {}) {
|
|
34
|
-
super(dexHelper, dexKey);
|
|
35
|
-
this.network = network;
|
|
36
|
-
this.dexKey = dexKey;
|
|
37
|
-
this.dexHelper = dexHelper;
|
|
38
|
-
this.adapters = adapters;
|
|
39
|
-
this.hasConstantPriceLargeAmounts = false;
|
|
40
|
-
// TODO: set true here if protocols works only with wrapped asset
|
|
41
|
-
this.needWrapNative = true;
|
|
42
|
-
this.isFeeOnTransferSupported = false;
|
|
43
|
-
this.logger = dexHelper.getLogger(dexKey);
|
|
44
|
-
this.eventPools = new test_dex_pool_1.TestDexEventPool(dexKey, network, dexHelper, this.logger);
|
|
45
|
-
}
|
|
46
|
-
// Initialize pricing is called once in the start of
|
|
47
|
-
// pricing service. It is intended to setup the integration
|
|
48
|
-
// for pricing requests. It is optional for a DEX to
|
|
49
|
-
// implement this function
|
|
50
|
-
async initializePricing(blockNumber) {
|
|
51
|
-
// TODO: complete me!
|
|
52
|
-
}
|
|
53
|
-
// Returns the list of contract adapters (name and index)
|
|
54
|
-
// for a buy/sell. Return null if there are no adapters.
|
|
55
|
-
getAdapters(side) {
|
|
56
|
-
return this.adapters[side] ? this.adapters[side] : null;
|
|
57
|
-
}
|
|
58
|
-
// Returns list of pool identifiers that can be used
|
|
59
|
-
// for a given swap. poolIdentifiers must be unique
|
|
60
|
-
// across DEXes. It is recommended to use
|
|
61
|
-
// ${dexKey}_${poolAddress} as a poolIdentifier
|
|
62
|
-
async getPoolIdentifiers(srcToken, destToken, side, blockNumber) {
|
|
63
|
-
// TODO: complete me!
|
|
64
|
-
return [];
|
|
65
|
-
}
|
|
66
|
-
// Returns pool prices for amounts.
|
|
67
|
-
// If limitPools is defined only pools in limitPools
|
|
68
|
-
// should be used. If limitPools is undefined then
|
|
69
|
-
// any pools can be used.
|
|
70
|
-
async getPricesVolume(srcToken, destToken, amounts, side, blockNumber, limitPools) {
|
|
71
|
-
// TODO: complete me!
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
// Returns estimated gas cost of calldata for this DEX in multiSwap
|
|
75
|
-
getCalldataGasCost(poolPrices) {
|
|
76
|
-
// TODO: update if there is any payload in getAdapterParam
|
|
77
|
-
return CALLDATA_GAS_COST.DEX_NO_PAYLOAD;
|
|
78
|
-
}
|
|
79
|
-
// Encode params required by the exchange adapter
|
|
80
|
-
// Used for multiSwap, buy & megaSwap
|
|
81
|
-
// Hint: abiCoder.encodeParameter() could be useful
|
|
82
|
-
getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
83
|
-
// TODO: complete me!
|
|
84
|
-
const { exchange } = data;
|
|
85
|
-
// Encode here the payload for adapter
|
|
86
|
-
const payload = '';
|
|
87
|
-
return {
|
|
88
|
-
targetExchange: exchange,
|
|
89
|
-
payload,
|
|
90
|
-
networkFee: '0',
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
// Encode call data used by simpleSwap like routers
|
|
94
|
-
// Used for simpleSwap & simpleBuy
|
|
95
|
-
// Hint: this.buildSimpleParamWithoutWETHConversion
|
|
96
|
-
// could be useful
|
|
97
|
-
async getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
98
|
-
// TODO: complete me!
|
|
99
|
-
const { exchange } = data;
|
|
100
|
-
// Encode here the transaction arguments
|
|
101
|
-
const swapData = '';
|
|
102
|
-
return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, exchange);
|
|
103
|
-
}
|
|
104
|
-
// This is called once before getTopPoolsForToken is
|
|
105
|
-
// called for multiple tokens. This can be helpful to
|
|
106
|
-
// update common state required for calculating
|
|
107
|
-
// getTopPoolsForToken. It is optional for a DEX
|
|
108
|
-
// to implement this
|
|
109
|
-
async updatePoolState() {
|
|
110
|
-
// TODO: complete me!
|
|
111
|
-
}
|
|
112
|
-
// Returns list of top pools based on liquidity. Max
|
|
113
|
-
// limit number pools should be returned.
|
|
114
|
-
async getTopPoolsForToken(tokenAddress, limit) {
|
|
115
|
-
//TODO: complete me!
|
|
116
|
-
return [];
|
|
117
|
-
}
|
|
118
|
-
// This is optional function in case if your implementation has acquired any resources
|
|
119
|
-
// you need to release for graceful shutdown. For example, it may be any interval timer
|
|
120
|
-
releaseResources() {
|
|
121
|
-
// TODO: complete me!
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
exports.TestDex = TestDex;
|
|
125
|
-
TestDex.dexKeysWithNetwork = (0, utils_1.getDexKeysWithNetwork)(config_1.TestDexConfig);
|
|
126
|
-
//# sourceMappingURL=test-dex.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-dex.js","sourceRoot":"","sources":["../../../src/dex/test-dex/test-dex.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,2EAA6D;AAC7D,uCAAoD;AAIpD,wDAAoD;AACpD,qCAAmD;AACnD,mDAAmD;AAEnD,MAAa,OACX,SAAQ,gCAAc;IAgBtB,YACW,OAAgB,EAChB,MAAc,EACd,SAAqB,EACpB,WAAW,iBAAQ,CAAC,OAAO,CAAC,IAAI,EAAE;QAE5C,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QALhB,YAAO,GAAP,OAAO,CAAS;QAChB,WAAM,GAAN,MAAM,CAAQ;QACd,cAAS,GAAT,SAAS,CAAY;QACpB,aAAQ,GAAR,QAAQ,CAA0B;QAfrC,iCAA4B,GAAG,KAAK,CAAC;QAC9C,iEAAiE;QACxD,mBAAc,GAAG,IAAI,CAAC;QAEtB,6BAAwB,GAAG,KAAK,CAAC;QAcxC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,UAAU,GAAG,IAAI,gCAAgB,CACpC,MAAM,EACN,OAAO,EACP,SAAS,EACT,IAAI,CAAC,MAAM,CACZ,CAAC;IACJ,CAAC;IAED,oDAAoD;IACpD,2DAA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gB,EAChB,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,IAAiB,EACjB,IAAc;QAEd,qBAAqB;QACrB,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QAE1B,wCAAwC;QACxC,MAAM,QAAQ,GAAG,EAAE,CAAC;QAEpB,OAAO,IAAI,CAAC,qCAAqC,CAC/C,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,CACT,CAAC;IACJ,CAAC;IAED,oDAAoD;IACpD,qDAAqD;IACrD,+CAA+C;IAC/C,gDAAgD;IAChD,oBAAoB;IACpB,KAAK,CAAC,eAAe;QACnB,qBAAqB;IACvB,CAAC;IAED,oDAAoD;IACpD,yCAAyC;IACzC,KAAK,CAAC,mBAAmB,CACvB,YAAqB,EACrB,KAAa;QAEb,oBAAoB;QACpB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,sFAAsF;IACtF,uFAAuF;IACvF,gBAAgB;QACd,qBAAqB;IACvB,CAAC;;AAhKH,0BAiKC;AArJe,0BAAkB,GAC9B,IAAA,6BAAqB,EAAC,sBAAa,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/dex/test-dex/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Adapters = exports.WooFiConfig = void 0;
|
|
4
|
-
const constants_1 = require("../../constants");
|
|
5
|
-
exports.WooFiConfig = {
|
|
6
|
-
WooFi: {
|
|
7
|
-
[constants_1.Network.BSC]: {
|
|
8
|
-
wooPPAddress: '0xbf365Ce9cFcb2d5855521985E351bA3bcf77FD3F',
|
|
9
|
-
wooOracleAddress: '0x6b6fBEc7934b104e81b2046D24A990e03e17afDC',
|
|
10
|
-
wooFeeManagerAddress: '0xaA6c60D638d34261B764fEDB551E50Ab02c34C90',
|
|
11
|
-
wooGuardianAddress: '0x910723e3c6a68276687b50613a1a9e42cc6589b4',
|
|
12
|
-
quoteToken: {
|
|
13
|
-
// USDT
|
|
14
|
-
address: '0x55d398326f99059ff775485246999027b3197955',
|
|
15
|
-
decimals: 18,
|
|
16
|
-
},
|
|
17
|
-
baseTokens: {
|
|
18
|
-
WBNB: {
|
|
19
|
-
address: '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c',
|
|
20
|
-
decimals: 18,
|
|
21
|
-
},
|
|
22
|
-
BTCB: {
|
|
23
|
-
address: '0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c',
|
|
24
|
-
decimals: 18,
|
|
25
|
-
},
|
|
26
|
-
ETH: {
|
|
27
|
-
address: '0x2170ed0880ac9a755fd29b2688956bd959f933f8',
|
|
28
|
-
decimals: 18,
|
|
29
|
-
},
|
|
30
|
-
WOO: {
|
|
31
|
-
address: '0x4691937a7508860f876c9c0a2a617e7d9e945d4b',
|
|
32
|
-
decimals: 18,
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
rebateTo: '0xcbb65ad3e64f404b5411486e15561bfb645ce642',
|
|
36
|
-
},
|
|
37
|
-
[constants_1.Network.AVALANCHE]: {
|
|
38
|
-
wooPPAddress: '0x1df3009c57a8B143c6246149F00B090Bce3b8f88',
|
|
39
|
-
wooOracleAddress: '0x25a4d4a094A084c7ad45Ac273cF7D6B6bfae7D4E',
|
|
40
|
-
wooFeeManagerAddress: '0x209102c0D2E34282494114ea76D5251c8e7Ea7ab',
|
|
41
|
-
wooGuardianAddress: '0x58c73f7e102bc6bcdc6b092ef0399b3e06d6b3e3',
|
|
42
|
-
quoteToken: {
|
|
43
|
-
// USDC
|
|
44
|
-
address: '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e',
|
|
45
|
-
decimals: 6,
|
|
46
|
-
},
|
|
47
|
-
baseTokens: {
|
|
48
|
-
WAVAX: {
|
|
49
|
-
address: '0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7',
|
|
50
|
-
decimals: 18,
|
|
51
|
-
},
|
|
52
|
-
['BTC.b']: {
|
|
53
|
-
address: '0x152b9d0FdC40C096757F570A51E494bd4b943E50',
|
|
54
|
-
decimals: 8,
|
|
55
|
-
},
|
|
56
|
-
['WETH.e']: {
|
|
57
|
-
address: '0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB',
|
|
58
|
-
decimals: 18,
|
|
59
|
-
},
|
|
60
|
-
['WOO.e']: {
|
|
61
|
-
address: '0xaBC9547B534519fF73921b1FBA6E672b5f58D083',
|
|
62
|
-
decimals: 18,
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
rebateTo: '0x1bf4c97384e7bdc609017305edb23fd28c13e76a',
|
|
66
|
-
},
|
|
67
|
-
[constants_1.Network.FANTOM]: {
|
|
68
|
-
wooPPAddress: '0x9503E7517D3C5bc4f9E4A1c6AE4f8B33AC2546f2',
|
|
69
|
-
wooOracleAddress: '0x209102c0D2E34282494114ea76D5251c8e7Ea7ab',
|
|
70
|
-
wooFeeManagerAddress: '0xBE1a0FccCFA9c9065152B7770B918f7C59914E8D',
|
|
71
|
-
wooGuardianAddress: '0x128758d0e909624841AB29D53919646BFBDa5dB2',
|
|
72
|
-
quoteToken: {
|
|
73
|
-
// USDC
|
|
74
|
-
address: '0x04068da6c83afcfa0e13ba15a6696662335d5b75',
|
|
75
|
-
decimals: 6,
|
|
76
|
-
},
|
|
77
|
-
baseTokens: {
|
|
78
|
-
WFTM: {
|
|
79
|
-
address: '0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83',
|
|
80
|
-
decimals: 18,
|
|
81
|
-
},
|
|
82
|
-
BTC: {
|
|
83
|
-
address: '0x321162Cd933E2Be498Cd2267a90534A804051b11',
|
|
84
|
-
decimals: 8,
|
|
85
|
-
},
|
|
86
|
-
ETH: {
|
|
87
|
-
address: '0x74b23882a30290451A17c44f4F05243b6b58C76d',
|
|
88
|
-
decimals: 18,
|
|
89
|
-
},
|
|
90
|
-
WOO: {
|
|
91
|
-
address: '0x6626c47c00F1D87902fc13EECfaC3ed06D5E8D8a',
|
|
92
|
-
decimals: 18,
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
rebateTo: '0xced122f9b99d224675eeda13f0c14639c5633f91',
|
|
96
|
-
},
|
|
97
|
-
[constants_1.Network.POLYGON]: {
|
|
98
|
-
wooPPAddress: '0x7400B665C8f4f3a951a99f1ee9872efb8778723d',
|
|
99
|
-
wooOracleAddress: '0x2Fe5E5D341cFFa606a5d9DA1B6B646a381B0f7ec',
|
|
100
|
-
wooFeeManagerAddress: '0x7214833BE05Ce39f6dCd97668e521162e6C18937',
|
|
101
|
-
wooGuardianAddress: '0xF5d215d9C84778F85746D15762DaF39B9E83a2d6',
|
|
102
|
-
quoteToken: {
|
|
103
|
-
// USDC
|
|
104
|
-
address: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174',
|
|
105
|
-
decimals: 6,
|
|
106
|
-
},
|
|
107
|
-
baseTokens: {
|
|
108
|
-
WMATIC: {
|
|
109
|
-
address: '0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270',
|
|
110
|
-
decimals: 18,
|
|
111
|
-
},
|
|
112
|
-
WBTC: {
|
|
113
|
-
address: '0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6',
|
|
114
|
-
decimals: 8,
|
|
115
|
-
},
|
|
116
|
-
WETH: {
|
|
117
|
-
address: '0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619',
|
|
118
|
-
decimals: 18,
|
|
119
|
-
},
|
|
120
|
-
WOO: {
|
|
121
|
-
address: '0x1B815d120B3eF02039Ee11dC2d33DE7aA4a8C603',
|
|
122
|
-
decimals: 18,
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
rebateTo: '0x0c84cd406b8a4e07df9a1b15ef348023a1dcd075',
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
};
|
|
129
|
-
exports.Adapters = {
|
|
130
|
-
[constants_1.Network.BSC]: { [constants_1.SwapSide.SELL]: [{ name: 'BscAdapter01', index: 13 }] },
|
|
131
|
-
[constants_1.Network.AVALANCHE]: {
|
|
132
|
-
[constants_1.SwapSide.SELL]: [{ name: 'AvalancheAdapter01', index: 12 }],
|
|
133
|
-
},
|
|
134
|
-
[constants_1.Network.FANTOM]: {
|
|
135
|
-
[constants_1.SwapSide.SELL]: [{ name: 'FantomAdapter01', index: 8 }],
|
|
136
|
-
},
|
|
137
|
-
[constants_1.Network.POLYGON]: {
|
|
138
|
-
[constants_1.SwapSide.SELL]: [{ name: 'PolygonAdapter02', index: 4 }],
|
|
139
|
-
},
|
|
140
|
-
};
|
|
141
|
-
//# sourceMappingURL=config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/dex/woo-fi/config.ts"],"names":[],"mappings":";;;AAEA,+CAAoD;AAEvC,QAAA,WAAW,GAA4B;IAClD,KAAK,EAAE;QACL,CAAC,mBAAO,CAAC,GAAG,CAAC,EAAE;YACb,YAAY,EAAE,4CAA4C;YAC1D,gBAAgB,EAAE,4CAA4C;YAC9D,oBAAoB,EAAE,4CAA4C;YAClE,kBAAkB,EAAE,4CAA4C;YAChE,UAAU,EAAE;gBACV,OAAO;gBACP,OAAO,EAAE,4CAA4C;gBACrD,QAAQ,EAAE,EAAE;aACb;YACD,UAAU,EAAE;gBACV,IAAI,EAAE;oBACJ,OAAO,EAAE,4CAA4C;oBACrD,QAAQ,EAAE,EAAE;iBACb;gBACD,IAAI,EAAE;oBACJ,OAAO,EAAE,4CAA4C;oBACrD,QAAQ,EAAE,EAAE;iBACb;gBACD,GAAG,EAAE;oBACH,OAAO,EAAE,4CAA4C;oBACrD,QAAQ,EAAE,EAAE;iBACb;gBACD,GAAG,EAAE;oBACH,OAAO,EAAE,4CAA4C;oBACrD,QAAQ,EAAE,EAAE;iBACb;aACF;YACD,QAA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QACjB,CAAC,oBAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;KAC1D;CACF,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NULL_STATE = exports.MIN_CONVERSION_RATE = exports.USD_PRECISION = exports.WOO_FI_GAS_COST = void 0;
|
|
4
|
-
exports.WOO_FI_GAS_COST = 270 * 1000;
|
|
5
|
-
exports.USD_PRECISION = 2;
|
|
6
|
-
exports.MIN_CONVERSION_RATE = 1;
|
|
7
|
-
exports.NULL_STATE = {
|
|
8
|
-
feeRates: {},
|
|
9
|
-
tokenInfos: {},
|
|
10
|
-
tokenStates: {},
|
|
11
|
-
oracleTimestamp: 0n,
|
|
12
|
-
isPaused: false,
|
|
13
|
-
guardian: {
|
|
14
|
-
globalBound: 0n,
|
|
15
|
-
refInfos: {},
|
|
16
|
-
},
|
|
17
|
-
chainlink: { latestRoundDatas: {} },
|
|
18
|
-
wooPPBalances: {},
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/dex/woo-fi/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,eAAe,GAAG,GAAG,GAAG,IAAI,CAAC;AAE7B,QAAA,aAAa,GAAG,CAAC,CAAC;AAElB,QAAA,mBAAmB,GAAG,CAAC,CAAC;AAExB,QAAA,UAAU,GAAc;IACnC,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE,EAAE;IACd,WAAW,EAAE,EAAE;IACf,eAAe,EAAE,EAAE;IACnB,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE;QACR,WAAW,EAAE,EAAE;QACf,QAAQ,EAAE,EAAE;KACb;IACD,SAAS,EAAE,EAAE,gBAAgB,EAAE,EAAE,EAAE;IACnC,aAAa,EAAE,EAAE;CAClB,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Address, Token } from '../../types';
|
|
2
|
-
export declare type TokenInfo = {
|
|
3
|
-
reserve: bigint;
|
|
4
|
-
R: bigint;
|
|
5
|
-
threshold: bigint;
|
|
6
|
-
target: bigint;
|
|
7
|
-
lastResetTimestamp: bigint;
|
|
8
|
-
};
|
|
9
|
-
export declare type TokenState = {
|
|
10
|
-
priceNow: bigint;
|
|
11
|
-
spreadNow: bigint;
|
|
12
|
-
coeffNow: bigint;
|
|
13
|
-
};
|
|
14
|
-
export declare type RefInfo = {
|
|
15
|
-
chainlinkRefOracle: Address;
|
|
16
|
-
refPriceFixCoeff: bigint;
|
|
17
|
-
minInputAmount: bigint;
|
|
18
|
-
maxInputAmount: bigint;
|
|
19
|
-
bound: bigint;
|
|
20
|
-
};
|
|
21
|
-
export declare type LatestRoundData = {
|
|
22
|
-
answer: bigint;
|
|
23
|
-
};
|
|
24
|
-
export declare type PoolState = {
|
|
25
|
-
feeRates: Record<Address, bigint>;
|
|
26
|
-
tokenInfos: Record<Address, TokenInfo>;
|
|
27
|
-
tokenStates: Record<Address, TokenState>;
|
|
28
|
-
oracleTimestamp: bigint;
|
|
29
|
-
isPaused: boolean;
|
|
30
|
-
guardian: {
|
|
31
|
-
globalBound: bigint;
|
|
32
|
-
refInfos: Record<Address, RefInfo>;
|
|
33
|
-
};
|
|
34
|
-
chainlink: {
|
|
35
|
-
latestRoundDatas: Record<Address, LatestRoundData>;
|
|
36
|
-
};
|
|
37
|
-
wooPPBalances: Record<Address, bigint>;
|
|
38
|
-
};
|
|
39
|
-
export declare type WooFiData = {};
|
|
40
|
-
export declare type DexParams = {
|
|
41
|
-
wooPPAddress: Address;
|
|
42
|
-
wooOracleAddress: Address;
|
|
43
|
-
wooFeeManagerAddress: Address;
|
|
44
|
-
wooGuardianAddress: Address;
|
|
45
|
-
quoteToken: Token;
|
|
46
|
-
baseTokens: Record<string, Token>;
|
|
47
|
-
rebateTo: Address;
|
|
48
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/dex/woo-fi/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
declare class WooFiDecimalMath {
|
|
2
|
-
readonly ONE: bigint;
|
|
3
|
-
readonly TWO: bigint;
|
|
4
|
-
readonly ONE2: bigint;
|
|
5
|
-
mulFloor(target: bigint, d: bigint): bigint;
|
|
6
|
-
mulCeil(target: bigint, d: bigint): bigint;
|
|
7
|
-
divFloor(target: bigint, d: bigint): bigint;
|
|
8
|
-
divCeil(target: bigint, d: bigint): bigint;
|
|
9
|
-
reciprocalFloor(target: bigint): bigint;
|
|
10
|
-
reciprocalCeil(target: bigint): bigint;
|
|
11
|
-
private _divCeil;
|
|
12
|
-
}
|
|
13
|
-
export declare const wooFiDecimalMath: WooFiDecimalMath;
|
|
14
|
-
export {};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.wooFiDecimalMath = void 0;
|
|
4
|
-
const bigint_constants_1 = require("../../bigint-constants");
|
|
5
|
-
class WooFiDecimalMath {
|
|
6
|
-
constructor() {
|
|
7
|
-
this.ONE = bigint_constants_1.BI_POWS[18];
|
|
8
|
-
this.TWO = 2n * bigint_constants_1.BI_POWS[18];
|
|
9
|
-
this.ONE2 = bigint_constants_1.BI_POWS[36];
|
|
10
|
-
}
|
|
11
|
-
mulFloor(target, d) {
|
|
12
|
-
// target.mul(d) / (10**18);
|
|
13
|
-
return (target * d) / bigint_constants_1.BI_POWS[18];
|
|
14
|
-
}
|
|
15
|
-
mulCeil(target, d) {
|
|
16
|
-
// _divCeil(target.mul(d), 10 ** 18);
|
|
17
|
-
return this._divCeil(target * d, bigint_constants_1.BI_POWS[18]);
|
|
18
|
-
}
|
|
19
|
-
divFloor(target, d) {
|
|
20
|
-
// target.mul(10 ** 18).div(d);
|
|
21
|
-
return (target * bigint_constants_1.BI_POWS[18]) / d;
|
|
22
|
-
}
|
|
23
|
-
divCeil(target, d) {
|
|
24
|
-
// _divCeil(target.mul(10 ** 18), d);
|
|
25
|
-
return this._divCeil(target * bigint_constants_1.BI_POWS[18], d);
|
|
26
|
-
}
|
|
27
|
-
reciprocalFloor(target) {
|
|
28
|
-
// uint256(10 ** 36).div(target);
|
|
29
|
-
return bigint_constants_1.BI_POWS[36] / target;
|
|
30
|
-
}
|
|
31
|
-
reciprocalCeil(target) {
|
|
32
|
-
// _divCeil(uint256(10 ** 36), target);
|
|
33
|
-
return this._divCeil(bigint_constants_1.BI_POWS[36], target);
|
|
34
|
-
}
|
|
35
|
-
_divCeil(a, b) {
|
|
36
|
-
const quotient = a / b;
|
|
37
|
-
const remainder = a - quotient * b;
|
|
38
|
-
return remainder > 0n ? quotient + 1n : quotient;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.wooFiDecimalMath = new WooFiDecimalMath();
|
|
42
|
-
//# sourceMappingURL=woo-fi-decimal-math.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"woo-fi-decimal-math.js","sourceRoot":"","sources":["../../../src/dex/woo-fi/woo-fi-decimal-math.ts"],"names":[],"mappings":";;;AAAA,6DAAiD;AAEjD,MAAM,gBAAgB;IAAtB;QACW,QAAG,GAAG,0BAAO,CAAC,EAAE,CAAC,CAAC;QAClB,QAAG,GAAG,EAAE,GAAG,0BAAO,CAAC,EAAE,CAAC,CAAC;QACvB,SAAI,GAAG,0BAAO,CAAC,EAAE,CAAC,CAAC;IAqC9B,CAAC;IAnCC,QAAQ,CAAC,MAAc,EAAE,CAAS;QAChC,4BAA4B;QAC5B,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,0BAAO,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,CAAC,MAAc,EAAE,CAAS;QAC/B,qCAAqC;QACrC,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,0BAAO,CAAC,EAAE,CAAC,CAAC,CAAC;IAChD,CAAC;IAED,QAAQ,CAAC,MAAc,EAAE,CAAS;QAChC,+BAA+B;QAC/B,OAAO,CAAC,MAAM,GAAG,0BAAO,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,CAAC,MAAc,EAAE,CAAS;QAC/B,qCAAqC;QACrC,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,0BAAO,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAChD,CAAC;IAED,eAAe,CAAC,MAAc;QAC5B,iCAAiC;QACjC,OAAO,0BAAO,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC;IAC9B,CAAC;IAED,cAAc,CAAC,MAAc;QAC3B,uCAAuC;QACvC,OAAO,IAAI,CAAC,QAAQ,CAAC,0BAAO,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IAC5C,CAAC;IAEO,QAAQ,CAAC,CAAS,EAAE,CAAS;QACnC,MAAM,QAAQ,GAAG,CAAC,GAAG,CAAC,CAAC;QACvB,MAAM,SAAS,GAAG,CAAC,GAAG,QAAQ,GAAG,CAAC,CAAC;QACnC,OAAO,SAAS,GAAG,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;IACnD,CAAC;CACF;AAEY,QAAA,gBAAgB,GAAG,IAAI,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { PoolState, TokenInfo } from './types';
|
|
2
|
-
import { wooFiDecimalMath } from './woo-fi-decimal-math';
|
|
3
|
-
import { Address, Logger } from '../../types';
|
|
4
|
-
export declare class WooFiMath {
|
|
5
|
-
private readonly logger;
|
|
6
|
-
private readonly _quoteToken;
|
|
7
|
-
readonly dMath: typeof wooFiDecimalMath;
|
|
8
|
-
private readonly _MIN_INPUT_DEFAULT;
|
|
9
|
-
private readonly _MAX_INPUT_DEFAULT;
|
|
10
|
-
state: PoolState;
|
|
11
|
-
constructor(logger: Logger, _quoteToken: Address);
|
|
12
|
-
querySellBase(baseToken: Address, baseAmounts: bigint[]): bigint[] | null;
|
|
13
|
-
querySellQuote(baseToken: Address, quoteAmounts: bigint[]): bigint[] | null;
|
|
14
|
-
protected _takeFee(amounts: bigint[], feeRate: bigint): bigint[];
|
|
15
|
-
protected _getQuoteAmountSellBase(baseToken: Address, baseAmounts: bigint[]): bigint[];
|
|
16
|
-
protected _getBaseAmountSellQuote(baseToken: string, quoteAmounts: bigint[]): bigint[];
|
|
17
|
-
protected _getBoughtAmount(baseInfo: TokenInfo, quoteInfo: TokenInfo, p: bigint, k: bigint, isSellBase: boolean): {
|
|
18
|
-
baseBought: bigint;
|
|
19
|
-
quoteBought: bigint;
|
|
20
|
-
};
|
|
21
|
-
protected _getBaseAmountLowBaseSide(p: bigint, k: bigint, r: bigint, quoteAmount: bigint): bigint;
|
|
22
|
-
protected _getQuoteAmountLowQuoteSide(p: bigint, k: bigint, r: bigint, baseAmount: bigint): bigint;
|
|
23
|
-
protected _getBaseAmountLowQuoteSide(p: bigint, k: bigint, r: bigint, quoteAmount: bigint): bigint;
|
|
24
|
-
protected _getQuoteAmountLowBaseSide(p: bigint, k: bigint, r: bigint, baseAmount: bigint): bigint;
|
|
25
|
-
protected _autoUpdate(quoteTokenAddress: string, baseTokenAddress: string): void;
|
|
26
|
-
private _checkInputAmount;
|
|
27
|
-
private _checkSwapAmount;
|
|
28
|
-
checkSwapPrice(price: bigint, fromToken: Address, toToken: Address): void;
|
|
29
|
-
private _refPrice;
|
|
30
|
-
private _boundForTokens;
|
|
31
|
-
}
|