@crypticdot/defituna-client 3.1.18 → 3.2.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/dist/index.d.mts +33 -184
- package/dist/index.d.ts +33 -184
- package/dist/index.js +61 -321
- package/dist/index.mjs +346 -629
- package/package.json +4 -3
package/dist/index.mjs
CHANGED
|
@@ -1671,8 +1671,8 @@ import {
|
|
|
1671
1671
|
getBytesEncoder as getBytesEncoder8,
|
|
1672
1672
|
getStructDecoder as getStructDecoder9,
|
|
1673
1673
|
getStructEncoder as getStructEncoder9,
|
|
1674
|
-
|
|
1675
|
-
|
|
1674
|
+
getU64Decoder as getU64Decoder6,
|
|
1675
|
+
getU64Encoder as getU64Encoder6,
|
|
1676
1676
|
transformEncoder as transformEncoder7
|
|
1677
1677
|
} from "@solana/kit";
|
|
1678
1678
|
|
|
@@ -1727,7 +1727,7 @@ function getCloseActiveTunaSpotPositionFusionInstructionDataEncoder() {
|
|
|
1727
1727
|
return transformEncoder7(
|
|
1728
1728
|
getStructEncoder9([
|
|
1729
1729
|
["discriminator", fixEncoderSize8(getBytesEncoder8(), 8)],
|
|
1730
|
-
["
|
|
1730
|
+
["maxSwapAmountIn", getU64Encoder6()],
|
|
1731
1731
|
["remainingAccountsInfo", getRemainingAccountsInfoEncoder()]
|
|
1732
1732
|
]),
|
|
1733
1733
|
(value) => ({
|
|
@@ -1739,7 +1739,7 @@ function getCloseActiveTunaSpotPositionFusionInstructionDataEncoder() {
|
|
|
1739
1739
|
function getCloseActiveTunaSpotPositionFusionInstructionDataDecoder() {
|
|
1740
1740
|
return getStructDecoder9([
|
|
1741
1741
|
["discriminator", fixDecoderSize7(getBytesDecoder7(), 8)],
|
|
1742
|
-
["
|
|
1742
|
+
["maxSwapAmountIn", getU64Decoder6()],
|
|
1743
1743
|
["remainingAccountsInfo", getRemainingAccountsInfoDecoder()]
|
|
1744
1744
|
]);
|
|
1745
1745
|
}
|
|
@@ -1883,8 +1883,8 @@ import {
|
|
|
1883
1883
|
getBytesEncoder as getBytesEncoder9,
|
|
1884
1884
|
getStructDecoder as getStructDecoder10,
|
|
1885
1885
|
getStructEncoder as getStructEncoder10,
|
|
1886
|
-
|
|
1887
|
-
|
|
1886
|
+
getU64Decoder as getU64Decoder7,
|
|
1887
|
+
getU64Encoder as getU64Encoder7,
|
|
1888
1888
|
transformEncoder as transformEncoder8
|
|
1889
1889
|
} from "@solana/kit";
|
|
1890
1890
|
var CLOSE_ACTIVE_TUNA_SPOT_POSITION_ORCA_DISCRIMINATOR = new Uint8Array([198, 185, 205, 125, 184, 130, 90, 82]);
|
|
@@ -1897,7 +1897,7 @@ function getCloseActiveTunaSpotPositionOrcaInstructionDataEncoder() {
|
|
|
1897
1897
|
return transformEncoder8(
|
|
1898
1898
|
getStructEncoder10([
|
|
1899
1899
|
["discriminator", fixEncoderSize9(getBytesEncoder9(), 8)],
|
|
1900
|
-
["
|
|
1900
|
+
["maxSwapAmountIn", getU64Encoder7()],
|
|
1901
1901
|
["remainingAccountsInfo", getRemainingAccountsInfoEncoder()]
|
|
1902
1902
|
]),
|
|
1903
1903
|
(value) => ({
|
|
@@ -1909,7 +1909,7 @@ function getCloseActiveTunaSpotPositionOrcaInstructionDataEncoder() {
|
|
|
1909
1909
|
function getCloseActiveTunaSpotPositionOrcaInstructionDataDecoder() {
|
|
1910
1910
|
return getStructDecoder10([
|
|
1911
1911
|
["discriminator", fixDecoderSize8(getBytesDecoder8(), 8)],
|
|
1912
|
-
["
|
|
1912
|
+
["maxSwapAmountIn", getU64Decoder7()],
|
|
1913
1913
|
["remainingAccountsInfo", getRemainingAccountsInfoDecoder()]
|
|
1914
1914
|
]);
|
|
1915
1915
|
}
|
|
@@ -3239,10 +3239,10 @@ import {
|
|
|
3239
3239
|
getStructEncoder as getStructEncoder19,
|
|
3240
3240
|
getU16Decoder as getU16Decoder7,
|
|
3241
3241
|
getU16Encoder as getU16Encoder7,
|
|
3242
|
-
getU32Decoder as
|
|
3243
|
-
getU32Encoder as
|
|
3244
|
-
getU64Decoder as
|
|
3245
|
-
getU64Encoder as
|
|
3242
|
+
getU32Decoder as getU32Decoder5,
|
|
3243
|
+
getU32Encoder as getU32Encoder5,
|
|
3244
|
+
getU64Decoder as getU64Decoder8,
|
|
3245
|
+
getU64Encoder as getU64Encoder8,
|
|
3246
3246
|
transformEncoder as transformEncoder17
|
|
3247
3247
|
} from "@solana/kit";
|
|
3248
3248
|
var CREATE_MARKET_DISCRIMINATOR = new Uint8Array([
|
|
@@ -3266,20 +3266,20 @@ function getCreateMarketInstructionDataEncoder() {
|
|
|
3266
3266
|
["discriminator", fixEncoderSize18(getBytesEncoder18(), 8)],
|
|
3267
3267
|
["marketMaker", getMarketMakerEncoder()],
|
|
3268
3268
|
["addressLookupTable", getAddressEncoder7()],
|
|
3269
|
-
["maxLeverage",
|
|
3269
|
+
["maxLeverage", getU32Encoder5()],
|
|
3270
3270
|
["protocolFee", getU16Encoder7()],
|
|
3271
3271
|
["protocolFeeOnCollateral", getU16Encoder7()],
|
|
3272
|
-
["liquidationFee",
|
|
3273
|
-
["liquidationThreshold",
|
|
3274
|
-
["limitOrderExecutionFee",
|
|
3275
|
-
["oraclePriceDeviationThreshold",
|
|
3272
|
+
["liquidationFee", getU32Encoder5()],
|
|
3273
|
+
["liquidationThreshold", getU32Encoder5()],
|
|
3274
|
+
["limitOrderExecutionFee", getU32Encoder5()],
|
|
3275
|
+
["oraclePriceDeviationThreshold", getU32Encoder5()],
|
|
3276
3276
|
["disabled", getBooleanEncoder5()],
|
|
3277
|
-
["borrowLimitA",
|
|
3278
|
-
["borrowLimitB",
|
|
3279
|
-
["maxSwapSlippage",
|
|
3280
|
-
["rebalanceProtocolFee",
|
|
3281
|
-
["spotPositionSizeLimitA",
|
|
3282
|
-
["spotPositionSizeLimitB",
|
|
3277
|
+
["borrowLimitA", getU64Encoder8()],
|
|
3278
|
+
["borrowLimitB", getU64Encoder8()],
|
|
3279
|
+
["maxSwapSlippage", getU32Encoder5()],
|
|
3280
|
+
["rebalanceProtocolFee", getU32Encoder5()],
|
|
3281
|
+
["spotPositionSizeLimitA", getU64Encoder8()],
|
|
3282
|
+
["spotPositionSizeLimitB", getU64Encoder8()]
|
|
3283
3283
|
]),
|
|
3284
3284
|
(value) => ({ ...value, discriminator: CREATE_MARKET_DISCRIMINATOR })
|
|
3285
3285
|
);
|
|
@@ -3289,20 +3289,20 @@ function getCreateMarketInstructionDataDecoder() {
|
|
|
3289
3289
|
["discriminator", fixDecoderSize17(getBytesDecoder17(), 8)],
|
|
3290
3290
|
["marketMaker", getMarketMakerDecoder()],
|
|
3291
3291
|
["addressLookupTable", getAddressDecoder7()],
|
|
3292
|
-
["maxLeverage",
|
|
3292
|
+
["maxLeverage", getU32Decoder5()],
|
|
3293
3293
|
["protocolFee", getU16Decoder7()],
|
|
3294
3294
|
["protocolFeeOnCollateral", getU16Decoder7()],
|
|
3295
|
-
["liquidationFee",
|
|
3296
|
-
["liquidationThreshold",
|
|
3297
|
-
["limitOrderExecutionFee",
|
|
3298
|
-
["oraclePriceDeviationThreshold",
|
|
3295
|
+
["liquidationFee", getU32Decoder5()],
|
|
3296
|
+
["liquidationThreshold", getU32Decoder5()],
|
|
3297
|
+
["limitOrderExecutionFee", getU32Decoder5()],
|
|
3298
|
+
["oraclePriceDeviationThreshold", getU32Decoder5()],
|
|
3299
3299
|
["disabled", getBooleanDecoder5()],
|
|
3300
|
-
["borrowLimitA",
|
|
3301
|
-
["borrowLimitB",
|
|
3302
|
-
["maxSwapSlippage",
|
|
3303
|
-
["rebalanceProtocolFee",
|
|
3304
|
-
["spotPositionSizeLimitA",
|
|
3305
|
-
["spotPositionSizeLimitB",
|
|
3300
|
+
["borrowLimitA", getU64Decoder8()],
|
|
3301
|
+
["borrowLimitB", getU64Decoder8()],
|
|
3302
|
+
["maxSwapSlippage", getU32Decoder5()],
|
|
3303
|
+
["rebalanceProtocolFee", getU32Decoder5()],
|
|
3304
|
+
["spotPositionSizeLimitA", getU64Decoder8()],
|
|
3305
|
+
["spotPositionSizeLimitB", getU64Decoder8()]
|
|
3306
3306
|
]);
|
|
3307
3307
|
}
|
|
3308
3308
|
function getCreateMarketInstructionDataCodec() {
|
|
@@ -3485,8 +3485,8 @@ import {
|
|
|
3485
3485
|
getBytesEncoder as getBytesEncoder20,
|
|
3486
3486
|
getStructDecoder as getStructDecoder21,
|
|
3487
3487
|
getStructEncoder as getStructEncoder21,
|
|
3488
|
-
getU64Decoder as
|
|
3489
|
-
getU64Encoder as
|
|
3488
|
+
getU64Decoder as getU64Decoder9,
|
|
3489
|
+
getU64Encoder as getU64Encoder9,
|
|
3490
3490
|
transformEncoder as transformEncoder19
|
|
3491
3491
|
} from "@solana/kit";
|
|
3492
3492
|
var CREATE_VAULT_DISCRIMINATOR = new Uint8Array([
|
|
@@ -3508,8 +3508,8 @@ function getCreateVaultInstructionDataEncoder() {
|
|
|
3508
3508
|
return transformEncoder19(
|
|
3509
3509
|
getStructEncoder21([
|
|
3510
3510
|
["discriminator", fixEncoderSize20(getBytesEncoder20(), 8)],
|
|
3511
|
-
["interestRate",
|
|
3512
|
-
["supplyLimit",
|
|
3511
|
+
["interestRate", getU64Encoder9()],
|
|
3512
|
+
["supplyLimit", getU64Encoder9()],
|
|
3513
3513
|
["pythOraclePriceUpdate", getAddressEncoder9()],
|
|
3514
3514
|
["pythOracleFeedId", getAddressEncoder9()],
|
|
3515
3515
|
["allowUnsafeTokenExtensions", getBooleanEncoder6()]
|
|
@@ -3520,8 +3520,8 @@ function getCreateVaultInstructionDataEncoder() {
|
|
|
3520
3520
|
function getCreateVaultInstructionDataDecoder() {
|
|
3521
3521
|
return getStructDecoder21([
|
|
3522
3522
|
["discriminator", fixDecoderSize19(getBytesDecoder19(), 8)],
|
|
3523
|
-
["interestRate",
|
|
3524
|
-
["supplyLimit",
|
|
3523
|
+
["interestRate", getU64Decoder9()],
|
|
3524
|
+
["supplyLimit", getU64Decoder9()],
|
|
3525
3525
|
["pythOraclePriceUpdate", getAddressDecoder9()],
|
|
3526
3526
|
["pythOracleFeedId", getAddressDecoder9()],
|
|
3527
3527
|
["allowUnsafeTokenExtensions", getBooleanDecoder6()]
|
|
@@ -3606,10 +3606,10 @@ import {
|
|
|
3606
3606
|
getOptionEncoder,
|
|
3607
3607
|
getStructDecoder as getStructDecoder22,
|
|
3608
3608
|
getStructEncoder as getStructEncoder22,
|
|
3609
|
-
getU32Decoder as
|
|
3610
|
-
getU32Encoder as
|
|
3611
|
-
getU64Decoder as
|
|
3612
|
-
getU64Encoder as
|
|
3609
|
+
getU32Decoder as getU32Decoder6,
|
|
3610
|
+
getU32Encoder as getU32Encoder6,
|
|
3611
|
+
getU64Decoder as getU64Decoder10,
|
|
3612
|
+
getU64Encoder as getU64Encoder10,
|
|
3613
3613
|
transformEncoder as transformEncoder20
|
|
3614
3614
|
} from "@solana/kit";
|
|
3615
3615
|
var DECREASE_TUNA_LP_POSITION_FUSION_DISCRIMINATOR = new Uint8Array([
|
|
@@ -3631,11 +3631,11 @@ function getDecreaseTunaLpPositionFusionInstructionDataEncoder() {
|
|
|
3631
3631
|
return transformEncoder20(
|
|
3632
3632
|
getStructEncoder22([
|
|
3633
3633
|
["discriminator", fixEncoderSize21(getBytesEncoder21(), 8)],
|
|
3634
|
-
["withdrawPercent",
|
|
3634
|
+
["withdrawPercent", getU32Encoder6()],
|
|
3635
3635
|
["swapToToken", getOptionEncoder(getPoolTokenEncoder())],
|
|
3636
|
-
["minRemovedAmountA",
|
|
3637
|
-
["minRemovedAmountB",
|
|
3638
|
-
["maxSwapSlippage",
|
|
3636
|
+
["minRemovedAmountA", getU64Encoder10()],
|
|
3637
|
+
["minRemovedAmountB", getU64Encoder10()],
|
|
3638
|
+
["maxSwapSlippage", getU32Encoder6()],
|
|
3639
3639
|
["remainingAccountsInfo", getRemainingAccountsInfoEncoder()]
|
|
3640
3640
|
]),
|
|
3641
3641
|
(value) => ({
|
|
@@ -3647,11 +3647,11 @@ function getDecreaseTunaLpPositionFusionInstructionDataEncoder() {
|
|
|
3647
3647
|
function getDecreaseTunaLpPositionFusionInstructionDataDecoder() {
|
|
3648
3648
|
return getStructDecoder22([
|
|
3649
3649
|
["discriminator", fixDecoderSize20(getBytesDecoder20(), 8)],
|
|
3650
|
-
["withdrawPercent",
|
|
3650
|
+
["withdrawPercent", getU32Decoder6()],
|
|
3651
3651
|
["swapToToken", getOptionDecoder(getPoolTokenDecoder())],
|
|
3652
|
-
["minRemovedAmountA",
|
|
3653
|
-
["minRemovedAmountB",
|
|
3654
|
-
["maxSwapSlippage",
|
|
3652
|
+
["minRemovedAmountA", getU64Decoder10()],
|
|
3653
|
+
["minRemovedAmountB", getU64Decoder10()],
|
|
3654
|
+
["maxSwapSlippage", getU32Decoder6()],
|
|
3655
3655
|
["remainingAccountsInfo", getRemainingAccountsInfoDecoder()]
|
|
3656
3656
|
]);
|
|
3657
3657
|
}
|
|
@@ -3799,10 +3799,10 @@ import {
|
|
|
3799
3799
|
getOptionEncoder as getOptionEncoder2,
|
|
3800
3800
|
getStructDecoder as getStructDecoder23,
|
|
3801
3801
|
getStructEncoder as getStructEncoder23,
|
|
3802
|
-
getU32Decoder as
|
|
3803
|
-
getU32Encoder as
|
|
3804
|
-
getU64Decoder as
|
|
3805
|
-
getU64Encoder as
|
|
3802
|
+
getU32Decoder as getU32Decoder7,
|
|
3803
|
+
getU32Encoder as getU32Encoder7,
|
|
3804
|
+
getU64Decoder as getU64Decoder11,
|
|
3805
|
+
getU64Encoder as getU64Encoder11,
|
|
3806
3806
|
transformEncoder as transformEncoder21
|
|
3807
3807
|
} from "@solana/kit";
|
|
3808
3808
|
var DECREASE_TUNA_LP_POSITION_ORCA_DISCRIMINATOR = new Uint8Array([
|
|
@@ -3824,11 +3824,11 @@ function getDecreaseTunaLpPositionOrcaInstructionDataEncoder() {
|
|
|
3824
3824
|
return transformEncoder21(
|
|
3825
3825
|
getStructEncoder23([
|
|
3826
3826
|
["discriminator", fixEncoderSize22(getBytesEncoder22(), 8)],
|
|
3827
|
-
["withdrawPercent",
|
|
3827
|
+
["withdrawPercent", getU32Encoder7()],
|
|
3828
3828
|
["swapToToken", getOptionEncoder2(getPoolTokenEncoder())],
|
|
3829
|
-
["minRemovedAmountA",
|
|
3830
|
-
["minRemovedAmountB",
|
|
3831
|
-
["maxSwapSlippage",
|
|
3829
|
+
["minRemovedAmountA", getU64Encoder11()],
|
|
3830
|
+
["minRemovedAmountB", getU64Encoder11()],
|
|
3831
|
+
["maxSwapSlippage", getU32Encoder7()],
|
|
3832
3832
|
["remainingAccountsInfo", getRemainingAccountsInfoEncoder()]
|
|
3833
3833
|
]),
|
|
3834
3834
|
(value) => ({
|
|
@@ -3840,11 +3840,11 @@ function getDecreaseTunaLpPositionOrcaInstructionDataEncoder() {
|
|
|
3840
3840
|
function getDecreaseTunaLpPositionOrcaInstructionDataDecoder() {
|
|
3841
3841
|
return getStructDecoder23([
|
|
3842
3842
|
["discriminator", fixDecoderSize21(getBytesDecoder21(), 8)],
|
|
3843
|
-
["withdrawPercent",
|
|
3843
|
+
["withdrawPercent", getU32Decoder7()],
|
|
3844
3844
|
["swapToToken", getOptionDecoder2(getPoolTokenDecoder())],
|
|
3845
|
-
["minRemovedAmountA",
|
|
3846
|
-
["minRemovedAmountB",
|
|
3847
|
-
["maxSwapSlippage",
|
|
3845
|
+
["minRemovedAmountA", getU64Decoder11()],
|
|
3846
|
+
["minRemovedAmountB", getU64Decoder11()],
|
|
3847
|
+
["maxSwapSlippage", getU32Decoder7()],
|
|
3848
3848
|
["remainingAccountsInfo", getRemainingAccountsInfoDecoder()]
|
|
3849
3849
|
]);
|
|
3850
3850
|
}
|
|
@@ -3990,8 +3990,10 @@ import {
|
|
|
3990
3990
|
getBytesEncoder as getBytesEncoder23,
|
|
3991
3991
|
getStructDecoder as getStructDecoder24,
|
|
3992
3992
|
getStructEncoder as getStructEncoder24,
|
|
3993
|
-
getU32Decoder as
|
|
3994
|
-
getU32Encoder as
|
|
3993
|
+
getU32Decoder as getU32Decoder8,
|
|
3994
|
+
getU32Encoder as getU32Encoder8,
|
|
3995
|
+
getU64Decoder as getU64Decoder12,
|
|
3996
|
+
getU64Encoder as getU64Encoder12,
|
|
3995
3997
|
transformEncoder as transformEncoder22
|
|
3996
3998
|
} from "@solana/kit";
|
|
3997
3999
|
var DECREASE_TUNA_SPOT_POSITION_FUSION_DISCRIMINATOR = new Uint8Array([
|
|
@@ -4013,8 +4015,8 @@ function getDecreaseTunaSpotPositionFusionInstructionDataEncoder() {
|
|
|
4013
4015
|
return transformEncoder22(
|
|
4014
4016
|
getStructEncoder24([
|
|
4015
4017
|
["discriminator", fixEncoderSize23(getBytesEncoder23(), 8)],
|
|
4016
|
-
["withdrawPercent",
|
|
4017
|
-
["
|
|
4018
|
+
["withdrawPercent", getU32Encoder8()],
|
|
4019
|
+
["maxSwapAmountIn", getU64Encoder12()],
|
|
4018
4020
|
["remainingAccountsInfo", getRemainingAccountsInfoEncoder()]
|
|
4019
4021
|
]),
|
|
4020
4022
|
(value) => ({
|
|
@@ -4026,8 +4028,8 @@ function getDecreaseTunaSpotPositionFusionInstructionDataEncoder() {
|
|
|
4026
4028
|
function getDecreaseTunaSpotPositionFusionInstructionDataDecoder() {
|
|
4027
4029
|
return getStructDecoder24([
|
|
4028
4030
|
["discriminator", fixDecoderSize22(getBytesDecoder22(), 8)],
|
|
4029
|
-
["withdrawPercent",
|
|
4030
|
-
["
|
|
4031
|
+
["withdrawPercent", getU32Decoder8()],
|
|
4032
|
+
["maxSwapAmountIn", getU64Decoder12()],
|
|
4031
4033
|
["remainingAccountsInfo", getRemainingAccountsInfoDecoder()]
|
|
4032
4034
|
]);
|
|
4033
4035
|
}
|
|
@@ -4177,8 +4179,10 @@ import {
|
|
|
4177
4179
|
getBytesEncoder as getBytesEncoder24,
|
|
4178
4180
|
getStructDecoder as getStructDecoder25,
|
|
4179
4181
|
getStructEncoder as getStructEncoder25,
|
|
4180
|
-
getU32Decoder as
|
|
4181
|
-
getU32Encoder as
|
|
4182
|
+
getU32Decoder as getU32Decoder9,
|
|
4183
|
+
getU32Encoder as getU32Encoder9,
|
|
4184
|
+
getU64Decoder as getU64Decoder13,
|
|
4185
|
+
getU64Encoder as getU64Encoder13,
|
|
4182
4186
|
transformEncoder as transformEncoder23
|
|
4183
4187
|
} from "@solana/kit";
|
|
4184
4188
|
var DECREASE_TUNA_SPOT_POSITION_ORCA_DISCRIMINATOR = new Uint8Array([
|
|
@@ -4200,8 +4204,8 @@ function getDecreaseTunaSpotPositionOrcaInstructionDataEncoder() {
|
|
|
4200
4204
|
return transformEncoder23(
|
|
4201
4205
|
getStructEncoder25([
|
|
4202
4206
|
["discriminator", fixEncoderSize24(getBytesEncoder24(), 8)],
|
|
4203
|
-
["withdrawPercent",
|
|
4204
|
-
["
|
|
4207
|
+
["withdrawPercent", getU32Encoder9()],
|
|
4208
|
+
["maxSwapAmountIn", getU64Encoder13()],
|
|
4205
4209
|
["remainingAccountsInfo", getRemainingAccountsInfoEncoder()]
|
|
4206
4210
|
]),
|
|
4207
4211
|
(value) => ({
|
|
@@ -4213,8 +4217,8 @@ function getDecreaseTunaSpotPositionOrcaInstructionDataEncoder() {
|
|
|
4213
4217
|
function getDecreaseTunaSpotPositionOrcaInstructionDataDecoder() {
|
|
4214
4218
|
return getStructDecoder25([
|
|
4215
4219
|
["discriminator", fixDecoderSize23(getBytesDecoder23(), 8)],
|
|
4216
|
-
["withdrawPercent",
|
|
4217
|
-
["
|
|
4220
|
+
["withdrawPercent", getU32Decoder9()],
|
|
4221
|
+
["maxSwapAmountIn", getU64Decoder13()],
|
|
4218
4222
|
["remainingAccountsInfo", getRemainingAccountsInfoDecoder()]
|
|
4219
4223
|
]);
|
|
4220
4224
|
}
|
|
@@ -4364,8 +4368,8 @@ import {
|
|
|
4364
4368
|
getBytesEncoder as getBytesEncoder25,
|
|
4365
4369
|
getStructDecoder as getStructDecoder26,
|
|
4366
4370
|
getStructEncoder as getStructEncoder26,
|
|
4367
|
-
getU64Decoder as
|
|
4368
|
-
getU64Encoder as
|
|
4371
|
+
getU64Decoder as getU64Decoder14,
|
|
4372
|
+
getU64Encoder as getU64Encoder14,
|
|
4369
4373
|
transformEncoder as transformEncoder24
|
|
4370
4374
|
} from "@solana/kit";
|
|
4371
4375
|
var DEPOSIT_DISCRIMINATOR = new Uint8Array([
|
|
@@ -4385,7 +4389,7 @@ function getDepositInstructionDataEncoder() {
|
|
|
4385
4389
|
return transformEncoder24(
|
|
4386
4390
|
getStructEncoder26([
|
|
4387
4391
|
["discriminator", fixEncoderSize25(getBytesEncoder25(), 8)],
|
|
4388
|
-
["amount",
|
|
4392
|
+
["amount", getU64Encoder14()]
|
|
4389
4393
|
]),
|
|
4390
4394
|
(value) => ({ ...value, discriminator: DEPOSIT_DISCRIMINATOR })
|
|
4391
4395
|
);
|
|
@@ -4393,7 +4397,7 @@ function getDepositInstructionDataEncoder() {
|
|
|
4393
4397
|
function getDepositInstructionDataDecoder() {
|
|
4394
4398
|
return getStructDecoder26([
|
|
4395
4399
|
["discriminator", fixDecoderSize24(getBytesDecoder24(), 8)],
|
|
4396
|
-
["amount",
|
|
4400
|
+
["amount", getU64Decoder14()]
|
|
4397
4401
|
]);
|
|
4398
4402
|
}
|
|
4399
4403
|
function getDepositInstructionDataCodec() {
|
|
@@ -4476,10 +4480,10 @@ import {
|
|
|
4476
4480
|
getBytesEncoder as getBytesEncoder26,
|
|
4477
4481
|
getStructDecoder as getStructDecoder27,
|
|
4478
4482
|
getStructEncoder as getStructEncoder27,
|
|
4479
|
-
getU32Decoder as
|
|
4480
|
-
getU32Encoder as
|
|
4481
|
-
getU64Decoder as
|
|
4482
|
-
getU64Encoder as
|
|
4483
|
+
getU32Decoder as getU32Decoder10,
|
|
4484
|
+
getU32Encoder as getU32Encoder10,
|
|
4485
|
+
getU64Decoder as getU64Decoder15,
|
|
4486
|
+
getU64Encoder as getU64Encoder15,
|
|
4483
4487
|
transformEncoder as transformEncoder25
|
|
4484
4488
|
} from "@solana/kit";
|
|
4485
4489
|
var INCREASE_TUNA_LP_POSITION_FUSION_DISCRIMINATOR = new Uint8Array([
|
|
@@ -4501,13 +4505,13 @@ function getIncreaseTunaLpPositionFusionInstructionDataEncoder() {
|
|
|
4501
4505
|
return transformEncoder25(
|
|
4502
4506
|
getStructEncoder27([
|
|
4503
4507
|
["discriminator", fixEncoderSize26(getBytesEncoder26(), 8)],
|
|
4504
|
-
["collateralA",
|
|
4505
|
-
["collateralB",
|
|
4506
|
-
["borrowA",
|
|
4507
|
-
["borrowB",
|
|
4508
|
-
["minAddedAmountA",
|
|
4509
|
-
["minAddedAmountB",
|
|
4510
|
-
["maxSwapSlippage",
|
|
4508
|
+
["collateralA", getU64Encoder15()],
|
|
4509
|
+
["collateralB", getU64Encoder15()],
|
|
4510
|
+
["borrowA", getU64Encoder15()],
|
|
4511
|
+
["borrowB", getU64Encoder15()],
|
|
4512
|
+
["minAddedAmountA", getU64Encoder15()],
|
|
4513
|
+
["minAddedAmountB", getU64Encoder15()],
|
|
4514
|
+
["maxSwapSlippage", getU32Encoder10()],
|
|
4511
4515
|
["remainingAccountsInfo", getRemainingAccountsInfoEncoder()]
|
|
4512
4516
|
]),
|
|
4513
4517
|
(value) => ({
|
|
@@ -4519,13 +4523,13 @@ function getIncreaseTunaLpPositionFusionInstructionDataEncoder() {
|
|
|
4519
4523
|
function getIncreaseTunaLpPositionFusionInstructionDataDecoder() {
|
|
4520
4524
|
return getStructDecoder27([
|
|
4521
4525
|
["discriminator", fixDecoderSize25(getBytesDecoder25(), 8)],
|
|
4522
|
-
["collateralA",
|
|
4523
|
-
["collateralB",
|
|
4524
|
-
["borrowA",
|
|
4525
|
-
["borrowB",
|
|
4526
|
-
["minAddedAmountA",
|
|
4527
|
-
["minAddedAmountB",
|
|
4528
|
-
["maxSwapSlippage",
|
|
4526
|
+
["collateralA", getU64Decoder15()],
|
|
4527
|
+
["collateralB", getU64Decoder15()],
|
|
4528
|
+
["borrowA", getU64Decoder15()],
|
|
4529
|
+
["borrowB", getU64Decoder15()],
|
|
4530
|
+
["minAddedAmountA", getU64Decoder15()],
|
|
4531
|
+
["minAddedAmountB", getU64Decoder15()],
|
|
4532
|
+
["maxSwapSlippage", getU32Decoder10()],
|
|
4529
4533
|
["remainingAccountsInfo", getRemainingAccountsInfoDecoder()]
|
|
4530
4534
|
]);
|
|
4531
4535
|
}
|
|
@@ -4683,10 +4687,10 @@ import {
|
|
|
4683
4687
|
getBytesEncoder as getBytesEncoder27,
|
|
4684
4688
|
getStructDecoder as getStructDecoder28,
|
|
4685
4689
|
getStructEncoder as getStructEncoder28,
|
|
4686
|
-
getU32Decoder as
|
|
4687
|
-
getU32Encoder as
|
|
4688
|
-
getU64Decoder as
|
|
4689
|
-
getU64Encoder as
|
|
4690
|
+
getU32Decoder as getU32Decoder11,
|
|
4691
|
+
getU32Encoder as getU32Encoder11,
|
|
4692
|
+
getU64Decoder as getU64Decoder16,
|
|
4693
|
+
getU64Encoder as getU64Encoder16,
|
|
4690
4694
|
transformEncoder as transformEncoder26
|
|
4691
4695
|
} from "@solana/kit";
|
|
4692
4696
|
var INCREASE_TUNA_LP_POSITION_ORCA_DISCRIMINATOR = new Uint8Array([
|
|
@@ -4708,13 +4712,13 @@ function getIncreaseTunaLpPositionOrcaInstructionDataEncoder() {
|
|
|
4708
4712
|
return transformEncoder26(
|
|
4709
4713
|
getStructEncoder28([
|
|
4710
4714
|
["discriminator", fixEncoderSize27(getBytesEncoder27(), 8)],
|
|
4711
|
-
["collateralA",
|
|
4712
|
-
["collateralB",
|
|
4713
|
-
["borrowA",
|
|
4714
|
-
["borrowB",
|
|
4715
|
-
["minAddedAmountA",
|
|
4716
|
-
["minAddedAmountB",
|
|
4717
|
-
["maxSwapSlippage",
|
|
4715
|
+
["collateralA", getU64Encoder16()],
|
|
4716
|
+
["collateralB", getU64Encoder16()],
|
|
4717
|
+
["borrowA", getU64Encoder16()],
|
|
4718
|
+
["borrowB", getU64Encoder16()],
|
|
4719
|
+
["minAddedAmountA", getU64Encoder16()],
|
|
4720
|
+
["minAddedAmountB", getU64Encoder16()],
|
|
4721
|
+
["maxSwapSlippage", getU32Encoder11()],
|
|
4718
4722
|
["remainingAccountsInfo", getRemainingAccountsInfoEncoder()]
|
|
4719
4723
|
]),
|
|
4720
4724
|
(value) => ({
|
|
@@ -4726,13 +4730,13 @@ function getIncreaseTunaLpPositionOrcaInstructionDataEncoder() {
|
|
|
4726
4730
|
function getIncreaseTunaLpPositionOrcaInstructionDataDecoder() {
|
|
4727
4731
|
return getStructDecoder28([
|
|
4728
4732
|
["discriminator", fixDecoderSize26(getBytesDecoder26(), 8)],
|
|
4729
|
-
["collateralA",
|
|
4730
|
-
["collateralB",
|
|
4731
|
-
["borrowA",
|
|
4732
|
-
["borrowB",
|
|
4733
|
-
["minAddedAmountA",
|
|
4734
|
-
["minAddedAmountB",
|
|
4735
|
-
["maxSwapSlippage",
|
|
4733
|
+
["collateralA", getU64Decoder16()],
|
|
4734
|
+
["collateralB", getU64Decoder16()],
|
|
4735
|
+
["borrowA", getU64Decoder16()],
|
|
4736
|
+
["borrowB", getU64Decoder16()],
|
|
4737
|
+
["minAddedAmountA", getU64Decoder16()],
|
|
4738
|
+
["minAddedAmountB", getU64Decoder16()],
|
|
4739
|
+
["maxSwapSlippage", getU32Decoder11()],
|
|
4736
4740
|
["remainingAccountsInfo", getRemainingAccountsInfoDecoder()]
|
|
4737
4741
|
]);
|
|
4738
4742
|
}
|
|
@@ -4890,10 +4894,8 @@ import {
|
|
|
4890
4894
|
getBytesEncoder as getBytesEncoder28,
|
|
4891
4895
|
getStructDecoder as getStructDecoder29,
|
|
4892
4896
|
getStructEncoder as getStructEncoder29,
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
getU64Decoder as getU64Decoder13,
|
|
4896
|
-
getU64Encoder as getU64Encoder13,
|
|
4897
|
+
getU64Decoder as getU64Decoder17,
|
|
4898
|
+
getU64Encoder as getU64Encoder17,
|
|
4897
4899
|
transformEncoder as transformEncoder27
|
|
4898
4900
|
} from "@solana/kit";
|
|
4899
4901
|
var INCREASE_TUNA_SPOT_POSITION_FUSION_DISCRIMINATOR = new Uint8Array([
|
|
@@ -4915,9 +4917,9 @@ function getIncreaseTunaSpotPositionFusionInstructionDataEncoder() {
|
|
|
4915
4917
|
return transformEncoder27(
|
|
4916
4918
|
getStructEncoder29([
|
|
4917
4919
|
["discriminator", fixEncoderSize28(getBytesEncoder28(), 8)],
|
|
4918
|
-
["collateralAmount",
|
|
4919
|
-
["borrowAmount",
|
|
4920
|
-
["
|
|
4920
|
+
["collateralAmount", getU64Encoder17()],
|
|
4921
|
+
["borrowAmount", getU64Encoder17()],
|
|
4922
|
+
["minSwapAmountOut", getU64Encoder17()],
|
|
4921
4923
|
["remainingAccountsInfo", getRemainingAccountsInfoEncoder()]
|
|
4922
4924
|
]),
|
|
4923
4925
|
(value) => ({
|
|
@@ -4929,9 +4931,9 @@ function getIncreaseTunaSpotPositionFusionInstructionDataEncoder() {
|
|
|
4929
4931
|
function getIncreaseTunaSpotPositionFusionInstructionDataDecoder() {
|
|
4930
4932
|
return getStructDecoder29([
|
|
4931
4933
|
["discriminator", fixDecoderSize27(getBytesDecoder27(), 8)],
|
|
4932
|
-
["collateralAmount",
|
|
4933
|
-
["borrowAmount",
|
|
4934
|
-
["
|
|
4934
|
+
["collateralAmount", getU64Decoder17()],
|
|
4935
|
+
["borrowAmount", getU64Decoder17()],
|
|
4936
|
+
["minSwapAmountOut", getU64Decoder17()],
|
|
4935
4937
|
["remainingAccountsInfo", getRemainingAccountsInfoDecoder()]
|
|
4936
4938
|
]);
|
|
4937
4939
|
}
|
|
@@ -5093,10 +5095,8 @@ import {
|
|
|
5093
5095
|
getBytesEncoder as getBytesEncoder29,
|
|
5094
5096
|
getStructDecoder as getStructDecoder30,
|
|
5095
5097
|
getStructEncoder as getStructEncoder30,
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
getU64Decoder as getU64Decoder14,
|
|
5099
|
-
getU64Encoder as getU64Encoder14,
|
|
5098
|
+
getU64Decoder as getU64Decoder18,
|
|
5099
|
+
getU64Encoder as getU64Encoder18,
|
|
5100
5100
|
transformEncoder as transformEncoder28
|
|
5101
5101
|
} from "@solana/kit";
|
|
5102
5102
|
var INCREASE_TUNA_SPOT_POSITION_ORCA_DISCRIMINATOR = new Uint8Array([
|
|
@@ -5118,9 +5118,9 @@ function getIncreaseTunaSpotPositionOrcaInstructionDataEncoder() {
|
|
|
5118
5118
|
return transformEncoder28(
|
|
5119
5119
|
getStructEncoder30([
|
|
5120
5120
|
["discriminator", fixEncoderSize29(getBytesEncoder29(), 8)],
|
|
5121
|
-
["collateralAmount",
|
|
5122
|
-
["borrowAmount",
|
|
5123
|
-
["
|
|
5121
|
+
["collateralAmount", getU64Encoder18()],
|
|
5122
|
+
["borrowAmount", getU64Encoder18()],
|
|
5123
|
+
["minSwapAmountOut", getU64Encoder18()],
|
|
5124
5124
|
["remainingAccountsInfo", getRemainingAccountsInfoEncoder()]
|
|
5125
5125
|
]),
|
|
5126
5126
|
(value) => ({
|
|
@@ -5132,9 +5132,9 @@ function getIncreaseTunaSpotPositionOrcaInstructionDataEncoder() {
|
|
|
5132
5132
|
function getIncreaseTunaSpotPositionOrcaInstructionDataDecoder() {
|
|
5133
5133
|
return getStructDecoder30([
|
|
5134
5134
|
["discriminator", fixDecoderSize28(getBytesDecoder28(), 8)],
|
|
5135
|
-
["collateralAmount",
|
|
5136
|
-
["borrowAmount",
|
|
5137
|
-
["
|
|
5135
|
+
["collateralAmount", getU64Decoder18()],
|
|
5136
|
+
["borrowAmount", getU64Decoder18()],
|
|
5137
|
+
["minSwapAmountOut", getU64Decoder18()],
|
|
5138
5138
|
["remainingAccountsInfo", getRemainingAccountsInfoDecoder()]
|
|
5139
5139
|
]);
|
|
5140
5140
|
}
|
|
@@ -5296,8 +5296,8 @@ import {
|
|
|
5296
5296
|
getBytesEncoder as getBytesEncoder30,
|
|
5297
5297
|
getStructDecoder as getStructDecoder31,
|
|
5298
5298
|
getStructEncoder as getStructEncoder31,
|
|
5299
|
-
getU32Decoder as
|
|
5300
|
-
getU32Encoder as
|
|
5299
|
+
getU32Decoder as getU32Decoder12,
|
|
5300
|
+
getU32Encoder as getU32Encoder12,
|
|
5301
5301
|
transformEncoder as transformEncoder29
|
|
5302
5302
|
} from "@solana/kit";
|
|
5303
5303
|
var LIQUIDATE_TUNA_LP_POSITION_FUSION_DISCRIMINATOR = new Uint8Array([
|
|
@@ -5319,7 +5319,7 @@ function getLiquidateTunaLpPositionFusionInstructionDataEncoder() {
|
|
|
5319
5319
|
return transformEncoder29(
|
|
5320
5320
|
getStructEncoder31([
|
|
5321
5321
|
["discriminator", fixEncoderSize30(getBytesEncoder30(), 8)],
|
|
5322
|
-
["withdrawPercent",
|
|
5322
|
+
["withdrawPercent", getU32Encoder12()],
|
|
5323
5323
|
["remainingAccountsInfo", getRemainingAccountsInfoEncoder()]
|
|
5324
5324
|
]),
|
|
5325
5325
|
(value) => ({
|
|
@@ -5331,7 +5331,7 @@ function getLiquidateTunaLpPositionFusionInstructionDataEncoder() {
|
|
|
5331
5331
|
function getLiquidateTunaLpPositionFusionInstructionDataDecoder() {
|
|
5332
5332
|
return getStructDecoder31([
|
|
5333
5333
|
["discriminator", fixDecoderSize29(getBytesDecoder29(), 8)],
|
|
5334
|
-
["withdrawPercent",
|
|
5334
|
+
["withdrawPercent", getU32Decoder12()],
|
|
5335
5335
|
["remainingAccountsInfo", getRemainingAccountsInfoDecoder()]
|
|
5336
5336
|
]);
|
|
5337
5337
|
}
|
|
@@ -5477,8 +5477,8 @@ import {
|
|
|
5477
5477
|
getBytesEncoder as getBytesEncoder31,
|
|
5478
5478
|
getStructDecoder as getStructDecoder32,
|
|
5479
5479
|
getStructEncoder as getStructEncoder32,
|
|
5480
|
-
getU32Decoder as
|
|
5481
|
-
getU32Encoder as
|
|
5480
|
+
getU32Decoder as getU32Decoder13,
|
|
5481
|
+
getU32Encoder as getU32Encoder13,
|
|
5482
5482
|
transformEncoder as transformEncoder30
|
|
5483
5483
|
} from "@solana/kit";
|
|
5484
5484
|
var LIQUIDATE_TUNA_LP_POSITION_ORCA_DISCRIMINATOR = new Uint8Array([
|
|
@@ -5500,7 +5500,7 @@ function getLiquidateTunaLpPositionOrcaInstructionDataEncoder() {
|
|
|
5500
5500
|
return transformEncoder30(
|
|
5501
5501
|
getStructEncoder32([
|
|
5502
5502
|
["discriminator", fixEncoderSize31(getBytesEncoder31(), 8)],
|
|
5503
|
-
["withdrawPercent",
|
|
5503
|
+
["withdrawPercent", getU32Encoder13()],
|
|
5504
5504
|
["remainingAccountsInfo", getRemainingAccountsInfoEncoder()]
|
|
5505
5505
|
]),
|
|
5506
5506
|
(value) => ({
|
|
@@ -5512,7 +5512,7 @@ function getLiquidateTunaLpPositionOrcaInstructionDataEncoder() {
|
|
|
5512
5512
|
function getLiquidateTunaLpPositionOrcaInstructionDataDecoder() {
|
|
5513
5513
|
return getStructDecoder32([
|
|
5514
5514
|
["discriminator", fixDecoderSize30(getBytesDecoder30(), 8)],
|
|
5515
|
-
["withdrawPercent",
|
|
5515
|
+
["withdrawPercent", getU32Decoder13()],
|
|
5516
5516
|
["remainingAccountsInfo", getRemainingAccountsInfoDecoder()]
|
|
5517
5517
|
]);
|
|
5518
5518
|
}
|
|
@@ -5658,8 +5658,8 @@ import {
|
|
|
5658
5658
|
getBytesEncoder as getBytesEncoder32,
|
|
5659
5659
|
getStructDecoder as getStructDecoder33,
|
|
5660
5660
|
getStructEncoder as getStructEncoder33,
|
|
5661
|
-
getU32Decoder as
|
|
5662
|
-
getU32Encoder as
|
|
5661
|
+
getU32Decoder as getU32Decoder14,
|
|
5662
|
+
getU32Encoder as getU32Encoder14,
|
|
5663
5663
|
transformEncoder as transformEncoder31
|
|
5664
5664
|
} from "@solana/kit";
|
|
5665
5665
|
var LIQUIDATE_TUNA_SPOT_POSITION_FUSION_DISCRIMINATOR = new Uint8Array(
|
|
@@ -5674,7 +5674,7 @@ function getLiquidateTunaSpotPositionFusionInstructionDataEncoder() {
|
|
|
5674
5674
|
return transformEncoder31(
|
|
5675
5675
|
getStructEncoder33([
|
|
5676
5676
|
["discriminator", fixEncoderSize32(getBytesEncoder32(), 8)],
|
|
5677
|
-
["withdrawPercent",
|
|
5677
|
+
["withdrawPercent", getU32Encoder14()],
|
|
5678
5678
|
["remainingAccountsInfo", getRemainingAccountsInfoEncoder()]
|
|
5679
5679
|
]),
|
|
5680
5680
|
(value) => ({
|
|
@@ -5686,7 +5686,7 @@ function getLiquidateTunaSpotPositionFusionInstructionDataEncoder() {
|
|
|
5686
5686
|
function getLiquidateTunaSpotPositionFusionInstructionDataDecoder() {
|
|
5687
5687
|
return getStructDecoder33([
|
|
5688
5688
|
["discriminator", fixDecoderSize31(getBytesDecoder31(), 8)],
|
|
5689
|
-
["withdrawPercent",
|
|
5689
|
+
["withdrawPercent", getU32Decoder14()],
|
|
5690
5690
|
["remainingAccountsInfo", getRemainingAccountsInfoDecoder()]
|
|
5691
5691
|
]);
|
|
5692
5692
|
}
|
|
@@ -5854,8 +5854,8 @@ import {
|
|
|
5854
5854
|
getBytesEncoder as getBytesEncoder33,
|
|
5855
5855
|
getStructDecoder as getStructDecoder34,
|
|
5856
5856
|
getStructEncoder as getStructEncoder34,
|
|
5857
|
-
getU32Decoder as
|
|
5858
|
-
getU32Encoder as
|
|
5857
|
+
getU32Decoder as getU32Decoder15,
|
|
5858
|
+
getU32Encoder as getU32Encoder15,
|
|
5859
5859
|
transformEncoder as transformEncoder32
|
|
5860
5860
|
} from "@solana/kit";
|
|
5861
5861
|
var LIQUIDATE_TUNA_SPOT_POSITION_ORCA_DISCRIMINATOR = new Uint8Array([
|
|
@@ -5877,7 +5877,7 @@ function getLiquidateTunaSpotPositionOrcaInstructionDataEncoder() {
|
|
|
5877
5877
|
return transformEncoder32(
|
|
5878
5878
|
getStructEncoder34([
|
|
5879
5879
|
["discriminator", fixEncoderSize33(getBytesEncoder33(), 8)],
|
|
5880
|
-
["withdrawPercent",
|
|
5880
|
+
["withdrawPercent", getU32Encoder15()],
|
|
5881
5881
|
["remainingAccountsInfo", getRemainingAccountsInfoEncoder()]
|
|
5882
5882
|
]),
|
|
5883
5883
|
(value) => ({
|
|
@@ -5889,7 +5889,7 @@ function getLiquidateTunaSpotPositionOrcaInstructionDataEncoder() {
|
|
|
5889
5889
|
function getLiquidateTunaSpotPositionOrcaInstructionDataDecoder() {
|
|
5890
5890
|
return getStructDecoder34([
|
|
5891
5891
|
["discriminator", fixDecoderSize32(getBytesDecoder32(), 8)],
|
|
5892
|
-
["withdrawPercent",
|
|
5892
|
+
["withdrawPercent", getU32Decoder15()],
|
|
5893
5893
|
["remainingAccountsInfo", getRemainingAccountsInfoDecoder()]
|
|
5894
5894
|
]);
|
|
5895
5895
|
}
|
|
@@ -6061,10 +6061,10 @@ import {
|
|
|
6061
6061
|
getStructEncoder as getStructEncoder35,
|
|
6062
6062
|
getU128Decoder as getU128Decoder3,
|
|
6063
6063
|
getU128Encoder as getU128Encoder3,
|
|
6064
|
-
getU32Decoder as
|
|
6065
|
-
getU32Encoder as
|
|
6066
|
-
getU64Decoder as
|
|
6067
|
-
getU64Encoder as
|
|
6064
|
+
getU32Decoder as getU32Decoder16,
|
|
6065
|
+
getU32Encoder as getU32Encoder16,
|
|
6066
|
+
getU64Decoder as getU64Decoder19,
|
|
6067
|
+
getU64Encoder as getU64Encoder19,
|
|
6068
6068
|
transformEncoder as transformEncoder33
|
|
6069
6069
|
} from "@solana/kit";
|
|
6070
6070
|
var OPEN_AND_INCREASE_TUNA_LP_POSITION_FUSION_DISCRIMINATOR = new Uint8Array([123, 115, 192, 91, 113, 191, 73, 56]);
|
|
@@ -6081,14 +6081,14 @@ function getOpenAndIncreaseTunaLpPositionFusionInstructionDataEncoder() {
|
|
|
6081
6081
|
["tickUpperIndex", getI32Encoder2()],
|
|
6082
6082
|
["lowerLimitOrderSqrtPrice", getU128Encoder3()],
|
|
6083
6083
|
["upperLimitOrderSqrtPrice", getU128Encoder3()],
|
|
6084
|
-
["flags",
|
|
6085
|
-
["collateralA",
|
|
6086
|
-
["collateralB",
|
|
6087
|
-
["borrowA",
|
|
6088
|
-
["borrowB",
|
|
6089
|
-
["minAddedAmountA",
|
|
6090
|
-
["minAddedAmountB",
|
|
6091
|
-
["maxSwapSlippage",
|
|
6084
|
+
["flags", getU32Encoder16()],
|
|
6085
|
+
["collateralA", getU64Encoder19()],
|
|
6086
|
+
["collateralB", getU64Encoder19()],
|
|
6087
|
+
["borrowA", getU64Encoder19()],
|
|
6088
|
+
["borrowB", getU64Encoder19()],
|
|
6089
|
+
["minAddedAmountA", getU64Encoder19()],
|
|
6090
|
+
["minAddedAmountB", getU64Encoder19()],
|
|
6091
|
+
["maxSwapSlippage", getU32Encoder16()],
|
|
6092
6092
|
["remainingAccountsInfo", getRemainingAccountsInfoEncoder()]
|
|
6093
6093
|
]),
|
|
6094
6094
|
(value) => ({
|
|
@@ -6104,14 +6104,14 @@ function getOpenAndIncreaseTunaLpPositionFusionInstructionDataDecoder() {
|
|
|
6104
6104
|
["tickUpperIndex", getI32Decoder2()],
|
|
6105
6105
|
["lowerLimitOrderSqrtPrice", getU128Decoder3()],
|
|
6106
6106
|
["upperLimitOrderSqrtPrice", getU128Decoder3()],
|
|
6107
|
-
["flags",
|
|
6108
|
-
["collateralA",
|
|
6109
|
-
["collateralB",
|
|
6110
|
-
["borrowA",
|
|
6111
|
-
["borrowB",
|
|
6112
|
-
["minAddedAmountA",
|
|
6113
|
-
["minAddedAmountB",
|
|
6114
|
-
["maxSwapSlippage",
|
|
6107
|
+
["flags", getU32Decoder16()],
|
|
6108
|
+
["collateralA", getU64Decoder19()],
|
|
6109
|
+
["collateralB", getU64Decoder19()],
|
|
6110
|
+
["borrowA", getU64Decoder19()],
|
|
6111
|
+
["borrowB", getU64Decoder19()],
|
|
6112
|
+
["minAddedAmountA", getU64Decoder19()],
|
|
6113
|
+
["minAddedAmountB", getU64Decoder19()],
|
|
6114
|
+
["maxSwapSlippage", getU32Decoder16()],
|
|
6115
6115
|
["remainingAccountsInfo", getRemainingAccountsInfoDecoder()]
|
|
6116
6116
|
]);
|
|
6117
6117
|
}
|
|
@@ -6303,10 +6303,10 @@ import {
|
|
|
6303
6303
|
getStructEncoder as getStructEncoder36,
|
|
6304
6304
|
getU128Decoder as getU128Decoder4,
|
|
6305
6305
|
getU128Encoder as getU128Encoder4,
|
|
6306
|
-
getU32Decoder as
|
|
6307
|
-
getU32Encoder as
|
|
6308
|
-
getU64Decoder as
|
|
6309
|
-
getU64Encoder as
|
|
6306
|
+
getU32Decoder as getU32Decoder17,
|
|
6307
|
+
getU32Encoder as getU32Encoder17,
|
|
6308
|
+
getU64Decoder as getU64Decoder20,
|
|
6309
|
+
getU64Encoder as getU64Encoder20,
|
|
6310
6310
|
transformEncoder as transformEncoder34
|
|
6311
6311
|
} from "@solana/kit";
|
|
6312
6312
|
var OPEN_AND_INCREASE_TUNA_LP_POSITION_ORCA_DISCRIMINATOR = new Uint8Array([163, 21, 84, 199, 172, 40, 87, 122]);
|
|
@@ -6323,14 +6323,14 @@ function getOpenAndIncreaseTunaLpPositionOrcaInstructionDataEncoder() {
|
|
|
6323
6323
|
["tickUpperIndex", getI32Encoder3()],
|
|
6324
6324
|
["lowerLimitOrderSqrtPrice", getU128Encoder4()],
|
|
6325
6325
|
["upperLimitOrderSqrtPrice", getU128Encoder4()],
|
|
6326
|
-
["flags",
|
|
6327
|
-
["collateralA",
|
|
6328
|
-
["collateralB",
|
|
6329
|
-
["borrowA",
|
|
6330
|
-
["borrowB",
|
|
6331
|
-
["minAddedAmountA",
|
|
6332
|
-
["minAddedAmountB",
|
|
6333
|
-
["maxSwapSlippage",
|
|
6326
|
+
["flags", getU32Encoder17()],
|
|
6327
|
+
["collateralA", getU64Encoder20()],
|
|
6328
|
+
["collateralB", getU64Encoder20()],
|
|
6329
|
+
["borrowA", getU64Encoder20()],
|
|
6330
|
+
["borrowB", getU64Encoder20()],
|
|
6331
|
+
["minAddedAmountA", getU64Encoder20()],
|
|
6332
|
+
["minAddedAmountB", getU64Encoder20()],
|
|
6333
|
+
["maxSwapSlippage", getU32Encoder17()],
|
|
6334
6334
|
["remainingAccountsInfo", getRemainingAccountsInfoEncoder()]
|
|
6335
6335
|
]),
|
|
6336
6336
|
(value) => ({
|
|
@@ -6346,14 +6346,14 @@ function getOpenAndIncreaseTunaLpPositionOrcaInstructionDataDecoder() {
|
|
|
6346
6346
|
["tickUpperIndex", getI32Decoder3()],
|
|
6347
6347
|
["lowerLimitOrderSqrtPrice", getU128Decoder4()],
|
|
6348
6348
|
["upperLimitOrderSqrtPrice", getU128Decoder4()],
|
|
6349
|
-
["flags",
|
|
6350
|
-
["collateralA",
|
|
6351
|
-
["collateralB",
|
|
6352
|
-
["borrowA",
|
|
6353
|
-
["borrowB",
|
|
6354
|
-
["minAddedAmountA",
|
|
6355
|
-
["minAddedAmountB",
|
|
6356
|
-
["maxSwapSlippage",
|
|
6349
|
+
["flags", getU32Decoder17()],
|
|
6350
|
+
["collateralA", getU64Decoder20()],
|
|
6351
|
+
["collateralB", getU64Decoder20()],
|
|
6352
|
+
["borrowA", getU64Decoder20()],
|
|
6353
|
+
["borrowB", getU64Decoder20()],
|
|
6354
|
+
["minAddedAmountA", getU64Decoder20()],
|
|
6355
|
+
["minAddedAmountB", getU64Decoder20()],
|
|
6356
|
+
["maxSwapSlippage", getU32Decoder17()],
|
|
6357
6357
|
["remainingAccountsInfo", getRemainingAccountsInfoDecoder()]
|
|
6358
6358
|
]);
|
|
6359
6359
|
}
|
|
@@ -6541,12 +6541,8 @@ import {
|
|
|
6541
6541
|
getBytesEncoder as getBytesEncoder36,
|
|
6542
6542
|
getStructDecoder as getStructDecoder37,
|
|
6543
6543
|
getStructEncoder as getStructEncoder37,
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
getU32Decoder as getU32Decoder22,
|
|
6547
|
-
getU32Encoder as getU32Encoder22,
|
|
6548
|
-
getU64Decoder as getU64Decoder17,
|
|
6549
|
-
getU64Encoder as getU64Encoder17,
|
|
6544
|
+
getU64Decoder as getU64Decoder21,
|
|
6545
|
+
getU64Encoder as getU64Encoder21,
|
|
6550
6546
|
transformEncoder as transformEncoder35
|
|
6551
6547
|
} from "@solana/kit";
|
|
6552
6548
|
var OPEN_AND_INCREASE_TUNA_SPOT_POSITION_FUSION_DISCRIMINATOR = new Uint8Array([242, 25, 184, 131, 250, 142, 138, 191]);
|
|
@@ -6561,12 +6557,9 @@ function getOpenAndIncreaseTunaSpotPositionFusionInstructionDataEncoder() {
|
|
|
6561
6557
|
["discriminator", fixEncoderSize36(getBytesEncoder36(), 8)],
|
|
6562
6558
|
["positionToken", getPoolTokenEncoder()],
|
|
6563
6559
|
["collateralToken", getPoolTokenEncoder()],
|
|
6564
|
-
["collateralAmount",
|
|
6565
|
-
["borrowAmount",
|
|
6566
|
-
["
|
|
6567
|
-
["upperLimitOrderSqrtPrice", getU128Encoder5()],
|
|
6568
|
-
["flags", getU32Encoder22()],
|
|
6569
|
-
["maxSwapSlippage", getU32Encoder22()],
|
|
6560
|
+
["collateralAmount", getU64Encoder21()],
|
|
6561
|
+
["borrowAmount", getU64Encoder21()],
|
|
6562
|
+
["minSwapAmountOut", getU64Encoder21()],
|
|
6570
6563
|
["remainingAccountsInfo", getRemainingAccountsInfoEncoder()]
|
|
6571
6564
|
]),
|
|
6572
6565
|
(value) => ({
|
|
@@ -6580,12 +6573,9 @@ function getOpenAndIncreaseTunaSpotPositionFusionInstructionDataDecoder() {
|
|
|
6580
6573
|
["discriminator", fixDecoderSize35(getBytesDecoder35(), 8)],
|
|
6581
6574
|
["positionToken", getPoolTokenDecoder()],
|
|
6582
6575
|
["collateralToken", getPoolTokenDecoder()],
|
|
6583
|
-
["collateralAmount",
|
|
6584
|
-
["borrowAmount",
|
|
6585
|
-
["
|
|
6586
|
-
["upperLimitOrderSqrtPrice", getU128Decoder5()],
|
|
6587
|
-
["flags", getU32Decoder22()],
|
|
6588
|
-
["maxSwapSlippage", getU32Decoder22()],
|
|
6576
|
+
["collateralAmount", getU64Decoder21()],
|
|
6577
|
+
["borrowAmount", getU64Decoder21()],
|
|
6578
|
+
["minSwapAmountOut", getU64Decoder21()],
|
|
6589
6579
|
["remainingAccountsInfo", getRemainingAccountsInfoDecoder()]
|
|
6590
6580
|
]);
|
|
6591
6581
|
}
|
|
@@ -6753,12 +6743,8 @@ import {
|
|
|
6753
6743
|
getBytesEncoder as getBytesEncoder37,
|
|
6754
6744
|
getStructDecoder as getStructDecoder38,
|
|
6755
6745
|
getStructEncoder as getStructEncoder38,
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
getU32Decoder as getU32Decoder23,
|
|
6759
|
-
getU32Encoder as getU32Encoder23,
|
|
6760
|
-
getU64Decoder as getU64Decoder18,
|
|
6761
|
-
getU64Encoder as getU64Encoder18,
|
|
6746
|
+
getU64Decoder as getU64Decoder22,
|
|
6747
|
+
getU64Encoder as getU64Encoder22,
|
|
6762
6748
|
transformEncoder as transformEncoder36
|
|
6763
6749
|
} from "@solana/kit";
|
|
6764
6750
|
var OPEN_AND_INCREASE_TUNA_SPOT_POSITION_ORCA_DISCRIMINATOR = new Uint8Array([124, 15, 205, 162, 7, 88, 34, 177]);
|
|
@@ -6773,12 +6759,9 @@ function getOpenAndIncreaseTunaSpotPositionOrcaInstructionDataEncoder() {
|
|
|
6773
6759
|
["discriminator", fixEncoderSize37(getBytesEncoder37(), 8)],
|
|
6774
6760
|
["positionToken", getPoolTokenEncoder()],
|
|
6775
6761
|
["collateralToken", getPoolTokenEncoder()],
|
|
6776
|
-
["collateralAmount",
|
|
6777
|
-
["borrowAmount",
|
|
6778
|
-
["
|
|
6779
|
-
["upperLimitOrderSqrtPrice", getU128Encoder6()],
|
|
6780
|
-
["flags", getU32Encoder23()],
|
|
6781
|
-
["maxSwapSlippage", getU32Encoder23()],
|
|
6762
|
+
["collateralAmount", getU64Encoder22()],
|
|
6763
|
+
["borrowAmount", getU64Encoder22()],
|
|
6764
|
+
["minSwapAmountOut", getU64Encoder22()],
|
|
6782
6765
|
["remainingAccountsInfo", getRemainingAccountsInfoEncoder()]
|
|
6783
6766
|
]),
|
|
6784
6767
|
(value) => ({
|
|
@@ -6792,12 +6775,9 @@ function getOpenAndIncreaseTunaSpotPositionOrcaInstructionDataDecoder() {
|
|
|
6792
6775
|
["discriminator", fixDecoderSize36(getBytesDecoder36(), 8)],
|
|
6793
6776
|
["positionToken", getPoolTokenDecoder()],
|
|
6794
6777
|
["collateralToken", getPoolTokenDecoder()],
|
|
6795
|
-
["collateralAmount",
|
|
6796
|
-
["borrowAmount",
|
|
6797
|
-
["
|
|
6798
|
-
["upperLimitOrderSqrtPrice", getU128Decoder6()],
|
|
6799
|
-
["flags", getU32Decoder23()],
|
|
6800
|
-
["maxSwapSlippage", getU32Decoder23()],
|
|
6778
|
+
["collateralAmount", getU64Decoder22()],
|
|
6779
|
+
["borrowAmount", getU64Decoder22()],
|
|
6780
|
+
["minSwapAmountOut", getU64Decoder22()],
|
|
6801
6781
|
["remainingAccountsInfo", getRemainingAccountsInfoDecoder()]
|
|
6802
6782
|
]);
|
|
6803
6783
|
}
|
|
@@ -7068,10 +7048,10 @@ import {
|
|
|
7068
7048
|
getI32Encoder as getI32Encoder4,
|
|
7069
7049
|
getStructDecoder as getStructDecoder40,
|
|
7070
7050
|
getStructEncoder as getStructEncoder40,
|
|
7071
|
-
getU128Decoder as
|
|
7072
|
-
getU128Encoder as
|
|
7073
|
-
getU32Decoder as
|
|
7074
|
-
getU32Encoder as
|
|
7051
|
+
getU128Decoder as getU128Decoder5,
|
|
7052
|
+
getU128Encoder as getU128Encoder5,
|
|
7053
|
+
getU32Decoder as getU32Decoder18,
|
|
7054
|
+
getU32Encoder as getU32Encoder18,
|
|
7075
7055
|
transformEncoder as transformEncoder38
|
|
7076
7056
|
} from "@solana/kit";
|
|
7077
7057
|
var OPEN_TUNA_LP_POSITION_FUSION_DISCRIMINATOR = new Uint8Array([
|
|
@@ -7095,9 +7075,9 @@ function getOpenTunaLpPositionFusionInstructionDataEncoder() {
|
|
|
7095
7075
|
["discriminator", fixEncoderSize39(getBytesEncoder39(), 8)],
|
|
7096
7076
|
["tickLowerIndex", getI32Encoder4()],
|
|
7097
7077
|
["tickUpperIndex", getI32Encoder4()],
|
|
7098
|
-
["lowerLimitOrderSqrtPrice",
|
|
7099
|
-
["upperLimitOrderSqrtPrice",
|
|
7100
|
-
["flags",
|
|
7078
|
+
["lowerLimitOrderSqrtPrice", getU128Encoder5()],
|
|
7079
|
+
["upperLimitOrderSqrtPrice", getU128Encoder5()],
|
|
7080
|
+
["flags", getU32Encoder18()]
|
|
7101
7081
|
]),
|
|
7102
7082
|
(value) => ({
|
|
7103
7083
|
...value,
|
|
@@ -7110,9 +7090,9 @@ function getOpenTunaLpPositionFusionInstructionDataDecoder() {
|
|
|
7110
7090
|
["discriminator", fixDecoderSize38(getBytesDecoder38(), 8)],
|
|
7111
7091
|
["tickLowerIndex", getI32Decoder4()],
|
|
7112
7092
|
["tickUpperIndex", getI32Decoder4()],
|
|
7113
|
-
["lowerLimitOrderSqrtPrice",
|
|
7114
|
-
["upperLimitOrderSqrtPrice",
|
|
7115
|
-
["flags",
|
|
7093
|
+
["lowerLimitOrderSqrtPrice", getU128Decoder5()],
|
|
7094
|
+
["upperLimitOrderSqrtPrice", getU128Decoder5()],
|
|
7095
|
+
["flags", getU32Decoder18()]
|
|
7116
7096
|
]);
|
|
7117
7097
|
}
|
|
7118
7098
|
function getOpenTunaLpPositionFusionInstructionDataCodec() {
|
|
@@ -7247,10 +7227,10 @@ import {
|
|
|
7247
7227
|
getI32Encoder as getI32Encoder5,
|
|
7248
7228
|
getStructDecoder as getStructDecoder41,
|
|
7249
7229
|
getStructEncoder as getStructEncoder41,
|
|
7250
|
-
getU128Decoder as
|
|
7251
|
-
getU128Encoder as
|
|
7252
|
-
getU32Decoder as
|
|
7253
|
-
getU32Encoder as
|
|
7230
|
+
getU128Decoder as getU128Decoder6,
|
|
7231
|
+
getU128Encoder as getU128Encoder6,
|
|
7232
|
+
getU32Decoder as getU32Decoder19,
|
|
7233
|
+
getU32Encoder as getU32Encoder19,
|
|
7254
7234
|
transformEncoder as transformEncoder39
|
|
7255
7235
|
} from "@solana/kit";
|
|
7256
7236
|
var OPEN_TUNA_LP_POSITION_ORCA_DISCRIMINATOR = new Uint8Array([
|
|
@@ -7274,9 +7254,9 @@ function getOpenTunaLpPositionOrcaInstructionDataEncoder() {
|
|
|
7274
7254
|
["discriminator", fixEncoderSize40(getBytesEncoder40(), 8)],
|
|
7275
7255
|
["tickLowerIndex", getI32Encoder5()],
|
|
7276
7256
|
["tickUpperIndex", getI32Encoder5()],
|
|
7277
|
-
["lowerLimitOrderSqrtPrice",
|
|
7278
|
-
["upperLimitOrderSqrtPrice",
|
|
7279
|
-
["flags",
|
|
7257
|
+
["lowerLimitOrderSqrtPrice", getU128Encoder6()],
|
|
7258
|
+
["upperLimitOrderSqrtPrice", getU128Encoder6()],
|
|
7259
|
+
["flags", getU32Encoder19()]
|
|
7280
7260
|
]),
|
|
7281
7261
|
(value) => ({
|
|
7282
7262
|
...value,
|
|
@@ -7289,9 +7269,9 @@ function getOpenTunaLpPositionOrcaInstructionDataDecoder() {
|
|
|
7289
7269
|
["discriminator", fixDecoderSize39(getBytesDecoder39(), 8)],
|
|
7290
7270
|
["tickLowerIndex", getI32Decoder5()],
|
|
7291
7271
|
["tickUpperIndex", getI32Decoder5()],
|
|
7292
|
-
["lowerLimitOrderSqrtPrice",
|
|
7293
|
-
["upperLimitOrderSqrtPrice",
|
|
7294
|
-
["flags",
|
|
7272
|
+
["lowerLimitOrderSqrtPrice", getU128Decoder6()],
|
|
7273
|
+
["upperLimitOrderSqrtPrice", getU128Decoder6()],
|
|
7274
|
+
["flags", getU32Decoder19()]
|
|
7295
7275
|
]);
|
|
7296
7276
|
}
|
|
7297
7277
|
function getOpenTunaLpPositionOrcaInstructionDataCodec() {
|
|
@@ -7424,10 +7404,6 @@ import {
|
|
|
7424
7404
|
getBytesEncoder as getBytesEncoder41,
|
|
7425
7405
|
getStructDecoder as getStructDecoder42,
|
|
7426
7406
|
getStructEncoder as getStructEncoder42,
|
|
7427
|
-
getU128Decoder as getU128Decoder9,
|
|
7428
|
-
getU128Encoder as getU128Encoder9,
|
|
7429
|
-
getU32Decoder as getU32Decoder26,
|
|
7430
|
-
getU32Encoder as getU32Encoder26,
|
|
7431
7407
|
transformEncoder as transformEncoder40
|
|
7432
7408
|
} from "@solana/kit";
|
|
7433
7409
|
var OPEN_TUNA_SPOT_POSITION_FUSION_DISCRIMINATOR = new Uint8Array([
|
|
@@ -7450,10 +7426,7 @@ function getOpenTunaSpotPositionFusionInstructionDataEncoder() {
|
|
|
7450
7426
|
getStructEncoder42([
|
|
7451
7427
|
["discriminator", fixEncoderSize41(getBytesEncoder41(), 8)],
|
|
7452
7428
|
["positionToken", getPoolTokenEncoder()],
|
|
7453
|
-
["collateralToken", getPoolTokenEncoder()]
|
|
7454
|
-
["lowerLimitOrderSqrtPrice", getU128Encoder9()],
|
|
7455
|
-
["upperLimitOrderSqrtPrice", getU128Encoder9()],
|
|
7456
|
-
["flags", getU32Encoder26()]
|
|
7429
|
+
["collateralToken", getPoolTokenEncoder()]
|
|
7457
7430
|
]),
|
|
7458
7431
|
(value) => ({
|
|
7459
7432
|
...value,
|
|
@@ -7465,10 +7438,7 @@ function getOpenTunaSpotPositionFusionInstructionDataDecoder() {
|
|
|
7465
7438
|
return getStructDecoder42([
|
|
7466
7439
|
["discriminator", fixDecoderSize40(getBytesDecoder40(), 8)],
|
|
7467
7440
|
["positionToken", getPoolTokenDecoder()],
|
|
7468
|
-
["collateralToken", getPoolTokenDecoder()]
|
|
7469
|
-
["lowerLimitOrderSqrtPrice", getU128Decoder9()],
|
|
7470
|
-
["upperLimitOrderSqrtPrice", getU128Decoder9()],
|
|
7471
|
-
["flags", getU32Decoder26()]
|
|
7441
|
+
["collateralToken", getPoolTokenDecoder()]
|
|
7472
7442
|
]);
|
|
7473
7443
|
}
|
|
7474
7444
|
function getOpenTunaSpotPositionFusionInstructionDataCodec() {
|
|
@@ -7568,10 +7538,6 @@ import {
|
|
|
7568
7538
|
getBytesEncoder as getBytesEncoder42,
|
|
7569
7539
|
getStructDecoder as getStructDecoder43,
|
|
7570
7540
|
getStructEncoder as getStructEncoder43,
|
|
7571
|
-
getU128Decoder as getU128Decoder10,
|
|
7572
|
-
getU128Encoder as getU128Encoder10,
|
|
7573
|
-
getU32Decoder as getU32Decoder27,
|
|
7574
|
-
getU32Encoder as getU32Encoder27,
|
|
7575
7541
|
transformEncoder as transformEncoder41
|
|
7576
7542
|
} from "@solana/kit";
|
|
7577
7543
|
var OPEN_TUNA_SPOT_POSITION_ORCA_DISCRIMINATOR = new Uint8Array([
|
|
@@ -7594,10 +7560,7 @@ function getOpenTunaSpotPositionOrcaInstructionDataEncoder() {
|
|
|
7594
7560
|
getStructEncoder43([
|
|
7595
7561
|
["discriminator", fixEncoderSize42(getBytesEncoder42(), 8)],
|
|
7596
7562
|
["positionToken", getPoolTokenEncoder()],
|
|
7597
|
-
["collateralToken", getPoolTokenEncoder()]
|
|
7598
|
-
["lowerLimitOrderSqrtPrice", getU128Encoder10()],
|
|
7599
|
-
["upperLimitOrderSqrtPrice", getU128Encoder10()],
|
|
7600
|
-
["flags", getU32Encoder27()]
|
|
7563
|
+
["collateralToken", getPoolTokenEncoder()]
|
|
7601
7564
|
]),
|
|
7602
7565
|
(value) => ({
|
|
7603
7566
|
...value,
|
|
@@ -7609,10 +7572,7 @@ function getOpenTunaSpotPositionOrcaInstructionDataDecoder() {
|
|
|
7609
7572
|
return getStructDecoder43([
|
|
7610
7573
|
["discriminator", fixDecoderSize41(getBytesDecoder41(), 8)],
|
|
7611
7574
|
["positionToken", getPoolTokenDecoder()],
|
|
7612
|
-
["collateralToken", getPoolTokenDecoder()]
|
|
7613
|
-
["lowerLimitOrderSqrtPrice", getU128Decoder10()],
|
|
7614
|
-
["upperLimitOrderSqrtPrice", getU128Decoder10()],
|
|
7615
|
-
["flags", getU32Decoder27()]
|
|
7575
|
+
["collateralToken", getPoolTokenDecoder()]
|
|
7616
7576
|
]);
|
|
7617
7577
|
}
|
|
7618
7578
|
function getOpenTunaSpotPositionOrcaInstructionDataCodec() {
|
|
@@ -8060,8 +8020,8 @@ import {
|
|
|
8060
8020
|
getBytesEncoder as getBytesEncoder45,
|
|
8061
8021
|
getStructDecoder as getStructDecoder46,
|
|
8062
8022
|
getStructEncoder as getStructEncoder46,
|
|
8063
|
-
getU64Decoder as
|
|
8064
|
-
getU64Encoder as
|
|
8023
|
+
getU64Decoder as getU64Decoder23,
|
|
8024
|
+
getU64Encoder as getU64Encoder23,
|
|
8065
8025
|
transformEncoder as transformEncoder44
|
|
8066
8026
|
} from "@solana/kit";
|
|
8067
8027
|
var REPAY_BAD_DEBT_DISCRIMINATOR = new Uint8Array([
|
|
@@ -8083,8 +8043,8 @@ function getRepayBadDebtInstructionDataEncoder() {
|
|
|
8083
8043
|
return transformEncoder44(
|
|
8084
8044
|
getStructEncoder46([
|
|
8085
8045
|
["discriminator", fixEncoderSize45(getBytesEncoder45(), 8)],
|
|
8086
|
-
["funds",
|
|
8087
|
-
["shares",
|
|
8046
|
+
["funds", getU64Encoder23()],
|
|
8047
|
+
["shares", getU64Encoder23()]
|
|
8088
8048
|
]),
|
|
8089
8049
|
(value) => ({ ...value, discriminator: REPAY_BAD_DEBT_DISCRIMINATOR })
|
|
8090
8050
|
);
|
|
@@ -8092,8 +8052,8 @@ function getRepayBadDebtInstructionDataEncoder() {
|
|
|
8092
8052
|
function getRepayBadDebtInstructionDataDecoder() {
|
|
8093
8053
|
return getStructDecoder46([
|
|
8094
8054
|
["discriminator", fixDecoderSize44(getBytesDecoder44(), 8)],
|
|
8095
|
-
["funds",
|
|
8096
|
-
["shares",
|
|
8055
|
+
["funds", getU64Decoder23()],
|
|
8056
|
+
["shares", getU64Decoder23()]
|
|
8097
8057
|
]);
|
|
8098
8058
|
}
|
|
8099
8059
|
function getRepayBadDebtInstructionDataCodec() {
|
|
@@ -8173,8 +8133,8 @@ import {
|
|
|
8173
8133
|
getBytesEncoder as getBytesEncoder46,
|
|
8174
8134
|
getStructDecoder as getStructDecoder47,
|
|
8175
8135
|
getStructEncoder as getStructEncoder47,
|
|
8176
|
-
getU64Decoder as
|
|
8177
|
-
getU64Encoder as
|
|
8136
|
+
getU64Decoder as getU64Decoder24,
|
|
8137
|
+
getU64Encoder as getU64Encoder24,
|
|
8178
8138
|
transformEncoder as transformEncoder45
|
|
8179
8139
|
} from "@solana/kit";
|
|
8180
8140
|
var REPAY_TUNA_LP_POSITION_DEBT_DISCRIMINATOR = new Uint8Array([
|
|
@@ -8196,8 +8156,8 @@ function getRepayTunaLpPositionDebtInstructionDataEncoder() {
|
|
|
8196
8156
|
return transformEncoder45(
|
|
8197
8157
|
getStructEncoder47([
|
|
8198
8158
|
["discriminator", fixEncoderSize46(getBytesEncoder46(), 8)],
|
|
8199
|
-
["collateralFundsA",
|
|
8200
|
-
["collateralFundsB",
|
|
8159
|
+
["collateralFundsA", getU64Encoder24()],
|
|
8160
|
+
["collateralFundsB", getU64Encoder24()]
|
|
8201
8161
|
]),
|
|
8202
8162
|
(value) => ({
|
|
8203
8163
|
...value,
|
|
@@ -8208,8 +8168,8 @@ function getRepayTunaLpPositionDebtInstructionDataEncoder() {
|
|
|
8208
8168
|
function getRepayTunaLpPositionDebtInstructionDataDecoder() {
|
|
8209
8169
|
return getStructDecoder47([
|
|
8210
8170
|
["discriminator", fixDecoderSize45(getBytesDecoder45(), 8)],
|
|
8211
|
-
["collateralFundsA",
|
|
8212
|
-
["collateralFundsB",
|
|
8171
|
+
["collateralFundsA", getU64Decoder24()],
|
|
8172
|
+
["collateralFundsB", getU64Decoder24()]
|
|
8213
8173
|
]);
|
|
8214
8174
|
}
|
|
8215
8175
|
function getRepayTunaLpPositionDebtInstructionDataCodec() {
|
|
@@ -8324,8 +8284,6 @@ import {
|
|
|
8324
8284
|
getBytesEncoder as getBytesEncoder47,
|
|
8325
8285
|
getStructDecoder as getStructDecoder48,
|
|
8326
8286
|
getStructEncoder as getStructEncoder48,
|
|
8327
|
-
getU128Decoder as getU128Decoder11,
|
|
8328
|
-
getU128Encoder as getU128Encoder11,
|
|
8329
8287
|
transformEncoder as transformEncoder46
|
|
8330
8288
|
} from "@solana/kit";
|
|
8331
8289
|
var RESET_TUNA_SPOT_POSITION_DISCRIMINATOR = new Uint8Array([
|
|
@@ -8348,9 +8306,7 @@ function getResetTunaSpotPositionInstructionDataEncoder() {
|
|
|
8348
8306
|
getStructEncoder48([
|
|
8349
8307
|
["discriminator", fixEncoderSize47(getBytesEncoder47(), 8)],
|
|
8350
8308
|
["positionToken", getPoolTokenEncoder()],
|
|
8351
|
-
["collateralToken", getPoolTokenEncoder()]
|
|
8352
|
-
["lowerLimitOrderSqrtPrice", getU128Encoder11()],
|
|
8353
|
-
["upperLimitOrderSqrtPrice", getU128Encoder11()]
|
|
8309
|
+
["collateralToken", getPoolTokenEncoder()]
|
|
8354
8310
|
]),
|
|
8355
8311
|
(value) => ({
|
|
8356
8312
|
...value,
|
|
@@ -8362,9 +8318,7 @@ function getResetTunaSpotPositionInstructionDataDecoder() {
|
|
|
8362
8318
|
return getStructDecoder48([
|
|
8363
8319
|
["discriminator", fixDecoderSize46(getBytesDecoder46(), 8)],
|
|
8364
8320
|
["positionToken", getPoolTokenDecoder()],
|
|
8365
|
-
["collateralToken", getPoolTokenDecoder()]
|
|
8366
|
-
["lowerLimitOrderSqrtPrice", getU128Decoder11()],
|
|
8367
|
-
["upperLimitOrderSqrtPrice", getU128Decoder11()]
|
|
8321
|
+
["collateralToken", getPoolTokenDecoder()]
|
|
8368
8322
|
]);
|
|
8369
8323
|
}
|
|
8370
8324
|
function getResetTunaSpotPositionInstructionDataCodec() {
|
|
@@ -8533,8 +8487,8 @@ import {
|
|
|
8533
8487
|
getBytesEncoder as getBytesEncoder49,
|
|
8534
8488
|
getStructDecoder as getStructDecoder50,
|
|
8535
8489
|
getStructEncoder as getStructEncoder50,
|
|
8536
|
-
getU32Decoder as
|
|
8537
|
-
getU32Encoder as
|
|
8490
|
+
getU32Decoder as getU32Decoder20,
|
|
8491
|
+
getU32Encoder as getU32Encoder20,
|
|
8538
8492
|
transformEncoder as transformEncoder48
|
|
8539
8493
|
} from "@solana/kit";
|
|
8540
8494
|
var SET_DEFAULT_MAX_PERCENTAGE_OF_LEFTOVERS_DISCRIMINATOR = new Uint8Array([37, 179, 107, 65, 203, 141, 183, 27]);
|
|
@@ -8547,7 +8501,7 @@ function getSetDefaultMaxPercentageOfLeftoversInstructionDataEncoder() {
|
|
|
8547
8501
|
return transformEncoder48(
|
|
8548
8502
|
getStructEncoder50([
|
|
8549
8503
|
["discriminator", fixEncoderSize49(getBytesEncoder49(), 8)],
|
|
8550
|
-
["maxPercentageOfLeftovers",
|
|
8504
|
+
["maxPercentageOfLeftovers", getU32Encoder20()]
|
|
8551
8505
|
]),
|
|
8552
8506
|
(value) => ({
|
|
8553
8507
|
...value,
|
|
@@ -8558,7 +8512,7 @@ function getSetDefaultMaxPercentageOfLeftoversInstructionDataEncoder() {
|
|
|
8558
8512
|
function getSetDefaultMaxPercentageOfLeftoversInstructionDataDecoder() {
|
|
8559
8513
|
return getStructDecoder50([
|
|
8560
8514
|
["discriminator", fixDecoderSize48(getBytesDecoder48(), 8)],
|
|
8561
|
-
["maxPercentageOfLeftovers",
|
|
8515
|
+
["maxPercentageOfLeftovers", getU32Decoder20()]
|
|
8562
8516
|
]);
|
|
8563
8517
|
}
|
|
8564
8518
|
function getSetDefaultMaxPercentageOfLeftoversInstructionDataCodec() {
|
|
@@ -8619,8 +8573,8 @@ import {
|
|
|
8619
8573
|
getBytesEncoder as getBytesEncoder50,
|
|
8620
8574
|
getStructDecoder as getStructDecoder51,
|
|
8621
8575
|
getStructEncoder as getStructEncoder51,
|
|
8622
|
-
getU32Decoder as
|
|
8623
|
-
getU32Encoder as
|
|
8576
|
+
getU32Decoder as getU32Decoder21,
|
|
8577
|
+
getU32Encoder as getU32Encoder21,
|
|
8624
8578
|
transformEncoder as transformEncoder49
|
|
8625
8579
|
} from "@solana/kit";
|
|
8626
8580
|
var SET_DEFAULT_MAX_SWAP_SLIPPAGE_DISCRIMINATOR = new Uint8Array([
|
|
@@ -8642,7 +8596,7 @@ function getSetDefaultMaxSwapSlippageInstructionDataEncoder() {
|
|
|
8642
8596
|
return transformEncoder49(
|
|
8643
8597
|
getStructEncoder51([
|
|
8644
8598
|
["discriminator", fixEncoderSize50(getBytesEncoder50(), 8)],
|
|
8645
|
-
["maxSwapSlippage",
|
|
8599
|
+
["maxSwapSlippage", getU32Encoder21()]
|
|
8646
8600
|
]),
|
|
8647
8601
|
(value) => ({
|
|
8648
8602
|
...value,
|
|
@@ -8653,7 +8607,7 @@ function getSetDefaultMaxSwapSlippageInstructionDataEncoder() {
|
|
|
8653
8607
|
function getSetDefaultMaxSwapSlippageInstructionDataDecoder() {
|
|
8654
8608
|
return getStructDecoder51([
|
|
8655
8609
|
["discriminator", fixDecoderSize49(getBytesDecoder49(), 8)],
|
|
8656
|
-
["maxSwapSlippage",
|
|
8610
|
+
["maxSwapSlippage", getU32Decoder21()]
|
|
8657
8611
|
]);
|
|
8658
8612
|
}
|
|
8659
8613
|
function getSetDefaultMaxSwapSlippageInstructionDataCodec() {
|
|
@@ -8714,8 +8668,8 @@ import {
|
|
|
8714
8668
|
getBytesEncoder as getBytesEncoder51,
|
|
8715
8669
|
getStructDecoder as getStructDecoder52,
|
|
8716
8670
|
getStructEncoder as getStructEncoder52,
|
|
8717
|
-
getU32Decoder as
|
|
8718
|
-
getU32Encoder as
|
|
8671
|
+
getU32Decoder as getU32Decoder22,
|
|
8672
|
+
getU32Encoder as getU32Encoder22,
|
|
8719
8673
|
transformEncoder as transformEncoder50
|
|
8720
8674
|
} from "@solana/kit";
|
|
8721
8675
|
var SET_DEFAULT_ORACLE_PRICE_DEVIATION_THRESHOLD_DISCRIMINATOR = new Uint8Array([142, 158, 143, 67, 206, 91, 139, 120]);
|
|
@@ -8728,7 +8682,7 @@ function getSetDefaultOraclePriceDeviationThresholdInstructionDataEncoder() {
|
|
|
8728
8682
|
return transformEncoder50(
|
|
8729
8683
|
getStructEncoder52([
|
|
8730
8684
|
["discriminator", fixEncoderSize51(getBytesEncoder51(), 8)],
|
|
8731
|
-
["oraclePriceDeviationThreshold",
|
|
8685
|
+
["oraclePriceDeviationThreshold", getU32Encoder22()]
|
|
8732
8686
|
]),
|
|
8733
8687
|
(value) => ({
|
|
8734
8688
|
...value,
|
|
@@ -8739,7 +8693,7 @@ function getSetDefaultOraclePriceDeviationThresholdInstructionDataEncoder() {
|
|
|
8739
8693
|
function getSetDefaultOraclePriceDeviationThresholdInstructionDataDecoder() {
|
|
8740
8694
|
return getStructDecoder52([
|
|
8741
8695
|
["discriminator", fixDecoderSize50(getBytesDecoder50(), 8)],
|
|
8742
|
-
["oraclePriceDeviationThreshold",
|
|
8696
|
+
["oraclePriceDeviationThreshold", getU32Decoder22()]
|
|
8743
8697
|
]);
|
|
8744
8698
|
}
|
|
8745
8699
|
function getSetDefaultOraclePriceDeviationThresholdInstructionDataCodec() {
|
|
@@ -9171,8 +9125,8 @@ import {
|
|
|
9171
9125
|
getBytesEncoder as getBytesEncoder56,
|
|
9172
9126
|
getStructDecoder as getStructDecoder57,
|
|
9173
9127
|
getStructEncoder as getStructEncoder57,
|
|
9174
|
-
getU32Decoder as
|
|
9175
|
-
getU32Encoder as
|
|
9128
|
+
getU32Decoder as getU32Decoder23,
|
|
9129
|
+
getU32Encoder as getU32Encoder23,
|
|
9176
9130
|
transformEncoder as transformEncoder55
|
|
9177
9131
|
} from "@solana/kit";
|
|
9178
9132
|
var SET_TUNA_LP_POSITION_FLAGS_DISCRIMINATOR = new Uint8Array([
|
|
@@ -9194,7 +9148,7 @@ function getSetTunaLpPositionFlagsInstructionDataEncoder() {
|
|
|
9194
9148
|
return transformEncoder55(
|
|
9195
9149
|
getStructEncoder57([
|
|
9196
9150
|
["discriminator", fixEncoderSize56(getBytesEncoder56(), 8)],
|
|
9197
|
-
["flags",
|
|
9151
|
+
["flags", getU32Encoder23()]
|
|
9198
9152
|
]),
|
|
9199
9153
|
(value) => ({
|
|
9200
9154
|
...value,
|
|
@@ -9205,7 +9159,7 @@ function getSetTunaLpPositionFlagsInstructionDataEncoder() {
|
|
|
9205
9159
|
function getSetTunaLpPositionFlagsInstructionDataDecoder() {
|
|
9206
9160
|
return getStructDecoder57([
|
|
9207
9161
|
["discriminator", fixDecoderSize55(getBytesDecoder55(), 8)],
|
|
9208
|
-
["flags",
|
|
9162
|
+
["flags", getU32Decoder23()]
|
|
9209
9163
|
]);
|
|
9210
9164
|
}
|
|
9211
9165
|
function getSetTunaLpPositionFlagsInstructionDataCodec() {
|
|
@@ -9266,8 +9220,8 @@ import {
|
|
|
9266
9220
|
getBytesEncoder as getBytesEncoder57,
|
|
9267
9221
|
getStructDecoder as getStructDecoder58,
|
|
9268
9222
|
getStructEncoder as getStructEncoder58,
|
|
9269
|
-
getU128Decoder as
|
|
9270
|
-
getU128Encoder as
|
|
9223
|
+
getU128Decoder as getU128Decoder7,
|
|
9224
|
+
getU128Encoder as getU128Encoder7,
|
|
9271
9225
|
getU8Decoder as getU8Decoder5,
|
|
9272
9226
|
getU8Encoder as getU8Encoder5,
|
|
9273
9227
|
transformEncoder as transformEncoder56
|
|
@@ -9291,8 +9245,8 @@ function getSetTunaLpPositionLimitOrdersInstructionDataEncoder() {
|
|
|
9291
9245
|
return transformEncoder56(
|
|
9292
9246
|
getStructEncoder58([
|
|
9293
9247
|
["discriminator", fixEncoderSize57(getBytesEncoder57(), 8)],
|
|
9294
|
-
["lowerLimitOrderSqrtPrice",
|
|
9295
|
-
["upperLimitOrderSqrtPrice",
|
|
9248
|
+
["lowerLimitOrderSqrtPrice", getU128Encoder7()],
|
|
9249
|
+
["upperLimitOrderSqrtPrice", getU128Encoder7()],
|
|
9296
9250
|
["swapToTokenOnLimitOrder", getU8Encoder5()]
|
|
9297
9251
|
]),
|
|
9298
9252
|
(value) => ({
|
|
@@ -9304,8 +9258,8 @@ function getSetTunaLpPositionLimitOrdersInstructionDataEncoder() {
|
|
|
9304
9258
|
function getSetTunaLpPositionLimitOrdersInstructionDataDecoder() {
|
|
9305
9259
|
return getStructDecoder58([
|
|
9306
9260
|
["discriminator", fixDecoderSize56(getBytesDecoder56(), 8)],
|
|
9307
|
-
["lowerLimitOrderSqrtPrice",
|
|
9308
|
-
["upperLimitOrderSqrtPrice",
|
|
9261
|
+
["lowerLimitOrderSqrtPrice", getU128Decoder7()],
|
|
9262
|
+
["upperLimitOrderSqrtPrice", getU128Decoder7()],
|
|
9309
9263
|
["swapToTokenOnLimitOrder", getU8Decoder5()]
|
|
9310
9264
|
]);
|
|
9311
9265
|
}
|
|
@@ -9367,8 +9321,8 @@ import {
|
|
|
9367
9321
|
getBytesEncoder as getBytesEncoder58,
|
|
9368
9322
|
getStructDecoder as getStructDecoder59,
|
|
9369
9323
|
getStructEncoder as getStructEncoder59,
|
|
9370
|
-
getU32Decoder as
|
|
9371
|
-
getU32Encoder as
|
|
9324
|
+
getU32Decoder as getU32Decoder24,
|
|
9325
|
+
getU32Encoder as getU32Encoder24,
|
|
9372
9326
|
transformEncoder as transformEncoder57
|
|
9373
9327
|
} from "@solana/kit";
|
|
9374
9328
|
var SET_TUNA_LP_POSITION_REBALANCE_THRESHOLD_DISCRIMINATOR = new Uint8Array([244, 174, 185, 58, 90, 150, 162, 51]);
|
|
@@ -9381,7 +9335,7 @@ function getSetTunaLpPositionRebalanceThresholdInstructionDataEncoder() {
|
|
|
9381
9335
|
return transformEncoder57(
|
|
9382
9336
|
getStructEncoder59([
|
|
9383
9337
|
["discriminator", fixEncoderSize58(getBytesEncoder58(), 8)],
|
|
9384
|
-
["rebalanceThresholdTicks",
|
|
9338
|
+
["rebalanceThresholdTicks", getU32Encoder24()]
|
|
9385
9339
|
]),
|
|
9386
9340
|
(value) => ({
|
|
9387
9341
|
...value,
|
|
@@ -9392,7 +9346,7 @@ function getSetTunaLpPositionRebalanceThresholdInstructionDataEncoder() {
|
|
|
9392
9346
|
function getSetTunaLpPositionRebalanceThresholdInstructionDataDecoder() {
|
|
9393
9347
|
return getStructDecoder59([
|
|
9394
9348
|
["discriminator", fixDecoderSize57(getBytesDecoder57(), 8)],
|
|
9395
|
-
["rebalanceThresholdTicks",
|
|
9349
|
+
["rebalanceThresholdTicks", getU32Decoder24()]
|
|
9396
9350
|
]);
|
|
9397
9351
|
}
|
|
9398
9352
|
function getSetTunaLpPositionRebalanceThresholdInstructionDataCodec() {
|
|
@@ -9453,8 +9407,8 @@ import {
|
|
|
9453
9407
|
getBytesEncoder as getBytesEncoder59,
|
|
9454
9408
|
getStructDecoder as getStructDecoder60,
|
|
9455
9409
|
getStructEncoder as getStructEncoder60,
|
|
9456
|
-
getU128Decoder as
|
|
9457
|
-
getU128Encoder as
|
|
9410
|
+
getU128Decoder as getU128Decoder8,
|
|
9411
|
+
getU128Encoder as getU128Encoder8,
|
|
9458
9412
|
transformEncoder as transformEncoder58
|
|
9459
9413
|
} from "@solana/kit";
|
|
9460
9414
|
var SET_TUNA_SPOT_POSITION_LIMIT_ORDERS_DISCRIMINATOR = new Uint8Array(
|
|
@@ -9469,8 +9423,8 @@ function getSetTunaSpotPositionLimitOrdersInstructionDataEncoder() {
|
|
|
9469
9423
|
return transformEncoder58(
|
|
9470
9424
|
getStructEncoder60([
|
|
9471
9425
|
["discriminator", fixEncoderSize59(getBytesEncoder59(), 8)],
|
|
9472
|
-
["lowerLimitOrderSqrtPrice",
|
|
9473
|
-
["upperLimitOrderSqrtPrice",
|
|
9426
|
+
["lowerLimitOrderSqrtPrice", getU128Encoder8()],
|
|
9427
|
+
["upperLimitOrderSqrtPrice", getU128Encoder8()]
|
|
9474
9428
|
]),
|
|
9475
9429
|
(value) => ({
|
|
9476
9430
|
...value,
|
|
@@ -9481,8 +9435,8 @@ function getSetTunaSpotPositionLimitOrdersInstructionDataEncoder() {
|
|
|
9481
9435
|
function getSetTunaSpotPositionLimitOrdersInstructionDataDecoder() {
|
|
9482
9436
|
return getStructDecoder60([
|
|
9483
9437
|
["discriminator", fixDecoderSize58(getBytesDecoder58(), 8)],
|
|
9484
|
-
["lowerLimitOrderSqrtPrice",
|
|
9485
|
-
["upperLimitOrderSqrtPrice",
|
|
9438
|
+
["lowerLimitOrderSqrtPrice", getU128Decoder8()],
|
|
9439
|
+
["upperLimitOrderSqrtPrice", getU128Decoder8()]
|
|
9486
9440
|
]);
|
|
9487
9441
|
}
|
|
9488
9442
|
function getSetTunaSpotPositionLimitOrdersInstructionDataCodec() {
|
|
@@ -9549,10 +9503,10 @@ import {
|
|
|
9549
9503
|
getStructEncoder as getStructEncoder61,
|
|
9550
9504
|
getU16Decoder as getU16Decoder8,
|
|
9551
9505
|
getU16Encoder as getU16Encoder8,
|
|
9552
|
-
getU32Decoder as
|
|
9553
|
-
getU32Encoder as
|
|
9554
|
-
getU64Decoder as
|
|
9555
|
-
getU64Encoder as
|
|
9506
|
+
getU32Decoder as getU32Decoder25,
|
|
9507
|
+
getU32Encoder as getU32Encoder25,
|
|
9508
|
+
getU64Decoder as getU64Decoder25,
|
|
9509
|
+
getU64Encoder as getU64Encoder25,
|
|
9556
9510
|
transformEncoder as transformEncoder59
|
|
9557
9511
|
} from "@solana/kit";
|
|
9558
9512
|
var UPDATE_MARKET_DISCRIMINATOR = new Uint8Array([
|
|
@@ -9575,20 +9529,20 @@ function getUpdateMarketInstructionDataEncoder() {
|
|
|
9575
9529
|
getStructEncoder61([
|
|
9576
9530
|
["discriminator", fixEncoderSize60(getBytesEncoder60(), 8)],
|
|
9577
9531
|
["addressLookupTable", getAddressEncoder14()],
|
|
9578
|
-
["maxLeverage",
|
|
9532
|
+
["maxLeverage", getU32Encoder25()],
|
|
9579
9533
|
["protocolFee", getU16Encoder8()],
|
|
9580
9534
|
["protocolFeeOnCollateral", getU16Encoder8()],
|
|
9581
|
-
["liquidationFee",
|
|
9582
|
-
["liquidationThreshold",
|
|
9583
|
-
["limitOrderExecutionFee",
|
|
9584
|
-
["oraclePriceDeviationThreshold",
|
|
9535
|
+
["liquidationFee", getU32Encoder25()],
|
|
9536
|
+
["liquidationThreshold", getU32Encoder25()],
|
|
9537
|
+
["limitOrderExecutionFee", getU32Encoder25()],
|
|
9538
|
+
["oraclePriceDeviationThreshold", getU32Encoder25()],
|
|
9585
9539
|
["disabled", getBooleanEncoder8()],
|
|
9586
|
-
["borrowLimitA",
|
|
9587
|
-
["borrowLimitB",
|
|
9588
|
-
["maxSwapSlippage",
|
|
9589
|
-
["rebalanceProtocolFee",
|
|
9590
|
-
["spotPositionSizeLimitA",
|
|
9591
|
-
["spotPositionSizeLimitB",
|
|
9540
|
+
["borrowLimitA", getU64Encoder25()],
|
|
9541
|
+
["borrowLimitB", getU64Encoder25()],
|
|
9542
|
+
["maxSwapSlippage", getU32Encoder25()],
|
|
9543
|
+
["rebalanceProtocolFee", getU32Encoder25()],
|
|
9544
|
+
["spotPositionSizeLimitA", getU64Encoder25()],
|
|
9545
|
+
["spotPositionSizeLimitB", getU64Encoder25()]
|
|
9592
9546
|
]),
|
|
9593
9547
|
(value) => ({ ...value, discriminator: UPDATE_MARKET_DISCRIMINATOR })
|
|
9594
9548
|
);
|
|
@@ -9597,20 +9551,20 @@ function getUpdateMarketInstructionDataDecoder() {
|
|
|
9597
9551
|
return getStructDecoder61([
|
|
9598
9552
|
["discriminator", fixDecoderSize59(getBytesDecoder59(), 8)],
|
|
9599
9553
|
["addressLookupTable", getAddressDecoder14()],
|
|
9600
|
-
["maxLeverage",
|
|
9554
|
+
["maxLeverage", getU32Decoder25()],
|
|
9601
9555
|
["protocolFee", getU16Decoder8()],
|
|
9602
9556
|
["protocolFeeOnCollateral", getU16Decoder8()],
|
|
9603
|
-
["liquidationFee",
|
|
9604
|
-
["liquidationThreshold",
|
|
9605
|
-
["limitOrderExecutionFee",
|
|
9606
|
-
["oraclePriceDeviationThreshold",
|
|
9557
|
+
["liquidationFee", getU32Decoder25()],
|
|
9558
|
+
["liquidationThreshold", getU32Decoder25()],
|
|
9559
|
+
["limitOrderExecutionFee", getU32Decoder25()],
|
|
9560
|
+
["oraclePriceDeviationThreshold", getU32Decoder25()],
|
|
9607
9561
|
["disabled", getBooleanDecoder8()],
|
|
9608
|
-
["borrowLimitA",
|
|
9609
|
-
["borrowLimitB",
|
|
9610
|
-
["maxSwapSlippage",
|
|
9611
|
-
["rebalanceProtocolFee",
|
|
9612
|
-
["spotPositionSizeLimitA",
|
|
9613
|
-
["spotPositionSizeLimitB",
|
|
9562
|
+
["borrowLimitA", getU64Decoder25()],
|
|
9563
|
+
["borrowLimitB", getU64Decoder25()],
|
|
9564
|
+
["maxSwapSlippage", getU32Decoder25()],
|
|
9565
|
+
["rebalanceProtocolFee", getU32Decoder25()],
|
|
9566
|
+
["spotPositionSizeLimitA", getU64Decoder25()],
|
|
9567
|
+
["spotPositionSizeLimitB", getU64Decoder25()]
|
|
9614
9568
|
]);
|
|
9615
9569
|
}
|
|
9616
9570
|
function getUpdateMarketInstructionDataCodec() {
|
|
@@ -9674,8 +9628,8 @@ import {
|
|
|
9674
9628
|
getBytesEncoder as getBytesEncoder61,
|
|
9675
9629
|
getStructDecoder as getStructDecoder62,
|
|
9676
9630
|
getStructEncoder as getStructEncoder62,
|
|
9677
|
-
getU64Decoder as
|
|
9678
|
-
getU64Encoder as
|
|
9631
|
+
getU64Decoder as getU64Decoder26,
|
|
9632
|
+
getU64Encoder as getU64Encoder26,
|
|
9679
9633
|
transformEncoder as transformEncoder60
|
|
9680
9634
|
} from "@solana/kit";
|
|
9681
9635
|
var UPDATE_VAULT_DISCRIMINATOR = new Uint8Array([
|
|
@@ -9697,8 +9651,8 @@ function getUpdateVaultInstructionDataEncoder() {
|
|
|
9697
9651
|
return transformEncoder60(
|
|
9698
9652
|
getStructEncoder62([
|
|
9699
9653
|
["discriminator", fixEncoderSize61(getBytesEncoder61(), 8)],
|
|
9700
|
-
["interestRate",
|
|
9701
|
-
["supplyLimit",
|
|
9654
|
+
["interestRate", getU64Encoder26()],
|
|
9655
|
+
["supplyLimit", getU64Encoder26()],
|
|
9702
9656
|
["pythOraclePriceUpdate", getAddressEncoder15()],
|
|
9703
9657
|
["pythOracleFeedId", getAddressEncoder15()]
|
|
9704
9658
|
]),
|
|
@@ -9708,8 +9662,8 @@ function getUpdateVaultInstructionDataEncoder() {
|
|
|
9708
9662
|
function getUpdateVaultInstructionDataDecoder() {
|
|
9709
9663
|
return getStructDecoder62([
|
|
9710
9664
|
["discriminator", fixDecoderSize60(getBytesDecoder60(), 8)],
|
|
9711
|
-
["interestRate",
|
|
9712
|
-
["supplyLimit",
|
|
9665
|
+
["interestRate", getU64Decoder26()],
|
|
9666
|
+
["supplyLimit", getU64Decoder26()],
|
|
9713
9667
|
["pythOraclePriceUpdate", getAddressDecoder15()],
|
|
9714
9668
|
["pythOracleFeedId", getAddressDecoder15()]
|
|
9715
9669
|
]);
|
|
@@ -9773,8 +9727,8 @@ import {
|
|
|
9773
9727
|
getBytesEncoder as getBytesEncoder62,
|
|
9774
9728
|
getStructDecoder as getStructDecoder63,
|
|
9775
9729
|
getStructEncoder as getStructEncoder63,
|
|
9776
|
-
getU64Decoder as
|
|
9777
|
-
getU64Encoder as
|
|
9730
|
+
getU64Decoder as getU64Decoder27,
|
|
9731
|
+
getU64Encoder as getU64Encoder27,
|
|
9778
9732
|
transformEncoder as transformEncoder61
|
|
9779
9733
|
} from "@solana/kit";
|
|
9780
9734
|
var WITHDRAW_DISCRIMINATOR = new Uint8Array([
|
|
@@ -9794,8 +9748,8 @@ function getWithdrawInstructionDataEncoder() {
|
|
|
9794
9748
|
return transformEncoder61(
|
|
9795
9749
|
getStructEncoder63([
|
|
9796
9750
|
["discriminator", fixEncoderSize62(getBytesEncoder62(), 8)],
|
|
9797
|
-
["funds",
|
|
9798
|
-
["shares",
|
|
9751
|
+
["funds", getU64Encoder27()],
|
|
9752
|
+
["shares", getU64Encoder27()]
|
|
9799
9753
|
]),
|
|
9800
9754
|
(value) => ({ ...value, discriminator: WITHDRAW_DISCRIMINATOR })
|
|
9801
9755
|
);
|
|
@@ -9803,8 +9757,8 @@ function getWithdrawInstructionDataEncoder() {
|
|
|
9803
9757
|
function getWithdrawInstructionDataDecoder() {
|
|
9804
9758
|
return getStructDecoder63([
|
|
9805
9759
|
["discriminator", fixDecoderSize61(getBytesDecoder61(), 8)],
|
|
9806
|
-
["funds",
|
|
9807
|
-
["shares",
|
|
9760
|
+
["funds", getU64Decoder27()],
|
|
9761
|
+
["shares", getU64Decoder27()]
|
|
9808
9762
|
]);
|
|
9809
9763
|
}
|
|
9810
9764
|
function getWithdrawInstructionDataCodec() {
|
|
@@ -10173,6 +10127,15 @@ async function fetchAllMarketWithFilter(rpc, ...filters) {
|
|
|
10173
10127
|
return fetchDecodedProgramAccounts(rpc, TUNA_PROGRAM_ADDRESS, [discriminatorFilter, ...filters], getMarketDecoder());
|
|
10174
10128
|
}
|
|
10175
10129
|
|
|
10130
|
+
// src/utils/math.ts
|
|
10131
|
+
function mulDiv(x, y, d, roundUp = false) {
|
|
10132
|
+
if (!roundUp) {
|
|
10133
|
+
return x * y / d;
|
|
10134
|
+
} else {
|
|
10135
|
+
return (x * y + (d - 1n)) / d;
|
|
10136
|
+
}
|
|
10137
|
+
}
|
|
10138
|
+
|
|
10176
10139
|
// src/utils/orca.ts
|
|
10177
10140
|
import { getInitializableTickIndex } from "@crypticdot/fusionamm-core";
|
|
10178
10141
|
import { getTickArrayAddress } from "@orca-so/whirlpools-client";
|
|
@@ -10455,269 +10418,6 @@ function calculateProtocolFee(collateralAmount, borrowAmount, protocolFeeRateOnC
|
|
|
10455
10418
|
return collateralAmount * BigInt(protocolFeeRateOnCollateral) / BigInt(HUNDRED_PERCENT) + borrowAmount * BigInt(protocolFeeRate) / BigInt(HUNDRED_PERCENT);
|
|
10456
10419
|
}
|
|
10457
10420
|
|
|
10458
|
-
// src/utils/spotPositionMath.ts
|
|
10459
|
-
import {
|
|
10460
|
-
sqrtPriceToPrice,
|
|
10461
|
-
swapQuoteByInputToken,
|
|
10462
|
-
swapQuoteByOutputToken,
|
|
10463
|
-
tryApplySwapFee as tryApplySwapFee2,
|
|
10464
|
-
tryReverseApplySwapFee
|
|
10465
|
-
} from "@crypticdot/fusionamm-core";
|
|
10466
|
-
function getIncreaseSpotPositionQuote(args) {
|
|
10467
|
-
const {
|
|
10468
|
-
fusionPool,
|
|
10469
|
-
tickArrays,
|
|
10470
|
-
leverage,
|
|
10471
|
-
protocolFeeRate,
|
|
10472
|
-
protocolFeeRateOnCollateral,
|
|
10473
|
-
increaseAmount,
|
|
10474
|
-
collateralToken,
|
|
10475
|
-
positionToken
|
|
10476
|
-
} = args;
|
|
10477
|
-
if (leverage < 1) {
|
|
10478
|
-
throw new Error("leverage must be greater or equal than 1.0");
|
|
10479
|
-
}
|
|
10480
|
-
if (protocolFeeRate < 0 || protocolFeeRate >= HUNDRED_PERCENT) {
|
|
10481
|
-
throw new Error("protocolFeeRate must be greater or equal than zero and less than HUNDRED_PERCENT");
|
|
10482
|
-
}
|
|
10483
|
-
if (protocolFeeRateOnCollateral < 0 || protocolFeeRateOnCollateral >= HUNDRED_PERCENT) {
|
|
10484
|
-
throw new Error("protocolFeeRate must be greater or equal than zero and less than HUNDRED_PERCENT");
|
|
10485
|
-
}
|
|
10486
|
-
if (increaseAmount <= 0) {
|
|
10487
|
-
throw new Error("increaseAmount must be greater than zero");
|
|
10488
|
-
}
|
|
10489
|
-
let borrow;
|
|
10490
|
-
let collateral;
|
|
10491
|
-
let estimatedAmount;
|
|
10492
|
-
let swapInputAmount;
|
|
10493
|
-
let nextSqrtPrice = fusionPool.sqrtPrice;
|
|
10494
|
-
if (positionToken != collateralToken) {
|
|
10495
|
-
const price = sqrtPriceToPrice(fusionPool.sqrtPrice, 1, 1);
|
|
10496
|
-
borrow = BigInt(Math.ceil(Number(increaseAmount) * (leverage - 1) / leverage));
|
|
10497
|
-
collateral = increaseAmount - tryApplySwapFee2(applyTunaProtocolFee(borrow, protocolFeeRate), fusionPool.feeRate);
|
|
10498
|
-
collateral = tryReverseApplySwapFee(collateral, fusionPool.feeRate);
|
|
10499
|
-
collateral = reverseApplyTunaProtocolFee(collateral, protocolFeeRateOnCollateral);
|
|
10500
|
-
swapInputAmount = increaseAmount;
|
|
10501
|
-
estimatedAmount = BigInt(
|
|
10502
|
-
Math.round(collateralToken == 0 /* A */ ? Number(increaseAmount) * price : Number(increaseAmount) / price)
|
|
10503
|
-
);
|
|
10504
|
-
} else {
|
|
10505
|
-
const price = sqrtPriceToPrice(fusionPool.sqrtPrice, 1, 1);
|
|
10506
|
-
const positionToBorrowedTokenPrice = collateralToken == 0 /* A */ ? price : 1 / price;
|
|
10507
|
-
const borrowInPositionToken = Math.ceil(Number(increaseAmount) * (leverage - 1) / leverage);
|
|
10508
|
-
borrow = BigInt(Math.ceil(borrowInPositionToken * positionToBorrowedTokenPrice));
|
|
10509
|
-
const borrowInPositionTokenWithFeesApplied = tryApplySwapFee2(
|
|
10510
|
-
applyTunaProtocolFee(BigInt(Math.floor(borrowInPositionToken)), protocolFeeRate),
|
|
10511
|
-
fusionPool.feeRate
|
|
10512
|
-
);
|
|
10513
|
-
collateral = increaseAmount - borrowInPositionTokenWithFeesApplied;
|
|
10514
|
-
collateral = reverseApplyTunaProtocolFee(collateral, protocolFeeRateOnCollateral);
|
|
10515
|
-
swapInputAmount = applyTunaProtocolFee(borrow, protocolFeeRate);
|
|
10516
|
-
estimatedAmount = increaseAmount;
|
|
10517
|
-
}
|
|
10518
|
-
if (swapInputAmount > 0) {
|
|
10519
|
-
const is_token_a = positionToken == 1 /* B */;
|
|
10520
|
-
nextSqrtPrice = swapQuoteByInputToken(swapInputAmount, is_token_a, 0, fusionPool, tickArrays).nextSqrtPrice;
|
|
10521
|
-
}
|
|
10522
|
-
const protocolFeeA = (collateralToken == 0 /* A */ ? collateral - applyTunaProtocolFee(collateral, protocolFeeRateOnCollateral) : 0n) + (positionToken == 1 /* B */ ? borrow - applyTunaProtocolFee(borrow, protocolFeeRate) : 0n);
|
|
10523
|
-
const protocolFeeB = (collateralToken == 1 /* B */ ? collateral - applyTunaProtocolFee(collateral, protocolFeeRateOnCollateral) : 0n) + (positionToken == 0 /* A */ ? borrow - applyTunaProtocolFee(borrow, protocolFeeRate) : 0n);
|
|
10524
|
-
const oldPrice = sqrtPriceToPrice(fusionPool.sqrtPrice, 1, 1);
|
|
10525
|
-
const newPrice = sqrtPriceToPrice(nextSqrtPrice, 1, 1);
|
|
10526
|
-
const priceImpact = Math.abs(newPrice / oldPrice - 1) * 100;
|
|
10527
|
-
return {
|
|
10528
|
-
collateral,
|
|
10529
|
-
borrow,
|
|
10530
|
-
swapInputAmount,
|
|
10531
|
-
estimatedAmount,
|
|
10532
|
-
protocolFeeA,
|
|
10533
|
-
protocolFeeB,
|
|
10534
|
-
priceImpact
|
|
10535
|
-
};
|
|
10536
|
-
}
|
|
10537
|
-
function getDecreaseSpotPositionQuote(args) {
|
|
10538
|
-
const {
|
|
10539
|
-
fusionPool,
|
|
10540
|
-
tickArrays,
|
|
10541
|
-
leverage,
|
|
10542
|
-
protocolFeeRate,
|
|
10543
|
-
protocolFeeRateOnCollateral,
|
|
10544
|
-
decreaseAmount,
|
|
10545
|
-
collateralToken,
|
|
10546
|
-
positionToken,
|
|
10547
|
-
positionAmount,
|
|
10548
|
-
positionDebt,
|
|
10549
|
-
reduceOnly
|
|
10550
|
-
} = args;
|
|
10551
|
-
if (leverage < 1) {
|
|
10552
|
-
throw new Error("leverage must be greater or equal than 1.0");
|
|
10553
|
-
}
|
|
10554
|
-
if (protocolFeeRate < 0 || protocolFeeRate >= HUNDRED_PERCENT) {
|
|
10555
|
-
throw new Error("protocolFeeRate must be greater or equal than zero and less than HUNDRED_PERCENT");
|
|
10556
|
-
}
|
|
10557
|
-
if (protocolFeeRateOnCollateral < 0 || protocolFeeRateOnCollateral >= HUNDRED_PERCENT) {
|
|
10558
|
-
throw new Error("protocolFeeRate must be greater or equal than zero and less than HUNDRED_PERCENT");
|
|
10559
|
-
}
|
|
10560
|
-
if (decreaseAmount <= 0) {
|
|
10561
|
-
throw new Error("decreaseAmount must be greater than zero");
|
|
10562
|
-
}
|
|
10563
|
-
let collateral = 0n;
|
|
10564
|
-
let borrow = 0n;
|
|
10565
|
-
let swapInputAmount = 0n;
|
|
10566
|
-
let estimatedAmount = 0n;
|
|
10567
|
-
let nextSqrtPrice = fusionPool.sqrtPrice;
|
|
10568
|
-
let newPositionToken = positionToken;
|
|
10569
|
-
let decreasePercent;
|
|
10570
|
-
const price = sqrtPriceToPrice(fusionPool.sqrtPrice, 1, 1);
|
|
10571
|
-
const positionToOppositeTokenPrice = positionToken == 0 /* A */ ? price : 1 / price;
|
|
10572
|
-
let decreaseAmountInPositionToken = collateralToken == positionToken ? decreaseAmount : BigInt(Math.round(Number(decreaseAmount) / positionToOppositeTokenPrice));
|
|
10573
|
-
if (reduceOnly && decreaseAmountInPositionToken > positionAmount) {
|
|
10574
|
-
decreaseAmountInPositionToken = positionAmount;
|
|
10575
|
-
}
|
|
10576
|
-
if (decreaseAmountInPositionToken <= positionAmount) {
|
|
10577
|
-
decreasePercent = Math.min(
|
|
10578
|
-
Math.floor(Number(decreaseAmountInPositionToken) * HUNDRED_PERCENT / Number(positionAmount)),
|
|
10579
|
-
HUNDRED_PERCENT
|
|
10580
|
-
);
|
|
10581
|
-
estimatedAmount = positionAmount - decreaseAmountInPositionToken;
|
|
10582
|
-
if (collateralToken == positionToken) {
|
|
10583
|
-
if (positionDebt > 0) {
|
|
10584
|
-
const swapOut = BigInt(Math.floor(Number(positionDebt) * decreasePercent / HUNDRED_PERCENT));
|
|
10585
|
-
const swapQuote = swapQuoteByOutputToken(swapOut, positionToken == 1 /* B */, 0, fusionPool, tickArrays);
|
|
10586
|
-
nextSqrtPrice = swapQuote.nextSqrtPrice;
|
|
10587
|
-
swapInputAmount = swapQuote.tokenEstIn;
|
|
10588
|
-
}
|
|
10589
|
-
} else {
|
|
10590
|
-
swapInputAmount = positionAmount - BigInt(Math.floor(Number(positionAmount) * (HUNDRED_PERCENT - decreasePercent) / HUNDRED_PERCENT));
|
|
10591
|
-
const swapQuote = swapQuoteByInputToken(swapInputAmount, positionToken == 0 /* A */, 0, fusionPool, tickArrays);
|
|
10592
|
-
nextSqrtPrice = swapQuote.nextSqrtPrice;
|
|
10593
|
-
}
|
|
10594
|
-
} else {
|
|
10595
|
-
decreasePercent = HUNDRED_PERCENT;
|
|
10596
|
-
newPositionToken = positionToken == 0 /* A */ ? 1 /* B */ : 0 /* A */;
|
|
10597
|
-
const increaseAmount = decreaseAmountInPositionToken - positionAmount;
|
|
10598
|
-
if (positionToken == collateralToken) {
|
|
10599
|
-
estimatedAmount = BigInt(Math.round(Number(increaseAmount) * positionToOppositeTokenPrice));
|
|
10600
|
-
borrow = BigInt(Math.round(Number(increaseAmount) * (leverage - 1) / leverage));
|
|
10601
|
-
const borrowWithFeesApplied = tryApplySwapFee2(applyTunaProtocolFee(borrow, protocolFeeRate), fusionPool.feeRate);
|
|
10602
|
-
collateral = increaseAmount - borrowWithFeesApplied;
|
|
10603
|
-
if (positionDebt > 0) {
|
|
10604
|
-
const swapQuote2 = swapQuoteByOutputToken(positionDebt, positionToken != 0 /* A */, 0, fusionPool, tickArrays);
|
|
10605
|
-
swapInputAmount = swapQuote2.tokenEstIn;
|
|
10606
|
-
}
|
|
10607
|
-
swapInputAmount += collateral + applyTunaProtocolFee(borrow, protocolFeeRate);
|
|
10608
|
-
const swapQuote = swapQuoteByInputToken(swapInputAmount, positionToken == 0 /* A */, 0, fusionPool, tickArrays);
|
|
10609
|
-
nextSqrtPrice = swapQuote.nextSqrtPrice;
|
|
10610
|
-
collateral = reverseApplyTunaProtocolFee(collateral, protocolFeeRateOnCollateral);
|
|
10611
|
-
} else {
|
|
10612
|
-
estimatedAmount = BigInt(Math.round(Number(increaseAmount) * positionToOppositeTokenPrice));
|
|
10613
|
-
borrow = BigInt(Math.round(Number(increaseAmount) * (leverage - 1) / leverage));
|
|
10614
|
-
const borrowWithFeesApplied = tryApplySwapFee2(applyTunaProtocolFee(borrow, protocolFeeRate), fusionPool.feeRate);
|
|
10615
|
-
collateral = increaseAmount - borrowWithFeesApplied;
|
|
10616
|
-
collateral = BigInt(Math.round(Number(collateral) * positionToOppositeTokenPrice));
|
|
10617
|
-
collateral = reverseApplyTunaProtocolFee(collateral, protocolFeeRateOnCollateral);
|
|
10618
|
-
swapInputAmount = positionAmount + applyTunaProtocolFee(borrow, protocolFeeRate);
|
|
10619
|
-
const swapQuote = swapQuoteByInputToken(swapInputAmount, positionToken == 0 /* A */, 0, fusionPool, tickArrays);
|
|
10620
|
-
nextSqrtPrice = swapQuote.nextSqrtPrice;
|
|
10621
|
-
}
|
|
10622
|
-
}
|
|
10623
|
-
const protocolFeeA = (collateralToken == 0 /* A */ ? collateral - applyTunaProtocolFee(collateral, protocolFeeRateOnCollateral) : 0n) + (positionToken == 1 /* B */ ? borrow - applyTunaProtocolFee(borrow, protocolFeeRate) : 0n);
|
|
10624
|
-
const protocolFeeB = (collateralToken == 1 /* B */ ? collateral - applyTunaProtocolFee(collateral, protocolFeeRateOnCollateral) : 0n) + (positionToken == 0 /* A */ ? borrow - applyTunaProtocolFee(borrow, protocolFeeRate) : 0n);
|
|
10625
|
-
const newPrice = sqrtPriceToPrice(nextSqrtPrice, 1, 1);
|
|
10626
|
-
const priceImpact = Math.abs(newPrice / price - 1) * 100;
|
|
10627
|
-
return {
|
|
10628
|
-
decreasePercent,
|
|
10629
|
-
collateralToken,
|
|
10630
|
-
positionToken: newPositionToken,
|
|
10631
|
-
collateral,
|
|
10632
|
-
borrow,
|
|
10633
|
-
swapInputAmount,
|
|
10634
|
-
estimatedAmount,
|
|
10635
|
-
protocolFeeA,
|
|
10636
|
-
protocolFeeB,
|
|
10637
|
-
priceImpact
|
|
10638
|
-
};
|
|
10639
|
-
}
|
|
10640
|
-
function getTradableAmount(args) {
|
|
10641
|
-
const {
|
|
10642
|
-
collateralToken,
|
|
10643
|
-
newPositionToken,
|
|
10644
|
-
positionToken,
|
|
10645
|
-
positionAmount,
|
|
10646
|
-
positionDebt,
|
|
10647
|
-
reduceOnly,
|
|
10648
|
-
fusionPool,
|
|
10649
|
-
tickArrays,
|
|
10650
|
-
leverage,
|
|
10651
|
-
availableBalance,
|
|
10652
|
-
protocolFeeRate,
|
|
10653
|
-
protocolFeeRateOnCollateral
|
|
10654
|
-
} = args;
|
|
10655
|
-
if (leverage < 1) {
|
|
10656
|
-
throw new Error("leverage must be greater or equal than 1.0");
|
|
10657
|
-
}
|
|
10658
|
-
if (protocolFeeRateOnCollateral < 0 || protocolFeeRateOnCollateral >= HUNDRED_PERCENT) {
|
|
10659
|
-
throw new Error("protocolFeeRate must be greater or equal than zero and less than HUNDRED_PERCENT");
|
|
10660
|
-
}
|
|
10661
|
-
if (protocolFeeRate < 0 || protocolFeeRate >= HUNDRED_PERCENT) {
|
|
10662
|
-
throw new Error("protocolFeeRate must be greater or equal than zero and less than HUNDRED_PERCENT");
|
|
10663
|
-
}
|
|
10664
|
-
if (positionAmount == 0n && newPositionToken != positionToken) {
|
|
10665
|
-
throw new Error("positionToken must be set to newPositionToken if positionAmount is zero");
|
|
10666
|
-
}
|
|
10667
|
-
let availableToTrade = 0n;
|
|
10668
|
-
const addLeverage = (collateral) => {
|
|
10669
|
-
collateral = applyTunaProtocolFee(collateral, protocolFeeRateOnCollateral);
|
|
10670
|
-
if (collateralToken != newPositionToken) {
|
|
10671
|
-
collateral = tryApplySwapFee2(collateral, fusionPool.feeRate);
|
|
10672
|
-
}
|
|
10673
|
-
const feeMultiplier = (1 - protocolFeeRate / HUNDRED_PERCENT) * (1 - fusionPool.feeRate / 1e6);
|
|
10674
|
-
const total = Number(collateral) / (1 - feeMultiplier * (leverage - 1) / leverage);
|
|
10675
|
-
return BigInt(Math.floor(total));
|
|
10676
|
-
};
|
|
10677
|
-
if (newPositionToken == positionToken) {
|
|
10678
|
-
availableToTrade = addLeverage(availableBalance);
|
|
10679
|
-
} else {
|
|
10680
|
-
const price = sqrtPriceToPrice(fusionPool.sqrtPrice, 1, 1);
|
|
10681
|
-
const positionToOppositeTokenPrice = positionToken == 0 /* A */ ? price : 1 / price;
|
|
10682
|
-
if (reduceOnly) {
|
|
10683
|
-
if (collateralToken == positionToken) {
|
|
10684
|
-
availableToTrade = positionAmount;
|
|
10685
|
-
} else {
|
|
10686
|
-
availableToTrade = BigInt(Math.round(Number(positionAmount) * positionToOppositeTokenPrice));
|
|
10687
|
-
}
|
|
10688
|
-
} else {
|
|
10689
|
-
const positionAmountInCollateralToken = collateralToken == positionToken ? positionAmount : BigInt(Math.round(Number(positionAmount) * positionToOppositeTokenPrice));
|
|
10690
|
-
let positionCollateral = collateralToken == positionToken ? positionAmount - (positionDebt > 0n ? swapQuoteByOutputToken(positionDebt, positionToken == 1 /* B */, 0, fusionPool, tickArrays).tokenEstIn : 0n) : positionAmount > 0n ? swapQuoteByInputToken(positionAmount, positionToken == 0 /* A */, 0, fusionPool, tickArrays).tokenEstOut - positionDebt : 0n;
|
|
10691
|
-
if (positionCollateral < 0n) positionCollateral = 0n;
|
|
10692
|
-
availableToTrade = positionAmountInCollateralToken + addLeverage(availableBalance + positionCollateral);
|
|
10693
|
-
}
|
|
10694
|
-
}
|
|
10695
|
-
return availableToTrade;
|
|
10696
|
-
}
|
|
10697
|
-
function getLiquidationPrice(positionToken, amount, debt, liquidationThreshold) {
|
|
10698
|
-
if (debt < 0) {
|
|
10699
|
-
throw new Error("debt must be greater or equal than zero");
|
|
10700
|
-
}
|
|
10701
|
-
if (amount < 0) {
|
|
10702
|
-
throw new Error("position amount must be greater or equal than zero");
|
|
10703
|
-
}
|
|
10704
|
-
if (liquidationThreshold <= 0 || liquidationThreshold >= 1) {
|
|
10705
|
-
throw new Error("liquidationThreshold must be greater than zero and less than one");
|
|
10706
|
-
}
|
|
10707
|
-
if (debt == 0 || amount == 0) return 0;
|
|
10708
|
-
if (positionToken == 0 /* A */) {
|
|
10709
|
-
return debt / (amount * liquidationThreshold);
|
|
10710
|
-
} else {
|
|
10711
|
-
return amount * liquidationThreshold / debt;
|
|
10712
|
-
}
|
|
10713
|
-
}
|
|
10714
|
-
function applyTunaProtocolFee(amount, protocolFeeRate) {
|
|
10715
|
-
return amount * BigInt(HUNDRED_PERCENT - protocolFeeRate) / BigInt(HUNDRED_PERCENT);
|
|
10716
|
-
}
|
|
10717
|
-
function reverseApplyTunaProtocolFee(amount, protocolFeeRate) {
|
|
10718
|
-
return amount * BigInt(HUNDRED_PERCENT) / BigInt(HUNDRED_PERCENT - protocolFeeRate);
|
|
10719
|
-
}
|
|
10720
|
-
|
|
10721
10421
|
// src/txbuilder/increaseTunaLpPositionOrca.ts
|
|
10722
10422
|
import {
|
|
10723
10423
|
fetchMaybeWhirlpool,
|
|
@@ -15869,6 +15569,24 @@ async function rebalanceTunaLpPositionFusionInstruction(authority, tunaPosition,
|
|
|
15869
15569
|
ix.accounts.push(...remainingAccounts);
|
|
15870
15570
|
return ix;
|
|
15871
15571
|
}
|
|
15572
|
+
|
|
15573
|
+
// src/casts.ts
|
|
15574
|
+
function toPoolTokenFacade(token) {
|
|
15575
|
+
switch (token) {
|
|
15576
|
+
case 0 /* A */:
|
|
15577
|
+
return "a";
|
|
15578
|
+
case 1 /* B */:
|
|
15579
|
+
return "b";
|
|
15580
|
+
}
|
|
15581
|
+
}
|
|
15582
|
+
function fromPoolTokenFacade(token) {
|
|
15583
|
+
switch (token) {
|
|
15584
|
+
case "a":
|
|
15585
|
+
return 0 /* A */;
|
|
15586
|
+
case "b":
|
|
15587
|
+
return 1 /* B */;
|
|
15588
|
+
}
|
|
15589
|
+
}
|
|
15872
15590
|
export {
|
|
15873
15591
|
AccountsType,
|
|
15874
15592
|
CLOSE_ACTIVE_TUNA_SPOT_POSITION_FUSION_DISCRIMINATOR,
|
|
@@ -16096,6 +15814,7 @@ export {
|
|
|
16096
15814
|
fetchTunaLpPosition,
|
|
16097
15815
|
fetchTunaSpotPosition,
|
|
16098
15816
|
fetchVault,
|
|
15817
|
+
fromPoolTokenFacade,
|
|
16099
15818
|
getAccountsTypeCodec,
|
|
16100
15819
|
getAccountsTypeDecoder,
|
|
16101
15820
|
getAccountsTypeEncoder,
|
|
@@ -16166,7 +15885,6 @@ export {
|
|
|
16166
15885
|
getCreateVaultInstructionDataCodec,
|
|
16167
15886
|
getCreateVaultInstructionDataDecoder,
|
|
16168
15887
|
getCreateVaultInstructionDataEncoder,
|
|
16169
|
-
getDecreaseSpotPositionQuote,
|
|
16170
15888
|
getDecreaseTunaLpPositionFusionDiscriminatorBytes,
|
|
16171
15889
|
getDecreaseTunaLpPositionFusionInstruction,
|
|
16172
15890
|
getDecreaseTunaLpPositionFusionInstructionDataCodec,
|
|
@@ -16193,7 +15911,6 @@ export {
|
|
|
16193
15911
|
getDepositInstructionDataDecoder,
|
|
16194
15912
|
getDepositInstructionDataEncoder,
|
|
16195
15913
|
getIncreaseLpPositionQuote,
|
|
16196
|
-
getIncreaseSpotPositionQuote,
|
|
16197
15914
|
getIncreaseTunaLpPositionFusionDiscriminatorBytes,
|
|
16198
15915
|
getIncreaseTunaLpPositionFusionInstruction,
|
|
16199
15916
|
getIncreaseTunaLpPositionFusionInstructionDataCodec,
|
|
@@ -16241,7 +15958,6 @@ export {
|
|
|
16241
15958
|
getLiquidateTunaSpotPositionOrcaInstructionDataCodec,
|
|
16242
15959
|
getLiquidateTunaSpotPositionOrcaInstructionDataDecoder,
|
|
16243
15960
|
getLiquidateTunaSpotPositionOrcaInstructionDataEncoder,
|
|
16244
|
-
getLiquidationPrice,
|
|
16245
15961
|
getMarketAddress,
|
|
16246
15962
|
getMarketCodec,
|
|
16247
15963
|
getMarketDecoder,
|
|
@@ -16391,7 +16107,6 @@ export {
|
|
|
16391
16107
|
getSetTunaSpotPositionLimitOrdersInstructionDataCodec,
|
|
16392
16108
|
getSetTunaSpotPositionLimitOrdersInstructionDataDecoder,
|
|
16393
16109
|
getSetTunaSpotPositionLimitOrdersInstructionDataEncoder,
|
|
16394
|
-
getTradableAmount,
|
|
16395
16110
|
getTunaConfigAddress,
|
|
16396
16111
|
getTunaConfigCodec,
|
|
16397
16112
|
getTunaConfigDecoder,
|
|
@@ -16455,6 +16170,7 @@ export {
|
|
|
16455
16170
|
liquidateTunaSpotPositionFusionInstructions,
|
|
16456
16171
|
liquidateTunaSpotPositionOrcaInstruction,
|
|
16457
16172
|
liquidateTunaSpotPositionOrcaInstructions,
|
|
16173
|
+
mulDiv,
|
|
16458
16174
|
openAndIncreaseTunaLpPositionFusionInstruction,
|
|
16459
16175
|
openAndIncreaseTunaLpPositionFusionInstructions,
|
|
16460
16176
|
openAndIncreaseTunaLpPositionOrcaInstruction,
|
|
@@ -16536,6 +16252,7 @@ export {
|
|
|
16536
16252
|
resetTunaSpotPositionInstruction,
|
|
16537
16253
|
setTunaLpPositionLimitOrdersInstruction,
|
|
16538
16254
|
setTunaSpotPositionLimitOrdersInstruction,
|
|
16255
|
+
toPoolTokenFacade,
|
|
16539
16256
|
tunaLpPositionAuthorityFilter,
|
|
16540
16257
|
tunaLpPositionMarketMakerFilter,
|
|
16541
16258
|
tunaLpPositionMintAFilter,
|