@@ -7,15 +7,15 @@ import { arbitrum, base, mainnet } from 'viem/chains'
7
7
import { getLeverageBaseToken } from '@/app/leverage/utils/get-leverage-base-token'
8
8
import { getLeverageType } from '@/app/leverage/utils/get-leverage-type'
9
9
import { ARBITRUM , BASE , MAINNET } from '@/constants/chains'
10
- import { ETH , Token , USDC , USDT , WBTC , WETH } from '@/constants/tokens'
10
+ import { ETH , type Token , USDC , USDT , WBTC , WETH } from '@/constants/tokens'
11
11
12
12
import {
13
13
LeverageMarket ,
14
- LeverageRatio ,
14
+ type LeverageRatio ,
15
15
LeverageStrategy ,
16
- LeverageToken ,
16
+ type LeverageToken ,
17
17
LeverageType ,
18
- Market ,
18
+ type Market ,
19
19
} from './types'
20
20
21
21
export enum LendingProtocol {
@@ -76,13 +76,14 @@ export function getPathForMarket(market: string, chainId?: number) {
76
76
const existingMarket = markets . find ( ( m ) => m . market === market )
77
77
if ( ! existingMarket ) return null
78
78
79
- const { defaultAsset } = existingMarket
79
+ const { defaultAsset, defaultChainId } = existingMarket
80
80
81
81
const queryChainId =
82
82
chainId && existingMarket . networks . some ( ( network ) => network . id === chainId )
83
83
? chainId
84
- : defaultAsset . chainId
85
- return `/leverage?sell=ETH&buy=${ defaultAsset . symbol } &network=${ queryChainId } `
84
+ : defaultChainId
85
+ console . log ( queryChainId , defaultAsset , existingMarket )
86
+ return `/leverage?sell=ETH&buy=${ defaultAsset [ queryChainId ] } &network=${ queryChainId } `
86
87
}
87
88
88
89
const defaultAssets = {
@@ -155,7 +156,12 @@ export const markets: Market[] = [
155
156
change24h : 0 ,
156
157
low24h : 0 ,
157
158
high24h : 0 ,
158
- defaultAsset : { symbol : 'ETH3X' , chainId : base . id } ,
159
+ defaultAsset : {
160
+ [ arbitrum . id ] : 'ETH3X' ,
161
+ [ base . id ] : 'ETH3X' ,
162
+ [ mainnet . id ] : 'ETH2X' ,
163
+ } ,
164
+ defaultChainId : base . id ,
159
165
lendingProtocol : LendingProtocol . aave ,
160
166
} ,
161
167
{
@@ -168,7 +174,12 @@ export const markets: Market[] = [
168
174
change24h : 0 ,
169
175
low24h : 0 ,
170
176
high24h : 0 ,
171
- defaultAsset : { symbol : 'BTC3X' , chainId : base . id } ,
177
+ defaultAsset : {
178
+ [ arbitrum . id ] : 'BTC3X' ,
179
+ [ base . id ] : 'BTC3X' ,
180
+ [ mainnet . id ] : 'BTC2X' ,
181
+ } ,
182
+ defaultChainId : base . id ,
172
183
lendingProtocol : LendingProtocol . aave ,
173
184
} ,
174
185
{
@@ -181,7 +192,10 @@ export const markets: Market[] = [
181
192
change24h : 0 ,
182
193
low24h : 0 ,
183
194
high24h : 0 ,
184
- defaultAsset : { symbol : 'uSOL2x' , chainId : base . id } ,
195
+ defaultAsset : {
196
+ [ base . id ] : 'uSOL2x' ,
197
+ } ,
198
+ defaultChainId : base . id ,
185
199
lendingProtocol : LendingProtocol . morpho ,
186
200
} ,
187
201
{
@@ -194,7 +208,10 @@ export const markets: Market[] = [
194
208
change24h : 0 ,
195
209
low24h : 0 ,
196
210
high24h : 0 ,
197
- defaultAsset : { symbol : 'uSUI2x' , chainId : base . id } ,
211
+ defaultAsset : {
212
+ [ base . id ] : 'uSUI2x' ,
213
+ } ,
214
+ defaultChainId : base . id ,
198
215
lendingProtocol : LendingProtocol . morpho ,
199
216
} ,
200
217
{
@@ -207,7 +224,10 @@ export const markets: Market[] = [
207
224
change24h : 0 ,
208
225
low24h : 0 ,
209
226
high24h : 0 ,
210
- defaultAsset : { symbol : 'ETH2xBTC' , chainId : arbitrum . id } ,
227
+ defaultAsset : {
228
+ [ arbitrum . id ] : 'ETH2xBTC' ,
229
+ } ,
230
+ defaultChainId : arbitrum . id ,
211
231
lendingProtocol : LendingProtocol . aave ,
212
232
} ,
213
233
{
@@ -220,7 +240,10 @@ export const markets: Market[] = [
220
240
change24h : 0 ,
221
241
low24h : 0 ,
222
242
high24h : 0 ,
223
- defaultAsset : { symbol : 'BTC2xETH' , chainId : arbitrum . id } ,
243
+ defaultAsset : {
244
+ [ arbitrum . id ] : 'BTC2xETH' ,
245
+ } ,
246
+ defaultChainId : arbitrum . id ,
224
247
lendingProtocol : LendingProtocol . aave ,
225
248
} ,
226
249
]
0 commit comments