@@ -98,29 +98,60 @@ export const TOKENS = {
9898 USDC : '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' ,
9999 USDT : '0xdac17f958d2ee523a2206206994597c13d831ec7' ,
100100 sUSD : '0x57ab1ec28d129707052df4df418d58a2d46d5f51' ,
101+ BUSD : '0x4fabb145d64652a948d72533023f6e7a623c7c53' ,
101102 TUSD : '0x0000000000085d4780b73119b644ae5ecd22b376' ,
103+ PAX : '0x8e870d67f660d95d5be530380d0ec0bd388289e1' ,
104+ GUSD : '0x056fd409e1d7a124bd7017459dfea2f387b6d5cd' ,
105+ HUSD : '0xdf574c24545e5ffecb9a659c229253d4111d87e1' ,
106+ mUSD : '0xe2f2a5c287993345a840db3b0845fbc70f5935a5' ,
107+ USDN : '0x674c6ad92fd080e4004b2312b45f796a192d27a0' ,
102108 // Bitcoins
103109 WBTC : '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599' ,
104110 RenBTC : '0xeb4c2781e4eba804ce9a9803c67d0893436bb27d' ,
105111 sBTC : '0xfe18be6b3bd88a2d2a7f928d00292e7a9963cfc6' ,
112+ tBTC : '0x8daebade922df735c38c80c7ebd708af50815faa' ,
113+ hBTC : '0x0316eb71485b0ab14103307bf65a021042c6d380' ,
106114 // Other
107115 MKR : '0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2' ,
108116} ;
109117
118+ export const POOLS = {
119+ // following the same order in curve.fi:
120+ curve_compound : '0xa2b47e3d5c44877cca798226b7b8118f9bfb7a56' ,
121+ // curve_USDT: '0x52ea46506b9cc5ef470c5bf89f17dc28bb35d85c',
122+ curve_PAX : '0x06364f10b501e868329afbc005b3492902d6c763' ,
123+ curve_y : '0x45f783cce6b7ff23b2ab2d70e416cdb7d6055f51' ,
124+ curve_BUSD : '0x79a8c46dea5ada233abaffd40f3a0a2b1e5a4f27' ,
125+ curve_sUSD : '0xa5407eae9ba41422680e2e00537571bcc53efbfd' ,
126+ curve_renBTC : '0x93054188d876f558f4a66b2ef1d97d16edf0895b' ,
127+ curve_sBTC : '0x7fc77b5c7614e1533320ea6ddc2eb61fa00a9714' ,
128+ curve_HBTC : '0x4ca9b3063ec5866a4b82e437059d2c43d1be596f' ,
129+ curve_TRI : '0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7' ,
130+ curve_GUSD : '0x4f062658eaaf2c1ccf8c8e36d6824cdf41167956' ,
131+ curve_HUSD : '0x3ef6a01a0f81d6046290f3e2a8c5b843e738e604' ,
132+ // 12.usdk is dead
133+ curve_USDN : '0x0f9cb53ebe405d49a0bbdbd291a65ff571bc83e1' ,
134+ // 14.linkusd is dead
135+ curve_mUSD : '0x8474ddbe98f5aa3179b3b3f5942d724afcdec9f6' ,
136+ // 16.rsv is dead
137+ curve_tBTC : '0xc25099792e9349c7dd09759744ea681c7de2cb66' ,
138+ } ;
139+
110140/**
111141 * Mainnet Curve configuration
112142 * The tokens are in order of their index, which each curve defines
113143 * I.e DaiUsdc curve has DAI as index 0 and USDC as index 1
114144 */
115145export const MAINNET_CURVE_INFOS : { [ name : string ] : CurveInfo } = {
116- DaiUsdc : {
146+ [ POOLS . curve_compound ] : {
117147 exchangeFunctionSelector : CurveFunctionSelectors . exchange_underlying ,
118148 sellQuoteFunctionSelector : CurveFunctionSelectors . get_dy_underlying ,
119149 buyQuoteFunctionSelector : CurveFunctionSelectors . get_dx_underlying ,
120- poolAddress : '0xa2b47e3d5c44877cca798226b7b8118f9bfb7a56' ,
150+ poolAddress : POOLS . curve_compound ,
121151 tokens : [ TOKENS . DAI , TOKENS . USDC ] ,
152+ metaToken : undefined ,
122153 } ,
123- // DaiUsdcUsdt : {
154+ // USDT : {
124155 // exchangeFunctionSelector: CurveFunctionSelectors.exchange_underlying,
125156 // sellQuoteFunctionSelector: CurveFunctionSelectors.get_dy_underlying,
126157 // buyQuoteFunctionSelector: CurveFunctionSelectors.get_dx_underlying,
@@ -131,53 +162,110 @@ export const MAINNET_CURVE_INFOS: { [name: string]: CurveInfo } = {
131162 // TOKENS.USDT,
132163 // ],
133164 // },
134- DaiUsdcUsdtTusd : {
165+ [ POOLS . curve_PAX ] : {
166+ exchangeFunctionSelector : CurveFunctionSelectors . exchange_underlying ,
167+ sellQuoteFunctionSelector : CurveFunctionSelectors . get_dy_underlying ,
168+ buyQuoteFunctionSelector : CurveFunctionSelectors . None ,
169+ poolAddress : POOLS . curve_PAX ,
170+ tokens : [ TOKENS . DAI , TOKENS . USDC , TOKENS . USDT , TOKENS . PAX ] ,
171+ metaToken : undefined ,
172+ } ,
173+ [ POOLS . curve_y ] : {
135174 exchangeFunctionSelector : CurveFunctionSelectors . exchange_underlying ,
136175 sellQuoteFunctionSelector : CurveFunctionSelectors . get_dy_underlying ,
137176 buyQuoteFunctionSelector : CurveFunctionSelectors . get_dx_underlying ,
138- poolAddress : '0x45f783cce6b7ff23b2ab2d70e416cdb7d6055f51' ,
177+ poolAddress : POOLS . curve_y ,
139178 tokens : [ TOKENS . DAI , TOKENS . USDC , TOKENS . USDT , TOKENS . TUSD ] ,
179+ metaToken : undefined ,
140180 } ,
141- // Looks like it's dying.
142- DaiUsdcUsdtBusd : {
181+ [ POOLS . curve_BUSD ] : {
143182 exchangeFunctionSelector : CurveFunctionSelectors . exchange_underlying ,
144183 sellQuoteFunctionSelector : CurveFunctionSelectors . get_dy_underlying ,
145184 buyQuoteFunctionSelector : CurveFunctionSelectors . get_dx_underlying ,
146- poolAddress : '0x79a8c46dea5ada233abaffd40f3a0a2b1e5a4f27' ,
147- tokens : [
148- TOKENS . DAI ,
149- TOKENS . USDC ,
150- TOKENS . USDT ,
151- '0x4fabb145d64652a948d72533023f6e7a623c7c53' , // bUSD
152- ] ,
185+ poolAddress : POOLS . curve_BUSD ,
186+ tokens : [ TOKENS . DAI , TOKENS . USDC , TOKENS . USDT , TOKENS . BUSD ] ,
187+ metaToken : undefined ,
153188 } ,
154- DaiUsdcUsdtSusd : {
189+ [ POOLS . curve_sUSD ] : {
155190 exchangeFunctionSelector : CurveFunctionSelectors . exchange_underlying ,
156191 sellQuoteFunctionSelector : CurveFunctionSelectors . get_dy_underlying ,
157192 buyQuoteFunctionSelector : CurveFunctionSelectors . None ,
158- poolAddress : '0xa5407eae9ba41422680e2e00537571bcc53efbfd' ,
193+ poolAddress : POOLS . curve_sUSD ,
159194 tokens : [ TOKENS . DAI , TOKENS . USDC , TOKENS . USDT , TOKENS . sUSD ] ,
195+ metaToken : undefined ,
160196 } ,
161- RenbtcWbtc : {
197+ [ POOLS . curve_renBTC ] : {
162198 exchangeFunctionSelector : CurveFunctionSelectors . exchange ,
163199 sellQuoteFunctionSelector : CurveFunctionSelectors . get_dy ,
164200 buyQuoteFunctionSelector : CurveFunctionSelectors . None ,
165- poolAddress : '0x93054188d876f558f4a66b2ef1d97d16edf0895b' ,
201+ poolAddress : POOLS . curve_renBTC ,
166202 tokens : [ TOKENS . RenBTC , TOKENS . WBTC ] ,
203+ metaToken : undefined ,
167204 } ,
168- RenbtcWbtcSbtc : {
205+ [ POOLS . curve_sBTC ] : {
169206 exchangeFunctionSelector : CurveFunctionSelectors . exchange ,
170207 sellQuoteFunctionSelector : CurveFunctionSelectors . get_dy ,
171208 buyQuoteFunctionSelector : CurveFunctionSelectors . None ,
172- poolAddress : '0x7fc77b5c7614e1533320ea6ddc2eb61fa00a9714' ,
209+ poolAddress : POOLS . curve_sBTC ,
173210 tokens : [ TOKENS . RenBTC , TOKENS . WBTC , TOKENS . sBTC ] ,
211+ metaToken : undefined ,
174212 } ,
175- TriPool : {
213+ [ POOLS . curve_HBTC ] : {
176214 exchangeFunctionSelector : CurveFunctionSelectors . exchange ,
177215 sellQuoteFunctionSelector : CurveFunctionSelectors . get_dy ,
178216 buyQuoteFunctionSelector : CurveFunctionSelectors . None ,
179- poolAddress : '0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7' ,
217+ poolAddress : POOLS . curve_HBTC ,
218+ tokens : [ TOKENS . hBTC , TOKENS . WBTC ] ,
219+ metaToken : undefined ,
220+ } ,
221+ [ POOLS . curve_TRI ] : {
222+ exchangeFunctionSelector : CurveFunctionSelectors . exchange ,
223+ sellQuoteFunctionSelector : CurveFunctionSelectors . get_dy ,
224+ buyQuoteFunctionSelector : CurveFunctionSelectors . None ,
225+ poolAddress : POOLS . curve_TRI ,
180226 tokens : [ TOKENS . DAI , TOKENS . USDC , TOKENS . USDT ] ,
227+ metaToken : undefined ,
228+ } ,
229+ // Metapools
230+ [ POOLS . curve_GUSD ] : {
231+ exchangeFunctionSelector : CurveFunctionSelectors . exchange_underlying ,
232+ sellQuoteFunctionSelector : CurveFunctionSelectors . get_dy_underlying ,
233+ buyQuoteFunctionSelector : CurveFunctionSelectors . None ,
234+ poolAddress : POOLS . curve_GUSD ,
235+ tokens : [ TOKENS . GUSD , TOKENS . DAI , TOKENS . USDC , TOKENS . USDT ] ,
236+ metaToken : TOKENS . GUSD ,
237+ } ,
238+ [ POOLS . curve_HUSD ] : {
239+ exchangeFunctionSelector : CurveFunctionSelectors . exchange_underlying ,
240+ sellQuoteFunctionSelector : CurveFunctionSelectors . get_dy_underlying ,
241+ buyQuoteFunctionSelector : CurveFunctionSelectors . None ,
242+ poolAddress : POOLS . curve_HUSD ,
243+ tokens : [ TOKENS . HUSD , TOKENS . DAI , TOKENS . USDC , TOKENS . USDT ] ,
244+ metaToken : TOKENS . HUSD ,
245+ } ,
246+ [ POOLS . curve_USDN ] : {
247+ exchangeFunctionSelector : CurveFunctionSelectors . exchange_underlying ,
248+ sellQuoteFunctionSelector : CurveFunctionSelectors . get_dy_underlying ,
249+ buyQuoteFunctionSelector : CurveFunctionSelectors . None ,
250+ poolAddress : POOLS . curve_USDN ,
251+ tokens : [ TOKENS . USDN , TOKENS . DAI , TOKENS . USDC , TOKENS . USDT ] ,
252+ metaToken : TOKENS . USDN ,
253+ } ,
254+ [ POOLS . curve_mUSD ] : {
255+ exchangeFunctionSelector : CurveFunctionSelectors . exchange_underlying ,
256+ sellQuoteFunctionSelector : CurveFunctionSelectors . get_dy_underlying ,
257+ buyQuoteFunctionSelector : CurveFunctionSelectors . None ,
258+ poolAddress : POOLS . curve_mUSD ,
259+ tokens : [ TOKENS . mUSD , TOKENS . DAI , TOKENS . USDC , TOKENS . USDT ] ,
260+ metaToken : TOKENS . mUSD ,
261+ } ,
262+ [ POOLS . curve_tBTC ] : {
263+ exchangeFunctionSelector : CurveFunctionSelectors . exchange_underlying ,
264+ sellQuoteFunctionSelector : CurveFunctionSelectors . get_dy_underlying ,
265+ buyQuoteFunctionSelector : CurveFunctionSelectors . None ,
266+ poolAddress : POOLS . curve_tBTC ,
267+ tokens : [ TOKENS . tBTC , TOKENS . RenBTC , TOKENS . WBTC , TOKENS . sBTC ] ,
268+ metaToken : TOKENS . tBTC ,
181269 } ,
182270} ;
183271
@@ -188,6 +276,7 @@ export const MAINNET_SWERVE_INFOS: { [name: string]: CurveInfo } = {
188276 buyQuoteFunctionSelector : CurveFunctionSelectors . None ,
189277 poolAddress : '0x329239599afb305da0a2ec69c58f8a6697f9f88d' , // _target: 0xa5407eae9ba41422680e2e00537571bcc53efbfd
190278 tokens : [ TOKENS . DAI , TOKENS . USDC , TOKENS . USDT , TOKENS . TUSD ] ,
279+ metaToken : undefined ,
191280 } ,
192281} ;
193282
@@ -201,6 +290,7 @@ export const MAINNET_SNOWSWAP_INFOS: { [name: string]: CurveInfo } = {
201290 '0x5dbcf33d8c2e976c6b560249878e6f1491bca25c' , // yUSD
202291 '0x2994529c0652d127b7842094103715ec5299bbed' , // ybCRV
203292 ] ,
293+ metaToken : undefined ,
204294 } ,
205295 yVaultCurveUnderlying : {
206296 exchangeFunctionSelector : CurveFunctionSelectors . exchange_underlying ,
@@ -211,6 +301,7 @@ export const MAINNET_SNOWSWAP_INFOS: { [name: string]: CurveInfo } = {
211301 '0xdf5e0e81dff6faf3a7e52ba697820c5e32d806a8' , // yCRV
212302 '0x3b3ac5386837dc563660fb6a0937dfaa5924333b' , // bCRV
213303 ] ,
304+ metaToken : undefined ,
214305 } ,
215306 yVaultUSD : {
216307 exchangeFunctionSelector : CurveFunctionSelectors . exchange ,
@@ -223,20 +314,8 @@ export const MAINNET_SNOWSWAP_INFOS: { [name: string]: CurveInfo } = {
223314 '0x2f08119c6f07c006695e079aafc638b8789faf18' , // yUSDT
224315 '0x37d19d1c4e1fa9dc47bd1ea12f742a0887eda74a' , // yTUSD
225316 ] ,
317+ metaToken : undefined ,
226318 } ,
227- // Gas is too high for these underlying tokens (3M+)
228- // yVaultUSDUnderlying: {
229- // exchangeFunctionSelector: CurveFunctionSelectors.exchange_underlying,
230- // sellQuoteFunctionSelector: CurveFunctionSelectors.get_dy_underlying,
231- // buyQuoteFunctionSelector: CurveFunctionSelectors.get_dx_underlying,
232- // poolAddress: '0x4571753311e37ddb44faa8fb78a6df9a6e3c6c0b',
233- // tokens: [
234- // TOKENS.DAI,
235- // TOKENS.USDC,
236- // TOKENS.USDT,
237- // TOKENS.TUSD,
238- // ],
239- // },
240319} ;
241320
242321export const MAINNET_KYBER_RESERVE_IDS : { [ name : string ] : string } = {
@@ -361,19 +440,25 @@ export const DEFAULT_GAS_SCHEDULE: Required<FeeSchedule> = {
361440 [ ERC20BridgeSource . Curve ] : fillData => {
362441 const poolAddress = ( fillData as CurveFillData ) . pool . poolAddress . toLowerCase ( ) ;
363442 switch ( poolAddress ) {
364- case '0xa5407eae9ba41422680e2e00537571bcc53efbfd' :
365- case '0x93054188d876f558f4a66b2ef1d97d16edf0895b' :
366- case '0x7fc77b5c7614e1533320ea6ddc2eb61fa00a9714' :
367- case '0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7' :
443+ case POOLS . curve_renBTC :
444+ case POOLS . curve_sBTC :
445+ case POOLS . curve_sUSD :
446+ case POOLS . curve_HBTC :
447+ case POOLS . curve_TRI :
368448 return 150e3 ;
369- case '0xa2b47e3d5c44877cca798226b7b8118f9bfb7a56' :
449+ case POOLS . curve_compound :
370450 return 750e3 ;
371- case '0x45f783cce6b7ff23b2ab2d70e416cdb7d6055f51' :
451+ case POOLS . curve_PAX :
452+ case POOLS . curve_y :
453+ case POOLS . curve_BUSD :
372454 return 850e3 ;
373- case '0x79a8c46dea5ada233abaffd40f3a0a2b1e5a4f27' :
374- return 1e6 ;
375- case '0x52ea46506b9cc5ef470c5bf89f17dc28bb35d85c' :
376- return 600e3 ;
455+ // Metapools
456+ case POOLS . curve_GUSD :
457+ case POOLS . curve_HUSD :
458+ case POOLS . curve_USDN :
459+ case POOLS . curve_mUSD :
460+ case POOLS . curve_tBTC :
461+ return 650e3 ;
377462 default :
378463 throw new Error ( `Unrecognized Curve address: ${ poolAddress } ` ) ;
379464 }
0 commit comments