@jup-ag/lend 0.2.0-beta.1 → 0.2.0-beta.3

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.
@@ -1,8 +1,11 @@
1
1
  import { PublicKey } from '@solana/web3.js';
2
2
  import { Program } from '@coral-xyz/anchor';
3
- import { ASSOCIATED_TOKEN_PROGRAM_ID, getAssociatedTokenAddressSync } from '@solana/spl-token';
3
+ import { getAssociatedTokenAddressSync, ASSOCIATED_TOKEN_PROGRAM_ID } from '@solana/spl-token';
4
+ import { r as getOracleSources } from '../shared/lend.CVtn-ehf.mjs';
4
5
  import { g as getLiquidityProgramId, a as getLiquidity, b as getUserBorrowPosition, c as getUserSupplyPosition, d as getRateModel, e as getReserve } from '../shared/lend.C3XdrR6R.mjs';
5
- import { g as getDex } from '../shared/lend.BC5Y1398.mjs';
6
+ import { g as getDex, a as getDexMetadata } from '../shared/lend.s0kjiHy3.mjs';
7
+ import 'bn.js';
8
+ import '../shared/lend.a53XYkl5.mjs';
6
9
 
7
10
  const address = "jupZ4m2GqUCJ5iueMfzQf8khFfH31d4XAQt3RzCT9Vd";
8
11
  const metadata = {
@@ -613,6 +616,36 @@ const instructions = [
613
616
  ]
614
617
  }
615
618
  },
619
+ {
620
+ name: "dex_metadata",
621
+ writable: true,
622
+ pda: {
623
+ seeds: [
624
+ {
625
+ kind: "const",
626
+ value: [
627
+ 100,
628
+ 101,
629
+ 120,
630
+ 95,
631
+ 109,
632
+ 101,
633
+ 116,
634
+ 97,
635
+ 100,
636
+ 97,
637
+ 116,
638
+ 97
639
+ ]
640
+ },
641
+ {
642
+ kind: "account",
643
+ path: "dex_admin.next_dex_id",
644
+ account: "DexAdmin"
645
+ }
646
+ ]
647
+ }
648
+ },
616
649
  {
617
650
  name: "token_0"
618
651
  },
@@ -691,6 +724,91 @@ const instructions = [
691
724
  }
692
725
  ]
693
726
  },
727
+ {
728
+ name: "init_dex_metadata",
729
+ discriminator: [
730
+ 114,
731
+ 167,
732
+ 144,
733
+ 220,
734
+ 143,
735
+ 73,
736
+ 224,
737
+ 8
738
+ ],
739
+ accounts: [
740
+ {
741
+ name: "authority",
742
+ writable: true,
743
+ signer: true
744
+ },
745
+ {
746
+ name: "dex_admin"
747
+ },
748
+ {
749
+ name: "dex",
750
+ pda: {
751
+ seeds: [
752
+ {
753
+ kind: "const",
754
+ value: [
755
+ 100,
756
+ 101,
757
+ 120
758
+ ]
759
+ },
760
+ {
761
+ kind: "arg",
762
+ path: "dex_id"
763
+ }
764
+ ]
765
+ }
766
+ },
767
+ {
768
+ name: "dex_metadata",
769
+ writable: true,
770
+ pda: {
771
+ seeds: [
772
+ {
773
+ kind: "const",
774
+ value: [
775
+ 100,
776
+ 101,
777
+ 120,
778
+ 95,
779
+ 109,
780
+ 101,
781
+ 116,
782
+ 97,
783
+ 100,
784
+ 97,
785
+ 116,
786
+ 97
787
+ ]
788
+ },
789
+ {
790
+ kind: "arg",
791
+ path: "dex_id"
792
+ }
793
+ ]
794
+ }
795
+ },
796
+ {
797
+ name: "system_program",
798
+ address: "11111111111111111111111111111111"
799
+ }
800
+ ],
801
+ args: [
802
+ {
803
+ name: "dex_id",
804
+ type: "u16"
805
+ },
806
+ {
807
+ name: "lookup_table",
808
+ type: "pubkey"
809
+ }
810
+ ]
811
+ },
694
812
  {
695
813
  name: "init_position",
696
814
  discriminator: [
@@ -2075,6 +2193,45 @@ const instructions = [
2075
2193
  }
2076
2194
  ]
2077
2195
  },
