@gmx-io/sdk 2.3.1 → 2.4.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/cjs/src/codegen/prebuilt/hashedKinkModelMarketRatesKeys.json +32 -0
- package/build/cjs/src/codegen/prebuilt/hashedMarketConfigKeys.json +272 -0
- package/build/cjs/src/codegen/prebuilt/hashedMarketValuesKeys.json +60 -0
- package/build/cjs/src/configs/chains.js +13 -1
- package/build/cjs/src/configs/markets.js +40 -7
- package/build/cjs/src/configs/tokens.js +12 -7
- package/build/cjs/src/utils/__tests__/numbers.spec.js +24 -0
- package/build/cjs/src/utils/__tests__/parseError.spec.js +61 -0
- package/build/cjs/src/utils/errors/parseError.js +10 -0
- package/build/cjs/src/utils/errors/transactionsErrors.js +6 -0
- package/build/cjs/src/utils/markets/__tests__/multicall.spec.js +27 -0
- package/build/cjs/src/utils/markets/multicall.js +5 -7
- package/build/cjs/src/utils/numbers/utils.js +7 -1
- package/build/cjs/src/utils/orders/utils.js +8 -1
- package/build/cjs/src/utils/paxos/__tests__/api.spec.js +23 -3
- package/build/cjs/src/utils/paxos/api.js +6 -0
- package/build/cjs/src/utils/swap/preparedSwapData.js +6 -4
- package/build/cjs/src/utils/swap/swapPath.js +1 -1
- package/build/cjs/src/utils/trade/__tests__/decreaseMarginCheck.spec.js +224 -0
- package/build/cjs/src/utils/trade/__tests__/getMaxWithdrawAmount.spec.js +128 -9
- package/build/cjs/src/utils/trade/decrease.js +198 -33
- package/build/cjs/src/utils/trade/decreaseMarginCheck.js +157 -0
- package/build/cjs/src/utils/trade/increaseMarginCheck.js +27 -15
- package/build/cjs/src/utils/trade/index.js +1 -0
- package/build/esm/src/codegen/prebuilt/hashedKinkModelMarketRatesKeys.json +32 -0
- package/build/esm/src/codegen/prebuilt/hashedMarketConfigKeys.json +272 -0
- package/build/esm/src/codegen/prebuilt/hashedMarketValuesKeys.json +60 -0
- package/build/esm/src/configs/chains.js +11 -0
- package/build/esm/src/configs/markets.js +41 -8
- package/build/esm/src/configs/tokens.js +13 -8
- package/build/esm/src/utils/__tests__/numbers.spec.js +25 -1
- package/build/esm/src/utils/__tests__/parseError.spec.js +62 -1
- package/build/esm/src/utils/errors/parseError.js +11 -1
- package/build/esm/src/utils/errors/transactionsErrors.js +6 -0
- package/build/esm/src/utils/markets/__tests__/multicall.spec.js +25 -0
- package/build/esm/src/utils/markets/multicall.js +5 -7
- package/build/esm/src/utils/numbers/utils.js +5 -0
- package/build/esm/src/utils/orders/utils.js +6 -0
- package/build/esm/src/utils/paxos/__tests__/api.spec.js +23 -3
- package/build/esm/src/utils/paxos/api.js +6 -0
- package/build/esm/src/utils/swap/preparedSwapData.js +6 -4
- package/build/esm/src/utils/swap/swapPath.js +2 -2
- package/build/esm/src/utils/trade/__tests__/decreaseMarginCheck.spec.js +222 -0
- package/build/esm/src/utils/trade/__tests__/getMaxWithdrawAmount.spec.js +129 -10
- package/build/esm/src/utils/trade/decrease.js +195 -32
- package/build/esm/src/utils/trade/decreaseMarginCheck.js +152 -0
- package/build/esm/src/utils/trade/increaseMarginCheck.js +25 -14
- package/build/esm/src/utils/trade/index.js +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types/src/codegen/prebuilt/index.d.ts +364 -0
- package/build/types/src/configs/chains.d.ts +6 -2
- package/build/types/src/configs/markets.d.ts +4 -4
- package/build/types/src/utils/markets/__tests__/multicall.spec.d.ts +1 -0
- package/build/types/src/utils/numbers/utils.d.ts +1 -0
- package/build/types/src/utils/orderTransactions/api.d.ts +1 -0
- package/build/types/src/utils/orders/utils.d.ts +1 -0
- package/build/types/src/utils/paxos/types.d.ts +2 -0
- package/build/types/src/utils/trade/__tests__/decreaseMarginCheck.spec.d.ts +1 -0
- package/build/types/src/utils/trade/decrease.d.ts +18 -0
- package/build/types/src/utils/trade/decreaseMarginCheck.d.ts +52 -0
- package/build/types/src/utils/trade/increaseMarginCheck.d.ts +11 -1
- package/build/types/src/utils/trade/index.d.ts +1 -0
- package/build/types/src/utils/trade/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1952,6 +1952,66 @@ export declare const HASHED_MARKET_VALUES_KEYS: {
|
|
|
1952
1952
|
shortInterestInTokensUsingLongToken: string;
|
|
1953
1953
|
shortInterestInTokensUsingShortToken: string;
|
|
1954
1954
|
};
|
|
1955
|
+
"0x54bc430A788DFFD4ae35e751E10899489f5a953f": {
|
|
1956
|
+
longPoolAmount: string;
|
|
1957
|
+
shortPoolAmount: string;
|
|
1958
|
+
positionImpactPoolAmount: string;
|
|
1959
|
+
swapImpactPoolAmountLong: string;
|
|
1960
|
+
swapImpactPoolAmountShort: string;
|
|
1961
|
+
longInterestUsingLongToken: string;
|
|
1962
|
+
longInterestUsingShortToken: string;
|
|
1963
|
+
shortInterestUsingLongToken: string;
|
|
1964
|
+
shortInterestUsingShortToken: string;
|
|
1965
|
+
longInterestInTokensUsingLongToken: string;
|
|
1966
|
+
longInterestInTokensUsingShortToken: string;
|
|
1967
|
+
shortInterestInTokensUsingLongToken: string;
|
|
1968
|
+
shortInterestInTokensUsingShortToken: string;
|
|
1969
|
+
};
|
|
1970
|
+
"0xc9ED746D613eEfC0F196658f6030e90482593004": {
|
|
1971
|
+
longPoolAmount: string;
|
|
1972
|
+
shortPoolAmount: string;
|
|
1973
|
+
positionImpactPoolAmount: string;
|
|
1974
|
+
swapImpactPoolAmountLong: string;
|
|
1975
|
+
swapImpactPoolAmountShort: string;
|
|
1976
|
+
longInterestUsingLongToken: string;
|
|
1977
|
+
longInterestUsingShortToken: string;
|
|
1978
|
+
shortInterestUsingLongToken: string;
|
|
1979
|
+
shortInterestUsingShortToken: string;
|
|
1980
|
+
longInterestInTokensUsingLongToken: string;
|
|
1981
|
+
longInterestInTokensUsingShortToken: string;
|
|
1982
|
+
shortInterestInTokensUsingLongToken: string;
|
|
1983
|
+
shortInterestInTokensUsingShortToken: string;
|
|
1984
|
+
};
|
|
1985
|
+
"0x2CeEafcA180B07C9d1d2f1086f8f59AAFd282832": {
|
|
1986
|
+
longPoolAmount: string;
|
|
1987
|
+
shortPoolAmount: string;
|
|
1988
|
+
positionImpactPoolAmount: string;
|
|
1989
|
+
swapImpactPoolAmountLong: string;
|
|
1990
|
+
swapImpactPoolAmountShort: string;
|
|
1991
|
+
longInterestUsingLongToken: string;
|
|
1992
|
+
longInterestUsingShortToken: string;
|
|
1993
|
+
shortInterestUsingLongToken: string;
|
|
1994
|
+
shortInterestUsingShortToken: string;
|
|
1995
|
+
longInterestInTokensUsingLongToken: string;
|
|
1996
|
+
longInterestInTokensUsingShortToken: string;
|
|
1997
|
+
shortInterestInTokensUsingLongToken: string;
|
|
1998
|
+
shortInterestInTokensUsingShortToken: string;
|
|
1999
|
+
};
|
|
2000
|
+
"0x162C091263fBb3dfAf1D55DCC979533EB341DA5f": {
|
|
2001
|
+
longPoolAmount: string;
|
|
2002
|
+
shortPoolAmount: string;
|
|
2003
|
+
positionImpactPoolAmount: string;
|
|
2004
|
+
swapImpactPoolAmountLong: string;
|
|
2005
|
+
swapImpactPoolAmountShort: string;
|
|
2006
|
+
longInterestUsingLongToken: string;
|
|
2007
|
+
longInterestUsingShortToken: string;
|
|
2008
|
+
shortInterestUsingLongToken: string;
|
|
2009
|
+
shortInterestUsingShortToken: string;
|
|
2010
|
+
longInterestInTokensUsingLongToken: string;
|
|
2011
|
+
longInterestInTokensUsingShortToken: string;
|
|
2012
|
+
shortInterestInTokensUsingLongToken: string;
|
|
2013
|
+
shortInterestInTokensUsingShortToken: string;
|
|
2014
|
+
};
|
|
1955
2015
|
};
|
|
1956
2016
|
"43113": {
|
|
1957
2017
|
"0xD996ff47A1F763E1e55415BC4437c59292D1F415": {
|
|
@@ -11509,6 +11569,278 @@ export declare const HASHED_MARKET_CONFIG_KEYS: {
|
|
|
11509
11569
|
virtualLongTokenId: string;
|
|
11510
11570
|
virtualShortTokenId: string;
|
|
11511
11571
|
};
|
|
11572
|
+
"0x54bc430A788DFFD4ae35e751E10899489f5a953f": {
|
|
11573
|
+
isDisabled: string;
|
|
11574
|
+
maxLongPoolAmount: string;
|
|
11575
|
+
maxShortPoolAmount: string;
|
|
11576
|
+
maxLongPoolUsdForDeposit: string;
|
|
11577
|
+
maxShortPoolUsdForDeposit: string;
|
|
11578
|
+
reserveFactorLong: string;
|
|
11579
|
+
reserveFactorShort: string;
|
|
11580
|
+
openInterestReserveFactorLong: string;
|
|
11581
|
+
openInterestReserveFactorShort: string;
|
|
11582
|
+
maxOpenInterestLong: string;
|
|
11583
|
+
maxOpenInterestShort: string;
|
|
11584
|
+
maxCollateralSumLongTokenLong: string;
|
|
11585
|
+
maxCollateralSumLongTokenShort: string;
|
|
11586
|
+
maxCollateralSumShortTokenLong: string;
|
|
11587
|
+
maxCollateralSumShortTokenShort: string;
|
|
11588
|
+
minPositionImpactPoolAmount: string;
|
|
11589
|
+
positionImpactPoolDistributionRate: string;
|
|
11590
|
+
borrowingFactorLong: string;
|
|
11591
|
+
borrowingFactorShort: string;
|
|
11592
|
+
borrowingExponentFactorLong: string;
|
|
11593
|
+
borrowingExponentFactorShort: string;
|
|
11594
|
+
fundingFactor: string;
|
|
11595
|
+
fundingExponentFactor: string;
|
|
11596
|
+
fundingIncreaseFactorPerSecond: string;
|
|
11597
|
+
minFundingIncreaseRatePerSecond: string;
|
|
11598
|
+
fundingDecreaseFactorPerSecond: string;
|
|
11599
|
+
thresholdForStableFunding: string;
|
|
11600
|
+
thresholdForDecreaseFunding: string;
|
|
11601
|
+
minFundingFactorPerSecondLong: string;
|
|
11602
|
+
minFundingFactorPerSecondShort: string;
|
|
11603
|
+
maxFundingFactorPerSecondLong: string;
|
|
11604
|
+
maxFundingFactorPerSecondShort: string;
|
|
11605
|
+
maxPnlFactorForTradersLong: string;
|
|
11606
|
+
maxPnlFactorForTradersShort: string;
|
|
11607
|
+
maxPnlFactorForDepositsLong: string;
|
|
11608
|
+
maxPnlFactorForDepositsShort: string;
|
|
11609
|
+
maxPnlFactorForWithdrawalsLong: string;
|
|
11610
|
+
maxPnlFactorForWithdrawalsShort: string;
|
|
11611
|
+
positionFeeFactorForBalanceWasImproved: string;
|
|
11612
|
+
positionFeeFactorForBalanceWasNotImproved: string;
|
|
11613
|
+
positionImpactFactorPositive: string;
|
|
11614
|
+
positionImpactFactorNegative: string;
|
|
11615
|
+
maxPositionImpactFactorPositive: string;
|
|
11616
|
+
maxPositionImpactFactorNegative: string;
|
|
11617
|
+
maxPositionImpactFactorForLiquidations: string;
|
|
11618
|
+
maxLendableImpactFactor: string;
|
|
11619
|
+
maxLendableImpactFactorForWithdrawals: string;
|
|
11620
|
+
maxLendableImpactUsd: string;
|
|
11621
|
+
lentPositionImpactPoolAmount: string;
|
|
11622
|
+
minCollateralFactor: string;
|
|
11623
|
+
minCollateralFactorForLiquidation: string;
|
|
11624
|
+
minCollateralFactorForOpenInterestLong: string;
|
|
11625
|
+
minCollateralFactorForOpenInterestShort: string;
|
|
11626
|
+
positionImpactExponentFactorPositive: string;
|
|
11627
|
+
positionImpactExponentFactorNegative: string;
|
|
11628
|
+
swapFeeFactorForBalanceWasImproved: string;
|
|
11629
|
+
swapFeeFactorForBalanceWasNotImproved: string;
|
|
11630
|
+
atomicSwapFeeFactor: string;
|
|
11631
|
+
swapImpactFactorPositive: string;
|
|
11632
|
+
swapImpactFactorNegative: string;
|
|
11633
|
+
swapImpactExponentFactor: string;
|
|
11634
|
+
withdrawalFeeFactorBalanceWasImproved: string;
|
|
11635
|
+
withdrawalFeeFactorBalanceWasNotImproved: string;
|
|
11636
|
+
virtualMarketId: string;
|
|
11637
|
+
virtualLongTokenId: string;
|
|
11638
|
+
virtualShortTokenId: string;
|
|
11639
|
+
};
|
|
11640
|
+
"0xc9ED746D613eEfC0F196658f6030e90482593004": {
|
|
11641
|
+
isDisabled: string;
|
|
11642
|
+
maxLongPoolAmount: string;
|
|
11643
|
+
maxShortPoolAmount: string;
|
|
11644
|
+
maxLongPoolUsdForDeposit: string;
|
|
11645
|
+
maxShortPoolUsdForDeposit: string;
|
|
11646
|
+
reserveFactorLong: string;
|
|
11647
|
+
reserveFactorShort: string;
|
|
11648
|
+
openInterestReserveFactorLong: string;
|
|
11649
|
+
openInterestReserveFactorShort: string;
|
|
11650
|
+
maxOpenInterestLong: string;
|
|
11651
|
+
maxOpenInterestShort: string;
|
|
11652
|
+
maxCollateralSumLongTokenLong: string;
|
|
11653
|
+
maxCollateralSumLongTokenShort: string;
|
|
11654
|
+
maxCollateralSumShortTokenLong: string;
|
|
11655
|
+
maxCollateralSumShortTokenShort: string;
|
|
11656
|
+
minPositionImpactPoolAmount: string;
|
|
11657
|
+
positionImpactPoolDistributionRate: string;
|
|
11658
|
+
borrowingFactorLong: string;
|
|
11659
|
+
borrowingFactorShort: string;
|
|
11660
|
+
borrowingExponentFactorLong: string;
|
|
11661
|
+
borrowingExponentFactorShort: string;
|
|
11662
|
+
fundingFactor: string;
|
|
11663
|
+
fundingExponentFactor: string;
|
|
11664
|
+
fundingIncreaseFactorPerSecond: string;
|
|
11665
|
+
minFundingIncreaseRatePerSecond: string;
|
|
11666
|
+
fundingDecreaseFactorPerSecond: string;
|
|
11667
|
+
thresholdForStableFunding: string;
|
|
11668
|
+
thresholdForDecreaseFunding: string;
|
|
11669
|
+
minFundingFactorPerSecondLong: string;
|
|
11670
|
+
minFundingFactorPerSecondShort: string;
|
|
11671
|
+
maxFundingFactorPerSecondLong: string;
|
|
11672
|
+
maxFundingFactorPerSecondShort: string;
|
|
11673
|
+
maxPnlFactorForTradersLong: string;
|
|
11674
|
+
maxPnlFactorForTradersShort: string;
|
|
11675
|
+
maxPnlFactorForDepositsLong: string;
|
|
11676
|
+
maxPnlFactorForDepositsShort: string;
|
|
11677
|
+
maxPnlFactorForWithdrawalsLong: string;
|
|
11678
|
+
maxPnlFactorForWithdrawalsShort: string;
|
|
11679
|
+
positionFeeFactorForBalanceWasImproved: string;
|
|
11680
|
+
positionFeeFactorForBalanceWasNotImproved: string;
|
|
11681
|
+
positionImpactFactorPositive: string;
|
|
11682
|
+
positionImpactFactorNegative: string;
|
|
11683
|
+
maxPositionImpactFactorPositive: string;
|
|
11684
|
+
maxPositionImpactFactorNegative: string;
|
|
11685
|
+
maxPositionImpactFactorForLiquidations: string;
|
|
11686
|
+
maxLendableImpactFactor: string;
|
|
11687
|
+
maxLendableImpactFactorForWithdrawals: string;
|
|
11688
|
+
maxLendableImpactUsd: string;
|
|
11689
|
+
lentPositionImpactPoolAmount: string;
|
|
11690
|
+
minCollateralFactor: string;
|
|
11691
|
+
minCollateralFactorForLiquidation: string;
|
|
11692
|
+
minCollateralFactorForOpenInterestLong: string;
|
|
11693
|
+
minCollateralFactorForOpenInterestShort: string;
|
|
11694
|
+
positionImpactExponentFactorPositive: string;
|
|
11695
|
+
positionImpactExponentFactorNegative: string;
|
|
11696
|
+
swapFeeFactorForBalanceWasImproved: string;
|
|
11697
|
+
swapFeeFactorForBalanceWasNotImproved: string;
|
|
11698
|
+
atomicSwapFeeFactor: string;
|
|
11699
|
+
swapImpactFactorPositive: string;
|
|
11700
|
+
swapImpactFactorNegative: string;
|
|
11701
|
+
swapImpactExponentFactor: string;
|
|
11702
|
+
withdrawalFeeFactorBalanceWasImproved: string;
|
|
11703
|
+
withdrawalFeeFactorBalanceWasNotImproved: string;
|
|
11704
|
+
virtualMarketId: string;
|
|
11705
|
+
virtualLongTokenId: string;
|
|
11706
|
+
virtualShortTokenId: string;
|
|
11707
|
+
};
|
|
11708
|
+
"0x2CeEafcA180B07C9d1d2f1086f8f59AAFd282832": {
|
|
11709
|
+
isDisabled: string;
|
|
11710
|
+
maxLongPoolAmount: string;
|
|
11711
|
+
maxShortPoolAmount: string;
|
|
11712
|
+
maxLongPoolUsdForDeposit: string;
|
|
11713
|
+
maxShortPoolUsdForDeposit: string;
|
|
11714
|
+
reserveFactorLong: string;
|
|
11715
|
+
reserveFactorShort: string;
|
|
11716
|
+
openInterestReserveFactorLong: string;
|
|
11717
|
+
openInterestReserveFactorShort: string;
|
|
11718
|
+
maxOpenInterestLong: string;
|
|
11719
|
+
maxOpenInterestShort: string;
|
|
11720
|
+
maxCollateralSumLongTokenLong: string;
|
|
11721
|
+
maxCollateralSumLongTokenShort: string;
|
|
11722
|
+
maxCollateralSumShortTokenLong: string;
|
|
11723
|
+
maxCollateralSumShortTokenShort: string;
|
|
11724
|
+
minPositionImpactPoolAmount: string;
|
|
11725
|
+
positionImpactPoolDistributionRate: string;
|
|
11726
|
+
borrowingFactorLong: string;
|
|
11727
|
+
borrowingFactorShort: string;
|
|
11728
|
+
borrowingExponentFactorLong: string;
|
|
11729
|
+
borrowingExponentFactorShort: string;
|
|
11730
|
+
fundingFactor: string;
|
|
11731
|
+
fundingExponentFactor: string;
|
|
11732
|
+
fundingIncreaseFactorPerSecond: string;
|
|
11733
|
+
minFundingIncreaseRatePerSecond: string;
|
|
11734
|
+
fundingDecreaseFactorPerSecond: string;
|
|
11735
|
+
thresholdForStableFunding: string;
|
|
11736
|
+
thresholdForDecreaseFunding: string;
|
|
11737
|
+
minFundingFactorPerSecondLong: string;
|
|
11738
|
+
minFundingFactorPerSecondShort: string;
|
|
11739
|
+
maxFundingFactorPerSecondLong: string;
|
|
11740
|
+
maxFundingFactorPerSecondShort: string;
|
|
11741
|
+
maxPnlFactorForTradersLong: string;
|
|
11742
|
+
maxPnlFactorForTradersShort: string;
|
|
11743
|
+
maxPnlFactorForDepositsLong: string;
|
|
11744
|
+
maxPnlFactorForDepositsShort: string;
|
|
11745
|
+
maxPnlFactorForWithdrawalsLong: string;
|
|
11746
|
+
maxPnlFactorForWithdrawalsShort: string;
|
|
11747
|
+
positionFeeFactorForBalanceWasImproved: string;
|
|
11748
|
+
positionFeeFactorForBalanceWasNotImproved: string;
|
|
11749
|
+
positionImpactFactorPositive: string;
|
|
11750
|
+
positionImpactFactorNegative: string;
|
|
11751
|
+
maxPositionImpactFactorPositive: string;
|
|
11752
|
+
maxPositionImpactFactorNegative: string;
|
|
11753
|
+
maxPositionImpactFactorForLiquidations: string;
|
|
11754
|
+
maxLendableImpactFactor: string;
|
|
11755
|
+
maxLendableImpactFactorForWithdrawals: string;
|
|
11756
|
+
maxLendableImpactUsd: string;
|
|
11757
|
+
lentPositionImpactPoolAmount: string;
|
|
11758
|
+
minCollateralFactor: string;
|
|
11759
|
+
minCollateralFactorForLiquidation: string;
|
|
11760
|
+
minCollateralFactorForOpenInterestLong: string;
|
|
11761
|
+
minCollateralFactorForOpenInterestShort: string;
|
|
11762
|
+
positionImpactExponentFactorPositive: string;
|
|
11763
|
+
positionImpactExponentFactorNegative: string;
|
|
11764
|
+
swapFeeFactorForBalanceWasImproved: string;
|
|
11765
|
+
swapFeeFactorForBalanceWasNotImproved: string;
|
|
11766
|
+
atomicSwapFeeFactor: string;
|
|
11767
|
+
swapImpactFactorPositive: string;
|
|
11768
|
+
swapImpactFactorNegative: string;
|
|
11769
|
+
swapImpactExponentFactor: string;
|
|
11770
|
+
withdrawalFeeFactorBalanceWasImproved: string;
|
|
11771
|
+
withdrawalFeeFactorBalanceWasNotImproved: string;
|
|
11772
|
+
virtualMarketId: string;
|
|
11773
|
+
virtualLongTokenId: string;
|
|
11774
|
+
virtualShortTokenId: string;
|
|
11775
|
+
};
|
|
11776
|
+
"0x162C091263fBb3dfAf1D55DCC979533EB341DA5f": {
|
|
11777
|
+
isDisabled: string;
|
|
11778
|
+
maxLongPoolAmount: string;
|
|
11779
|
+
maxShortPoolAmount: string;
|
|
11780
|
+
maxLongPoolUsdForDeposit: string;
|
|
11781
|
+
maxShortPoolUsdForDeposit: string;
|
|
11782
|
+
reserveFactorLong: string;
|
|
11783
|
+
reserveFactorShort: string;
|
|
11784
|
+
openInterestReserveFactorLong: string;
|
|
11785
|
+
openInterestReserveFactorShort: string;
|
|
11786
|
+
maxOpenInterestLong: string;
|
|
11787
|
+
maxOpenInterestShort: string;
|
|
11788
|
+
maxCollateralSumLongTokenLong: string;
|
|
11789
|
+
maxCollateralSumLongTokenShort: string;
|
|
11790
|
+
maxCollateralSumShortTokenLong: string;
|
|
11791
|
+
maxCollateralSumShortTokenShort: string;
|
|
11792
|
+
minPositionImpactPoolAmount: string;
|
|
11793
|
+
positionImpactPoolDistributionRate: string;
|
|
11794
|
+
borrowingFactorLong: string;
|
|
11795
|
+
borrowingFactorShort: string;
|
|
11796
|
+
borrowingExponentFactorLong: string;
|
|
11797
|
+
borrowingExponentFactorShort: string;
|
|
11798
|
+
fundingFactor: string;
|
|
11799
|
+
fundingExponentFactor: string;
|
|
11800
|
+
fundingIncreaseFactorPerSecond: string;
|
|
11801
|
+
minFundingIncreaseRatePerSecond: string;
|
|
11802
|
+
fundingDecreaseFactorPerSecond: string;
|
|
11803
|
+
thresholdForStableFunding: string;
|
|
11804
|
+
thresholdForDecreaseFunding: string;
|
|
11805
|
+
minFundingFactorPerSecondLong: string;
|
|
11806
|
+
minFundingFactorPerSecondShort: string;
|
|
11807
|
+
maxFundingFactorPerSecondLong: string;
|
|
11808
|
+
maxFundingFactorPerSecondShort: string;
|
|
11809
|
+
maxPnlFactorForTradersLong: string;
|
|
11810
|
+
maxPnlFactorForTradersShort: string;
|
|
11811
|
+
maxPnlFactorForDepositsLong: string;
|
|
11812
|
+
maxPnlFactorForDepositsShort: string;
|
|
11813
|
+
maxPnlFactorForWithdrawalsLong: string;
|
|
11814
|
+
maxPnlFactorForWithdrawalsShort: string;
|
|
11815
|
+
positionFeeFactorForBalanceWasImproved: string;
|
|
11816
|
+
positionFeeFactorForBalanceWasNotImproved: string;
|
|
11817
|
+
positionImpactFactorPositive: string;
|
|
11818
|
+
positionImpactFactorNegative: string;
|
|
11819
|
+
maxPositionImpactFactorPositive: string;
|
|
11820
|
+
maxPositionImpactFactorNegative: string;
|
|
11821
|
+
maxPositionImpactFactorForLiquidations: string;
|
|
11822
|
+
maxLendableImpactFactor: string;
|
|
11823
|
+
maxLendableImpactFactorForWithdrawals: string;
|
|
11824
|
+
maxLendableImpactUsd: string;
|
|
11825
|
+
lentPositionImpactPoolAmount: string;
|
|
11826
|
+
minCollateralFactor: string;
|
|
11827
|
+
minCollateralFactorForLiquidation: string;
|
|
11828
|
+
minCollateralFactorForOpenInterestLong: string;
|
|
11829
|
+
minCollateralFactorForOpenInterestShort: string;
|
|
11830
|
+
positionImpactExponentFactorPositive: string;
|
|
11831
|
+
positionImpactExponentFactorNegative: string;
|
|
11832
|
+
swapFeeFactorForBalanceWasImproved: string;
|
|
11833
|
+
swapFeeFactorForBalanceWasNotImproved: string;
|
|
11834
|
+
atomicSwapFeeFactor: string;
|
|
11835
|
+
swapImpactFactorPositive: string;
|
|
11836
|
+
swapImpactFactorNegative: string;
|
|
11837
|
+
swapImpactExponentFactor: string;
|
|
11838
|
+
withdrawalFeeFactorBalanceWasImproved: string;
|
|
11839
|
+
withdrawalFeeFactorBalanceWasNotImproved: string;
|
|
11840
|
+
virtualMarketId: string;
|
|
11841
|
+
virtualLongTokenId: string;
|
|
11842
|
+
virtualShortTokenId: string;
|
|
11843
|
+
};
|
|
11512
11844
|
};
|
|
11513
11845
|
"43113": {
|
|
11514
11846
|
"0xD996ff47A1F763E1e55415BC4437c59292D1F415": {
|
|
@@ -15757,6 +16089,38 @@ export declare const HASHED_KINK_MODEL_MARKET_RATES_KEYS: {
|
|
|
15757
16089
|
aboveOptimalUsageBorrowingFactorLong: string;
|
|
15758
16090
|
aboveOptimalUsageBorrowingFactorShort: string;
|
|
15759
16091
|
};
|
|
16092
|
+
"0x54bc430A788DFFD4ae35e751E10899489f5a953f": {
|
|
16093
|
+
optimalUsageFactorLong: string;
|
|
16094
|
+
optimalUsageFactorShort: string;
|
|
16095
|
+
baseBorrowingFactorLong: string;
|
|
16096
|
+
baseBorrowingFactorShort: string;
|
|
16097
|
+
aboveOptimalUsageBorrowingFactorLong: string;
|
|
16098
|
+
aboveOptimalUsageBorrowingFactorShort: string;
|
|
16099
|
+
};
|
|
16100
|
+
"0xc9ED746D613eEfC0F196658f6030e90482593004": {
|
|
16101
|
+
optimalUsageFactorLong: string;
|
|
16102
|
+
optimalUsageFactorShort: string;
|
|
16103
|
+
baseBorrowingFactorLong: string;
|
|
16104
|
+
baseBorrowingFactorShort: string;
|
|
16105
|
+
aboveOptimalUsageBorrowingFactorLong: string;
|
|
16106
|
+
aboveOptimalUsageBorrowingFactorShort: string;
|
|
16107
|
+
};
|
|
16108
|
+
"0x2CeEafcA180B07C9d1d2f1086f8f59AAFd282832": {
|
|
16109
|
+
optimalUsageFactorLong: string;
|
|
16110
|
+
optimalUsageFactorShort: string;
|
|
16111
|
+
baseBorrowingFactorLong: string;
|
|
16112
|
+
baseBorrowingFactorShort: string;
|
|
16113
|
+
aboveOptimalUsageBorrowingFactorLong: string;
|
|
16114
|
+
aboveOptimalUsageBorrowingFactorShort: string;
|
|
16115
|
+
};
|
|
16116
|
+
"0x162C091263fBb3dfAf1D55DCC979533EB341DA5f": {
|
|
16117
|
+
optimalUsageFactorLong: string;
|
|
16118
|
+
optimalUsageFactorShort: string;
|
|
16119
|
+
baseBorrowingFactorLong: string;
|
|
16120
|
+
baseBorrowingFactorShort: string;
|
|
16121
|
+
aboveOptimalUsageBorrowingFactorLong: string;
|
|
16122
|
+
aboveOptimalUsageBorrowingFactorShort: string;
|
|
16123
|
+
};
|
|
15760
16124
|
};
|
|
15761
16125
|
"43113": {
|
|
15762
16126
|
"0xD996ff47A1F763E1e55415BC4437c59292D1F415": {
|
|
@@ -12,7 +12,10 @@ export type SettlementChainId = (typeof SETTLEMENT_CHAIN_IDS_DEV)[number];
|
|
|
12
12
|
export type SourceChainId = (typeof SOURCE_CHAIN_IDS)[number];
|
|
13
13
|
export declare const GMX_ACCOUNT_PSEUDO_CHAIN_ID = 0;
|
|
14
14
|
export type GmxAccountPseudoChainId = typeof GMX_ACCOUNT_PSEUDO_CHAIN_ID;
|
|
15
|
+
export declare const SOLANA_NETWORK_ID = -501;
|
|
16
|
+
export type SolanaNetworkId = typeof SOLANA_NETWORK_ID;
|
|
15
17
|
export type AnyChainId = ContractsChainId | SettlementChainId | SourceChainId;
|
|
18
|
+
export type NetworkId = ContractsChainId | SolanaNetworkId;
|
|
16
19
|
declare const CONTRACTS_CHAIN_CONFIGS: {
|
|
17
20
|
readonly 42161: {
|
|
18
21
|
readonly chainId: 42161;
|
|
@@ -190,12 +193,13 @@ declare const SOURCE_CHAIN_CONFIGS: {
|
|
|
190
193
|
};
|
|
191
194
|
export type ContractsChainName = (typeof CONTRACTS_CHAIN_CONFIGS)[keyof typeof CONTRACTS_CHAIN_CONFIGS]["name"];
|
|
192
195
|
export type SourceChainName = (typeof SOURCE_CHAIN_CONFIGS)[keyof typeof SOURCE_CHAIN_CONFIGS]["name"];
|
|
193
|
-
export type ChainName = ContractsChainName | SourceChainName | "Unknown";
|
|
196
|
+
export type ChainName = ContractsChainName | SourceChainName | "Solana" | "Unknown";
|
|
194
197
|
export type ContractsChainSlug = (typeof CONTRACTS_CHAIN_CONFIGS)[keyof typeof CONTRACTS_CHAIN_CONFIGS]["slug"];
|
|
195
198
|
export type SourceChainSlug = (typeof SOURCE_CHAIN_CONFIGS)[keyof typeof SOURCE_CHAIN_CONFIGS]["slug"];
|
|
196
|
-
export type ChainSlug = ContractsChainSlug | SourceChainSlug | "unknown";
|
|
199
|
+
export type ChainSlug = ContractsChainSlug | SourceChainSlug | "solana" | "unknown";
|
|
197
200
|
export declare const megaeth: Chain;
|
|
198
201
|
export declare const VIEM_CHAIN_BY_CHAIN_ID: Record<AnyChainId, Chain>;
|
|
202
|
+
export declare function isSolanaNetwork(networkId: number): networkId is SolanaNetworkId;
|
|
199
203
|
export declare function getChainName(chainId: number): ChainName;
|
|
200
204
|
export declare function getChainSlug(chainId: number): ChainSlug;
|
|
201
205
|
export declare function getChainIdBySlug(slug: string): AnyChainId | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ERC20Address, NativeTokenSupportedAddress, Token } from "../utils/tokens/types";
|
|
2
|
-
import { ContractsChainId } from "./chains";
|
|
2
|
+
import { ContractsChainId, NetworkId } from "./chains";
|
|
3
3
|
export declare const SWAP_GRAPH_MAX_MARKETS_PER_TOKEN = 5;
|
|
4
4
|
export declare const UI_MAX_LEVERAGE_BY_MARKET: Record<string, number>;
|
|
5
5
|
export type MarketConfig = {
|
|
@@ -11,9 +11,9 @@ export type MarketConfig = {
|
|
|
11
11
|
export type MarketsConfigMap = Record<string, MarketConfig>;
|
|
12
12
|
export declare const MARKETS: Record<ContractsChainId, MarketsConfigMap>;
|
|
13
13
|
export type MarketLabel = `${string}/USD [${string}-${string}]`;
|
|
14
|
-
export declare function getMarketsByChainId(chainId:
|
|
15
|
-
export declare function getMarketByLabel(chainId:
|
|
16
|
-
export declare const fixTokenSymbolFromMarketLabel: (chainId:
|
|
14
|
+
export declare function getMarketsByChainId(chainId: NetworkId): Record<string, MarketConfig>;
|
|
15
|
+
export declare function getMarketByLabel(chainId: NetworkId, label: MarketLabel): MarketConfig;
|
|
16
|
+
export declare const fixTokenSymbolFromMarketLabel: (chainId: NetworkId, symbol: string) => string;
|
|
17
17
|
export declare function isMarketTokenAddress(chainId: number, marketTokenAddress: string): boolean;
|
|
18
18
|
export declare function getTokenAddressByMarket<T extends "long" | "short" | "index">(chainId: number, marketTokenAddress: string, tokenType: T): T extends "index" ? NativeTokenSupportedAddress | ERC20Address : ERC20Address;
|
|
19
19
|
export declare function getMarketIndexToken(chainId: number, marketTokenAddress: string): Token;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -109,6 +109,7 @@ export declare function formatBalanceAmount(amount: bigint, tokenDecimals: numbe
|
|
|
109
109
|
isStable?: boolean;
|
|
110
110
|
signed?: boolean;
|
|
111
111
|
}): string;
|
|
112
|
+
export declare function truncateToBalanceDisplayDecimals(amount: bigint, tokenDecimals: number, isStable?: boolean): bigint;
|
|
112
113
|
export declare function formatFactor(factor: bigint): string;
|
|
113
114
|
export declare function numberWithCommasParts(x: BigNumberish, { showDollar }?: {
|
|
114
115
|
showDollar?: boolean;
|
|
@@ -172,6 +172,7 @@ export type PrepareCancelOrderRequest = {
|
|
|
172
172
|
export type CollateralOperation = "deposit" | "withdraw";
|
|
173
173
|
export type PrepareCollateralRequest = {
|
|
174
174
|
operation: CollateralOperation;
|
|
175
|
+
/** Use position.contractKey, the bytes32 contract hash. */
|
|
175
176
|
positionKey: string;
|
|
176
177
|
amount: bigint;
|
|
177
178
|
slippage?: number;
|
|
@@ -35,4 +35,5 @@ export declare function isOrderForPositionByData(order: OrderInfo, { account, ma
|
|
|
35
35
|
collateralAddress: string;
|
|
36
36
|
isLong: boolean;
|
|
37
37
|
}): order is PositionOrderInfo;
|
|
38
|
+
export declare function getOrderPositionKey(order: OrderInfo): string;
|
|
38
39
|
export declare function getOrderTradeboxKey(order: OrderInfo): string;
|
|
@@ -4,6 +4,8 @@ export type TransitOrderStatus = "PENDING_BRIDGE" | "PROCESSING" | "PROCESSED" |
|
|
|
4
4
|
export type TransitFeeTierResponse = {
|
|
5
5
|
feeTier: TransitFeeTier;
|
|
6
6
|
zeroFeeCapacity: bigint;
|
|
7
|
+
isZeroFeeAvailable: boolean;
|
|
8
|
+
zeroFeeExpectedReopenAt: number | undefined;
|
|
7
9
|
};
|
|
8
10
|
export type TransitTokenMetadata = {
|
|
9
11
|
chain_id: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -21,6 +21,7 @@ export declare function getDecreasePositionAmounts(p: {
|
|
|
21
21
|
fixedAcceptablePriceImpactBps?: bigint;
|
|
22
22
|
acceptablePriceImpactBuffer?: number;
|
|
23
23
|
userReferralInfo: UserReferralInfo | undefined;
|
|
24
|
+
proDiscountFactor?: bigint;
|
|
24
25
|
minCollateralUsd: bigint;
|
|
25
26
|
minPositionSizeUsd: bigint;
|
|
26
27
|
uiFeeFactor: bigint;
|
|
@@ -30,6 +31,7 @@ export declare function getDecreasePositionAmounts(p: {
|
|
|
30
31
|
isSetAcceptablePriceImpactEnabled: boolean;
|
|
31
32
|
receiveToken?: TokenData;
|
|
32
33
|
forceDecreaseSwapType?: DecreasePositionSwapType;
|
|
34
|
+
isTwap?: boolean;
|
|
33
35
|
}): DecreasePositionAmounts;
|
|
34
36
|
export declare function getIsFullClose(p: {
|
|
35
37
|
position: PositionInfoLoaded;
|
|
@@ -51,6 +53,18 @@ export declare function getMaxWithdrawAmount(p: {
|
|
|
51
53
|
collateralPrice: bigint | undefined;
|
|
52
54
|
collateralDecimals: number | undefined;
|
|
53
55
|
userReferralInfo: UserReferralInfo | undefined;
|
|
56
|
+
proDiscountFactor?: bigint;
|
|
57
|
+
}): bigint;
|
|
58
|
+
export declare function getIsProfitKeptInPnlToken(p: {
|
|
59
|
+
pnlToken: TokenData;
|
|
60
|
+
collateralToken: TokenData;
|
|
61
|
+
decreaseSwapType: DecreasePositionSwapType;
|
|
62
|
+
isProfitSwapReverted?: boolean;
|
|
63
|
+
}): boolean;
|
|
64
|
+
export declare function getCollateralDeltaAmountAfterPriceImpactDiff(p: {
|
|
65
|
+
collateralDeltaAmount: bigint;
|
|
66
|
+
priceImpactDiffUsd: bigint;
|
|
67
|
+
collateralToken: TokenData;
|
|
54
68
|
}): bigint;
|
|
55
69
|
export declare function payForCollateralCost(p: {
|
|
56
70
|
initialCostUsd: bigint;
|
|
@@ -63,6 +77,7 @@ export declare function payForCollateralCost(p: {
|
|
|
63
77
|
remainingCollateralAmount: bigint;
|
|
64
78
|
paidOutputAmount: bigint;
|
|
65
79
|
paidRemainingCollateralAmount: bigint;
|
|
80
|
+
unpaidCostAmount: bigint;
|
|
66
81
|
};
|
|
67
82
|
export declare function estimateCollateralCost(baseUsd: bigint, collateralToken: TokenData, collateralPrice: bigint): {
|
|
68
83
|
amount: bigint;
|
|
@@ -95,6 +110,7 @@ export declare function getNextPositionValuesForDecreaseTrade(p: {
|
|
|
95
110
|
isLong: boolean;
|
|
96
111
|
minCollateralUsd: bigint;
|
|
97
112
|
userReferralInfo: UserReferralInfo | undefined;
|
|
113
|
+
priceImpactDiffUsd?: bigint;
|
|
98
114
|
}): NextPositionValues;
|
|
99
115
|
export declare function getDecreaseSwapType(pnlToken: TokenData, collateralToken: TokenData, receiveToken: TokenData): DecreasePositionSwapType;
|
|
100
116
|
export declare function isThirdTokenDecreaseSwap(pnlToken: TokenData, collateralToken: TokenData, receiveToken: TokenData): boolean;
|
|
@@ -119,6 +135,7 @@ export declare function getOptimalDecreaseAndSwapAmounts(p: {
|
|
|
119
135
|
fixedAcceptablePriceImpactBps?: bigint;
|
|
120
136
|
acceptablePriceImpactBuffer?: number;
|
|
121
137
|
userReferralInfo: UserReferralInfo | undefined;
|
|
138
|
+
proDiscountFactor?: bigint;
|
|
122
139
|
minCollateralUsd: bigint;
|
|
123
140
|
minPositionSizeUsd: bigint;
|
|
124
141
|
uiFeeFactor: bigint;
|
|
@@ -126,6 +143,7 @@ export declare function getOptimalDecreaseAndSwapAmounts(p: {
|
|
|
126
143
|
isSetAcceptablePriceImpactEnabled: boolean;
|
|
127
144
|
receiveToken: TokenData;
|
|
128
145
|
forceDecreaseSwapType?: DecreasePositionSwapType;
|
|
146
|
+
isTwap?: boolean;
|
|
129
147
|
findSwapPath: FindSwapPath;
|
|
130
148
|
findSwapPathFromPnl: FindSwapPath;
|
|
131
149
|
marketsInfoData: MarketsInfoData | undefined;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { MarketInfo } from "../markets/types";
|
|
2
|
+
import { UserReferralInfo } from "../referrals/types";
|
|
3
|
+
import { TokenData } from "../tokens/types";
|
|
4
|
+
import { PositionMarginState } from "./increaseMarginCheck";
|
|
5
|
+
import { DecreasePositionAmounts } from "./types";
|
|
6
|
+
export type DecreasePositionMarginState = PositionMarginState & {
|
|
7
|
+
isCollateralWithdrawalCancelled: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type DecreaseResultingPositionMarginStateParams = {
|
|
10
|
+
marketInfo: MarketInfo;
|
|
11
|
+
collateralToken: TokenData;
|
|
12
|
+
isLong: boolean;
|
|
13
|
+
position: {
|
|
14
|
+
sizeInUsd: bigint;
|
|
15
|
+
sizeInTokens: bigint;
|
|
16
|
+
collateralAmount: bigint;
|
|
17
|
+
pendingImpactAmount: bigint;
|
|
18
|
+
};
|
|
19
|
+
sizeDeltaUsd: bigint;
|
|
20
|
+
sizeDeltaInTokens: bigint;
|
|
21
|
+
collateralDeltaAmount: bigint;
|
|
22
|
+
payedRemainingCollateralAmount: bigint;
|
|
23
|
+
priceImpactDiffUsd: bigint;
|
|
24
|
+
minCollateralUsd: bigint;
|
|
25
|
+
minPositionSizeUsd: bigint;
|
|
26
|
+
userReferralInfo: UserReferralInfo | undefined;
|
|
27
|
+
proDiscountFactor?: bigint;
|
|
28
|
+
indexPriceForEvaluation?: bigint;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Mirrors the gates of `DecreasePositionUtils.decreasePosition` from the gmx-synthetics build deployed on
|
|
32
|
+
* Arbitrum (release_2.2.1 @ 23c9d160) for a market decrease, a trigger decrease at `indexPriceForEvaluation`
|
|
33
|
+
* or a collateral withdrawal that leaves a position open.
|
|
34
|
+
*/
|
|
35
|
+
export declare function getDecreaseResultingPositionMarginState(p: DecreaseResultingPositionMarginStateParams): DecreasePositionMarginState | undefined;
|
|
36
|
+
export type TriggerDecreaseRemainingPositionMarginStateParams = {
|
|
37
|
+
marketInfo: MarketInfo;
|
|
38
|
+
collateralToken: TokenData;
|
|
39
|
+
isLong: boolean;
|
|
40
|
+
position: DecreaseResultingPositionMarginStateParams["position"];
|
|
41
|
+
decreaseAmounts: DecreasePositionAmounts;
|
|
42
|
+
collateralDeltaAmount: bigint;
|
|
43
|
+
minCollateralUsd: bigint;
|
|
44
|
+
minPositionSizeUsd: bigint;
|
|
45
|
+
userReferralInfo: UserReferralInfo | undefined;
|
|
46
|
+
proDiscountFactor?: bigint;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* The same gates for a Take-Profit or Stop-Loss at its trigger price: `decreaseAmounts` are its amounts at that
|
|
50
|
+
* price and `collateralDeltaAmount` is the collateral withdrawal the order stores.
|
|
51
|
+
*/
|
|
52
|
+
export declare function getTriggerDecreaseRemainingPositionMarginState(p: TriggerDecreaseRemainingPositionMarginStateParams): DecreasePositionMarginState | undefined;
|
|
@@ -6,6 +6,7 @@ export declare enum PositionMarginFailureReason {
|
|
|
6
6
|
NonPositiveRemainingMargin = "< 0",
|
|
7
7
|
MinCollateralForLeverage = "min collateral for leverage",
|
|
8
8
|
InsufficientCollateralUsd = "insufficient collateral usd",
|
|
9
|
+
UnableToWithdrawCollateral = "unable to withdraw collateral",
|
|
9
10
|
MaxAllowedLeverage = "max allowed leverage"
|
|
10
11
|
}
|
|
11
12
|
export declare function getIsMaxLeverageMarginReason(reason: PositionMarginFailureReason | undefined): boolean;
|
|
@@ -27,12 +28,13 @@ export type PositionMarginStateParams = {
|
|
|
27
28
|
isLong: boolean;
|
|
28
29
|
userReferralInfo: UserReferralInfo | undefined;
|
|
29
30
|
proDiscountFactor?: bigint;
|
|
31
|
+
shouldValidateMinCollateralUsd?: boolean;
|
|
30
32
|
};
|
|
31
33
|
/**
|
|
32
34
|
* Port of `PositionUtils.isPositionLiquidatable` from the gmx-synthetics build deployed on Arbitrum
|
|
33
35
|
* (release_2.2.1 @ 23c9d160: release-v2.2c plus MarketUtils.getPositivePnl in the per-position pnl cap)
|
|
34
36
|
* for a position whose pending fees have just been settled — the state the contract validates right
|
|
35
|
-
* after an increase.
|
|
37
|
+
* after an increase or a decrease.
|
|
36
38
|
*/
|
|
37
39
|
export declare function getResultingPositionMarginState(p: PositionMarginStateParams): PositionMarginState;
|
|
38
40
|
export type IncreasePositionState = {
|
|
@@ -54,6 +56,14 @@ export type IncreaseResultingPositionMarginStateParams = {
|
|
|
54
56
|
proDiscountFactor?: bigint;
|
|
55
57
|
indexPriceForEvaluation?: bigint;
|
|
56
58
|
};
|
|
59
|
+
export declare function getMarketInfoAtIndexPrice(p: {
|
|
60
|
+
marketInfo: MarketInfo;
|
|
61
|
+
collateralToken: TokenData;
|
|
62
|
+
indexPrice: bigint | undefined;
|
|
63
|
+
}): {
|
|
64
|
+
marketInfo: MarketInfo;
|
|
65
|
+
collateralToken: TokenData;
|
|
66
|
+
};
|
|
57
67
|
export type IncreaseResultingPositionState = {
|
|
58
68
|
marginState: PositionMarginState;
|
|
59
69
|
position: IncreasePositionState;
|
|
@@ -110,6 +110,7 @@ export type DecreasePositionAmounts = {
|
|
|
110
110
|
payedRemainingCollateralAmount: bigint;
|
|
111
111
|
payedOutputUsd: bigint;
|
|
112
112
|
payedRemainingCollateralUsd: bigint;
|
|
113
|
+
unpaidCostUsd: bigint;
|
|
113
114
|
receiveTokenAmount: bigint;
|
|
114
115
|
receiveUsd: bigint;
|
|
115
116
|
primaryOutput: DecreasePositionOutput;
|