@0dotxyz/p0-ts-sdk 2.7.1 → 2.7.2
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/README.md +9 -2
- package/dist/index.cjs +2118 -229
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +226 -6
- package/dist/index.d.ts +226 -6
- package/dist/index.js +2103 -230
- package/dist/index.js.map +1 -1
- package/dist/instructions.d.cts +1 -1
- package/dist/instructions.d.ts +1 -1
- package/dist/{types-Ctm1kvCr.d.ts → types-B5SGXpex.d.ts} +1 -1
- package/dist/{types-DzbVhEfo.d.cts → types-BFLi0Ozl.d.cts} +1 -1
- package/dist/vendor.cjs +2016 -645
- package/dist/vendor.cjs.map +1 -1
- package/dist/vendor.d.cts +1932 -834
- package/dist/vendor.d.ts +1932 -834
- package/dist/vendor.js +2016 -645
- package/dist/vendor.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -27746,6 +27746,11 @@ var klendInstructions = {
|
|
|
27746
27746
|
};
|
|
27747
27747
|
var instructions_default2 = klendInstructions;
|
|
27748
27748
|
|
|
27749
|
+
// src/vendor/drift/types/drift-spot-market/drift-spot-market.types.ts
|
|
27750
|
+
function isSpotBalanceTypeVariant(value, variant) {
|
|
27751
|
+
return value === variant;
|
|
27752
|
+
}
|
|
27753
|
+
|
|
27749
27754
|
// src/vendor/drift/idl/drift.json
|
|
27750
27755
|
var drift_default = {
|
|
27751
27756
|
address: "dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH",
|
|
@@ -42111,6 +42116,34 @@ function deriveDriftSpotMarketVault(marketIndex, programId = DRIFT_PROGRAM_ID) {
|
|
|
42111
42116
|
programId
|
|
42112
42117
|
);
|
|
42113
42118
|
}
|
|
42119
|
+
var ZERO = new BN9__default.default(0);
|
|
42120
|
+
var ONE = new BN9__default.default(1);
|
|
42121
|
+
var TEN = new BN9__default.default(10);
|
|
42122
|
+
var PERCENTAGE_PRECISION_EXP = new BN9__default.default(6);
|
|
42123
|
+
new BN9__default.default(10).pow(PERCENTAGE_PRECISION_EXP);
|
|
42124
|
+
var SPOT_MARKET_RATE_PRECISION_EXP = new BN9__default.default(6);
|
|
42125
|
+
new BN9__default.default(10).pow(SPOT_MARKET_RATE_PRECISION_EXP);
|
|
42126
|
+
var SPOT_MARKET_UTILIZATION_PRECISION_EXP = new BN9__default.default(6);
|
|
42127
|
+
new BN9__default.default(10).pow(
|
|
42128
|
+
SPOT_MARKET_UTILIZATION_PRECISION_EXP
|
|
42129
|
+
);
|
|
42130
|
+
new BN9__default.default(31536e3);
|
|
42131
|
+
function divCeil(a, b) {
|
|
42132
|
+
const quotient = a.div(b);
|
|
42133
|
+
const remainder = a.mod(b);
|
|
42134
|
+
if (remainder.gt(ZERO)) {
|
|
42135
|
+
return quotient.add(ONE);
|
|
42136
|
+
}
|
|
42137
|
+
return quotient;
|
|
42138
|
+
}
|
|
42139
|
+
function getDriftTokenAmount(balanceAmount, spotMarket, balanceType) {
|
|
42140
|
+
const precisionDecrease = TEN.pow(new BN9__default.default(19 - spotMarket.decimals));
|
|
42141
|
+
if (isSpotBalanceTypeVariant(balanceType, "deposit")) {
|
|
42142
|
+
return balanceAmount.mul(spotMarket.cumulativeDepositInterest).div(precisionDecrease);
|
|
42143
|
+
} else {
|
|
42144
|
+
return divCeil(balanceAmount.mul(spotMarket.cumulativeBorrowInterest), precisionDecrease);
|
|
42145
|
+
}
|
|
42146
|
+
}
|
|
42114
42147
|
|
|
42115
42148
|
// src/vendor/drift/utils/rewards.utils.ts
|
|
42116
42149
|
async function getDriftRewards(spotMarkets, userStates, connection) {
|
|
@@ -49322,170 +49355,1430 @@ var jup_lend_default = {
|
|
|
49322
49355
|
address: "jup3YeL8QhtSx1e253b2FDvsMNC87fDrgQZivbrndc9",
|
|
49323
49356
|
metadata: {
|
|
49324
49357
|
name: "lending",
|
|
49325
|
-
version: "0.1.
|
|
49358
|
+
version: "0.1.4",
|
|
49326
49359
|
spec: "0.1.0",
|
|
49327
49360
|
description: "Created with Anchor"
|
|
49328
49361
|
},
|
|
49329
49362
|
instructions: [
|
|
49330
49363
|
{
|
|
49331
|
-
name: "deposit",
|
|
49332
|
-
discriminator: [242, 35, 198, 137, 82, 225, 242, 182],
|
|
49333
|
-
accounts: [
|
|
49334
|
-
{
|
|
49335
|
-
|
|
49336
|
-
|
|
49337
|
-
|
|
49338
|
-
|
|
49339
|
-
{
|
|
49340
|
-
|
|
49341
|
-
|
|
49342
|
-
|
|
49343
|
-
{
|
|
49344
|
-
|
|
49345
|
-
|
|
49346
|
-
|
|
49347
|
-
{
|
|
49348
|
-
|
|
49349
|
-
|
|
49350
|
-
|
|
49351
|
-
|
|
49352
|
-
|
|
49353
|
-
|
|
49364
|
+
name: "deposit",
|
|
49365
|
+
discriminator: [242, 35, 198, 137, 82, 225, 242, 182],
|
|
49366
|
+
accounts: [
|
|
49367
|
+
{
|
|
49368
|
+
name: "signer",
|
|
49369
|
+
writable: true,
|
|
49370
|
+
signer: true
|
|
49371
|
+
},
|
|
49372
|
+
{
|
|
49373
|
+
name: "depositor_token_account",
|
|
49374
|
+
writable: true
|
|
49375
|
+
},
|
|
49376
|
+
{
|
|
49377
|
+
name: "recipient_token_account",
|
|
49378
|
+
writable: true
|
|
49379
|
+
},
|
|
49380
|
+
{
|
|
49381
|
+
name: "mint",
|
|
49382
|
+
relations: ["lending", "rewards_rate_model"]
|
|
49383
|
+
},
|
|
49384
|
+
{
|
|
49385
|
+
name: "lending_admin"
|
|
49386
|
+
},
|
|
49387
|
+
{
|
|
49388
|
+
name: "lending",
|
|
49389
|
+
writable: true
|
|
49390
|
+
},
|
|
49391
|
+
{
|
|
49392
|
+
name: "f_token_mint",
|
|
49393
|
+
writable: true,
|
|
49394
|
+
relations: ["lending"]
|
|
49395
|
+
},
|
|
49396
|
+
{
|
|
49397
|
+
name: "supply_token_reserves_liquidity",
|
|
49398
|
+
writable: true
|
|
49399
|
+
},
|
|
49400
|
+
{
|
|
49401
|
+
name: "lending_supply_position_on_liquidity",
|
|
49402
|
+
writable: true
|
|
49403
|
+
},
|
|
49404
|
+
{
|
|
49405
|
+
name: "rate_model"
|
|
49406
|
+
},
|
|
49407
|
+
{
|
|
49408
|
+
name: "vault",
|
|
49409
|
+
writable: true
|
|
49410
|
+
},
|
|
49411
|
+
{
|
|
49412
|
+
name: "liquidity",
|
|
49413
|
+
writable: true
|
|
49414
|
+
},
|
|
49415
|
+
{
|
|
49416
|
+
name: "liquidity_program",
|
|
49417
|
+
relations: ["lending_admin"]
|
|
49418
|
+
},
|
|
49419
|
+
{
|
|
49420
|
+
name: "rewards_rate_model"
|
|
49421
|
+
},
|
|
49422
|
+
{
|
|
49423
|
+
name: "token_program"
|
|
49424
|
+
},
|
|
49425
|
+
{
|
|
49426
|
+
name: "associated_token_program",
|
|
49427
|
+
optional: true,
|
|
49428
|
+
address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
49429
|
+
},
|
|
49430
|
+
{
|
|
49431
|
+
name: "system_program",
|
|
49432
|
+
address: "11111111111111111111111111111111"
|
|
49433
|
+
}
|
|
49434
|
+
],
|
|
49435
|
+
args: [
|
|
49436
|
+
{
|
|
49437
|
+
name: "assets",
|
|
49438
|
+
type: "u64"
|
|
49439
|
+
}
|
|
49440
|
+
],
|
|
49441
|
+
returns: "u64"
|
|
49442
|
+
},
|
|
49443
|
+
{
|
|
49444
|
+
name: "deposit_with_min_amount_out",
|
|
49445
|
+
discriminator: [116, 144, 16, 97, 118, 109, 40, 119],
|
|
49446
|
+
accounts: [
|
|
49447
|
+
{
|
|
49448
|
+
name: "signer",
|
|
49449
|
+
writable: true,
|
|
49450
|
+
signer: true
|
|
49451
|
+
},
|
|
49452
|
+
{
|
|
49453
|
+
name: "depositor_token_account",
|
|
49454
|
+
writable: true
|
|
49455
|
+
},
|
|
49456
|
+
{
|
|
49457
|
+
name: "recipient_token_account",
|
|
49458
|
+
writable: true
|
|
49459
|
+
},
|
|
49460
|
+
{
|
|
49461
|
+
name: "mint",
|
|
49462
|
+
relations: ["lending", "rewards_rate_model"]
|
|
49463
|
+
},
|
|
49464
|
+
{
|
|
49465
|
+
name: "lending_admin"
|
|
49466
|
+
},
|
|
49467
|
+
{
|
|
49468
|
+
name: "lending",
|
|
49469
|
+
writable: true
|
|
49470
|
+
},
|
|
49471
|
+
{
|
|
49472
|
+
name: "f_token_mint",
|
|
49473
|
+
writable: true,
|
|
49474
|
+
relations: ["lending"]
|
|
49475
|
+
},
|
|
49476
|
+
{
|
|
49477
|
+
name: "supply_token_reserves_liquidity",
|
|
49478
|
+
writable: true
|
|
49479
|
+
},
|
|
49480
|
+
{
|
|
49481
|
+
name: "lending_supply_position_on_liquidity",
|
|
49482
|
+
writable: true
|
|
49483
|
+
},
|
|
49484
|
+
{
|
|
49485
|
+
name: "rate_model"
|
|
49486
|
+
},
|
|
49487
|
+
{
|
|
49488
|
+
name: "vault",
|
|
49489
|
+
writable: true
|
|
49490
|
+
},
|
|
49491
|
+
{
|
|
49492
|
+
name: "liquidity",
|
|
49493
|
+
writable: true
|
|
49494
|
+
},
|
|
49495
|
+
{
|
|
49496
|
+
name: "liquidity_program",
|
|
49497
|
+
relations: ["lending_admin"]
|
|
49498
|
+
},
|
|
49499
|
+
{
|
|
49500
|
+
name: "rewards_rate_model"
|
|
49501
|
+
},
|
|
49502
|
+
{
|
|
49503
|
+
name: "token_program"
|
|
49504
|
+
},
|
|
49505
|
+
{
|
|
49506
|
+
name: "associated_token_program",
|
|
49507
|
+
optional: true,
|
|
49508
|
+
address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
49509
|
+
},
|
|
49510
|
+
{
|
|
49511
|
+
name: "system_program",
|
|
49512
|
+
address: "11111111111111111111111111111111"
|
|
49513
|
+
}
|
|
49514
|
+
],
|
|
49515
|
+
args: [
|
|
49516
|
+
{
|
|
49517
|
+
name: "assets",
|
|
49518
|
+
type: "u64"
|
|
49519
|
+
},
|
|
49520
|
+
{
|
|
49521
|
+
name: "min_amount_out",
|
|
49522
|
+
type: "u64"
|
|
49523
|
+
}
|
|
49524
|
+
]
|
|
49525
|
+
},
|
|
49526
|
+
{
|
|
49527
|
+
name: "init_lending",
|
|
49528
|
+
discriminator: [156, 224, 67, 46, 89, 189, 157, 209],
|
|
49529
|
+
accounts: [
|
|
49530
|
+
{
|
|
49531
|
+
name: "signer",
|
|
49532
|
+
writable: true,
|
|
49533
|
+
signer: true
|
|
49534
|
+
},
|
|
49535
|
+
{
|
|
49536
|
+
name: "lending_admin",
|
|
49537
|
+
writable: true
|
|
49538
|
+
},
|
|
49539
|
+
{
|
|
49540
|
+
name: "mint",
|
|
49541
|
+
relations: ["token_reserves_liquidity"]
|
|
49542
|
+
},
|
|
49543
|
+
{
|
|
49544
|
+
name: "f_token_mint",
|
|
49545
|
+
writable: true,
|
|
49546
|
+
pda: {
|
|
49547
|
+
seeds: [
|
|
49548
|
+
{
|
|
49549
|
+
kind: "const",
|
|
49550
|
+
value: [
|
|
49551
|
+
102,
|
|
49552
|
+
95,
|
|
49553
|
+
116,
|
|
49554
|
+
111,
|
|
49555
|
+
107,
|
|
49556
|
+
101,
|
|
49557
|
+
110,
|
|
49558
|
+
95,
|
|
49559
|
+
109,
|
|
49560
|
+
105,
|
|
49561
|
+
110,
|
|
49562
|
+
116
|
|
49563
|
+
]
|
|
49564
|
+
},
|
|
49565
|
+
{
|
|
49566
|
+
kind: "account",
|
|
49567
|
+
path: "mint"
|
|
49568
|
+
}
|
|
49569
|
+
]
|
|
49570
|
+
}
|
|
49571
|
+
},
|
|
49572
|
+
{
|
|
49573
|
+
name: "metadata_account",
|
|
49574
|
+
writable: true,
|
|
49575
|
+
pda: {
|
|
49576
|
+
seeds: [
|
|
49577
|
+
{
|
|
49578
|
+
kind: "const",
|
|
49579
|
+
value: [109, 101, 116, 97, 100, 97, 116, 97]
|
|
49580
|
+
},
|
|
49581
|
+
{
|
|
49582
|
+
kind: "const",
|
|
49583
|
+
value: [
|
|
49584
|
+
11,
|
|
49585
|
+
112,
|
|
49586
|
+
101,
|
|
49587
|
+
177,
|
|
49588
|
+
227,
|
|
49589
|
+
209,
|
|
49590
|
+
124,
|
|
49591
|
+
69,
|
|
49592
|
+
56,
|
|
49593
|
+
157,
|
|
49594
|
+
82,
|
|
49595
|
+
127,
|
|
49596
|
+
107,
|
|
49597
|
+
4,
|
|
49598
|
+
195,
|
|
49599
|
+
205,
|
|
49600
|
+
88,
|
|
49601
|
+
184,
|
|
49602
|
+
108,
|
|
49603
|
+
115,
|
|
49604
|
+
26,
|
|
49605
|
+
160,
|
|
49606
|
+
253,
|
|
49607
|
+
181,
|
|
49608
|
+
73,
|
|
49609
|
+
182,
|
|
49610
|
+
209,
|
|
49611
|
+
188,
|
|
49612
|
+
3,
|
|
49613
|
+
248,
|
|
49614
|
+
41,
|
|
49615
|
+
70
|
|
49616
|
+
]
|
|
49617
|
+
},
|
|
49618
|
+
{
|
|
49619
|
+
kind: "account",
|
|
49620
|
+
path: "f_token_mint"
|
|
49621
|
+
}
|
|
49622
|
+
],
|
|
49623
|
+
program: {
|
|
49624
|
+
kind: "const",
|
|
49625
|
+
value: [
|
|
49626
|
+
11,
|
|
49627
|
+
112,
|
|
49628
|
+
101,
|
|
49629
|
+
177,
|
|
49630
|
+
227,
|
|
49631
|
+
209,
|
|
49632
|
+
124,
|
|
49633
|
+
69,
|
|
49634
|
+
56,
|
|
49635
|
+
157,
|
|
49636
|
+
82,
|
|
49637
|
+
127,
|
|
49638
|
+
107,
|
|
49639
|
+
4,
|
|
49640
|
+
195,
|
|
49641
|
+
205,
|
|
49642
|
+
88,
|
|
49643
|
+
184,
|
|
49644
|
+
108,
|
|
49645
|
+
115,
|
|
49646
|
+
26,
|
|
49647
|
+
160,
|
|
49648
|
+
253,
|
|
49649
|
+
181,
|
|
49650
|
+
73,
|
|
49651
|
+
182,
|
|
49652
|
+
209,
|
|
49653
|
+
188,
|
|
49654
|
+
3,
|
|
49655
|
+
248,
|
|
49656
|
+
41,
|
|
49657
|
+
70
|
|
49658
|
+
]
|
|
49659
|
+
}
|
|
49660
|
+
}
|
|
49661
|
+
},
|
|
49662
|
+
{
|
|
49663
|
+
name: "lending",
|
|
49664
|
+
writable: true,
|
|
49665
|
+
pda: {
|
|
49666
|
+
seeds: [
|
|
49667
|
+
{
|
|
49668
|
+
kind: "const",
|
|
49669
|
+
value: [108, 101, 110, 100, 105, 110, 103]
|
|
49670
|
+
},
|
|
49671
|
+
{
|
|
49672
|
+
kind: "account",
|
|
49673
|
+
path: "mint"
|
|
49674
|
+
},
|
|
49675
|
+
{
|
|
49676
|
+
kind: "account",
|
|
49677
|
+
path: "f_token_mint"
|
|
49678
|
+
}
|
|
49679
|
+
]
|
|
49680
|
+
}
|
|
49681
|
+
},
|
|
49682
|
+
{
|
|
49683
|
+
name: "token_reserves_liquidity"
|
|
49684
|
+
},
|
|
49685
|
+
{
|
|
49686
|
+
name: "token_program"
|
|
49687
|
+
},
|
|
49688
|
+
{
|
|
49689
|
+
name: "system_program",
|
|
49690
|
+
address: "11111111111111111111111111111111"
|
|
49691
|
+
},
|
|
49692
|
+
{
|
|
49693
|
+
name: "sysvar_instruction",
|
|
49694
|
+
address: "Sysvar1nstructions1111111111111111111111111"
|
|
49695
|
+
},
|
|
49696
|
+
{
|
|
49697
|
+
name: "metadata_program",
|
|
49698
|
+
address: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"
|
|
49699
|
+
},
|
|
49700
|
+
{
|
|
49701
|
+
name: "rent",
|
|
49702
|
+
address: "SysvarRent111111111111111111111111111111111"
|
|
49703
|
+
}
|
|
49704
|
+
],
|
|
49705
|
+
args: [
|
|
49706
|
+
{
|
|
49707
|
+
name: "symbol",
|
|
49708
|
+
type: "string"
|
|
49709
|
+
},
|
|
49710
|
+
{
|
|
49711
|
+
name: "liquidity_program",
|
|
49712
|
+
type: "pubkey"
|
|
49713
|
+
}
|
|
49714
|
+
]
|
|
49715
|
+
},
|
|
49716
|
+
{
|
|
49717
|
+
name: "init_lending_admin",
|
|
49718
|
+
discriminator: [203, 185, 241, 165, 56, 254, 33, 9],
|
|
49719
|
+
accounts: [
|
|
49720
|
+
{
|
|
49721
|
+
name: "authority",
|
|
49722
|
+
writable: true,
|
|
49723
|
+
signer: true
|
|
49724
|
+
},
|
|
49725
|
+
{
|
|
49726
|
+
name: "lending_admin",
|
|
49727
|
+
writable: true,
|
|
49728
|
+
pda: {
|
|
49729
|
+
seeds: [
|
|
49730
|
+
{
|
|
49731
|
+
kind: "const",
|
|
49732
|
+
value: [
|
|
49733
|
+
108,
|
|
49734
|
+
101,
|
|
49735
|
+
110,
|
|
49736
|
+
100,
|
|
49737
|
+
105,
|
|
49738
|
+
110,
|
|
49739
|
+
103,
|
|
49740
|
+
95,
|
|
49741
|
+
97,
|
|
49742
|
+
100,
|
|
49743
|
+
109,
|
|
49744
|
+
105,
|
|
49745
|
+
110
|
|
49746
|
+
]
|
|
49747
|
+
}
|
|
49748
|
+
]
|
|
49749
|
+
}
|
|
49750
|
+
},
|
|
49751
|
+
{
|
|
49752
|
+
name: "system_program",
|
|
49753
|
+
address: "11111111111111111111111111111111"
|
|
49754
|
+
}
|
|
49755
|
+
],
|
|
49756
|
+
args: [
|
|
49757
|
+
{
|
|
49758
|
+
name: "liquidity_program",
|
|
49759
|
+
type: "pubkey"
|
|
49760
|
+
},
|
|
49761
|
+
{
|
|
49762
|
+
name: "rebalancer",
|
|
49763
|
+
type: "pubkey"
|
|
49764
|
+
},
|
|
49765
|
+
{
|
|
49766
|
+
name: "authority",
|
|
49767
|
+
type: "pubkey"
|
|
49768
|
+
}
|
|
49769
|
+
]
|
|
49770
|
+
},
|
|
49771
|
+
{
|
|
49772
|
+
name: "mint",
|
|
49773
|
+
discriminator: [51, 57, 225, 47, 182, 146, 137, 166],
|
|
49774
|
+
accounts: [
|
|
49775
|
+
{
|
|
49776
|
+
name: "signer",
|
|
49777
|
+
writable: true,
|
|
49778
|
+
signer: true
|
|
49779
|
+
},
|
|
49780
|
+
{
|
|
49781
|
+
name: "depositor_token_account",
|
|
49782
|
+
writable: true
|
|
49783
|
+
},
|
|
49784
|
+
{
|
|
49785
|
+
name: "recipient_token_account",
|
|
49786
|
+
writable: true
|
|
49787
|
+
},
|
|
49788
|
+
{
|
|
49789
|
+
name: "mint",
|
|
49790
|
+
relations: ["lending", "rewards_rate_model"]
|
|
49791
|
+
},
|
|
49792
|
+
{
|
|
49793
|
+
name: "lending_admin"
|
|
49794
|
+
},
|
|
49795
|
+
{
|
|
49796
|
+
name: "lending",
|
|
49797
|
+
writable: true
|
|
49798
|
+
},
|
|
49799
|
+
{
|
|
49800
|
+
name: "f_token_mint",
|
|
49801
|
+
writable: true,
|
|
49802
|
+
relations: ["lending"]
|
|
49803
|
+
},
|
|
49804
|
+
{
|
|
49805
|
+
name: "supply_token_reserves_liquidity",
|
|
49806
|
+
writable: true
|
|
49807
|
+
},
|
|
49808
|
+
{
|
|
49809
|
+
name: "lending_supply_position_on_liquidity",
|
|
49810
|
+
writable: true
|
|
49811
|
+
},
|
|
49812
|
+
{
|
|
49813
|
+
name: "rate_model"
|
|
49814
|
+
},
|
|
49815
|
+
{
|
|
49816
|
+
name: "vault",
|
|
49817
|
+
writable: true
|
|
49818
|
+
},
|
|
49819
|
+
{
|
|
49820
|
+
name: "liquidity",
|
|
49821
|
+
writable: true
|
|
49822
|
+
},
|
|
49823
|
+
{
|
|
49824
|
+
name: "liquidity_program",
|
|
49825
|
+
relations: ["lending_admin"]
|
|
49826
|
+
},
|
|
49827
|
+
{
|
|
49828
|
+
name: "rewards_rate_model"
|
|
49829
|
+
},
|
|
49830
|
+
{
|
|
49831
|
+
name: "token_program"
|
|
49832
|
+
},
|
|
49833
|
+
{
|
|
49834
|
+
name: "associated_token_program",
|
|
49835
|
+
optional: true,
|
|
49836
|
+
address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
49837
|
+
},
|
|
49838
|
+
{
|
|
49839
|
+
name: "system_program",
|
|
49840
|
+
address: "11111111111111111111111111111111"
|
|
49841
|
+
}
|
|
49842
|
+
],
|
|
49843
|
+
args: [
|
|
49844
|
+
{
|
|
49845
|
+
name: "shares",
|
|
49846
|
+
type: "u64"
|
|
49847
|
+
}
|
|
49848
|
+
],
|
|
49849
|
+
returns: "u64"
|
|
49850
|
+
},
|
|
49851
|
+
{
|
|
49852
|
+
name: "mint_with_max_assets",
|
|
49853
|
+
discriminator: [6, 94, 69, 122, 30, 179, 146, 171],
|
|
49854
|
+
accounts: [
|
|
49855
|
+
{
|
|
49856
|
+
name: "signer",
|
|
49857
|
+
writable: true,
|
|
49858
|
+
signer: true
|
|
49859
|
+
},
|
|
49860
|
+
{
|
|
49861
|
+
name: "depositor_token_account",
|
|
49862
|
+
writable: true
|
|
49863
|
+
},
|
|
49864
|
+
{
|
|
49865
|
+
name: "recipient_token_account",
|
|
49866
|
+
writable: true
|
|
49867
|
+
},
|
|
49868
|
+
{
|
|
49869
|
+
name: "mint",
|
|
49870
|
+
relations: ["lending", "rewards_rate_model"]
|
|
49871
|
+
},
|
|
49872
|
+
{
|
|
49873
|
+
name: "lending_admin"
|
|
49874
|
+
},
|
|
49875
|
+
{
|
|
49876
|
+
name: "lending",
|
|
49877
|
+
writable: true
|
|
49878
|
+
},
|
|
49879
|
+
{
|
|
49880
|
+
name: "f_token_mint",
|
|
49881
|
+
writable: true,
|
|
49882
|
+
relations: ["lending"]
|
|
49883
|
+
},
|
|
49884
|
+
{
|
|
49885
|
+
name: "supply_token_reserves_liquidity",
|
|
49886
|
+
writable: true
|
|
49887
|
+
},
|
|
49888
|
+
{
|
|
49889
|
+
name: "lending_supply_position_on_liquidity",
|
|
49890
|
+
writable: true
|
|
49891
|
+
},
|
|
49892
|
+
{
|
|
49893
|
+
name: "rate_model"
|
|
49894
|
+
},
|
|
49895
|
+
{
|
|
49896
|
+
name: "vault",
|
|
49897
|
+
writable: true
|
|
49898
|
+
},
|
|
49899
|
+
{
|
|
49900
|
+
name: "liquidity",
|
|
49901
|
+
writable: true
|
|
49902
|
+
},
|
|
49903
|
+
{
|
|
49904
|
+
name: "liquidity_program",
|
|
49905
|
+
relations: ["lending_admin"]
|
|
49906
|
+
},
|
|
49907
|
+
{
|
|
49908
|
+
name: "rewards_rate_model"
|
|
49909
|
+
},
|
|
49910
|
+
{
|
|
49911
|
+
name: "token_program"
|
|
49912
|
+
},
|
|
49913
|
+
{
|
|
49914
|
+
name: "associated_token_program",
|
|
49915
|
+
optional: true,
|
|
49916
|
+
address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
49917
|
+
},
|
|
49918
|
+
{
|
|
49919
|
+
name: "system_program",
|
|
49920
|
+
address: "11111111111111111111111111111111"
|
|
49921
|
+
}
|
|
49922
|
+
],
|
|
49923
|
+
args: [
|
|
49924
|
+
{
|
|
49925
|
+
name: "shares",
|
|
49926
|
+
type: "u64"
|
|
49927
|
+
},
|
|
49928
|
+
{
|
|
49929
|
+
name: "max_assets",
|
|
49930
|
+
type: "u64"
|
|
49931
|
+
}
|
|
49932
|
+
],
|
|
49933
|
+
returns: "u64"
|
|
49934
|
+
},
|
|
49935
|
+
{
|
|
49936
|
+
name: "rebalance",
|
|
49937
|
+
discriminator: [108, 158, 77, 9, 210, 52, 88, 62],
|
|
49938
|
+
accounts: [
|
|
49939
|
+
{
|
|
49940
|
+
name: "signer",
|
|
49941
|
+
writable: true,
|
|
49942
|
+
signer: true
|
|
49943
|
+
},
|
|
49944
|
+
{
|
|
49945
|
+
name: "depositor_token_account",
|
|
49946
|
+
writable: true,
|
|
49947
|
+
pda: {
|
|
49948
|
+
seeds: [
|
|
49949
|
+
{
|
|
49950
|
+
kind: "account",
|
|
49951
|
+
path: "signer"
|
|
49952
|
+
},
|
|
49953
|
+
{
|
|
49954
|
+
kind: "account",
|
|
49955
|
+
path: "token_program"
|
|
49956
|
+
},
|
|
49957
|
+
{
|
|
49958
|
+
kind: "account",
|
|
49959
|
+
path: "mint"
|
|
49960
|
+
}
|
|
49961
|
+
],
|
|
49962
|
+
program: {
|
|
49963
|
+
kind: "const",
|
|
49964
|
+
value: [
|
|
49965
|
+
140,
|
|
49966
|
+
151,
|
|
49967
|
+
37,
|
|
49968
|
+
143,
|
|
49969
|
+
78,
|
|
49970
|
+
36,
|
|
49971
|
+
137,
|
|
49972
|
+
241,
|
|
49973
|
+
187,
|
|
49974
|
+
61,
|
|
49975
|
+
16,
|
|
49976
|
+
41,
|
|
49977
|
+
20,
|
|
49978
|
+
142,
|
|
49979
|
+
13,
|
|
49980
|
+
131,
|
|
49981
|
+
11,
|
|
49982
|
+
90,
|
|
49983
|
+
19,
|
|
49984
|
+
153,
|
|
49985
|
+
218,
|
|
49986
|
+
255,
|
|
49987
|
+
16,
|
|
49988
|
+
132,
|
|
49989
|
+
4,
|
|
49990
|
+
142,
|
|
49991
|
+
123,
|
|
49992
|
+
216,
|
|
49993
|
+
219,
|
|
49994
|
+
233,
|
|
49995
|
+
248,
|
|
49996
|
+
89
|
|
49997
|
+
]
|
|
49998
|
+
}
|
|
49999
|
+
}
|
|
50000
|
+
},
|
|
50001
|
+
{
|
|
50002
|
+
name: "lending_admin"
|
|
50003
|
+
},
|
|
50004
|
+
{
|
|
50005
|
+
name: "lending",
|
|
50006
|
+
writable: true
|
|
50007
|
+
},
|
|
50008
|
+
{
|
|
50009
|
+
name: "mint",
|
|
50010
|
+
relations: ["lending", "rewards_rate_model"]
|
|
50011
|
+
},
|
|
50012
|
+
{
|
|
50013
|
+
name: "f_token_mint",
|
|
50014
|
+
writable: true,
|
|
50015
|
+
relations: ["lending"]
|
|
50016
|
+
},
|
|
50017
|
+
{
|
|
50018
|
+
name: "supply_token_reserves_liquidity",
|
|
50019
|
+
writable: true
|
|
50020
|
+
},
|
|
50021
|
+
{
|
|
50022
|
+
name: "lending_supply_position_on_liquidity",
|
|
50023
|
+
writable: true
|
|
50024
|
+
},
|
|
50025
|
+
{
|
|
50026
|
+
name: "rate_model",
|
|
50027
|
+
writable: true
|
|
50028
|
+
},
|
|
50029
|
+
{
|
|
50030
|
+
name: "vault",
|
|
50031
|
+
writable: true
|
|
50032
|
+
},
|
|
50033
|
+
{
|
|
50034
|
+
name: "liquidity",
|
|
50035
|
+
writable: true
|
|
50036
|
+
},
|
|
50037
|
+
{
|
|
50038
|
+
name: "liquidity_program",
|
|
50039
|
+
relations: ["lending_admin"]
|
|
50040
|
+
},
|
|
50041
|
+
{
|
|
50042
|
+
name: "rewards_rate_model"
|
|
50043
|
+
},
|
|
50044
|
+
{
|
|
50045
|
+
name: "token_program"
|
|
50046
|
+
},
|
|
50047
|
+
{
|
|
50048
|
+
name: "associated_token_program",
|
|
50049
|
+
address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
50050
|
+
},
|
|
50051
|
+
{
|
|
50052
|
+
name: "system_program",
|
|
50053
|
+
address: "11111111111111111111111111111111"
|
|
50054
|
+
}
|
|
50055
|
+
],
|
|
50056
|
+
args: []
|
|
50057
|
+
},
|
|
50058
|
+
{
|
|
50059
|
+
name: "rebalance_with_amounts",
|
|
50060
|
+
discriminator: [190, 33, 144, 182, 86, 4, 141, 73],
|
|
50061
|
+
accounts: [
|
|
50062
|
+
{
|
|
50063
|
+
name: "signer",
|
|
50064
|
+
writable: true,
|
|
50065
|
+
signer: true
|
|
50066
|
+
},
|
|
50067
|
+
{
|
|
50068
|
+
name: "depositor_token_account",
|
|
50069
|
+
writable: true,
|
|
50070
|
+
pda: {
|
|
50071
|
+
seeds: [
|
|
50072
|
+
{
|
|
50073
|
+
kind: "account",
|
|
50074
|
+
path: "signer"
|
|
50075
|
+
},
|
|
50076
|
+
{
|
|
50077
|
+
kind: "account",
|
|
50078
|
+
path: "token_program"
|
|
50079
|
+
},
|
|
50080
|
+
{
|
|
50081
|
+
kind: "account",
|
|
50082
|
+
path: "mint"
|
|
50083
|
+
}
|
|
50084
|
+
],
|
|
50085
|
+
program: {
|
|
50086
|
+
kind: "const",
|
|
50087
|
+
value: [
|
|
50088
|
+
140,
|
|
50089
|
+
151,
|
|
50090
|
+
37,
|
|
50091
|
+
143,
|
|
50092
|
+
78,
|
|
50093
|
+
36,
|
|
50094
|
+
137,
|
|
50095
|
+
241,
|
|
50096
|
+
187,
|
|
50097
|
+
61,
|
|
50098
|
+
16,
|
|
50099
|
+
41,
|
|
50100
|
+
20,
|
|
50101
|
+
142,
|
|
50102
|
+
13,
|
|
50103
|
+
131,
|
|
50104
|
+
11,
|
|
50105
|
+
90,
|
|
50106
|
+
19,
|
|
50107
|
+
153,
|
|
50108
|
+
218,
|
|
50109
|
+
255,
|
|
50110
|
+
16,
|
|
50111
|
+
132,
|
|
50112
|
+
4,
|
|
50113
|
+
142,
|
|
50114
|
+
123,
|
|
50115
|
+
216,
|
|
50116
|
+
219,
|
|
50117
|
+
233,
|
|
50118
|
+
248,
|
|
50119
|
+
89
|
|
50120
|
+
]
|
|
50121
|
+
}
|
|
50122
|
+
}
|
|
50123
|
+
},
|
|
50124
|
+
{
|
|
50125
|
+
name: "lending_admin"
|
|
50126
|
+
},
|
|
50127
|
+
{
|
|
50128
|
+
name: "lending",
|
|
50129
|
+
writable: true
|
|
50130
|
+
},
|
|
50131
|
+
{
|
|
50132
|
+
name: "mint",
|
|
50133
|
+
relations: ["lending", "rewards_rate_model"]
|
|
50134
|
+
},
|
|
50135
|
+
{
|
|
50136
|
+
name: "f_token_mint",
|
|
50137
|
+
writable: true,
|
|
50138
|
+
relations: ["lending"]
|
|
50139
|
+
},
|
|
50140
|
+
{
|
|
50141
|
+
name: "supply_token_reserves_liquidity",
|
|
50142
|
+
writable: true
|
|
50143
|
+
},
|
|
50144
|
+
{
|
|
50145
|
+
name: "lending_supply_position_on_liquidity",
|
|
50146
|
+
writable: true
|
|
50147
|
+
},
|
|
50148
|
+
{
|
|
50149
|
+
name: "rate_model",
|
|
50150
|
+
writable: true
|
|
50151
|
+
},
|
|
50152
|
+
{
|
|
50153
|
+
name: "vault",
|
|
50154
|
+
writable: true
|
|
50155
|
+
},
|
|
50156
|
+
{
|
|
50157
|
+
name: "liquidity",
|
|
50158
|
+
writable: true
|
|
50159
|
+
},
|
|
50160
|
+
{
|
|
50161
|
+
name: "liquidity_program",
|
|
50162
|
+
relations: ["lending_admin"]
|
|
50163
|
+
},
|
|
50164
|
+
{
|
|
50165
|
+
name: "rewards_rate_model"
|
|
50166
|
+
},
|
|
50167
|
+
{
|
|
50168
|
+
name: "token_program"
|
|
50169
|
+
},
|
|
50170
|
+
{
|
|
50171
|
+
name: "associated_token_program",
|
|
50172
|
+
address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
50173
|
+
},
|
|
50174
|
+
{
|
|
50175
|
+
name: "system_program",
|
|
50176
|
+
address: "11111111111111111111111111111111"
|
|
50177
|
+
}
|
|
50178
|
+
],
|
|
50179
|
+
args: [
|
|
50180
|
+
{
|
|
50181
|
+
name: "amount",
|
|
50182
|
+
type: {
|
|
50183
|
+
option: "u64"
|
|
50184
|
+
}
|
|
50185
|
+
}
|
|
50186
|
+
]
|
|
50187
|
+
},
|
|
50188
|
+
{
|
|
50189
|
+
name: "redeem",
|
|
50190
|
+
discriminator: [184, 12, 86, 149, 70, 196, 97, 225],
|
|
50191
|
+
accounts: [
|
|
50192
|
+
{
|
|
50193
|
+
name: "signer",
|
|
50194
|
+
writable: true,
|
|
50195
|
+
signer: true
|
|
50196
|
+
},
|
|
50197
|
+
{
|
|
50198
|
+
name: "owner_token_account",
|
|
50199
|
+
writable: true
|
|
50200
|
+
},
|
|
50201
|
+
{
|
|
50202
|
+
name: "recipient_token_account",
|
|
50203
|
+
writable: true
|
|
50204
|
+
},
|
|
50205
|
+
{
|
|
50206
|
+
name: "lending_admin"
|
|
50207
|
+
},
|
|
50208
|
+
{
|
|
50209
|
+
name: "lending",
|
|
50210
|
+
writable: true
|
|
50211
|
+
},
|
|
50212
|
+
{
|
|
50213
|
+
name: "mint",
|
|
50214
|
+
relations: ["lending", "rewards_rate_model"]
|
|
50215
|
+
},
|
|
50216
|
+
{
|
|
50217
|
+
name: "f_token_mint",
|
|
50218
|
+
writable: true,
|
|
50219
|
+
relations: ["lending"]
|
|
50220
|
+
},
|
|
50221
|
+
{
|
|
50222
|
+
name: "supply_token_reserves_liquidity",
|
|
50223
|
+
writable: true
|
|
50224
|
+
},
|
|
50225
|
+
{
|
|
50226
|
+
name: "lending_supply_position_on_liquidity",
|
|
50227
|
+
writable: true
|
|
50228
|
+
},
|
|
50229
|
+
{
|
|
50230
|
+
name: "rate_model"
|
|
50231
|
+
},
|
|
50232
|
+
{
|
|
50233
|
+
name: "vault",
|
|
50234
|
+
writable: true
|
|
50235
|
+
},
|
|
50236
|
+
{
|
|
50237
|
+
name: "claim_account",
|
|
50238
|
+
writable: true,
|
|
50239
|
+
optional: true
|
|
50240
|
+
},
|
|
50241
|
+
{
|
|
50242
|
+
name: "liquidity",
|
|
50243
|
+
writable: true
|
|
50244
|
+
},
|
|
50245
|
+
{
|
|
50246
|
+
name: "liquidity_program",
|
|
50247
|
+
relations: ["lending_admin"]
|
|
50248
|
+
},
|
|
50249
|
+
{
|
|
50250
|
+
name: "rewards_rate_model"
|
|
50251
|
+
},
|
|
50252
|
+
{
|
|
50253
|
+
name: "token_program"
|
|
50254
|
+
},
|
|
50255
|
+
{
|
|
50256
|
+
name: "associated_token_program",
|
|
50257
|
+
optional: true,
|
|
50258
|
+
address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
50259
|
+
},
|
|
50260
|
+
{
|
|
50261
|
+
name: "system_program",
|
|
50262
|
+
address: "11111111111111111111111111111111"
|
|
50263
|
+
}
|
|
50264
|
+
],
|
|
50265
|
+
args: [
|
|
50266
|
+
{
|
|
50267
|
+
name: "shares",
|
|
50268
|
+
type: "u64"
|
|
50269
|
+
}
|
|
50270
|
+
],
|
|
50271
|
+
returns: "u64"
|
|
50272
|
+
},
|
|
50273
|
+
{
|
|
50274
|
+
name: "redeem_with_min_amount_out",
|
|
50275
|
+
discriminator: [235, 189, 237, 56, 166, 180, 184, 149],
|
|
50276
|
+
accounts: [
|
|
50277
|
+
{
|
|
50278
|
+
name: "signer",
|
|
50279
|
+
writable: true,
|
|
50280
|
+
signer: true
|
|
50281
|
+
},
|
|
50282
|
+
{
|
|
50283
|
+
name: "owner_token_account",
|
|
50284
|
+
writable: true
|
|
50285
|
+
},
|
|
50286
|
+
{
|
|
50287
|
+
name: "recipient_token_account",
|
|
50288
|
+
writable: true
|
|
50289
|
+
},
|
|
50290
|
+
{
|
|
50291
|
+
name: "lending_admin"
|
|
50292
|
+
},
|
|
50293
|
+
{
|
|
50294
|
+
name: "lending",
|
|
50295
|
+
writable: true
|
|
50296
|
+
},
|
|
50297
|
+
{
|
|
50298
|
+
name: "mint",
|
|
50299
|
+
relations: ["lending", "rewards_rate_model"]
|
|
50300
|
+
},
|
|
50301
|
+
{
|
|
50302
|
+
name: "f_token_mint",
|
|
50303
|
+
writable: true,
|
|
50304
|
+
relations: ["lending"]
|
|
50305
|
+
},
|
|
50306
|
+
{
|
|
50307
|
+
name: "supply_token_reserves_liquidity",
|
|
50308
|
+
writable: true
|
|
50309
|
+
},
|
|
50310
|
+
{
|
|
50311
|
+
name: "lending_supply_position_on_liquidity",
|
|
50312
|
+
writable: true
|
|
50313
|
+
},
|
|
50314
|
+
{
|
|
50315
|
+
name: "rate_model"
|
|
50316
|
+
},
|
|
50317
|
+
{
|
|
50318
|
+
name: "vault",
|
|
50319
|
+
writable: true
|
|
50320
|
+
},
|
|
50321
|
+
{
|
|
50322
|
+
name: "claim_account",
|
|
50323
|
+
writable: true,
|
|
50324
|
+
optional: true
|
|
50325
|
+
},
|
|
50326
|
+
{
|
|
50327
|
+
name: "liquidity",
|
|
50328
|
+
writable: true
|
|
50329
|
+
},
|
|
50330
|
+
{
|
|
50331
|
+
name: "liquidity_program",
|
|
50332
|
+
relations: ["lending_admin"]
|
|
50333
|
+
},
|
|
50334
|
+
{
|
|
50335
|
+
name: "rewards_rate_model"
|
|
50336
|
+
},
|
|
50337
|
+
{
|
|
50338
|
+
name: "token_program"
|
|
50339
|
+
},
|
|
50340
|
+
{
|
|
50341
|
+
name: "associated_token_program",
|
|
50342
|
+
optional: true,
|
|
50343
|
+
address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
50344
|
+
},
|
|
50345
|
+
{
|
|
50346
|
+
name: "system_program",
|
|
50347
|
+
address: "11111111111111111111111111111111"
|
|
50348
|
+
}
|
|
50349
|
+
],
|
|
50350
|
+
args: [
|
|
50351
|
+
{
|
|
50352
|
+
name: "shares",
|
|
50353
|
+
type: "u64"
|
|
50354
|
+
},
|
|
50355
|
+
{
|
|
50356
|
+
name: "min_amount_out",
|
|
50357
|
+
type: "u64"
|
|
50358
|
+
}
|
|
50359
|
+
]
|
|
50360
|
+
},
|
|
50361
|
+
{
|
|
50362
|
+
name: "set_rewards_rate_model",
|
|
50363
|
+
discriminator: [174, 231, 116, 203, 8, 58, 143, 203],
|
|
50364
|
+
accounts: [
|
|
50365
|
+
{
|
|
50366
|
+
name: "signer",
|
|
50367
|
+
signer: true
|
|
50368
|
+
},
|
|
50369
|
+
{
|
|
50370
|
+
name: "lending_admin"
|
|
50371
|
+
},
|
|
50372
|
+
{
|
|
50373
|
+
name: "lending",
|
|
50374
|
+
writable: true
|
|
50375
|
+
},
|
|
50376
|
+
{
|
|
50377
|
+
name: "f_token_mint",
|
|
50378
|
+
relations: ["lending"]
|
|
50379
|
+
},
|
|
50380
|
+
{
|
|
50381
|
+
name: "new_rewards_rate_model"
|
|
50382
|
+
},
|
|
50383
|
+
{
|
|
50384
|
+
name: "supply_token_reserves_liquidity"
|
|
50385
|
+
}
|
|
50386
|
+
],
|
|
50387
|
+
args: [
|
|
50388
|
+
{
|
|
50389
|
+
name: "mint",
|
|
50390
|
+
type: "pubkey"
|
|
50391
|
+
}
|
|
50392
|
+
]
|
|
50393
|
+
},
|
|
50394
|
+
{
|
|
50395
|
+
name: "update_authority",
|
|
50396
|
+
discriminator: [32, 46, 64, 28, 149, 75, 243, 88],
|
|
50397
|
+
accounts: [
|
|
50398
|
+
{
|
|
50399
|
+
name: "signer",
|
|
50400
|
+
signer: true
|
|
50401
|
+
},
|
|
50402
|
+
{
|
|
50403
|
+
name: "lending_admin",
|
|
50404
|
+
writable: true
|
|
50405
|
+
}
|
|
50406
|
+
],
|
|
50407
|
+
args: [
|
|
50408
|
+
{
|
|
50409
|
+
name: "new_authority",
|
|
50410
|
+
type: "pubkey"
|
|
50411
|
+
}
|
|
50412
|
+
]
|
|
50413
|
+
},
|
|
50414
|
+
{
|
|
50415
|
+
name: "update_auths",
|
|
50416
|
+
discriminator: [93, 96, 178, 156, 57, 117, 253, 209],
|
|
50417
|
+
accounts: [
|
|
50418
|
+
{
|
|
50419
|
+
name: "signer",
|
|
50420
|
+
signer: true
|
|
50421
|
+
},
|
|
50422
|
+
{
|
|
50423
|
+
name: "lending_admin",
|
|
50424
|
+
writable: true
|
|
50425
|
+
}
|
|
50426
|
+
],
|
|
50427
|
+
args: [
|
|
50428
|
+
{
|
|
50429
|
+
name: "auth_status",
|
|
50430
|
+
type: {
|
|
50431
|
+
vec: {
|
|
50432
|
+
defined: {
|
|
50433
|
+
name: "AddressBool"
|
|
50434
|
+
}
|
|
50435
|
+
}
|
|
50436
|
+
}
|
|
50437
|
+
}
|
|
50438
|
+
]
|
|
50439
|
+
},
|
|
50440
|
+
{
|
|
50441
|
+
name: "update_rate",
|
|
50442
|
+
discriminator: [24, 225, 53, 189, 72, 212, 225, 178],
|
|
50443
|
+
accounts: [
|
|
50444
|
+
{
|
|
50445
|
+
name: "lending",
|
|
50446
|
+
writable: true
|
|
50447
|
+
},
|
|
50448
|
+
{
|
|
50449
|
+
name: "mint",
|
|
50450
|
+
relations: ["lending", "supply_token_reserves_liquidity"]
|
|
50451
|
+
},
|
|
50452
|
+
{
|
|
50453
|
+
name: "f_token_mint",
|
|
50454
|
+
relations: ["lending"]
|
|
50455
|
+
},
|
|
50456
|
+
{
|
|
50457
|
+
name: "supply_token_reserves_liquidity"
|
|
50458
|
+
},
|
|
50459
|
+
{
|
|
50460
|
+
name: "rewards_rate_model"
|
|
50461
|
+
}
|
|
50462
|
+
],
|
|
50463
|
+
args: []
|
|
50464
|
+
},
|
|
50465
|
+
{
|
|
50466
|
+
name: "update_rebalancer",
|
|
50467
|
+
discriminator: [206, 187, 54, 228, 145, 8, 203, 111],
|
|
50468
|
+
accounts: [
|
|
50469
|
+
{
|
|
50470
|
+
name: "signer",
|
|
50471
|
+
signer: true
|
|
50472
|
+
},
|
|
50473
|
+
{
|
|
50474
|
+
name: "lending_admin",
|
|
50475
|
+
writable: true
|
|
50476
|
+
}
|
|
50477
|
+
],
|
|
50478
|
+
args: [
|
|
50479
|
+
{
|
|
50480
|
+
name: "new_rebalancer",
|
|
50481
|
+
type: "pubkey"
|
|
50482
|
+
}
|
|
50483
|
+
]
|
|
50484
|
+
},
|
|
50485
|
+
{
|
|
50486
|
+
name: "withdraw",
|
|
50487
|
+
discriminator: [183, 18, 70, 156, 148, 109, 161, 34],
|
|
50488
|
+
accounts: [
|
|
50489
|
+
{
|
|
50490
|
+
name: "signer",
|
|
50491
|
+
writable: true,
|
|
50492
|
+
signer: true
|
|
50493
|
+
},
|
|
50494
|
+
{
|
|
50495
|
+
name: "owner_token_account",
|
|
50496
|
+
writable: true
|
|
50497
|
+
},
|
|
50498
|
+
{
|
|
50499
|
+
name: "recipient_token_account",
|
|
50500
|
+
writable: true
|
|
50501
|
+
},
|
|
50502
|
+
{
|
|
50503
|
+
name: "lending_admin"
|
|
50504
|
+
},
|
|
50505
|
+
{
|
|
50506
|
+
name: "lending",
|
|
50507
|
+
writable: true
|
|
50508
|
+
},
|
|
50509
|
+
{
|
|
50510
|
+
name: "mint",
|
|
50511
|
+
relations: ["lending", "rewards_rate_model"]
|
|
50512
|
+
},
|
|
50513
|
+
{
|
|
50514
|
+
name: "f_token_mint",
|
|
50515
|
+
writable: true,
|
|
50516
|
+
relations: ["lending"]
|
|
50517
|
+
},
|
|
50518
|
+
{
|
|
50519
|
+
name: "supply_token_reserves_liquidity",
|
|
50520
|
+
writable: true
|
|
50521
|
+
},
|
|
50522
|
+
{
|
|
50523
|
+
name: "lending_supply_position_on_liquidity",
|
|
50524
|
+
writable: true
|
|
50525
|
+
},
|
|
50526
|
+
{
|
|
50527
|
+
name: "rate_model"
|
|
50528
|
+
},
|
|
50529
|
+
{
|
|
50530
|
+
name: "vault",
|
|
50531
|
+
writable: true
|
|
50532
|
+
},
|
|
50533
|
+
{
|
|
50534
|
+
name: "claim_account",
|
|
50535
|
+
writable: true,
|
|
50536
|
+
optional: true
|
|
50537
|
+
},
|
|
50538
|
+
{
|
|
50539
|
+
name: "liquidity",
|
|
50540
|
+
writable: true
|
|
50541
|
+
},
|
|
50542
|
+
{
|
|
50543
|
+
name: "liquidity_program",
|
|
50544
|
+
relations: ["lending_admin"]
|
|
50545
|
+
},
|
|
50546
|
+
{
|
|
50547
|
+
name: "rewards_rate_model"
|
|
50548
|
+
},
|
|
50549
|
+
{
|
|
50550
|
+
name: "token_program"
|
|
50551
|
+
},
|
|
50552
|
+
{
|
|
50553
|
+
name: "associated_token_program",
|
|
50554
|
+
optional: true,
|
|
50555
|
+
address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
50556
|
+
},
|
|
50557
|
+
{
|
|
50558
|
+
name: "system_program",
|
|
50559
|
+
address: "11111111111111111111111111111111"
|
|
50560
|
+
}
|
|
50561
|
+
],
|
|
50562
|
+
args: [
|
|
50563
|
+
{
|
|
50564
|
+
name: "amount",
|
|
50565
|
+
type: "u64"
|
|
50566
|
+
}
|
|
50567
|
+
],
|
|
50568
|
+
returns: "u64"
|
|
50569
|
+
},
|
|
50570
|
+
{
|
|
50571
|
+
name: "withdraw_with_max_shares_burn",
|
|
50572
|
+
discriminator: [47, 197, 183, 171, 239, 18, 245, 171],
|
|
50573
|
+
accounts: [
|
|
50574
|
+
{
|
|
50575
|
+
name: "signer",
|
|
50576
|
+
writable: true,
|
|
50577
|
+
signer: true
|
|
50578
|
+
},
|
|
50579
|
+
{
|
|
50580
|
+
name: "owner_token_account",
|
|
50581
|
+
writable: true
|
|
50582
|
+
},
|
|
50583
|
+
{
|
|
50584
|
+
name: "recipient_token_account",
|
|
50585
|
+
writable: true
|
|
50586
|
+
},
|
|
50587
|
+
{
|
|
50588
|
+
name: "lending_admin"
|
|
50589
|
+
},
|
|
50590
|
+
{
|
|
50591
|
+
name: "lending",
|
|
50592
|
+
writable: true
|
|
50593
|
+
},
|
|
50594
|
+
{
|
|
50595
|
+
name: "mint",
|
|
50596
|
+
relations: ["lending", "rewards_rate_model"]
|
|
50597
|
+
},
|
|
50598
|
+
{
|
|
50599
|
+
name: "f_token_mint",
|
|
50600
|
+
writable: true,
|
|
50601
|
+
relations: ["lending"]
|
|
50602
|
+
},
|
|
50603
|
+
{
|
|
50604
|
+
name: "supply_token_reserves_liquidity",
|
|
50605
|
+
writable: true
|
|
50606
|
+
},
|
|
50607
|
+
{
|
|
50608
|
+
name: "lending_supply_position_on_liquidity",
|
|
50609
|
+
writable: true
|
|
50610
|
+
},
|
|
50611
|
+
{
|
|
50612
|
+
name: "rate_model"
|
|
50613
|
+
},
|
|
50614
|
+
{
|
|
50615
|
+
name: "vault",
|
|
50616
|
+
writable: true
|
|
50617
|
+
},
|
|
50618
|
+
{
|
|
50619
|
+
name: "claim_account",
|
|
50620
|
+
writable: true,
|
|
50621
|
+
optional: true
|
|
50622
|
+
},
|
|
50623
|
+
{
|
|
50624
|
+
name: "liquidity",
|
|
50625
|
+
writable: true
|
|
50626
|
+
},
|
|
50627
|
+
{
|
|
50628
|
+
name: "liquidity_program",
|
|
50629
|
+
relations: ["lending_admin"]
|
|
50630
|
+
},
|
|
50631
|
+
{
|
|
50632
|
+
name: "rewards_rate_model"
|
|
50633
|
+
},
|
|
50634
|
+
{
|
|
50635
|
+
name: "token_program"
|
|
50636
|
+
},
|
|
50637
|
+
{
|
|
50638
|
+
name: "associated_token_program",
|
|
50639
|
+
optional: true,
|
|
50640
|
+
address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
50641
|
+
},
|
|
50642
|
+
{
|
|
50643
|
+
name: "system_program",
|
|
50644
|
+
address: "11111111111111111111111111111111"
|
|
50645
|
+
}
|
|
50646
|
+
],
|
|
50647
|
+
args: [
|
|
50648
|
+
{
|
|
50649
|
+
name: "amount",
|
|
50650
|
+
type: "u64"
|
|
50651
|
+
},
|
|
50652
|
+
{
|
|
50653
|
+
name: "max_shares_burn",
|
|
50654
|
+
type: "u64"
|
|
50655
|
+
}
|
|
50656
|
+
],
|
|
50657
|
+
returns: "u64"
|
|
50658
|
+
}
|
|
50659
|
+
],
|
|
50660
|
+
accounts: [
|
|
50661
|
+
{
|
|
50662
|
+
name: "Lending",
|
|
50663
|
+
discriminator: [135, 199, 82, 16, 249, 131, 182, 241]
|
|
50664
|
+
},
|
|
50665
|
+
{
|
|
50666
|
+
name: "LendingAdmin",
|
|
50667
|
+
discriminator: [42, 8, 33, 220, 163, 40, 210, 5]
|
|
49354
50668
|
},
|
|
49355
50669
|
{
|
|
49356
|
-
name: "
|
|
49357
|
-
discriminator: [
|
|
49358
|
-
accounts: [
|
|
49359
|
-
{ name: "signer", writable: true, signer: true },
|
|
49360
|
-
{ name: "depositor_token_account", writable: true },
|
|
49361
|
-
{ name: "recipient_token_account", writable: true },
|
|
49362
|
-
{ name: "mint", relations: ["lending", "rewards_rate_model"] },
|
|
49363
|
-
{ name: "lending_admin" },
|
|
49364
|
-
{ name: "lending", writable: true },
|
|
49365
|
-
{ name: "f_token_mint", writable: true, relations: ["lending"] },
|
|
49366
|
-
{ name: "supply_token_reserves_liquidity", writable: true },
|
|
49367
|
-
{ name: "lending_supply_position_on_liquidity", writable: true },
|
|
49368
|
-
{ name: "rate_model" },
|
|
49369
|
-
{ name: "vault", writable: true },
|
|
49370
|
-
{ name: "liquidity", writable: true },
|
|
49371
|
-
{ name: "liquidity_program", writable: true, relations: ["lending_admin"] },
|
|
49372
|
-
{ name: "rewards_rate_model" },
|
|
49373
|
-
{ name: "token_program" },
|
|
49374
|
-
{ name: "associated_token_program", address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" },
|
|
49375
|
-
{ name: "system_program", address: "11111111111111111111111111111111" }
|
|
49376
|
-
],
|
|
49377
|
-
args: [{ name: "shares", type: "u64" }],
|
|
49378
|
-
returns: "u64"
|
|
50670
|
+
name: "LendingRewardsRateModel",
|
|
50671
|
+
discriminator: [166, 72, 71, 131, 172, 74, 166, 181]
|
|
49379
50672
|
},
|
|
49380
50673
|
{
|
|
49381
|
-
name: "
|
|
49382
|
-
discriminator: [
|
|
49383
|
-
accounts: [
|
|
49384
|
-
{ name: "signer", writable: true, signer: true },
|
|
49385
|
-
{ name: "owner_token_account", writable: true },
|
|
49386
|
-
{ name: "recipient_token_account", writable: true },
|
|
49387
|
-
{ name: "lending_admin" },
|
|
49388
|
-
{ name: "lending", writable: true },
|
|
49389
|
-
{ name: "mint", relations: ["lending", "rewards_rate_model"] },
|
|
49390
|
-
{ name: "f_token_mint", writable: true, relations: ["lending"] },
|
|
49391
|
-
{ name: "supply_token_reserves_liquidity", writable: true },
|
|
49392
|
-
{ name: "lending_supply_position_on_liquidity", writable: true },
|
|
49393
|
-
{ name: "rate_model" },
|
|
49394
|
-
{ name: "vault", writable: true },
|
|
49395
|
-
{ name: "claim_account", writable: true },
|
|
49396
|
-
{ name: "liquidity", writable: true },
|
|
49397
|
-
{ name: "liquidity_program", writable: true, relations: ["lending_admin"] },
|
|
49398
|
-
{ name: "rewards_rate_model" },
|
|
49399
|
-
{ name: "token_program" },
|
|
49400
|
-
{ name: "associated_token_program", address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" },
|
|
49401
|
-
{ name: "system_program", address: "11111111111111111111111111111111" }
|
|
49402
|
-
],
|
|
49403
|
-
args: [{ name: "amount", type: "u64" }],
|
|
49404
|
-
returns: "u64"
|
|
50674
|
+
name: "TokenReserve",
|
|
50675
|
+
discriminator: [21, 18, 59, 135, 120, 20, 31, 12]
|
|
49405
50676
|
},
|
|
49406
50677
|
{
|
|
49407
|
-
name: "
|
|
49408
|
-
discriminator: [
|
|
49409
|
-
|
|
49410
|
-
|
|
49411
|
-
|
|
49412
|
-
|
|
49413
|
-
|
|
49414
|
-
|
|
49415
|
-
{ name: "mint", relations: ["lending", "rewards_rate_model"] },
|
|
49416
|
-
{ name: "f_token_mint", writable: true, relations: ["lending"] },
|
|
49417
|
-
{ name: "supply_token_reserves_liquidity", writable: true },
|
|
49418
|
-
{ name: "lending_supply_position_on_liquidity", writable: true },
|
|
49419
|
-
{ name: "rate_model" },
|
|
49420
|
-
{ name: "vault", writable: true },
|
|
49421
|
-
{ name: "claim_account", writable: true },
|
|
49422
|
-
{ name: "liquidity", writable: true },
|
|
49423
|
-
{ name: "liquidity_program", writable: true, relations: ["lending_admin"] },
|
|
49424
|
-
{ name: "rewards_rate_model" },
|
|
49425
|
-
{ name: "token_program" },
|
|
49426
|
-
{ name: "associated_token_program", address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" },
|
|
49427
|
-
{ name: "system_program", address: "11111111111111111111111111111111" }
|
|
49428
|
-
],
|
|
49429
|
-
args: [{ name: "shares", type: "u64" }],
|
|
49430
|
-
returns: "u64"
|
|
50678
|
+
name: "UserSupplyPosition",
|
|
50679
|
+
discriminator: [202, 219, 136, 118, 61, 177, 21, 146]
|
|
50680
|
+
}
|
|
50681
|
+
],
|
|
50682
|
+
events: [
|
|
50683
|
+
{
|
|
50684
|
+
name: "LogDeposit",
|
|
50685
|
+
discriminator: [176, 243, 1, 56, 142, 206, 1, 106]
|
|
49431
50686
|
},
|
|
49432
50687
|
{
|
|
49433
|
-
name: "
|
|
49434
|
-
discriminator: [
|
|
49435
|
-
accounts: [
|
|
49436
|
-
{ name: "signer", writable: true, signer: true },
|
|
49437
|
-
{ name: "depositor_token_account", writable: true },
|
|
49438
|
-
{ name: "lending_admin" },
|
|
49439
|
-
{ name: "lending", writable: true },
|
|
49440
|
-
{ name: "mint", relations: ["lending", "rewards_rate_model"] },
|
|
49441
|
-
{ name: "f_token_mint", writable: true, relations: ["lending"] },
|
|
49442
|
-
{ name: "supply_token_reserves_liquidity", writable: true },
|
|
49443
|
-
{ name: "lending_supply_position_on_liquidity", writable: true },
|
|
49444
|
-
{ name: "rate_model", writable: true },
|
|
49445
|
-
{ name: "vault", writable: true },
|
|
49446
|
-
{ name: "liquidity", writable: true },
|
|
49447
|
-
{ name: "liquidity_program", writable: true, relations: ["lending_admin"] },
|
|
49448
|
-
{ name: "rewards_rate_model" },
|
|
49449
|
-
{ name: "token_program" },
|
|
49450
|
-
{ name: "associated_token_program", address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" },
|
|
49451
|
-
{ name: "system_program", address: "11111111111111111111111111111111" }
|
|
49452
|
-
],
|
|
49453
|
-
args: []
|
|
50688
|
+
name: "LogRebalance",
|
|
50689
|
+
discriminator: [90, 67, 219, 41, 181, 118, 132, 9]
|
|
49454
50690
|
},
|
|
49455
50691
|
{
|
|
49456
|
-
name: "
|
|
49457
|
-
discriminator: [
|
|
49458
|
-
|
|
49459
|
-
|
|
49460
|
-
|
|
49461
|
-
|
|
49462
|
-
|
|
49463
|
-
|
|
49464
|
-
|
|
49465
|
-
|
|
50692
|
+
name: "LogUpdateAuthority",
|
|
50693
|
+
discriminator: [150, 152, 157, 143, 6, 135, 193, 101]
|
|
50694
|
+
},
|
|
50695
|
+
{
|
|
50696
|
+
name: "LogUpdateAuths",
|
|
50697
|
+
discriminator: [88, 80, 109, 48, 111, 203, 76, 251]
|
|
50698
|
+
},
|
|
50699
|
+
{
|
|
50700
|
+
name: "LogUpdateRates",
|
|
50701
|
+
discriminator: [222, 11, 113, 60, 147, 15, 68, 217]
|
|
50702
|
+
},
|
|
50703
|
+
{
|
|
50704
|
+
name: "LogUpdateRebalancer",
|
|
50705
|
+
discriminator: [66, 79, 144, 204, 26, 217, 153, 225]
|
|
50706
|
+
},
|
|
50707
|
+
{
|
|
50708
|
+
name: "LogUpdateRewards",
|
|
50709
|
+
discriminator: [37, 13, 111, 186, 47, 245, 162, 121]
|
|
50710
|
+
},
|
|
50711
|
+
{
|
|
50712
|
+
name: "LogWithdraw",
|
|
50713
|
+
discriminator: [49, 9, 176, 179, 222, 190, 6, 117]
|
|
49466
50714
|
}
|
|
49467
50715
|
],
|
|
49468
|
-
accounts: [
|
|
49469
|
-
{ name: "Lending", discriminator: [135, 199, 82, 16, 249, 131, 182, 241] },
|
|
49470
|
-
{ name: "LendingAdmin", discriminator: [42, 8, 33, 220, 163, 40, 210, 5] },
|
|
49471
|
-
{ name: "LendingRewardsRateModel", discriminator: [166, 72, 71, 131, 172, 74, 166, 181] },
|
|
49472
|
-
{ name: "TokenReserve", discriminator: [21, 18, 59, 135, 120, 20, 31, 12] },
|
|
49473
|
-
{ name: "UserSupplyPosition", discriminator: [202, 219, 136, 118, 61, 177, 21, 146] }
|
|
49474
|
-
],
|
|
49475
50716
|
errors: [
|
|
49476
|
-
{
|
|
49477
|
-
|
|
49478
|
-
|
|
49479
|
-
|
|
49480
|
-
|
|
49481
|
-
{
|
|
49482
|
-
|
|
49483
|
-
|
|
49484
|
-
|
|
49485
|
-
|
|
49486
|
-
{
|
|
49487
|
-
|
|
49488
|
-
|
|
50717
|
+
{
|
|
50718
|
+
code: 6e3,
|
|
50719
|
+
name: "FTokenDepositInsignificant",
|
|
50720
|
+
msg: "F_TOKEN_DEPOSIT_INSIGNIFICANT"
|
|
50721
|
+
},
|
|
50722
|
+
{
|
|
50723
|
+
code: 6001,
|
|
50724
|
+
name: "FTokenMinAmountOut",
|
|
50725
|
+
msg: "F_TOKEN_MIN_AMOUNT_OUT"
|
|
50726
|
+
},
|
|
50727
|
+
{
|
|
50728
|
+
code: 6002,
|
|
50729
|
+
name: "FTokenMaxAmount",
|
|
50730
|
+
msg: "F_TOKEN_MAX_AMOUNT"
|
|
50731
|
+
},
|
|
50732
|
+
{
|
|
50733
|
+
code: 6003,
|
|
50734
|
+
name: "FTokenInvalidParams",
|
|
50735
|
+
msg: "F_TOKEN_INVALID_PARAMS"
|
|
50736
|
+
},
|
|
50737
|
+
{
|
|
50738
|
+
code: 6004,
|
|
50739
|
+
name: "FTokenRewardsRateModelAlreadySet",
|
|
50740
|
+
msg: "F_TOKEN_REWARDS_RATE_MODEL_ALREADY_SET"
|
|
50741
|
+
},
|
|
50742
|
+
{
|
|
50743
|
+
code: 6005,
|
|
50744
|
+
name: "FTokenMaxAuthCountReached",
|
|
50745
|
+
msg: "F_TOKEN_MAX_AUTH_COUNT"
|
|
50746
|
+
},
|
|
50747
|
+
{
|
|
50748
|
+
code: 6006,
|
|
50749
|
+
name: "FTokenLiquidityExchangePriceUnexpected",
|
|
50750
|
+
msg: "F_TOKEN_LIQUIDITY_EXCHANGE_PRICE_UNEXPECTED"
|
|
50751
|
+
},
|
|
50752
|
+
{
|
|
50753
|
+
code: 6007,
|
|
50754
|
+
name: "FTokenCpiToLiquidityFailed",
|
|
50755
|
+
msg: "F_TOKEN_CPI_TO_LIQUIDITY_FAILED"
|
|
50756
|
+
},
|
|
50757
|
+
{
|
|
50758
|
+
code: 6008,
|
|
50759
|
+
name: "FTokenOnlyAuth",
|
|
50760
|
+
msg: "F_TOKEN_ONLY_AUTH"
|
|
50761
|
+
},
|
|
50762
|
+
{
|
|
50763
|
+
code: 6009,
|
|
50764
|
+
name: "FTokenOnlyAuthority",
|
|
50765
|
+
msg: "F_TOKEN_ONLY_AUTHORITY"
|
|
50766
|
+
},
|
|
50767
|
+
{
|
|
50768
|
+
code: 6010,
|
|
50769
|
+
name: "FTokenOnlyRebalancer",
|
|
50770
|
+
msg: "F_TOKEN_ONLY_REBALANCER"
|
|
50771
|
+
},
|
|
50772
|
+
{
|
|
50773
|
+
code: 6011,
|
|
50774
|
+
name: "FTokenUserSupplyPositionRequired",
|
|
50775
|
+
msg: "F_TOKEN_USER_SUPPLY_POSITION_REQUIRED"
|
|
50776
|
+
},
|
|
50777
|
+
{
|
|
50778
|
+
code: 6012,
|
|
50779
|
+
name: "FTokenLiquidityProgramMismatch",
|
|
50780
|
+
msg: "F_TOKEN_LIQUIDITY_PROGRAM_MISMATCH"
|
|
50781
|
+
}
|
|
49489
50782
|
],
|
|
49490
50783
|
types: [
|
|
49491
50784
|
{
|
|
@@ -49493,8 +50786,14 @@ var jup_lend_default = {
|
|
|
49493
50786
|
type: {
|
|
49494
50787
|
kind: "struct",
|
|
49495
50788
|
fields: [
|
|
49496
|
-
{
|
|
49497
|
-
|
|
50789
|
+
{
|
|
50790
|
+
name: "addr",
|
|
50791
|
+
type: "pubkey"
|
|
50792
|
+
},
|
|
50793
|
+
{
|
|
50794
|
+
name: "value",
|
|
50795
|
+
type: "bool"
|
|
50796
|
+
}
|
|
49498
50797
|
]
|
|
49499
50798
|
}
|
|
49500
50799
|
},
|
|
@@ -49503,17 +50802,63 @@ var jup_lend_default = {
|
|
|
49503
50802
|
type: {
|
|
49504
50803
|
kind: "struct",
|
|
49505
50804
|
fields: [
|
|
49506
|
-
{
|
|
49507
|
-
|
|
49508
|
-
|
|
49509
|
-
|
|
49510
|
-
{
|
|
49511
|
-
|
|
49512
|
-
|
|
49513
|
-
|
|
49514
|
-
{
|
|
49515
|
-
|
|
49516
|
-
|
|
50805
|
+
{
|
|
50806
|
+
name: "mint",
|
|
50807
|
+
type: "pubkey"
|
|
50808
|
+
},
|
|
50809
|
+
{
|
|
50810
|
+
name: "f_token_mint",
|
|
50811
|
+
type: "pubkey"
|
|
50812
|
+
},
|
|
50813
|
+
{
|
|
50814
|
+
name: "lending_id",
|
|
50815
|
+
type: "u16"
|
|
50816
|
+
},
|
|
50817
|
+
{
|
|
50818
|
+
name: "decimals",
|
|
50819
|
+
docs: ["@dev number of decimals for the fToken, same as ASSET"],
|
|
50820
|
+
type: "u8"
|
|
50821
|
+
},
|
|
50822
|
+
{
|
|
50823
|
+
name: "rewards_rate_model",
|
|
50824
|
+
docs: [
|
|
50825
|
+
"@dev To read PDA of rewards rate model to get_rate instruction"
|
|
50826
|
+
],
|
|
50827
|
+
type: "pubkey"
|
|
50828
|
+
},
|
|
50829
|
+
{
|
|
50830
|
+
name: "liquidity_exchange_price",
|
|
50831
|
+
docs: [
|
|
50832
|
+
"@dev exchange price for the underlying asset in the liquidity protocol (without rewards)"
|
|
50833
|
+
],
|
|
50834
|
+
type: "u64"
|
|
50835
|
+
},
|
|
50836
|
+
{
|
|
50837
|
+
name: "token_exchange_price",
|
|
50838
|
+
docs: [
|
|
50839
|
+
"@dev exchange price between fToken and the underlying asset (with rewards)"
|
|
50840
|
+
],
|
|
50841
|
+
type: "u64"
|
|
50842
|
+
},
|
|
50843
|
+
{
|
|
50844
|
+
name: "last_update_timestamp",
|
|
50845
|
+
docs: [
|
|
50846
|
+
"@dev timestamp when exchange prices were updated the last time"
|
|
50847
|
+
],
|
|
50848
|
+
type: "u64"
|
|
50849
|
+
},
|
|
50850
|
+
{
|
|
50851
|
+
name: "token_reserves_liquidity",
|
|
50852
|
+
type: "pubkey"
|
|
50853
|
+
},
|
|
50854
|
+
{
|
|
50855
|
+
name: "supply_position_on_liquidity",
|
|
50856
|
+
type: "pubkey"
|
|
50857
|
+
},
|
|
50858
|
+
{
|
|
50859
|
+
name: "bump",
|
|
50860
|
+
type: "u8"
|
|
50861
|
+
}
|
|
49517
50862
|
]
|
|
49518
50863
|
}
|
|
49519
50864
|
},
|
|
@@ -49522,12 +50867,32 @@ var jup_lend_default = {
|
|
|
49522
50867
|
type: {
|
|
49523
50868
|
kind: "struct",
|
|
49524
50869
|
fields: [
|
|
49525
|
-
{
|
|
49526
|
-
|
|
49527
|
-
|
|
49528
|
-
|
|
49529
|
-
{
|
|
49530
|
-
|
|
50870
|
+
{
|
|
50871
|
+
name: "authority",
|
|
50872
|
+
type: "pubkey"
|
|
50873
|
+
},
|
|
50874
|
+
{
|
|
50875
|
+
name: "liquidity_program",
|
|
50876
|
+
type: "pubkey"
|
|
50877
|
+
},
|
|
50878
|
+
{
|
|
50879
|
+
name: "rebalancer",
|
|
50880
|
+
type: "pubkey"
|
|
50881
|
+
},
|
|
50882
|
+
{
|
|
50883
|
+
name: "next_lending_id",
|
|
50884
|
+
type: "u16"
|
|
50885
|
+
},
|
|
50886
|
+
{
|
|
50887
|
+
name: "auths",
|
|
50888
|
+
type: {
|
|
50889
|
+
vec: "pubkey"
|
|
50890
|
+
}
|
|
50891
|
+
},
|
|
50892
|
+
{
|
|
50893
|
+
name: "bump",
|
|
50894
|
+
type: "u8"
|
|
50895
|
+
}
|
|
49531
50896
|
]
|
|
49532
50897
|
}
|
|
49533
50898
|
},
|
|
@@ -49536,61 +50901,328 @@ var jup_lend_default = {
|
|
|
49536
50901
|
type: {
|
|
49537
50902
|
kind: "struct",
|
|
49538
50903
|
fields: [
|
|
49539
|
-
{
|
|
49540
|
-
|
|
49541
|
-
|
|
49542
|
-
|
|
49543
|
-
|
|
49544
|
-
{
|
|
49545
|
-
|
|
49546
|
-
|
|
50904
|
+
{
|
|
50905
|
+
name: "mint",
|
|
50906
|
+
docs: ["@dev mint address"],
|
|
50907
|
+
type: "pubkey"
|
|
50908
|
+
},
|
|
50909
|
+
{
|
|
50910
|
+
name: "start_tvl",
|
|
50911
|
+
docs: [
|
|
50912
|
+
"@dev tvl below which rewards rate is 0. If current TVL is below this value, triggering `update_rate()` on the fToken",
|
|
50913
|
+
"might bring the total TVL above this cut-off."
|
|
50914
|
+
],
|
|
50915
|
+
type: "u64"
|
|
50916
|
+
},
|
|
50917
|
+
{
|
|
50918
|
+
name: "duration",
|
|
50919
|
+
docs: ["@dev for how long current rewards should run"],
|
|
50920
|
+
type: "u64"
|
|
50921
|
+
},
|
|
50922
|
+
{
|
|
50923
|
+
name: "start_time",
|
|
50924
|
+
docs: ["@dev when current rewards got started"],
|
|
50925
|
+
type: "u64"
|
|
50926
|
+
},
|
|
50927
|
+
{
|
|
50928
|
+
name: "yearly_reward",
|
|
50929
|
+
docs: [
|
|
50930
|
+
"@dev current annualized reward based on input params (duration, rewardAmount)"
|
|
50931
|
+
],
|
|
50932
|
+
type: "u64"
|
|
50933
|
+
},
|
|
50934
|
+
{
|
|
50935
|
+
name: "next_duration",
|
|
50936
|
+
docs: ["@dev Duration for the next rewards phase"],
|
|
50937
|
+
type: "u64"
|
|
50938
|
+
},
|
|
50939
|
+
{
|
|
50940
|
+
name: "next_reward_amount",
|
|
50941
|
+
docs: ["@dev Amount of rewards for the next phase"],
|
|
50942
|
+
type: "u64"
|
|
50943
|
+
},
|
|
50944
|
+
{
|
|
50945
|
+
name: "bump",
|
|
50946
|
+
type: "u8"
|
|
50947
|
+
}
|
|
50948
|
+
]
|
|
50949
|
+
}
|
|
50950
|
+
},
|
|
50951
|
+
{
|
|
50952
|
+
name: "LogDeposit",
|
|
50953
|
+
type: {
|
|
50954
|
+
kind: "struct",
|
|
50955
|
+
fields: [
|
|
50956
|
+
{
|
|
50957
|
+
name: "sender",
|
|
50958
|
+
type: "pubkey"
|
|
50959
|
+
},
|
|
50960
|
+
{
|
|
50961
|
+
name: "receiver",
|
|
50962
|
+
type: "pubkey"
|
|
50963
|
+
},
|
|
50964
|
+
{
|
|
50965
|
+
name: "assets",
|
|
50966
|
+
type: "u64"
|
|
50967
|
+
},
|
|
50968
|
+
{
|
|
50969
|
+
name: "shares_minted",
|
|
50970
|
+
type: "u64"
|
|
50971
|
+
}
|
|
50972
|
+
]
|
|
50973
|
+
}
|
|
50974
|
+
},
|
|
50975
|
+
{
|
|
50976
|
+
name: "LogRebalance",
|
|
50977
|
+
type: {
|
|
50978
|
+
kind: "struct",
|
|
50979
|
+
fields: [
|
|
50980
|
+
{
|
|
50981
|
+
name: "assets",
|
|
50982
|
+
type: "u64"
|
|
50983
|
+
}
|
|
50984
|
+
]
|
|
50985
|
+
}
|
|
50986
|
+
},
|
|
50987
|
+
{
|
|
50988
|
+
name: "LogUpdateAuthority",
|
|
50989
|
+
type: {
|
|
50990
|
+
kind: "struct",
|
|
50991
|
+
fields: [
|
|
50992
|
+
{
|
|
50993
|
+
name: "new_authority",
|
|
50994
|
+
type: "pubkey"
|
|
50995
|
+
}
|
|
50996
|
+
]
|
|
50997
|
+
}
|
|
50998
|
+
},
|
|
50999
|
+
{
|
|
51000
|
+
name: "LogUpdateAuths",
|
|
51001
|
+
type: {
|
|
51002
|
+
kind: "struct",
|
|
51003
|
+
fields: [
|
|
51004
|
+
{
|
|
51005
|
+
name: "auth_status",
|
|
51006
|
+
type: {
|
|
51007
|
+
vec: {
|
|
51008
|
+
defined: {
|
|
51009
|
+
name: "AddressBool"
|
|
51010
|
+
}
|
|
51011
|
+
}
|
|
51012
|
+
}
|
|
51013
|
+
}
|
|
51014
|
+
]
|
|
51015
|
+
}
|
|
51016
|
+
},
|
|
51017
|
+
{
|
|
51018
|
+
name: "LogUpdateRates",
|
|
51019
|
+
type: {
|
|
51020
|
+
kind: "struct",
|
|
51021
|
+
fields: [
|
|
51022
|
+
{
|
|
51023
|
+
name: "token_exchange_price",
|
|
51024
|
+
type: "u64"
|
|
51025
|
+
},
|
|
51026
|
+
{
|
|
51027
|
+
name: "liquidity_exchange_price",
|
|
51028
|
+
type: "u64"
|
|
51029
|
+
}
|
|
51030
|
+
]
|
|
51031
|
+
}
|
|
51032
|
+
},
|
|
51033
|
+
{
|
|
51034
|
+
name: "LogUpdateRebalancer",
|
|
51035
|
+
type: {
|
|
51036
|
+
kind: "struct",
|
|
51037
|
+
fields: [
|
|
51038
|
+
{
|
|
51039
|
+
name: "new_rebalancer",
|
|
51040
|
+
type: "pubkey"
|
|
51041
|
+
}
|
|
51042
|
+
]
|
|
51043
|
+
}
|
|
51044
|
+
},
|
|
51045
|
+
{
|
|
51046
|
+
name: "LogUpdateRewards",
|
|
51047
|
+
type: {
|
|
51048
|
+
kind: "struct",
|
|
51049
|
+
fields: [
|
|
51050
|
+
{
|
|
51051
|
+
name: "rewards_rate_model",
|
|
51052
|
+
type: "pubkey"
|
|
51053
|
+
}
|
|
51054
|
+
]
|
|
51055
|
+
}
|
|
51056
|
+
},
|
|
51057
|
+
{
|
|
51058
|
+
name: "LogWithdraw",
|
|
51059
|
+
type: {
|
|
51060
|
+
kind: "struct",
|
|
51061
|
+
fields: [
|
|
51062
|
+
{
|
|
51063
|
+
name: "sender",
|
|
51064
|
+
type: "pubkey"
|
|
51065
|
+
},
|
|
51066
|
+
{
|
|
51067
|
+
name: "receiver",
|
|
51068
|
+
type: "pubkey"
|
|
51069
|
+
},
|
|
51070
|
+
{
|
|
51071
|
+
name: "owner",
|
|
51072
|
+
type: "pubkey"
|
|
51073
|
+
},
|
|
51074
|
+
{
|
|
51075
|
+
name: "assets",
|
|
51076
|
+
type: "u64"
|
|
51077
|
+
},
|
|
51078
|
+
{
|
|
51079
|
+
name: "shares_burned",
|
|
51080
|
+
type: "u64"
|
|
51081
|
+
}
|
|
49547
51082
|
]
|
|
49548
51083
|
}
|
|
49549
51084
|
},
|
|
49550
51085
|
{
|
|
49551
51086
|
name: "TokenReserve",
|
|
51087
|
+
docs: ["Token configuration and exchange prices"],
|
|
49552
51088
|
serialization: "bytemuck",
|
|
49553
|
-
repr: {
|
|
51089
|
+
repr: {
|
|
51090
|
+
kind: "c",
|
|
51091
|
+
packed: true
|
|
51092
|
+
},
|
|
49554
51093
|
type: {
|
|
49555
51094
|
kind: "struct",
|
|
49556
51095
|
fields: [
|
|
49557
|
-
{
|
|
49558
|
-
|
|
49559
|
-
|
|
49560
|
-
|
|
49561
|
-
{
|
|
49562
|
-
|
|
49563
|
-
|
|
49564
|
-
|
|
49565
|
-
{
|
|
49566
|
-
|
|
49567
|
-
|
|
49568
|
-
|
|
49569
|
-
{
|
|
49570
|
-
|
|
49571
|
-
|
|
49572
|
-
|
|
49573
|
-
{
|
|
51096
|
+
{
|
|
51097
|
+
name: "mint",
|
|
51098
|
+
type: "pubkey"
|
|
51099
|
+
},
|
|
51100
|
+
{
|
|
51101
|
+
name: "vault",
|
|
51102
|
+
type: "pubkey"
|
|
51103
|
+
},
|
|
51104
|
+
{
|
|
51105
|
+
name: "borrow_rate",
|
|
51106
|
+
type: "u16"
|
|
51107
|
+
},
|
|
51108
|
+
{
|
|
51109
|
+
name: "fee_on_interest",
|
|
51110
|
+
type: "u16"
|
|
51111
|
+
},
|
|
51112
|
+
{
|
|
51113
|
+
name: "last_utilization",
|
|
51114
|
+
type: "u16"
|
|
51115
|
+
},
|
|
51116
|
+
{
|
|
51117
|
+
name: "last_update_timestamp",
|
|
51118
|
+
type: "u64"
|
|
51119
|
+
},
|
|
51120
|
+
{
|
|
51121
|
+
name: "supply_exchange_price",
|
|
51122
|
+
type: "u64"
|
|
51123
|
+
},
|
|
51124
|
+
{
|
|
51125
|
+
name: "borrow_exchange_price",
|
|
51126
|
+
type: "u64"
|
|
51127
|
+
},
|
|
51128
|
+
{
|
|
51129
|
+
name: "max_utilization",
|
|
51130
|
+
type: "u16"
|
|
51131
|
+
},
|
|
51132
|
+
{
|
|
51133
|
+
name: "total_supply_with_interest",
|
|
51134
|
+
type: "u64"
|
|
51135
|
+
},
|
|
51136
|
+
{
|
|
51137
|
+
name: "total_supply_interest_free",
|
|
51138
|
+
type: "u64"
|
|
51139
|
+
},
|
|
51140
|
+
{
|
|
51141
|
+
name: "total_borrow_with_interest",
|
|
51142
|
+
type: "u64"
|
|
51143
|
+
},
|
|
51144
|
+
{
|
|
51145
|
+
name: "total_borrow_interest_free",
|
|
51146
|
+
type: "u64"
|
|
51147
|
+
},
|
|
51148
|
+
{
|
|
51149
|
+
name: "total_claim_amount",
|
|
51150
|
+
type: "u64"
|
|
51151
|
+
},
|
|
51152
|
+
{
|
|
51153
|
+
name: "interacting_protocol",
|
|
51154
|
+
type: "pubkey"
|
|
51155
|
+
},
|
|
51156
|
+
{
|
|
51157
|
+
name: "interacting_timestamp",
|
|
51158
|
+
type: "u64"
|
|
51159
|
+
},
|
|
51160
|
+
{
|
|
51161
|
+
name: "interacting_balance",
|
|
51162
|
+
type: "u64"
|
|
51163
|
+
}
|
|
49574
51164
|
]
|
|
49575
51165
|
}
|
|
49576
51166
|
},
|
|
49577
51167
|
{
|
|
49578
51168
|
name: "UserSupplyPosition",
|
|
51169
|
+
docs: ["User supply position"],
|
|
49579
51170
|
serialization: "bytemuck",
|
|
49580
|
-
repr: {
|
|
51171
|
+
repr: {
|
|
51172
|
+
kind: "c",
|
|
51173
|
+
packed: true
|
|
51174
|
+
},
|
|
49581
51175
|
type: {
|
|
49582
51176
|
kind: "struct",
|
|
49583
51177
|
fields: [
|
|
49584
|
-
{
|
|
49585
|
-
|
|
49586
|
-
|
|
49587
|
-
|
|
49588
|
-
{
|
|
49589
|
-
|
|
49590
|
-
|
|
49591
|
-
|
|
49592
|
-
{
|
|
49593
|
-
|
|
51178
|
+
{
|
|
51179
|
+
name: "protocol",
|
|
51180
|
+
type: "pubkey"
|
|
51181
|
+
},
|
|
51182
|
+
{
|
|
51183
|
+
name: "mint",
|
|
51184
|
+
type: "pubkey"
|
|
51185
|
+
},
|
|
51186
|
+
{
|
|
51187
|
+
name: "with_interest",
|
|
51188
|
+
type: "u8"
|
|
51189
|
+
},
|
|
51190
|
+
{
|
|
51191
|
+
name: "amount",
|
|
51192
|
+
type: "u64"
|
|
51193
|
+
},
|
|
51194
|
+
{
|
|
51195
|
+
name: "withdrawal_limit",
|
|
51196
|
+
type: "u64"
|
|
51197
|
+
},
|
|
51198
|
+
{
|
|
51199
|
+
name: "decay_amount",
|
|
51200
|
+
type: "u64"
|
|
51201
|
+
},
|
|
51202
|
+
{
|
|
51203
|
+
name: "last_update",
|
|
51204
|
+
type: "u64"
|
|
51205
|
+
},
|
|
51206
|
+
{
|
|
51207
|
+
name: "expand_pct",
|
|
51208
|
+
type: "u16"
|
|
51209
|
+
},
|
|
51210
|
+
{
|
|
51211
|
+
name: "expand_duration",
|
|
51212
|
+
type: "u32"
|
|
51213
|
+
},
|
|
51214
|
+
{
|
|
51215
|
+
name: "decay_duration",
|
|
51216
|
+
type: "u32"
|
|
51217
|
+
},
|
|
51218
|
+
{
|
|
51219
|
+
name: "base_withdrawal_limit",
|
|
51220
|
+
type: "u64"
|
|
51221
|
+
},
|
|
51222
|
+
{
|
|
51223
|
+
name: "status",
|
|
51224
|
+
type: "u8"
|
|
51225
|
+
}
|
|
49594
51226
|
]
|
|
49595
51227
|
}
|
|
49596
51228
|
}
|
|
@@ -73888,6 +75520,20 @@ var MarginfiAccount = class _MarginfiAccount {
|
|
|
73888
75520
|
...params
|
|
73889
75521
|
});
|
|
73890
75522
|
}
|
|
75523
|
+
/**
|
|
75524
|
+
* Calculates the maximum amount that can be deposited into a bank.
|
|
75525
|
+
*
|
|
75526
|
+
* Deposits are not constrained by account health, only by the bank's remaining deposit cap
|
|
75527
|
+
* and (optionally) the wallet balance.
|
|
75528
|
+
*
|
|
75529
|
+
* @param params - Configuration for max deposit computation
|
|
75530
|
+
* @returns Maximum depositable amount in UI units
|
|
75531
|
+
*
|
|
75532
|
+
* @see {@link computeMaxDepositForBank} for implementation details
|
|
75533
|
+
*/
|
|
75534
|
+
computeMaxDepositForBank(params) {
|
|
75535
|
+
return computeMaxDepositForBank(params);
|
|
75536
|
+
}
|
|
73891
75537
|
/**
|
|
73892
75538
|
* Gets the banks required for health check calculations.
|
|
73893
75539
|
*
|
|
@@ -77747,7 +79393,9 @@ function computeMaxBorrowForBank(params) {
|
|
|
77747
79393
|
assetShareValueMultiplierByBank,
|
|
77748
79394
|
emodeImpactStatus,
|
|
77749
79395
|
volatilityFactor,
|
|
77750
|
-
activePair
|
|
79396
|
+
activePair,
|
|
79397
|
+
groupRateLimiter,
|
|
79398
|
+
ignoreBankLimits
|
|
77751
79399
|
} = params;
|
|
77752
79400
|
const bank = banksMap.get(bankAddress.toBase58());
|
|
77753
79401
|
if (!bank) throw Error(`Bank ${bankAddress.toBase58()} not found`);
|
|
@@ -77807,15 +79455,83 @@ function computeMaxBorrowForBank(params) {
|
|
|
77807
79455
|
assetShareValueMultiplier
|
|
77808
79456
|
});
|
|
77809
79457
|
const liabWeight = getLiabilityWeight(bank.config, 0 /* Initial */);
|
|
77810
|
-
|
|
77811
|
-
|
|
77812
|
-
|
|
77813
|
-
|
|
77814
|
-
|
|
77815
|
-
|
|
79458
|
+
const originationFeeFactor = new BigNumber3__default.default(1).plus(
|
|
79459
|
+
bank.config.interestRateConfig.protocolOriginationFee
|
|
79460
|
+
);
|
|
79461
|
+
const liabPriceWeighted = priceHighestBias.times(liabWeight).times(originationFeeFactor);
|
|
79462
|
+
const healthMaxBorrow = assetWeight.eq(0) ? computeQuantityUi(balance, bank, assetShareValueMultiplier).assets.plus(
|
|
79463
|
+
freeCollateral.minus(untiedCollateralForBank).div(liabPriceWeighted)
|
|
79464
|
+
) : untiedCollateralForBank.div(priceLowestBias.times(assetWeight)).plus(freeCollateral.minus(untiedCollateralForBank).div(liabPriceWeighted));
|
|
79465
|
+
if (ignoreBankLimits) return healthMaxBorrow;
|
|
79466
|
+
const borrowCapRemaining = new BigNumber3__default.default(computeBankBorrowCapRemaining(bank)).div(
|
|
79467
|
+
originationFeeFactor
|
|
79468
|
+
);
|
|
79469
|
+
const availableLiquidity = computeBankProjectedAvailableLiquidity(
|
|
79470
|
+
bank,
|
|
79471
|
+
assetShareValueMultiplier
|
|
79472
|
+
).div(originationFeeFactor);
|
|
79473
|
+
const rateLimitRemaining = computeOutflowRateLimitRemaining(
|
|
79474
|
+
bank,
|
|
79475
|
+
oraclePrice,
|
|
79476
|
+
groupRateLimiter,
|
|
79477
|
+
assetShareValueMultiplier
|
|
79478
|
+
);
|
|
79479
|
+
return BigNumber3__default.default.max(
|
|
79480
|
+
0,
|
|
79481
|
+
BigNumber3__default.default.min(healthMaxBorrow, borrowCapRemaining, availableLiquidity, rateLimitRemaining)
|
|
79482
|
+
);
|
|
79483
|
+
}
|
|
79484
|
+
function computeOutflowRateLimitRemaining(bank, oraclePrice, groupRateLimiter, assetShareValueMultiplier) {
|
|
79485
|
+
const nowSeconds = Date.now() / 1e3;
|
|
79486
|
+
let remaining = new BigNumber3__default.default(Infinity);
|
|
79487
|
+
let bankRemaining = computeBankRateLimitRemaining(bank, nowSeconds);
|
|
79488
|
+
if (bankRemaining !== null) {
|
|
79489
|
+
const limiterInBankMintUnits = bank.config.assetTag === 3 /* KAMINO */ || bank.config.assetTag === 2 /* STAKED */;
|
|
79490
|
+
if (limiterInBankMintUnits && assetShareValueMultiplier?.gt(0)) {
|
|
79491
|
+
bankRemaining = bankRemaining.times(assetShareValueMultiplier);
|
|
79492
|
+
}
|
|
79493
|
+
remaining = BigNumber3__default.default.min(remaining, bankRemaining);
|
|
77816
79494
|
}
|
|
79495
|
+
const groupRemainingUsd = computeGroupRateLimitRemainingUsd(groupRateLimiter, nowSeconds);
|
|
79496
|
+
if (groupRemainingUsd !== null) {
|
|
79497
|
+
const price = getPrice(oraclePrice, 1 /* None */, false);
|
|
79498
|
+
if (price.gt(0)) remaining = BigNumber3__default.default.min(remaining, groupRemainingUsd.div(price));
|
|
79499
|
+
}
|
|
79500
|
+
return remaining;
|
|
77817
79501
|
}
|
|
77818
79502
|
function computeMaxWithdrawForBank(params) {
|
|
79503
|
+
const {
|
|
79504
|
+
banksMap,
|
|
79505
|
+
bankAddress,
|
|
79506
|
+
oraclePricesByBank,
|
|
79507
|
+
assetShareValueMultiplierByBank,
|
|
79508
|
+
groupRateLimiter,
|
|
79509
|
+
venueStates,
|
|
79510
|
+
ignoreBankLimits
|
|
79511
|
+
} = params;
|
|
79512
|
+
const bank = banksMap.get(bankAddress.toBase58());
|
|
79513
|
+
if (!bank) throw Error(`Bank ${bankAddress.toBase58()} not found`);
|
|
79514
|
+
const healthMaxWithdraw = computeHealthMaxWithdrawForBank(params);
|
|
79515
|
+
if (ignoreBankLimits) return healthMaxWithdraw;
|
|
79516
|
+
const oraclePrice = oraclePricesByBank.get(bankAddress.toBase58());
|
|
79517
|
+
if (!oraclePrice) throw Error(`Oracle price for ${bankAddress.toBase58()} not found`);
|
|
79518
|
+
const assetShareValueMultiplier = assetShareValueMultiplierByBank?.get(bankAddress.toBase58());
|
|
79519
|
+
const availableLiquidity = computeBankProjectedAvailableLiquidity(
|
|
79520
|
+
bank,
|
|
79521
|
+
assetShareValueMultiplier
|
|
79522
|
+
);
|
|
79523
|
+
const rateLimitRemaining = computeOutflowRateLimitRemaining(
|
|
79524
|
+
bank,
|
|
79525
|
+
oraclePrice,
|
|
79526
|
+
groupRateLimiter,
|
|
79527
|
+
assetShareValueMultiplier
|
|
79528
|
+
);
|
|
79529
|
+
const clamps = [healthMaxWithdraw, availableLiquidity, rateLimitRemaining];
|
|
79530
|
+
const venueLiquidity = computeVenueAvailableLiquidity(bank, venueStates);
|
|
79531
|
+
if (venueLiquidity !== void 0) clamps.push(venueLiquidity);
|
|
79532
|
+
return BigNumber3__default.default.max(0, BigNumber3__default.default.min(...clamps));
|
|
79533
|
+
}
|
|
79534
|
+
function computeHealthMaxWithdrawForBank(params) {
|
|
77819
79535
|
const {
|
|
77820
79536
|
account,
|
|
77821
79537
|
banksMap,
|
|
@@ -77911,6 +79627,17 @@ function computeMaxWithdrawForBank(params) {
|
|
|
77911
79627
|
const maxWithdraw = initUntiedCollateralForBank.div(initWeightedPrice);
|
|
77912
79628
|
return maxWithdraw;
|
|
77913
79629
|
}
|
|
79630
|
+
function computeMaxDepositForBank(params) {
|
|
79631
|
+
const { banksMap, bankAddress, assetShareValueMultiplierByBank, walletBalance } = params;
|
|
79632
|
+
const bank = banksMap.get(bankAddress.toBase58());
|
|
79633
|
+
if (!bank) throw Error(`Bank ${bankAddress.toBase58()} not found`);
|
|
79634
|
+
const assetShareValueMultiplier = assetShareValueMultiplierByBank?.get(bankAddress.toBase58());
|
|
79635
|
+
const depositCapRemaining = new BigNumber3__default.default(computeBankDepositCapRemaining(bank)).times(
|
|
79636
|
+
assetShareValueMultiplier ?? 1
|
|
79637
|
+
);
|
|
79638
|
+
if (walletBalance === void 0) return depositCapRemaining;
|
|
79639
|
+
return BigNumber3__default.default.max(0, BigNumber3__default.default.min(depositCapRemaining, new BigNumber3__default.default(walletBalance)));
|
|
79640
|
+
}
|
|
77914
79641
|
|
|
77915
79642
|
// src/services/account/utils/misc.utils.ts
|
|
77916
79643
|
function floor(value, decimals) {
|
|
@@ -79583,6 +81310,21 @@ var fetchMultipleBanks = async (program, opts) => {
|
|
|
79583
81310
|
}
|
|
79584
81311
|
return bankDatas;
|
|
79585
81312
|
};
|
|
81313
|
+
var U64_MAX = new BigNumber3__default.default("18446744073709551615");
|
|
81314
|
+
var DRIFT_SCALED_BALANCE_DECIMALS = 9;
|
|
81315
|
+
function isDepositLimitActive(bank) {
|
|
81316
|
+
return !bank.config.depositLimit.eq(U64_MAX);
|
|
81317
|
+
}
|
|
81318
|
+
function isBorrowLimitActive(bank) {
|
|
81319
|
+
return !bank.config.borrowLimit.eq(U64_MAX);
|
|
81320
|
+
}
|
|
81321
|
+
function getEffectiveDepositLimit(bank) {
|
|
81322
|
+
const limit = bank.config.depositLimit;
|
|
81323
|
+
if (bank.config.assetTag !== 4 /* DRIFT */) return limit;
|
|
81324
|
+
const diff = DRIFT_SCALED_BALANCE_DECIMALS - bank.mintDecimals;
|
|
81325
|
+
if (diff === 0) return limit;
|
|
81326
|
+
return diff > 0 ? limit.times(10 ** diff) : limit.div(10 ** -diff);
|
|
81327
|
+
}
|
|
79586
81328
|
function computeInterestRates(bank) {
|
|
79587
81329
|
const { insuranceFeeFixedApr, insuranceIrFee, protocolFixedFeeApr, protocolIrFee } = bank.config.interestRateConfig;
|
|
79588
81330
|
const fixedFee = insuranceFeeFixedApr.plus(protocolFixedFeeApr);
|
|
@@ -79677,25 +81419,34 @@ function computeUtilizationRate(bank) {
|
|
|
79677
81419
|
return liabilities.div(assets);
|
|
79678
81420
|
}
|
|
79679
81421
|
var SECONDS_PER_DAY = 24 * 60 * 60;
|
|
79680
|
-
var SECONDS_PER_YEAR = SECONDS_PER_DAY * 365
|
|
81422
|
+
var SECONDS_PER_YEAR = SECONDS_PER_DAY * 365;
|
|
81423
|
+
var EXECUTION_HEADROOM_SECONDS = 120;
|
|
81424
|
+
function computeAccrualProjectionSeconds(bank, nowSeconds = Date.now() / 1e3) {
|
|
81425
|
+
const age = Math.max(0, nowSeconds - bank.lastUpdate);
|
|
81426
|
+
return Math.max(2 * age, age + EXECUTION_HEADROOM_SECONDS);
|
|
81427
|
+
}
|
|
79681
81428
|
function computeRemainingCapacity(bank) {
|
|
79682
81429
|
const totalDeposits = getTotalAssetQuantity(bank);
|
|
79683
|
-
const remainingCapacity = BigNumber3__default.default.max(
|
|
81430
|
+
const remainingCapacity = isDepositLimitActive(bank) ? BigNumber3__default.default.max(
|
|
81431
|
+
0,
|
|
81432
|
+
getEffectiveDepositLimit(bank).minus(totalDeposits).minus(1).integerValue(BigNumber3__default.default.ROUND_FLOOR)
|
|
81433
|
+
) : U64_MAX;
|
|
79684
81434
|
const totalBorrows = getTotalLiabilityQuantity(bank);
|
|
79685
|
-
const remainingBorrowCapacity = BigNumber3__default.default.max(
|
|
79686
|
-
|
|
81435
|
+
const remainingBorrowCapacity = isBorrowLimitActive(bank) ? BigNumber3__default.default.max(
|
|
81436
|
+
0,
|
|
81437
|
+
bank.config.borrowLimit.minus(totalBorrows).minus(1).integerValue(BigNumber3__default.default.ROUND_FLOOR)
|
|
81438
|
+
) : U64_MAX;
|
|
81439
|
+
const projectionSeconds = computeAccrualProjectionSeconds(bank);
|
|
79687
81440
|
const { lendingRate, borrowingRate } = computeInterestRates(bank);
|
|
79688
|
-
const
|
|
79689
|
-
const
|
|
79690
|
-
const depositCapacity = remainingCapacity.minus(
|
|
79691
|
-
const borrowCapacity = remainingBorrowCapacity.minus(
|
|
81441
|
+
const projectedLendingInterest = lendingRate.times(projectionSeconds).dividedBy(SECONDS_PER_YEAR).times(totalDeposits);
|
|
81442
|
+
const projectedBorrowInterest = borrowingRate.times(projectionSeconds).dividedBy(SECONDS_PER_YEAR).times(totalBorrows);
|
|
81443
|
+
const depositCapacity = remainingCapacity.minus(projectedLendingInterest);
|
|
81444
|
+
const borrowCapacity = remainingBorrowCapacity.minus(projectedBorrowInterest);
|
|
79692
81445
|
return {
|
|
79693
81446
|
depositCapacity,
|
|
79694
81447
|
borrowCapacity
|
|
79695
81448
|
};
|
|
79696
81449
|
}
|
|
79697
|
-
|
|
79698
|
-
// src/services/bank/utils/bank-metrics.utils.ts
|
|
79699
81450
|
function isStandardBorrowable(bank) {
|
|
79700
81451
|
const { assetTag, operationalState, borrowLimit } = bank.config;
|
|
79701
81452
|
return (assetTag === 0 /* DEFAULT */ || assetTag === 1 /* SOL */) && operationalState === "Operational" /* Operational */ && borrowLimit.gt(0);
|
|
@@ -79705,9 +81456,7 @@ function isStandardDepositable(bank) {
|
|
|
79705
81456
|
return (assetTag === 0 /* DEFAULT */ || assetTag === 1 /* SOL */) && operationalState === "Operational" /* Operational */;
|
|
79706
81457
|
}
|
|
79707
81458
|
function computeBankTotalDeposits(bank, assetShareValueMultiplier) {
|
|
79708
|
-
const totalAssets = getTotalAssetQuantity(bank).times(
|
|
79709
|
-
assetShareValueMultiplier ?? 1
|
|
79710
|
-
);
|
|
81459
|
+
const totalAssets = getTotalAssetQuantity(bank).times(assetShareValueMultiplier ?? 1);
|
|
79711
81460
|
return nativeToUi(totalAssets, bank.mintDecimals);
|
|
79712
81461
|
}
|
|
79713
81462
|
function computeBankTotalBorrows(bank) {
|
|
@@ -79738,14 +81487,35 @@ function computeBankPoolSize(bank, assetShareValueMultiplier) {
|
|
|
79738
81487
|
const borrowCap = nativeToUi(bank.config.borrowLimit, bank.mintDecimals);
|
|
79739
81488
|
return Math.max(0, Math.min(totalDeposits, borrowCap) - totalBorrows);
|
|
79740
81489
|
}
|
|
81490
|
+
function computeBankAvailableLiquidity(bank, assetShareValueMultiplier) {
|
|
81491
|
+
const totalDeposits = computeBankTotalDeposits(bank, assetShareValueMultiplier);
|
|
81492
|
+
const totalBorrows = computeBankTotalBorrows(bank);
|
|
81493
|
+
return BigNumber3__default.default.max(0, new BigNumber3__default.default(totalDeposits).minus(totalBorrows));
|
|
81494
|
+
}
|
|
79741
81495
|
function computeBankDepositCapRemaining(bank) {
|
|
81496
|
+
if (!isDepositLimitActive(bank)) return Infinity;
|
|
79742
81497
|
const { depositCapacity } = computeRemainingCapacity(bank);
|
|
79743
81498
|
return Math.max(0, nativeToUi(depositCapacity, bank.mintDecimals));
|
|
79744
81499
|
}
|
|
79745
81500
|
function computeBankBorrowCapRemaining(bank) {
|
|
81501
|
+
if (!isBorrowLimitActive(bank)) return Infinity;
|
|
79746
81502
|
const { borrowCapacity } = computeRemainingCapacity(bank);
|
|
79747
81503
|
return Math.max(0, nativeToUi(borrowCapacity, bank.mintDecimals));
|
|
79748
81504
|
}
|
|
81505
|
+
function computeBankProjectedAvailableLiquidity(bank, assetShareValueMultiplier) {
|
|
81506
|
+
const liquidity = computeBankAvailableLiquidity(bank, assetShareValueMultiplier);
|
|
81507
|
+
const totalDeposits = computeBankTotalDeposits(bank, assetShareValueMultiplier);
|
|
81508
|
+
const totalBorrows = computeBankTotalBorrows(bank);
|
|
81509
|
+
const projectionYears = computeAccrualProjectionSeconds(bank) / SECONDS_PER_YEAR;
|
|
81510
|
+
const { lendingRate, borrowingRate } = computeInterestRates(bank);
|
|
81511
|
+
const projectedBorrowInterest = borrowingRate.times(totalBorrows).times(projectionYears);
|
|
81512
|
+
const projectedLendingInterest = lendingRate.times(totalDeposits).times(projectionYears);
|
|
81513
|
+
const liquidityLostToAccrual = BigNumber3__default.default.max(
|
|
81514
|
+
0,
|
|
81515
|
+
projectedBorrowInterest.minus(projectedLendingInterest)
|
|
81516
|
+
);
|
|
81517
|
+
return BigNumber3__default.default.max(0, liquidity.minus(liquidityLostToAccrual));
|
|
81518
|
+
}
|
|
79749
81519
|
function computeBankSupplyApy(bank) {
|
|
79750
81520
|
return aprToApy(computeInterestRates(bank).lendingRate.toNumber());
|
|
79751
81521
|
}
|
|
@@ -79758,11 +81528,7 @@ function computeBankMetrics(params) {
|
|
|
79758
81528
|
symbol,
|
|
79759
81529
|
totalDeposits: computeBankTotalDeposits(bank, assetShareValueMultiplier),
|
|
79760
81530
|
totalBorrows: computeBankTotalBorrows(bank),
|
|
79761
|
-
totalDepositsUsd: computeBankTotalDepositsUsd(
|
|
79762
|
-
bank,
|
|
79763
|
-
oraclePrice,
|
|
79764
|
-
assetShareValueMultiplier
|
|
79765
|
-
),
|
|
81531
|
+
totalDepositsUsd: computeBankTotalDepositsUsd(bank, oraclePrice, assetShareValueMultiplier),
|
|
79766
81532
|
totalBorrowsUsd: computeBankTotalBorrowsUsd(bank, oraclePrice),
|
|
79767
81533
|
utilizationRate: computeUtilizationRate(bank).toNumber(),
|
|
79768
81534
|
poolSize: computeBankPoolSize(bank, assetShareValueMultiplier),
|
|
@@ -79790,6 +81556,92 @@ function requireTokenProgram(tokenProgramsByBank, address, makeError = (message)
|
|
|
79790
81556
|
}
|
|
79791
81557
|
return tokenProgram;
|
|
79792
81558
|
}
|
|
81559
|
+
function computeRateLimitWindowRemainingCapacity(window, nowSeconds) {
|
|
81560
|
+
const { maxOutflow, windowDuration } = window;
|
|
81561
|
+
if (maxOutflow.lte(0)) return null;
|
|
81562
|
+
if (windowDuration === 0) return maxOutflow;
|
|
81563
|
+
let { windowStart, prevWindowOutflow, curWindowOutflow } = window;
|
|
81564
|
+
const elapsedRaw = Math.floor(nowSeconds) - windowStart;
|
|
81565
|
+
if (elapsedRaw >= windowDuration * 2) {
|
|
81566
|
+
windowStart = Math.floor(nowSeconds);
|
|
81567
|
+
prevWindowOutflow = new BigNumber3__default.default(0);
|
|
81568
|
+
curWindowOutflow = new BigNumber3__default.default(0);
|
|
81569
|
+
} else if (elapsedRaw >= windowDuration) {
|
|
81570
|
+
windowStart = windowStart + windowDuration;
|
|
81571
|
+
prevWindowOutflow = curWindowOutflow;
|
|
81572
|
+
curWindowOutflow = new BigNumber3__default.default(0);
|
|
81573
|
+
}
|
|
81574
|
+
const elapsed = Math.floor(nowSeconds) - windowStart;
|
|
81575
|
+
if (elapsed < 0) return new BigNumber3__default.default(0);
|
|
81576
|
+
if (elapsed >= windowDuration) return maxOutflow;
|
|
81577
|
+
const remainingTime = windowDuration - elapsed;
|
|
81578
|
+
const weightedPrev = prevWindowOutflow.abs().times(remainingTime).idiv(windowDuration).times(prevWindowOutflow.isNegative() ? -1 : 1);
|
|
81579
|
+
const totalNetOutflow = weightedPrev.plus(curWindowOutflow);
|
|
81580
|
+
return maxOutflow.minus(totalNetOutflow);
|
|
81581
|
+
}
|
|
81582
|
+
function computeRateLimiterRemainingCapacity(rateLimiter, nowSeconds) {
|
|
81583
|
+
if (!rateLimiter) return null;
|
|
81584
|
+
const hourly = computeRateLimitWindowRemainingCapacity(rateLimiter.hourly, nowSeconds);
|
|
81585
|
+
const daily = computeRateLimitWindowRemainingCapacity(rateLimiter.daily, nowSeconds);
|
|
81586
|
+
if (hourly === null) return daily;
|
|
81587
|
+
if (daily === null) return hourly;
|
|
81588
|
+
return BigNumber3__default.default.min(hourly, daily);
|
|
81589
|
+
}
|
|
81590
|
+
function computeBankRateLimitRemaining(bank, nowSeconds = Date.now() / 1e3) {
|
|
81591
|
+
const remaining = computeRateLimiterRemainingCapacity(bank.rateLimiter, nowSeconds);
|
|
81592
|
+
if (remaining === null) return null;
|
|
81593
|
+
return BigNumber3__default.default.max(0, nativeToUi(remaining, bank.mintDecimals));
|
|
81594
|
+
}
|
|
81595
|
+
function computeGroupRateLimitRemainingUsd(rateLimiter, nowSeconds = Date.now() / 1e3) {
|
|
81596
|
+
const remaining = computeRateLimiterRemainingCapacity(rateLimiter, nowSeconds);
|
|
81597
|
+
if (remaining === null) return null;
|
|
81598
|
+
return BigNumber3__default.default.max(0, remaining);
|
|
81599
|
+
}
|
|
81600
|
+
var VENUE_AVAILABLE_LIQUIDITY_BUFFER = 0.995;
|
|
81601
|
+
function computeVenueAvailableLiquidity(bank, venueStates) {
|
|
81602
|
+
const decimals = bank.mintDecimals;
|
|
81603
|
+
switch (bank.config.assetTag) {
|
|
81604
|
+
case 3 /* KAMINO */: {
|
|
81605
|
+
const reserveState = venueStates?.kaminoStates?.reserveState;
|
|
81606
|
+
if (!reserveState) return void 0;
|
|
81607
|
+
return new BigNumber3__default.default(
|
|
81608
|
+
nativeToUi(reserveState.liquidity.availableAmount.toString(), decimals)
|
|
81609
|
+
).times(VENUE_AVAILABLE_LIQUIDITY_BUFFER);
|
|
81610
|
+
}
|
|
81611
|
+
case 4 /* DRIFT */: {
|
|
81612
|
+
const spotMarketState = venueStates?.driftStates?.spotMarketState;
|
|
81613
|
+
if (!spotMarketState) return void 0;
|
|
81614
|
+
const deposits = getDriftTokenAmount(
|
|
81615
|
+
spotMarketState.depositBalance,
|
|
81616
|
+
spotMarketState,
|
|
81617
|
+
"deposit" /* DEPOSIT */
|
|
81618
|
+
);
|
|
81619
|
+
const borrows = getDriftTokenAmount(
|
|
81620
|
+
spotMarketState.borrowBalance,
|
|
81621
|
+
spotMarketState,
|
|
81622
|
+
"borrow" /* BORROW */
|
|
81623
|
+
);
|
|
81624
|
+
const idle = deposits.sub(borrows);
|
|
81625
|
+
return new BigNumber3__default.default(nativeToUi(idle.isNeg() ? "0" : idle.toString(), decimals)).times(
|
|
81626
|
+
VENUE_AVAILABLE_LIQUIDITY_BUFFER
|
|
81627
|
+
);
|
|
81628
|
+
}
|
|
81629
|
+
case 6 /* JUPLEND */: {
|
|
81630
|
+
const reserveState = venueStates?.jupLendStates?.jupTokenReserveState;
|
|
81631
|
+
if (!reserveState) return void 0;
|
|
81632
|
+
const supplyWithInterestNative = reserveState.totalSupplyWithInterest.mul(reserveState.supplyExchangePrice).div(JUP_EXCHANGE_PRICES_PRECISION);
|
|
81633
|
+
const borrowWithInterestNative = reserveState.totalBorrowWithInterest.mul(reserveState.borrowExchangePrice).div(JUP_EXCHANGE_PRICES_PRECISION);
|
|
81634
|
+
const totalSupply = supplyWithInterestNative.add(reserveState.totalSupplyInterestFree);
|
|
81635
|
+
const totalBorrow = borrowWithInterestNative.add(reserveState.totalBorrowInterestFree);
|
|
81636
|
+
const idle = totalSupply.sub(totalBorrow);
|
|
81637
|
+
return new BigNumber3__default.default(nativeToUi(idle.isNeg() ? "0" : idle.toString(), decimals)).times(
|
|
81638
|
+
VENUE_AVAILABLE_LIQUIDITY_BUFFER
|
|
81639
|
+
);
|
|
81640
|
+
}
|
|
81641
|
+
default:
|
|
81642
|
+
return void 0;
|
|
81643
|
+
}
|
|
81644
|
+
}
|
|
79793
81645
|
|
|
79794
81646
|
// src/services/bank/bank.service.ts
|
|
79795
81647
|
async function freezeBankConfigIx(program, bankAddress, bankConfigOpt) {
|
|
@@ -82614,7 +84466,9 @@ var MarginfiAccountWrapper = class {
|
|
|
82614
84466
|
assetShareValueMultiplierByBank: this.client.assetShareValueMultiplierByBank,
|
|
82615
84467
|
emodeImpactStatus: borrowImpact?.status,
|
|
82616
84468
|
activePair: borrowImpact?.activePair,
|
|
82617
|
-
volatilityFactor: opts?.volatilityFactor
|
|
84469
|
+
volatilityFactor: opts?.volatilityFactor,
|
|
84470
|
+
groupRateLimiter: this.client.group.rateLimiter,
|
|
84471
|
+
ignoreBankLimits: opts?.ignoreBankLimits
|
|
82618
84472
|
});
|
|
82619
84473
|
}
|
|
82620
84474
|
/**
|
|
@@ -82632,7 +84486,26 @@ var MarginfiAccountWrapper = class {
|
|
|
82632
84486
|
bankAddress,
|
|
82633
84487
|
assetShareValueMultiplierByBank: this.client.assetShareValueMultiplierByBank,
|
|
82634
84488
|
activePair,
|
|
82635
|
-
volatilityFactor: opts?.volatilityFactor
|
|
84489
|
+
volatilityFactor: opts?.volatilityFactor,
|
|
84490
|
+
groupRateLimiter: this.client.group.rateLimiter,
|
|
84491
|
+
venueStates: this.client.bankIntegrationMap[bankAddress.toBase58()],
|
|
84492
|
+
ignoreBankLimits: opts?.ignoreBankLimits
|
|
84493
|
+
});
|
|
84494
|
+
}
|
|
84495
|
+
/**
|
|
84496
|
+
* Computes max deposit for a bank with auto-injected client data.
|
|
84497
|
+
*
|
|
84498
|
+
* Bounded by the bank's remaining deposit cap and, if provided, the wallet balance.
|
|
84499
|
+
*
|
|
84500
|
+
* @param bankAddress - Bank address to check max deposit for
|
|
84501
|
+
* @param opts - Optional wallet balance (UI units) to cap the result
|
|
84502
|
+
*/
|
|
84503
|
+
computeMaxDepositForBank(bankAddress, opts) {
|
|
84504
|
+
return this.account.computeMaxDepositForBank({
|
|
84505
|
+
banksMap: this.client.bankMap,
|
|
84506
|
+
bankAddress,
|
|
84507
|
+
assetShareValueMultiplierByBank: this.client.assetShareValueMultiplierByBank,
|
|
84508
|
+
walletBalance: opts?.walletBalance
|
|
82636
84509
|
});
|
|
82637
84510
|
}
|
|
82638
84511
|
/**
|
|
@@ -83065,6 +84938,7 @@ exports.DEFAULT_ORACLE_MAX_AGE = DEFAULT_ORACLE_MAX_AGE;
|
|
|
83065
84938
|
exports.DEFAULT_REPAY_ALL_EXTRA_BUFFER_BPS = DEFAULT_REPAY_ALL_EXTRA_BUFFER_BPS;
|
|
83066
84939
|
exports.DISABLED_FLAG = DISABLED_FLAG;
|
|
83067
84940
|
exports.EMPTY_HEALTH_CACHE = EMPTY_HEALTH_CACHE;
|
|
84941
|
+
exports.EXECUTION_HEADROOM_SECONDS = EXECUTION_HEADROOM_SECONDS;
|
|
83068
84942
|
exports.EmodeEntryFlags = EmodeEntryFlags;
|
|
83069
84943
|
exports.EmodeFlags = EmodeFlags;
|
|
83070
84944
|
exports.EmodeImpactStatus = EmodeImpactStatus;
|
|
@@ -83113,6 +84987,7 @@ exports.PYTH_SPONSORED_SHARD_ID = PYTH_SPONSORED_SHARD_ID;
|
|
|
83113
84987
|
exports.PriceBias = PriceBias;
|
|
83114
84988
|
exports.Project0Client = Project0Client;
|
|
83115
84989
|
exports.RiskTier = RiskTier;
|
|
84990
|
+
exports.SECONDS_PER_YEAR = SECONDS_PER_YEAR;
|
|
83116
84991
|
exports.SINGLE_POOL_PROGRAM_ID = SINGLE_POOL_PROGRAM_ID;
|
|
83117
84992
|
exports.STAKED_ORACLE_DISABLED_FLAG = STAKED_ORACLE_DISABLED_FLAG;
|
|
83118
84993
|
exports.STAKED_ORACLE_USES_ONRAMP_FLAG = STAKED_ORACLE_USES_ONRAMP_FLAG;
|
|
@@ -83131,9 +85006,11 @@ exports.TransactionBuildingError = TransactionBuildingError;
|
|
|
83131
85006
|
exports.TransactionBuildingErrorCode = TransactionBuildingErrorCode;
|
|
83132
85007
|
exports.TransactionConfigMap = TransactionConfigMap;
|
|
83133
85008
|
exports.TransactionType = TransactionType;
|
|
85009
|
+
exports.U64_MAX = U64_MAX;
|
|
83134
85010
|
exports.USDC_DECIMALS = USDC_DECIMALS;
|
|
83135
85011
|
exports.USDC_MINT = USDC_MINT;
|
|
83136
85012
|
exports.USDT_MINT = USDT_MINT;
|
|
85013
|
+
exports.VENUE_AVAILABLE_LIQUIDITY_BUFFER = VENUE_AVAILABLE_LIQUIDITY_BUFFER;
|
|
83137
85014
|
exports.WSOL_MINT = WSOL_MINT;
|
|
83138
85015
|
exports.ZERO_ORACLE_KEY = ZERO_ORACLE_KEY;
|
|
83139
85016
|
exports.accountConflictsWithBridgeBank = accountConflictsWithBridgeBank;
|
|
@@ -83169,15 +85046,19 @@ exports.compileFlashloanPrecheck = compileFlashloanPrecheck;
|
|
|
83169
85046
|
exports.composeBridgedSwap = composeBridgedSwap;
|
|
83170
85047
|
exports.composeRemainingAccounts = composeRemainingAccounts;
|
|
83171
85048
|
exports.computeAccountValue = computeAccountValue;
|
|
85049
|
+
exports.computeAccrualProjectionSeconds = computeAccrualProjectionSeconds;
|
|
83172
85050
|
exports.computeActiveEmodePairs = computeActiveEmodePairs;
|
|
83173
85051
|
exports.computeAssetHealthComponent = computeAssetHealthComponent;
|
|
83174
85052
|
exports.computeAssetUsdValue = computeAssetUsdValue;
|
|
83175
85053
|
exports.computeBalanceUsdValue = computeBalanceUsdValue;
|
|
85054
|
+
exports.computeBankAvailableLiquidity = computeBankAvailableLiquidity;
|
|
83176
85055
|
exports.computeBankBorrowApy = computeBankBorrowApy;
|
|
83177
85056
|
exports.computeBankBorrowCapRemaining = computeBankBorrowCapRemaining;
|
|
83178
85057
|
exports.computeBankDepositCapRemaining = computeBankDepositCapRemaining;
|
|
83179
85058
|
exports.computeBankMetrics = computeBankMetrics;
|
|
83180
85059
|
exports.computeBankPoolSize = computeBankPoolSize;
|
|
85060
|
+
exports.computeBankProjectedAvailableLiquidity = computeBankProjectedAvailableLiquidity;
|
|
85061
|
+
exports.computeBankRateLimitRemaining = computeBankRateLimitRemaining;
|
|
83181
85062
|
exports.computeBankSupplyApy = computeBankSupplyApy;
|
|
83182
85063
|
exports.computeBankTotalBorrows = computeBankTotalBorrows;
|
|
83183
85064
|
exports.computeBankTotalBorrowsUsd = computeBankTotalBorrowsUsd;
|
|
@@ -83192,6 +85073,7 @@ exports.computeFlashLoanNonSwapBudget = computeFlashLoanNonSwapBudget;
|
|
|
83192
85073
|
exports.computeFlashloanSwapConstraints = computeFlashloanSwapConstraints;
|
|
83193
85074
|
exports.computeFreeCollateralFromBalances = computeFreeCollateralFromBalances;
|
|
83194
85075
|
exports.computeFreeCollateralFromCache = computeFreeCollateralFromCache;
|
|
85076
|
+
exports.computeGroupRateLimitRemainingUsd = computeGroupRateLimitRemainingUsd;
|
|
83195
85077
|
exports.computeHealthAccountMetas = computeHealthAccountMetas;
|
|
83196
85078
|
exports.computeHealthCacheStatus = computeHealthCacheStatus;
|
|
83197
85079
|
exports.computeHealthCheckAccounts = computeHealthCheckAccounts;
|
|
@@ -83204,6 +85086,7 @@ exports.computeLiquidationPriceForBank = computeLiquidationPriceForBank;
|
|
|
83204
85086
|
exports.computeLoopingParams = computeLoopingParams;
|
|
83205
85087
|
exports.computeLowestEmodeWeights = computeLowestEmodeWeights;
|
|
83206
85088
|
exports.computeMaxBorrowForBank = computeMaxBorrowForBank;
|
|
85089
|
+
exports.computeMaxDepositForBank = computeMaxDepositForBank;
|
|
83207
85090
|
exports.computeMaxLeverage = computeMaxLeverage;
|
|
83208
85091
|
exports.computeMaxWithdrawForBank = computeMaxWithdrawForBank;
|
|
83209
85092
|
exports.computeNetApy = computeNetApy;
|
|
@@ -83211,6 +85094,8 @@ exports.computeProjectedActiveBalancesNoCpi = computeProjectedActiveBalancesNoCp
|
|
|
83211
85094
|
exports.computeProjectedActiveBanksNoCpi = computeProjectedActiveBanksNoCpi;
|
|
83212
85095
|
exports.computeQuantity = computeQuantity;
|
|
83213
85096
|
exports.computeQuantityUi = computeQuantityUi;
|
|
85097
|
+
exports.computeRateLimitWindowRemainingCapacity = computeRateLimitWindowRemainingCapacity;
|
|
85098
|
+
exports.computeRateLimiterRemainingCapacity = computeRateLimiterRemainingCapacity;
|
|
83214
85099
|
exports.computeRemainingCapacity = computeRemainingCapacity;
|
|
83215
85100
|
exports.computeSmartCrank = computeSmartCrank;
|
|
83216
85101
|
exports.computeStakedBankMultipliers = computeStakedBankMultipliers;
|
|
@@ -83219,6 +85104,7 @@ exports.computeTvl = computeTvl;
|
|
|
83219
85104
|
exports.computeUsdValue = computeUsdValue;
|
|
83220
85105
|
exports.computeUtilizationRate = computeUtilizationRate;
|
|
83221
85106
|
exports.computeV0TxSize = computeV0TxSize;
|
|
85107
|
+
exports.computeVenueAvailableLiquidity = computeVenueAvailableLiquidity;
|
|
83222
85108
|
exports.convertVoteAccCoeffsToBankCoeffs = convertVoteAccCoeffsToBankCoeffs;
|
|
83223
85109
|
exports.createActiveEmodePairFromPairs = createActiveEmodePairFromPairs;
|
|
83224
85110
|
exports.createEmptyBalance = createEmptyBalance;
|
|
@@ -83304,6 +85190,7 @@ exports.getConfig = getConfig;
|
|
|
83304
85190
|
exports.getDriftCTokenMultiplier = getDriftCTokenMultiplier;
|
|
83305
85191
|
exports.getDriftMetadata = getDriftMetadata;
|
|
83306
85192
|
exports.getDriftStatesDto = getDriftStatesDto;
|
|
85193
|
+
exports.getEffectiveDepositLimit = getEffectiveDepositLimit;
|
|
83307
85194
|
exports.getEmodePairs = getEmodePairs;
|
|
83308
85195
|
exports.getExactOutEstimate = getExactOutEstimate;
|
|
83309
85196
|
exports.getFallbackPricesByFeedId = getFallbackPricesByFeedId;
|
|
@@ -83343,9 +85230,11 @@ exports.hasEmodeEntryFlag = hasEmodeEntryFlag;
|
|
|
83343
85230
|
exports.hasEmodeFlag = hasEmodeFlag;
|
|
83344
85231
|
exports.hasHealthCacheFlag = hasHealthCacheFlag;
|
|
83345
85232
|
exports.healthCacheToDto = healthCacheToDto;
|
|
85233
|
+
exports.isBorrowLimitActive = isBorrowLimitActive;
|
|
83346
85234
|
exports.isBridgeConflictError = isBridgeConflictError;
|
|
83347
85235
|
exports.isDecomposableSwapError = isDecomposableSwapError;
|
|
83348
85236
|
exports.isDepositIx = isDepositIx;
|
|
85237
|
+
exports.isDepositLimitActive = isDepositLimitActive;
|
|
83349
85238
|
exports.isFlashloan = isFlashloan;
|
|
83350
85239
|
exports.isGroupRateLimiterEnabled = isGroupRateLimiterEnabled;
|
|
83351
85240
|
exports.isMarginfiV0110Live = isMarginfiV0110Live;
|