2196
+ {
2197
+ name: "update_dex_lookup_table",
2198
+ discriminator: [
2199
+ 87,
2200
+ 149,
2201
+ 96,
2202
+ 95,
2203
+ 24,
2204
+ 20,
2205
+ 211,
2206
+ 43
2207
+ ],
2208
+ accounts: [
2209
+ {
2210
+ name: "authority",
2211
+ signer: true
2212
+ },
2213
+ {
2214
+ name: "dex_admin"
2215
+ },
2216
+ {
2217
+ name: "dex_metadata",
2218
+ docs: [
2219
+ "@dev Verification inside instruction logic"
2220
+ ],
2221
+ writable: true
2222
+ }
2223
+ ],
2224
+ args: [
2225
+ {
2226
+ name: "dex_id",
2227
+ type: "u16"
2228
+ },
2229
+ {
2230
+ name: "lookup_table",
2231
+ type: "pubkey"
2232
+ }
2233
+ ]
2234
+ },
2078
2235
  {
2079
2236
  name: "update_fee_and_revenue_cut",
2080
2237
  discriminator: [
@@ -2855,6 +3012,19 @@ const accounts = [
2855
3012
  155
2856
3013
  ]
2857
3014
  },
3015
+ {
3016
+ name: "DexMetadata",
3017
+ discriminator: [
3018
+ 177,
3019
+ 231,
3020
+ 57,
3021
+ 253,
3022
+ 64,
3023
+ 12,
3024
+ 205,
3025
+ 37
3026
+ ]
3027
+ },
2858
3028
  {
2859
3029
  name: "DexPosition",
2860
3030
  discriminator: [
@@ -2987,6 +3157,19 @@ const events = [
2987
3157
  132
2988
3158
  ]
2989
3159
  },
3160
+ {
3161
+ name: "LogInitDexMetadata",
3162
+ discriminator: [
3163
+ 53,
3164
+ 61,
3165
+ 248,
3166
+ 111,
3167
+ 245,
3168
+ 219,
3169
+ 167,
3170
+ 73
3171
+ ]
3172
+ },
2990
3173
  {
2991
3174
  name: "LogInitDexPriceParams",
2992
3175
  discriminator: [
@@ -3208,6 +3391,19 @@ const events = [
3208
3391
  17
3209
3392
  ]
3210
3393
  },
3394
+ {
3395
+ name: "LogUpdateDexLookupTable",
3396
+ discriminator: [
3397
+ 135,
3398
+ 31,
3399
+ 232,
3400
+ 96,
3401
+ 2,
3402
+ 64,
3403
+ 116,
3404
+ 229
3405
+ ]
3406
+ },
3211
3407
  {
3212
3408
  name: "LogUpdateFeeAndRevenueCut",
3213
3409
  discriminator: [
@@ -3780,6 +3976,11 @@ const errors = [
3780
3976
  code: 6082,
3781
3977
  name: "DexSwapOutResult",
3782
3978
  msg: "DEX_SWAP_OUT_RESULT"
3979
+ },
3980
+ {
3981
+ code: 6083,
3982
+ name: "DexAdminDexIdMismatch",
3983
+ msg: "DEX_ADMIN_DEX_ID_MISMATCH"
3783
3984
  }
3784
3985
  ];
3785
3986
  const types = [
@@ -4051,6 +4252,31 @@ const types = [
4051
4252
  ]
4052
4253
  }
4053
4254
  },
4255
+ {
4256
+ name: "DexMetadata",
4257
+ type: {
4258
+ kind: "struct",
4259
+ fields: [
4260
+ {
4261
+ name: "dex_id",
4262
+ type: "u16"
4263
+ },
4264
+ {
4265
+ name: "lookup_table",
4266
+ type: "pubkey"
4267
+ },
4268
+ {
4269
+ name: "_reserved",
4270
+ type: {
4271
+ array: [
4272
+ "u8",
4273
+ 32
4274
+ ]
4275
+ }
4276
+ }
4277
+ ]
4278
+ }
4279
+ },
4054
4280
  {
4055
4281
  name: "DexPosition",
4056
4282
  docs: [
@@ -4411,6 +4637,22 @@ const types = [
4411
4637
  ]
4412
4638
  }
4413
4639
  },
4640
+ {
4641
+ name: "LogInitDexMetadata",
4642
+ type: {
4643
+ kind: "struct",
4644
+ fields: [
4645
+ {
4646
+ name: "dex_id",
4647
+ type: "u16"
4648
+ },
4649
+ {
4650
+ name: "lookup_table",
4651
+ type: "pubkey"
4652
+ }
4653
+ ]
4654
+ }
4655
+ },
4414
4656
  {
4415
4657
  name: "LogInitDexPriceParams",
4416
4658
  type: {
@@ -4777,6 +5019,22 @@ const types = [
4777
5019
  ]
4778
5020
  }
4779
5021
  },
5022
+ {
5023
+ name: "LogUpdateDexLookupTable",
5024
+ type: {
5025
+ kind: "struct",
5026
+ fields: [
5027
+ {
5028
+ name: "dex_id",
5029
+ type: "u16"
5030
+ },
5031
+ {
5032
+ name: "lookup_table",
5033
+ type: "pubkey"
5034
+ }
5035
+ ]
5036
+ }
5037
+ },
4780
5038
  {
4781
5039
  name: "LogUpdateFeeAndRevenueCut",
4782
5040
  type: {
@@ -5338,7 +5596,6 @@ const getAccountOwner = async (account, connection) => {
5338
5596
  throw new Error(`Account info not found for ${account.toString()}`);
5339
5597
  return info.owner;
5340
5598
  };
5341
- const decodeBool = (v) => Number(v) === 1;
5342
5599
 
5343
5600
  const getDexProgram = ({
5344
5601
  connection,
@@ -5350,6 +5607,12 @@ const getDexProgram = ({
5350
5607
  publicKey: signer
5351
5608
  });
5352
5609
  };
5610
+ async function resolveDexMetadata(dexId, connection) {
5611
+ const dex2 = getDexMetadata(dexId);
5612
+ const program = getDexProgram({ connection });
5613
+ const dexMetadata = await program.account.dexMetadata.fetch(dex2);
5614
+ return dexMetadata;
5615
+ }
5353
5616
  async function resolvePool(dexId, connection) {
5354
5617
  const dex2 = getDex(dexId);
5355
5618
  const program = getDexProgram({ connection });
@@ -5368,8 +5631,8 @@ async function resolvePool(dexId, connection) {
5368
5631
  token1,
5369
5632
  token0Program,
5370
5633
  token1Program,
5371
- smartCol: decodeBool(dexAccount.isSmartCollateralEnabled),
5372
- smartDebt: decodeBool(dexAccount.isSmartDebtEnabled),
5634
+ smartCol: dexAccount.isSmartCollateralEnabled === 1,
5635
+ smartDebt: dexAccount.isSmartDebtEnabled === 1,
5373
5636
  centerPriceAddress: dexAccount.centerPriceAddress,
5374
5637
  liquidity: liquidity$1,
5375
5638
  token0Reserve: getReserve(token0, "main"),
@@ -5395,17 +5658,62 @@ async function resolvePool(dexId, connection) {
5395
5658
  };
5396
5659
  return resolved;
5397
5660
  }
5398
- const getSwapAccounts = async (params) => {
5661
+ async function getCenterPriceRemainingAccounts({
5662
+ connection,
5663
+ oracle
5664
+ }) {
5665
+ if (oracle.equals(PublicKey.default)) {
5666
+ return [];
5667
+ }
5668
+ const accounts = [
5669
+ oracle,
5670
+ // 0th accounts is center price address
5671
+ ...// rest of the accounts are oracle sources
5672
+ (await getOracleSources({
5673
+ connection,
5674
+ oracle
5675
+ })).map((s) => s.source)
5676
+ ];
5677
+ return accounts.map((a) => ({
5678
+ pubkey: a,
5679
+ isWritable: false,
5680
+ isSigner: false
5681
+ }));
5682
+ }
5683
+ const getSwapContext = async (params) => {
5399
5684
  const { signer, recipient, connection, dexId } = params;
5400
- const pool = await resolvePool(dexId, connection);
5401
- return {
5685
+ const [pool, dexMetadata] = await Promise.all([
5686
+ resolvePool(dexId, connection),
5687
+ resolveDexMetadata(dexId, connection)
5688
+ ]);
5689
+ const accounts = {
5402
5690
  signer,
5403
5691
  dex: pool.dex,
5404
- userToken0Account: getAssociatedTokenAddressSync(pool.token0, signer, true, pool.token0Program),
5405
- userToken1Account: getAssociatedTokenAddressSync(pool.token1, signer, true, pool.token1Program),
5692
+ userToken0Account: getAssociatedTokenAddressSync(
5693
+ pool.token0,
5694
+ signer,
5695
+ true,
5696
+ pool.token0Program
5697
+ ),
5698
+ userToken1Account: getAssociatedTokenAddressSync(
5699
+ pool.token1,
5700
+ signer,
5701
+ true,
5702
+ pool.token1Program
5703
+ ),
5406
5704
  recipient,
5407
- recipientToken0Account: getAssociatedTokenAddressSync(pool.token0, recipient ?? signer, true, pool.token0Program),
5408
- recipientToken1Account: getAssociatedTokenAddressSync(pool.token1, recipient ?? signer, true, pool.token1Program),
5705
+ recipientToken0Account: getAssociatedTokenAddressSync(
5706
+ pool.token0,
5707
+ recipient ?? signer,
5708
+ true,
5709
+ pool.token0Program
5710
+ ),
5711
+ recipientToken1Account: getAssociatedTokenAddressSync(
5712
+ pool.token1,
5713
+ recipient ?? signer,
5714
+ true,
5715
+ pool.token1Program
5716
+ ),
5409
5717
  token0: pool.token0,
5410
5718
  token1: pool.token1,
5411
5719
  token0Reserve: pool.token0Reserve,
@@ -5425,36 +5733,57 @@ const getSwapAccounts = async (params) => {
5425
5733
  oracleProgram: new PublicKey("jupnw4B6Eqs7ft6rxpzYLJZYSnrpRgPcr589n5Kv4oc"),
5426
5734
  associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID
5427
5735
  };
5736
+ const centerPriceRemainingAccounts = await getCenterPriceRemainingAccounts({
5737
+ connection,
5738
+ oracle: pool.centerPriceAddress
5739
+ });
5740
+ return {
5741
+ accounts,
5742
+ remainingAccounts: [...centerPriceRemainingAccounts],
5743
+ lookupTable: dexMetadata.lookupTable
5744
+ };
5428
5745
  };
5429
- async function swapIn(params) {
5430
- const { connection, signer, swap0to1, amountIn, amountOutMin, centerPriceRemainingAccounts } = params;
5746
+ async function getSwapInIx(params) {
5747
+ const { connection, signer, swap0to1, amountIn, amountOutMin } = params;
5431
5748
  const program = getDexProgram({ connection, signer });
5432
- const ix = await program.methods.swapIn(swap0to1, amountIn, amountOutMin).accountsPartial(await getSwapAccounts({
5749
+ const { accounts, remainingAccounts, lookupTable } = await getSwapContext({
5433
5750
  dexId: params.dexId,
5434
5751
  connection: params.connection,
5435
5752
  signer: params.signer,
5436
5753
  recipient: params.recipient
5437
- })).remainingAccounts(
5438
- (centerPriceRemainingAccounts || []).map((a) => ({ pubkey: a, isSigner: false, isWritable: false }))
5439
- ).instruction();
5754
+ });
5755
+ const [ix, addressLookupTable] = await Promise.all([
5756
+ program.methods.swapIn(swap0to1, amountIn, amountOutMin).accountsPartial(accounts).remainingAccounts(remainingAccounts).instruction(),
5757
+ connection.getAddressLookupTable(lookupTable)
5758
+ ]);
5440
5759
  return {
5441
- ixs: [ix]
5760
+ ixs: [ix],
5761
+ accounts,
5762
+ remainingAccounts,
5763
+ addressLookupTableAddresses: lookupTable ? [lookupTable] : [],
5764
+ addressLookupTableAccounts: addressLookupTable.value ? [addressLookupTable.value] : []
5442
5765
  };
5443
5766
  }
5444
- async function swapOut(params) {
5445
- const { connection, signer, swap0to1, amountIn, amountInMax, centerPriceRemainingAccounts } = params;
5767
+ async function getSwapOutIx(params) {
5768
+ const { connection, signer, swap0to1, amountOut, amountInMax } = params;
5446
5769
  const program = getDexProgram({ connection, signer });
5447
- const ix = await program.methods.swapIn(swap0to1, amountIn, amountInMax).accountsPartial(await getSwapAccounts({
5770
+ const { accounts, remainingAccounts, lookupTable } = await getSwapContext({
5448
5771
  dexId: params.dexId,
5449
5772
  connection: params.connection,
5450
5773
  signer: params.signer,
5451
5774
  recipient: params.recipient
5452
- })).remainingAccounts(
5453
- (centerPriceRemainingAccounts || []).map((a) => ({ pubkey: a, isSigner: false, isWritable: false }))
5454
- ).instruction();
5775
+ });
5776
+ const [ix, addressLookupTable] = await Promise.all([
5777
+ program.methods.swapOut(swap0to1, amountOut, amountInMax).accountsPartial(accounts).remainingAccounts(remainingAccounts).instruction(),
5778
+ connection.getAddressLookupTable(lookupTable)
5779
+ ]);
5455
5780
  return {
5456
- ixs: [ix]
5781
+ ixs: [ix],
5782
+ accounts,
5783
+ remainingAccounts,
5784
+ addressLookupTableAddresses: lookupTable ? [lookupTable] : [],
5785
+ addressLookupTableAccounts: addressLookupTable.value ? [addressLookupTable.value] : []
5457
5786
  };
5458
5787
  }
5459
5788
 
5460
- export { getDexProgram, swapIn, swapOut };
5789
+ export { getDexProgram, getSwapInIx, getSwapOutIx };
@@ -39,7 +39,6 @@ declare function getDepositContext({ asset, signer, connection, market, }: Depos
39
39
  liquidityProgram: PublicKey;
40
40
  rewardsRateModel: PublicKey;
41
41
  tokenProgram: PublicKey;
42
- associatedTokenProgram: PublicKey;
43
42
  systemProgram: PublicKey;
44
43
  sysvarInstruction: PublicKey;
45
44
  }>;
@@ -92,7 +91,6 @@ declare function getWithdrawContext({ asset, signer, connection, market, }: With
92
91
  liquidityProgram: PublicKey;
93
92
  rewardsRateModel: PublicKey;
94
93
  tokenProgram: PublicKey;
95
- associatedTokenProgram: PublicKey;
96
94
  systemProgram: PublicKey;
97
95
  sysvarInstruction: PublicKey;
98
96
  }>;
@@ -127,7 +125,7 @@ type Lending = {
127
125
  address: "jup3YeL8QhtSx1e253b2FDvsMNC87fDrgQZivbrndc9";
128
126
  metadata: {
129
127
  name: "lending";
130
- version: "0.1.0";
128
+ version: "0.1.2";
131
129
  spec: "0.1.0";
132
130
  description: "Created with Anchor";
133
131
  };
@@ -186,7 +184,6 @@ type Lending = {
186
184
  },
187
185
  {
188
186
  name: "liquidityProgram";
189
- writable: true;
190
187
  relations: ["lendingAdmin"];
191
188
  },
192
189
  {
@@ -197,6 +194,7 @@ type Lending = {
197
194
  },
198
195
  {
199
196
  name: "associatedTokenProgram";
197
+ optional: true;
200
198
  address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
201
199
  },
202
200
  {
@@ -266,7 +264,6 @@ type Lending = {
266
264
  },
267
265
  {
268
266
  name: "liquidityProgram";
269
- writable: true;
270
267
  relations: ["lendingAdmin"];
271
268
  },
272
269
  {
@@ -277,6 +274,7 @@ type Lending = {
277
274
  },
278
275
  {
279
276
  name: "associatedTokenProgram";
277
+ optional: true;
280
278
  address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
281
279
  },
282
280
  {
@@ -594,7 +592,6 @@ type Lending = {
594
592
  },
595
593
  {
596
594
  name: "liquidityProgram";
597
- writable: true;
598
595
  relations: ["lendingAdmin"];
599
596
  },
600
597
  {
@@ -605,6 +602,7 @@ type Lending = {
605
602
  },
606
603
  {
607
604
  name: "associatedTokenProgram";
605
+ optional: true;
608
606
  address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
609
607
  },
610
608
  {
@@ -674,7 +672,6 @@ type Lending = {
674
672
  },
675
673
  {
676
674
  name: "liquidityProgram";
677
- writable: true;
678
675
  relations: ["lendingAdmin"];
679
676
  },
680
677
  {
@@ -685,6 +682,7 @@ type Lending = {
685
682
  },
686
683
  {
687
684
  name: "associatedTokenProgram";
685
+ optional: true;
688
686
  address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
689
687
  },
690
688
  {
@@ -808,7 +806,6 @@ type Lending = {
808
806
  },
809
807
  {
810
808
  name: "liquidityProgram";
811
- writable: true;
812
809
  relations: ["lendingAdmin"];
813
810
  },
814
811
  {
@@ -879,6 +876,7 @@ type Lending = {
879
876
  {
880
877
  name: "claimAccount";
881
878
  writable: true;
879
+ optional: true;
882
880
  },
883
881
  {
884
882
  name: "liquidity";
@@ -886,7 +884,6 @@ type Lending = {
886
884
  },
887
885
  {
888
886
  name: "liquidityProgram";
889
- writable: true;
890
887
  relations: ["lendingAdmin"];
891
888
  },
892
889
  {
@@ -897,6 +894,7 @@ type Lending = {
897
894
  },
898
895
  {
899
896
  name: "associatedTokenProgram";
897
+ optional: true;
900
898
  address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
901
899
  },
902
900
  {
@@ -963,6 +961,7 @@ type Lending = {
963
961
  {
964
962
  name: "claimAccount";
965
963
  writable: true;
964
+ optional: true;
966
965
  },
967
966
  {
968
967
  name: "liquidity";
@@ -970,7 +969,6 @@ type Lending = {
970
969
  },
971
970
  {
972
971
  name: "liquidityProgram";
973
- writable: true;
974
972
  relations: ["lendingAdmin"];
975
973
  },
976
974
  {
@@ -981,6 +979,7 @@ type Lending = {
981
979
  },
982
980
  {
983
981
  name: "associatedTokenProgram";
982
+ optional: true;
984
983
  address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
985
984
  },
986
985
  {
@@ -1174,6 +1173,7 @@ type Lending = {
1174
1173
  {
1175
1174
  name: "claimAccount";
1176
1175
  writable: true;
1176
+ optional: true;
1177
1177
  },
1178
1178
  {
1179
1179
  name: "liquidity";
@@ -1181,7 +1181,6 @@ type Lending = {
1181
1181
  },
1182
1182
  {
1183
1183
  name: "liquidityProgram";
1184
- writable: true;
1185
1184
  relations: ["lendingAdmin"];
1186
1185
  },
1187
1186
  {
@@ -1192,6 +1191,7 @@ type Lending = {
1192
1191
  },
1193
1192
  {
1194
1193
  name: "associatedTokenProgram";
1194
+ optional: true;
1195
1195
  address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
1196
1196
  },
1197
1197
  {
@@ -1258,6 +1258,7 @@ type Lending = {
1258
1258
  {
1259
1259
  name: "claimAccount";
1260
1260
  writable: true;
1261
+ optional: true;
1261
1262
  },
1262
1263
  {
1263
1264
  name: "liquidity";
@@ -1265,7 +1266,6 @@ type Lending = {
1265
1266
  },
1266
1267
  {
1267
1268
  name: "liquidityProgram";
1268
- writable: true;
1269
1269
  relations: ["lendingAdmin"];
1270
1270
  },
1271
1271
  {
@@ -1276,6 +1276,7 @@ type Lending = {
1276
1276
  },
1277
1277
  {
1278
1278
  name: "associatedTokenProgram";
1279
+ optional: true;
1279
1280
  address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
1280
1281
  },
1281
1282
  {
@@ -1832,7 +1833,11 @@ type Lending = {
1832
1833
  },
1833
1834
  {
1834
1835
  name: "withdrawalLimit";
1835
- type: "u128";
1836
+ type: "u64";
1837
+ },
1838
+ {
1839
+ name: "decayAmount";
1840
+ type: "u64";
1836
1841
  },
1837
1842
  {
1838
1843
  name: "lastUpdate";
@@ -1844,7 +1849,11 @@ type Lending = {
1844
1849
  },
1845
1850
  {
1846
1851
  name: "expandDuration";
1847
- type: "u64";
1852
+ type: "u32";
1853
+ },
1854
+ {
1855
+ name: "decayDuration";
1856
+ type: "u32";
1848
1857
  },
1849
1858
  {
1850
1859
  name: "baseWithdrawalLimit";