@@ -29,31 +29,46 @@ export async function getPreLiquidablePositions(
29
29
} ;
30
30
31
31
const preLiquidationInstances = await Promise . all (
32
- data . preLiquidationData . map ( async ( preLiquidation ) => {
33
- const {
34
- markets : { items : market } ,
35
- } = await apiSdk . getMarketAssets ( {
36
- chainId,
37
- marketId : preLiquidation . marketId ,
38
- } ) ;
32
+ data . preLiquidationData
33
+ . map ( ( preLiquidation ) => {
34
+ return {
35
+ ...preLiquidation ,
36
+ price : BigInt ( preLiquidation . price ) ,
37
+ preLiquidationParams : {
38
+ ...preLiquidation . preLiquidationParams ,
39
+ preLCF1 : BigInt ( preLiquidation . preLiquidationParams . preLCF1 ) ,
40
+ preLCF2 : BigInt ( preLiquidation . preLiquidationParams . preLCF2 ) ,
41
+ preLIF1 : BigInt ( preLiquidation . preLiquidationParams . preLIF1 ) ,
42
+ preLIF2 : BigInt ( preLiquidation . preLiquidationParams . preLIF2 ) ,
43
+ preLltv : BigInt ( preLiquidation . preLiquidationParams . preLltv ) ,
44
+ } ,
45
+ } ;
46
+ } )
47
+ . map ( async ( preLiquidation ) => {
48
+ const {
49
+ markets : { items : market } ,
50
+ } = await apiSdk . getMarketAssets ( {
51
+ chainId,
52
+ marketId : preLiquidation . marketId ,
53
+ } ) ;
39
54
40
- const loanAsset = market !== null ? market [ 0 ] ?. loanAsset : undefined ;
41
- const collateralAsset =
42
- market !== null ? market [ 0 ] ?. collateralAsset : undefined ;
55
+ const loanAsset = market !== null ? market [ 0 ] ?. loanAsset : undefined ;
56
+ const collateralAsset =
57
+ market !== null ? market [ 0 ] ?. collateralAsset : undefined ;
43
58
44
- if (
45
- loanAsset === undefined ||
46
- collateralAsset === undefined ||
47
- collateralAsset === null
48
- )
49
- return ;
59
+ if (
60
+ loanAsset === undefined ||
61
+ collateralAsset === undefined ||
62
+ collateralAsset === null
63
+ )
64
+ return ;
50
65
51
- return {
52
- ...preLiquidation ,
53
- loanAsset,
54
- collateralAsset,
55
- } ;
56
- } ) ,
66
+ return {
67
+ ...preLiquidation ,
68
+ loanAsset,
69
+ collateralAsset,
70
+ } ;
71
+ } ) ,
57
72
) ;
58
73
59
74
const preLiquidablePositions = await Promise . all (
0 commit comments