@kamino-finance/klend-sdk 7.4.0-beta.2 → 7.4.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.
- package/dist/@codegen/klend/accounts/LendingMarket.d.ts +150 -3
- package/dist/@codegen/klend/accounts/LendingMarket.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/LendingMarket.js +91 -2
- package/dist/@codegen/klend/accounts/LendingMarket.js.map +1 -1
- package/dist/@codegen/klend/accounts/Reserve.d.ts +6 -0
- package/dist/@codegen/klend/accounts/Reserve.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/Reserve.js +8 -1
- package/dist/@codegen/klend/accounts/Reserve.js.map +1 -1
- package/dist/@codegen/klend/accounts/WithdrawTicket.d.ts +144 -0
- package/dist/@codegen/klend/accounts/WithdrawTicket.d.ts.map +1 -0
- package/dist/@codegen/klend/accounts/WithdrawTicket.js +205 -0
- package/dist/@codegen/klend/accounts/WithdrawTicket.js.map +1 -0
- package/dist/@codegen/klend/accounts/index.d.ts +2 -0
- package/dist/@codegen/klend/accounts/index.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/index.js +3 -1
- package/dist/@codegen/klend/accounts/index.js.map +1 -1
- package/dist/@codegen/klend/errors/custom.d.ts +81 -1
- package/dist/@codegen/klend/errors/custom.d.ts.map +1 -1
- package/dist/@codegen/klend/errors/custom.js +142 -1
- package/dist/@codegen/klend/errors/custom.js.map +1 -1
- package/dist/@codegen/klend/instructions/enqueueToWithdraw.d.ts +62 -0
- package/dist/@codegen/klend/instructions/enqueueToWithdraw.d.ts.map +1 -0
- package/dist/@codegen/klend/instructions/enqueueToWithdraw.js +79 -0
- package/dist/@codegen/klend/instructions/enqueueToWithdraw.js.map +1 -0
- package/dist/@codegen/klend/instructions/index.d.ts +6 -0
- package/dist/@codegen/klend/instructions/index.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/index.js +8 -2
- package/dist/@codegen/klend/instructions/index.js.map +1 -1
- package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.d.ts +54 -0
- package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.d.ts.map +1 -0
- package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.js +66 -0
- package/dist/@codegen/klend/instructions/recoverInvalidTicketCollateral.js.map +1 -0
- package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.d.ts +66 -0
- package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.d.ts.map +1 -0
- package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.js +41 -0
- package/dist/@codegen/klend/instructions/withdrawQueuedLiquidity.js.map +1 -0
- package/dist/@codegen/klend/types/BorrowOrder.d.ts +3 -3
- package/dist/@codegen/klend/types/BorrowOrder.js +1 -1
- package/dist/@codegen/klend/types/FixedTermBorrowRolloverConfig.d.ts +145 -0
- package/dist/@codegen/klend/types/FixedTermBorrowRolloverConfig.d.ts.map +1 -0
- package/dist/@codegen/klend/types/FixedTermBorrowRolloverConfig.js +144 -0
- package/dist/@codegen/klend/types/FixedTermBorrowRolloverConfig.js.map +1 -0
- package/dist/@codegen/klend/types/ObligationLiquidity.d.ts +29 -0
- package/dist/@codegen/klend/types/ObligationLiquidity.d.ts.map +1 -1
- package/dist/@codegen/klend/types/ObligationLiquidity.js +15 -1
- package/dist/@codegen/klend/types/ObligationLiquidity.js.map +1 -1
- package/dist/@codegen/klend/types/ProgressCallbackType.d.ts +32 -0
- package/dist/@codegen/klend/types/ProgressCallbackType.d.ts.map +1 -0
- package/dist/@codegen/klend/types/ProgressCallbackType.js +108 -0
- package/dist/@codegen/klend/types/ProgressCallbackType.js.map +1 -0
- package/dist/@codegen/klend/types/ReserveLiquidity.d.ts +26 -8
- package/dist/@codegen/klend/types/ReserveLiquidity.d.ts.map +1 -1
- package/dist/@codegen/klend/types/ReserveLiquidity.js +14 -8
- package/dist/@codegen/klend/types/ReserveLiquidity.js.map +1 -1
- package/dist/@codegen/klend/types/UpdateConfigMode.d.ts +7 -7
- package/dist/@codegen/klend/types/UpdateConfigMode.d.ts.map +1 -1
- package/dist/@codegen/klend/types/UpdateConfigMode.js +12 -12
- package/dist/@codegen/klend/types/UpdateConfigMode.js.map +1 -1
- package/dist/@codegen/klend/types/UpdateLendingMarketMode.d.ts +78 -0
- package/dist/@codegen/klend/types/UpdateLendingMarketMode.d.ts.map +1 -1
- package/dist/@codegen/klend/types/UpdateLendingMarketMode.js +145 -1
- package/dist/@codegen/klend/types/UpdateLendingMarketMode.js.map +1 -1
- package/dist/@codegen/klend/types/WithdrawQueue.d.ts +64 -0
- package/dist/@codegen/klend/types/WithdrawQueue.d.ts.map +1 -0
- package/dist/@codegen/klend/types/WithdrawQueue.js +104 -0
- package/dist/@codegen/klend/types/WithdrawQueue.js.map +1 -0
- package/dist/@codegen/klend/types/index.d.ts +23 -4
- package/dist/@codegen/klend/types/index.d.ts.map +1 -1
- package/dist/@codegen/klend/types/index.js +7 -1
- package/dist/@codegen/klend/types/index.js.map +1 -1
- package/dist/classes/action.d.ts +11 -0
- package/dist/classes/action.d.ts.map +1 -1
- package/dist/classes/action.js +66 -0
- package/dist/classes/action.js.map +1 -1
- package/dist/classes/actionTypes.d.ts +29 -0
- package/dist/classes/actionTypes.d.ts.map +1 -1
- package/dist/classes/manager.d.ts +1 -1
- package/dist/classes/manager.d.ts.map +1 -1
- package/dist/classes/manager.js +9 -8
- package/dist/classes/manager.js.map +1 -1
- package/dist/classes/market.d.ts +7 -102
- package/dist/classes/market.d.ts.map +1 -1
- package/dist/classes/market.js +8 -153
- package/dist/classes/market.js.map +1 -1
- package/dist/classes/reserve.d.ts +3 -10
- package/dist/classes/reserve.d.ts.map +1 -1
- package/dist/classes/reserve.js +45 -51
- package/dist/classes/reserve.js.map +1 -1
- package/dist/idl/klend.json +860 -32
- package/dist/manager/client_kamino_manager.js +2 -3
- package/dist/manager/client_kamino_manager.js.map +1 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/seeds.d.ts +24 -0
- package/dist/utils/seeds.d.ts.map +1 -1
- package/dist/utils/seeds.js +41 -1
- package/dist/utils/seeds.js.map +1 -1
- package/package.json +1 -1
- package/src/@codegen/klend/accounts/LendingMarket.ts +205 -4
- package/src/@codegen/klend/accounts/Reserve.ts +12 -1
- package/src/@codegen/klend/accounts/WithdrawTicket.ts +280 -0
- package/src/@codegen/klend/accounts/index.ts +2 -0
- package/src/@codegen/klend/errors/custom.ts +161 -0
- package/src/@codegen/klend/instructions/enqueueToWithdraw.ts +120 -0
- package/src/@codegen/klend/instructions/index.ts +12 -0
- package/src/@codegen/klend/instructions/recoverInvalidTicketCollateral.ts +103 -0
- package/src/@codegen/klend/instructions/withdrawQueuedLiquidity.ts +118 -0
- package/src/@codegen/klend/types/BorrowOrder.ts +3 -3
- package/src/@codegen/klend/types/FixedTermBorrowRolloverConfig.ts +199 -0
- package/src/@codegen/klend/types/ObligationLiquidity.ts +37 -1
- package/src/@codegen/klend/types/ProgressCallbackType.ts +91 -0
- package/src/@codegen/klend/types/ReserveLiquidity.ts +30 -12
- package/src/@codegen/klend/types/UpdateConfigMode.ts +13 -13
- package/src/@codegen/klend/types/UpdateLendingMarketMode.ts +180 -0
- package/src/@codegen/klend/types/WithdrawQueue.ts +117 -0
- package/src/@codegen/klend/types/index.ts +42 -2
- package/src/classes/action.ts +115 -1
- package/src/classes/actionTypes.ts +31 -0
- package/src/classes/manager.ts +19 -27
- package/src/classes/market.ts +8 -183
- package/src/classes/reserve.ts +45 -68
- package/src/idl/klend.json +860 -32
- package/src/manager/client_kamino_manager.ts +2 -4
- package/src/utils/index.ts +0 -1
- package/src/utils/seeds.ts +49 -0
- package/dist/utils/ReserveKind.d.ts +0 -57
- package/dist/utils/ReserveKind.d.ts.map +0 -1
- package/dist/utils/ReserveKind.js +0 -76
- package/dist/utils/ReserveKind.js.map +0 -1
- package/src/utils/ReserveKind.ts +0 -94
package/dist/idl/klend.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.13.
|
|
2
|
+
"version": "1.13.1",
|
|
3
3
|
"name": "kamino_lending",
|
|
4
4
|
"instructions": [
|
|
5
5
|
{
|
|
@@ -3187,6 +3187,410 @@
|
|
|
3187
3187
|
],
|
|
3188
3188
|
"args": []
|
|
3189
3189
|
},
|
|
3190
|
+
{
|
|
3191
|
+
"name": "enqueueToWithdraw",
|
|
3192
|
+
"accounts": [
|
|
3193
|
+
{
|
|
3194
|
+
"name": "owner",
|
|
3195
|
+
"isMut": true,
|
|
3196
|
+
"isSigner": true,
|
|
3197
|
+
"docs": [
|
|
3198
|
+
"The depositor holding ctokens."
|
|
3199
|
+
]
|
|
3200
|
+
},
|
|
3201
|
+
{
|
|
3202
|
+
"name": "lendingMarket",
|
|
3203
|
+
"isMut": false,
|
|
3204
|
+
"isSigner": false
|
|
3205
|
+
},
|
|
3206
|
+
{
|
|
3207
|
+
"name": "lendingMarketAuthority",
|
|
3208
|
+
"isMut": false,
|
|
3209
|
+
"isSigner": false,
|
|
3210
|
+
"docs": [
|
|
3211
|
+
"The market's authority, needed to initialize the [Self::owner_queued_collateral_vault]."
|
|
3212
|
+
]
|
|
3213
|
+
},
|
|
3214
|
+
{
|
|
3215
|
+
"name": "reserve",
|
|
3216
|
+
"isMut": true,
|
|
3217
|
+
"isSigner": false
|
|
3218
|
+
},
|
|
3219
|
+
{
|
|
3220
|
+
"name": "userSourceCollateralTa",
|
|
3221
|
+
"isMut": true,
|
|
3222
|
+
"isSigner": false,
|
|
3223
|
+
"docs": [
|
|
3224
|
+
"The source of collateral to be enqueued."
|
|
3225
|
+
]
|
|
3226
|
+
},
|
|
3227
|
+
{
|
|
3228
|
+
"name": "userDestinationLiquidityTa",
|
|
3229
|
+
"isMut": false,
|
|
3230
|
+
"isSigner": false,
|
|
3231
|
+
"docs": [
|
|
3232
|
+
"The account to which the liquidity should be finally transferred later (to be recorded in",
|
|
3233
|
+
"the ticket)."
|
|
3234
|
+
]
|
|
3235
|
+
},
|
|
3236
|
+
{
|
|
3237
|
+
"name": "reserveLiquidityMint",
|
|
3238
|
+
"isMut": false,
|
|
3239
|
+
"isSigner": false
|
|
3240
|
+
},
|
|
3241
|
+
{
|
|
3242
|
+
"name": "reserveCollateralMint",
|
|
3243
|
+
"isMut": false,
|
|
3244
|
+
"isSigner": false
|
|
3245
|
+
},
|
|
3246
|
+
{
|
|
3247
|
+
"name": "collateralTokenProgram",
|
|
3248
|
+
"isMut": false,
|
|
3249
|
+
"isSigner": false,
|
|
3250
|
+
"docs": [
|
|
3251
|
+
"The collateral's program - needed for invoking the transfer to the vault *and* (implicitly)",
|
|
3252
|
+
"for handling the `init_if_needed`."
|
|
3253
|
+
]
|
|
3254
|
+
},
|
|
3255
|
+
{
|
|
3256
|
+
"name": "withdrawTicket",
|
|
3257
|
+
"isMut": true,
|
|
3258
|
+
"isSigner": false,
|
|
3259
|
+
"docs": [
|
|
3260
|
+
"The new account to be initialized with the issued ticket's data."
|
|
3261
|
+
]
|
|
3262
|
+
},
|
|
3263
|
+
{
|
|
3264
|
+
"name": "ownerQueuedCollateralVault",
|
|
3265
|
+
"isMut": true,
|
|
3266
|
+
"isSigner": false,
|
|
3267
|
+
"docs": [
|
|
3268
|
+
"The per-owner \"this reserve's queued collateral\" vault (in which the collateral will be",
|
|
3269
|
+
"locked)."
|
|
3270
|
+
]
|
|
3271
|
+
},
|
|
3272
|
+
{
|
|
3273
|
+
"name": "systemProgram",
|
|
3274
|
+
"isMut": false,
|
|
3275
|
+
"isSigner": false,
|
|
3276
|
+
"docs": [
|
|
3277
|
+
"The System program - needed only for `init` / `init_if_needed` of the accounts above."
|
|
3278
|
+
]
|
|
3279
|
+
},
|
|
3280
|
+
{
|
|
3281
|
+
"name": "progressCallbackCustomAccount0",
|
|
3282
|
+
"isMut": false,
|
|
3283
|
+
"isSigner": false,
|
|
3284
|
+
"isOptional": true,
|
|
3285
|
+
"docs": [
|
|
3286
|
+
"The first one out of maximum 2 custom accounts that may be required if the optional \"ticket",
|
|
3287
|
+
"progress callback\" is configured for this ticket.",
|
|
3288
|
+
"",
|
|
3289
|
+
"The expected custom accounts are validated based on the `progress_callback_type` instruction",
|
|
3290
|
+
"argument. The currently supported ones are:",
|
|
3291
|
+
"- for [ProgressCallbackType::None] no custom accounts are expected (this is the default",
|
|
3292
|
+
"behavior, when the instruction data is zeroed or absent).",
|
|
3293
|
+
"- for [ProgressCallbackType::KlendQueueAccountingHandlerOnKvault], only the `_0` custom",
|
|
3294
|
+
"account is required:",
|
|
3295
|
+
"- the `_0` custom account must represent the `VaultState` which disinvests from the",
|
|
3296
|
+
"reserve (readonly; needed to be later passed as an input to the Kvault's handler);",
|
|
3297
|
+
"- the `_1` custom account is ignored;",
|
|
3298
|
+
"- the `owner` account (i.e. the signer) must be a Kvault-owned PDA base authority",
|
|
3299
|
+
"associated with the vault indicated by `_0` (needed to prove that Kvault is CPI'ing this",
|
|
3300
|
+
"handler)."
|
|
3301
|
+
]
|
|
3302
|
+
},
|
|
3303
|
+
{
|
|
3304
|
+
"name": "progressCallbackCustomAccount1",
|
|
3305
|
+
"isMut": false,
|
|
3306
|
+
"isSigner": false,
|
|
3307
|
+
"isOptional": true,
|
|
3308
|
+
"docs": [
|
|
3309
|
+
"The second possible account (see the `progress_callback_custom_account_0` above)."
|
|
3310
|
+
]
|
|
3311
|
+
}
|
|
3312
|
+
],
|
|
3313
|
+
"args": [
|
|
3314
|
+
{
|
|
3315
|
+
"name": "collateralAmount",
|
|
3316
|
+
"type": "u64"
|
|
3317
|
+
},
|
|
3318
|
+
{
|
|
3319
|
+
"name": "progressCallbackType",
|
|
3320
|
+
"type": {
|
|
3321
|
+
"defined": "ProgressCallbackType"
|
|
3322
|
+
}
|
|
3323
|
+
}
|
|
3324
|
+
]
|
|
3325
|
+
},
|
|
3326
|
+
{
|
|
3327
|
+
"name": "withdrawQueuedLiquidity",
|
|
3328
|
+
"accounts": [
|
|
3329
|
+
{
|
|
3330
|
+
"name": "payer",
|
|
3331
|
+
"isMut": true,
|
|
3332
|
+
"isSigner": true,
|
|
3333
|
+
"docs": [
|
|
3334
|
+
"The executor of the permissionless tx (not necessarily the ticket owner)."
|
|
3335
|
+
]
|
|
3336
|
+
},
|
|
3337
|
+
{
|
|
3338
|
+
"name": "lendingMarket",
|
|
3339
|
+
"isMut": false,
|
|
3340
|
+
"isSigner": false,
|
|
3341
|
+
"docs": [
|
|
3342
|
+
"The lending market."
|
|
3343
|
+
]
|
|
3344
|
+
},
|
|
3345
|
+
{
|
|
3346
|
+
"name": "lendingMarketAuthority",
|
|
3347
|
+
"isMut": false,
|
|
3348
|
+
"isSigner": false,
|
|
3349
|
+
"docs": [
|
|
3350
|
+
"The market's authority, needed for burning the collateral (from",
|
|
3351
|
+
"[Self::owner_queued_collateral_vault]) and transferring the liquidity (from",
|
|
3352
|
+
"[Self::reserve_liquidity_supply])."
|
|
3353
|
+
]
|
|
3354
|
+
},
|
|
3355
|
+
{
|
|
3356
|
+
"name": "reserve",
|
|
3357
|
+
"isMut": true,
|
|
3358
|
+
"isSigner": false,
|
|
3359
|
+
"docs": [
|
|
3360
|
+
"The reserve."
|
|
3361
|
+
]
|
|
3362
|
+
},
|
|
3363
|
+
{
|
|
3364
|
+
"name": "reserveLiquidityMint",
|
|
3365
|
+
"isMut": false,
|
|
3366
|
+
"isSigner": false,
|
|
3367
|
+
"docs": [
|
|
3368
|
+
"The liquidity mint, needed to invoke the transfer."
|
|
3369
|
+
]
|
|
3370
|
+
},
|
|
3371
|
+
{
|
|
3372
|
+
"name": "reserveCollateralMint",
|
|
3373
|
+
"isMut": true,
|
|
3374
|
+
"isSigner": false,
|
|
3375
|
+
"docs": [
|
|
3376
|
+
"The collateral mint, needed to burn (`mut`!) the queued collateral."
|
|
3377
|
+
]
|
|
3378
|
+
},
|
|
3379
|
+
{
|
|
3380
|
+
"name": "reserveLiquiditySupply",
|
|
3381
|
+
"isMut": true,
|
|
3382
|
+
"isSigner": false,
|
|
3383
|
+
"docs": [
|
|
3384
|
+
"The liquidity supply vault (to withdraw the liquidity from)."
|
|
3385
|
+
]
|
|
3386
|
+
},
|
|
3387
|
+
{
|
|
3388
|
+
"name": "ownerQueuedCollateralVault",
|
|
3389
|
+
"isMut": true,
|
|
3390
|
+
"isSigner": false,
|
|
3391
|
+
"docs": [
|
|
3392
|
+
"The per-owner \"this reserve's queued collateral\" vault (from which the collateral will be",
|
|
3393
|
+
"burnt)."
|
|
3394
|
+
]
|
|
3395
|
+
},
|
|
3396
|
+
{
|
|
3397
|
+
"name": "userDestinationLiquidity",
|
|
3398
|
+
"isMut": true,
|
|
3399
|
+
"isSigner": false,
|
|
3400
|
+
"docs": [
|
|
3401
|
+
"The token account to which the liquidity should be transferred (the one recorded in the",
|
|
3402
|
+
"ticket)."
|
|
3403
|
+
]
|
|
3404
|
+
},
|
|
3405
|
+
{
|
|
3406
|
+
"name": "collateralTokenProgram",
|
|
3407
|
+
"isMut": false,
|
|
3408
|
+
"isSigner": false,
|
|
3409
|
+
"docs": [
|
|
3410
|
+
"The program of [Self::reserve_collateral_mint], needed for transfer."
|
|
3411
|
+
]
|
|
3412
|
+
},
|
|
3413
|
+
{
|
|
3414
|
+
"name": "liquidityTokenProgram",
|
|
3415
|
+
"isMut": false,
|
|
3416
|
+
"isSigner": false,
|
|
3417
|
+
"docs": [
|
|
3418
|
+
"The program of [Self::reserve_liquidity_mint], needed for transfer."
|
|
3419
|
+
]
|
|
3420
|
+
},
|
|
3421
|
+
{
|
|
3422
|
+
"name": "withdrawTicket",
|
|
3423
|
+
"isMut": true,
|
|
3424
|
+
"isSigner": false,
|
|
3425
|
+
"docs": [
|
|
3426
|
+
"The ticket's data itself.",
|
|
3427
|
+
"",
|
|
3428
|
+
"Note: in case of complete withdrawal, this account will be closed. In case of partial",
|
|
3429
|
+
"withdrawal, its [WithdrawTicket::queued_collateral_amount] will simply be reduced, and the",
|
|
3430
|
+
"ticket will maintain its position in the queue."
|
|
3431
|
+
]
|
|
3432
|
+
},
|
|
3433
|
+
{
|
|
3434
|
+
"name": "withdrawTicketOwner",
|
|
3435
|
+
"isMut": true,
|
|
3436
|
+
"isSigner": false,
|
|
3437
|
+
"docs": [
|
|
3438
|
+
"The owner of the [Self::withdraw_ticket]; needed only to return the rent of the",
|
|
3439
|
+
"[WithdrawTicket] account (if it is getting fully-consumed and closed here)."
|
|
3440
|
+
]
|
|
3441
|
+
},
|
|
3442
|
+
{
|
|
3443
|
+
"name": "associatedTokenProgram",
|
|
3444
|
+
"isMut": false,
|
|
3445
|
+
"isSigner": false,
|
|
3446
|
+
"docs": [
|
|
3447
|
+
"The ATA program - needed for potential destination ATA creation."
|
|
3448
|
+
]
|
|
3449
|
+
},
|
|
3450
|
+
{
|
|
3451
|
+
"name": "systemProgram",
|
|
3452
|
+
"isMut": false,
|
|
3453
|
+
"isSigner": false,
|
|
3454
|
+
"docs": [
|
|
3455
|
+
"The System program - needed for potential destination ATA creation."
|
|
3456
|
+
]
|
|
3457
|
+
},
|
|
3458
|
+
{
|
|
3459
|
+
"name": "progressCallbackProgram",
|
|
3460
|
+
"isMut": false,
|
|
3461
|
+
"isSigner": false,
|
|
3462
|
+
"isOptional": true,
|
|
3463
|
+
"docs": [
|
|
3464
|
+
"The progress callback program (if configured by the withdraw ticket)."
|
|
3465
|
+
]
|
|
3466
|
+
},
|
|
3467
|
+
{
|
|
3468
|
+
"name": "progressCallbackCustomAccount0",
|
|
3469
|
+
"isMut": false,
|
|
3470
|
+
"isSigner": false,
|
|
3471
|
+
"isOptional": true,
|
|
3472
|
+
"docs": [
|
|
3473
|
+
"The first one out of maximum 2 custom accounts that may be required if the withdraw ticket",
|
|
3474
|
+
"defines a callback.",
|
|
3475
|
+
"Please note that the constraints defined here do not mention `mut`, but a specific",
|
|
3476
|
+
"[WithdrawTicket::progress_callback_type] may require it."
|
|
3477
|
+
]
|
|
3478
|
+
},
|
|
3479
|
+
{
|
|
3480
|
+
"name": "progressCallbackCustomAccount1",
|
|
3481
|
+
"isMut": false,
|
|
3482
|
+
"isSigner": false,
|
|
3483
|
+
"isOptional": true,
|
|
3484
|
+
"docs": [
|
|
3485
|
+
"The second possibly-required account (see the `progress_callback_custom_account_0` above)."
|
|
3486
|
+
]
|
|
3487
|
+
}
|
|
3488
|
+
],
|
|
3489
|
+
"args": [],
|
|
3490
|
+
"returns": "bool"
|
|
3491
|
+
},
|
|
3492
|
+
{
|
|
3493
|
+
"name": "recoverInvalidTicketCollateral",
|
|
3494
|
+
"accounts": [
|
|
3495
|
+
{
|
|
3496
|
+
"name": "payer",
|
|
3497
|
+
"isMut": false,
|
|
3498
|
+
"isSigner": true,
|
|
3499
|
+
"docs": [
|
|
3500
|
+
"The transaction executor.",
|
|
3501
|
+
"",
|
|
3502
|
+
"This instruction is, in principle, permissionless. However, only the ticket owner can use",
|
|
3503
|
+
"arbitrary token account as destination for recovered collateral. Other signers can only",
|
|
3504
|
+
"transfer the collateral to the ticket owner's ATA (see [Self::user_source_collateral])."
|
|
3505
|
+
]
|
|
3506
|
+
},
|
|
3507
|
+
{
|
|
3508
|
+
"name": "lendingMarket",
|
|
3509
|
+
"isMut": false,
|
|
3510
|
+
"isSigner": false,
|
|
3511
|
+
"docs": [
|
|
3512
|
+
"The lending market."
|
|
3513
|
+
]
|
|
3514
|
+
},
|
|
3515
|
+
{
|
|
3516
|
+
"name": "lendingMarketAuthority",
|
|
3517
|
+
"isMut": false,
|
|
3518
|
+
"isSigner": false,
|
|
3519
|
+
"docs": [
|
|
3520
|
+
"The market's authority, needed for transferring the collateral (from",
|
|
3521
|
+
"[Self::owner_queued_collateral_vault])."
|
|
3522
|
+
]
|
|
3523
|
+
},
|
|
3524
|
+
{
|
|
3525
|
+
"name": "reserve",
|
|
3526
|
+
"isMut": false,
|
|
3527
|
+
"isSigner": false,
|
|
3528
|
+
"docs": [
|
|
3529
|
+
"The reserve, needed only to validate the other accounts."
|
|
3530
|
+
]
|
|
3531
|
+
},
|
|
3532
|
+
{
|
|
3533
|
+
"name": "reserveCollateralMint",
|
|
3534
|
+
"isMut": false,
|
|
3535
|
+
"isSigner": false,
|
|
3536
|
+
"docs": [
|
|
3537
|
+
"The collateral mint, needed to invoke the transfer."
|
|
3538
|
+
]
|
|
3539
|
+
},
|
|
3540
|
+
{
|
|
3541
|
+
"name": "ownerQueuedCollateralVault",
|
|
3542
|
+
"isMut": true,
|
|
3543
|
+
"isSigner": false,
|
|
3544
|
+
"docs": [
|
|
3545
|
+
"The per-owner \"this reserve's queued collateral\" vault (from which the collateral will be",
|
|
3546
|
+
"recovered)."
|
|
3547
|
+
]
|
|
3548
|
+
},
|
|
3549
|
+
{
|
|
3550
|
+
"name": "userSourceCollateral",
|
|
3551
|
+
"isMut": true,
|
|
3552
|
+
"isSigner": false,
|
|
3553
|
+
"docs": [
|
|
3554
|
+
"The ticket's owner token account to which the ticket-locked collateral should be returned.",
|
|
3555
|
+
"",
|
|
3556
|
+
"Only the ticket's owner can indicate an arbitrary token account here. Permissionless",
|
|
3557
|
+
"executors must indicate the ticket's owner ATA."
|
|
3558
|
+
]
|
|
3559
|
+
},
|
|
3560
|
+
{
|
|
3561
|
+
"name": "collateralTokenProgram",
|
|
3562
|
+
"isMut": false,
|
|
3563
|
+
"isSigner": false,
|
|
3564
|
+
"docs": [
|
|
3565
|
+
"The program of [Self::reserve_collateral_mint], needed for transfer."
|
|
3566
|
+
]
|
|
3567
|
+
},
|
|
3568
|
+
{
|
|
3569
|
+
"name": "withdrawTicket",
|
|
3570
|
+
"isMut": true,
|
|
3571
|
+
"isSigner": false,
|
|
3572
|
+
"docs": [
|
|
3573
|
+
"The ticket's account, necessarily marked as [WithdrawTicket::invalid] first (by the",
|
|
3574
|
+
"`handler_withdraw_queued_liquidity`)."
|
|
3575
|
+
]
|
|
3576
|
+
},
|
|
3577
|
+
{
|
|
3578
|
+
"name": "withdrawTicketOwner",
|
|
3579
|
+
"isMut": true,
|
|
3580
|
+
"isSigner": false,
|
|
3581
|
+
"docs": [
|
|
3582
|
+
"The owner of the [Self::withdraw_ticket]; needed only to return the rent of the",
|
|
3583
|
+
"[WithdrawTicket] account."
|
|
3584
|
+
]
|
|
3585
|
+
}
|
|
3586
|
+
],
|
|
3587
|
+
"args": [
|
|
3588
|
+
{
|
|
3589
|
+
"name": "ticketSequenceNumber",
|
|
3590
|
+
"type": "u64"
|
|
3591
|
+
}
|
|
3592
|
+
]
|
|
3593
|
+
},
|
|
3190
3594
|
{
|
|
3191
3595
|
"name": "initGlobalConfig",
|
|
3192
3596
|
"accounts": [
|
|
@@ -3565,7 +3969,8 @@
|
|
|
3565
3969
|
{
|
|
3566
3970
|
"name": "minFullLiquidationValueThreshold",
|
|
3567
3971
|
"docs": [
|
|
3568
|
-
"Minimum liquidation value threshold triggering full liquidation for an obligation"
|
|
3972
|
+
"Minimum liquidation value threshold triggering full liquidation for an obligation, in full",
|
|
3973
|
+
"units of the quote currency (e.g. `2` means \"$2\", not \"2 lamports of USDC\")."
|
|
3569
3974
|
],
|
|
3570
3975
|
"type": "u64"
|
|
3571
3976
|
},
|
|
@@ -3709,61 +4114,133 @@
|
|
|
3709
4114
|
"type": "u8"
|
|
3710
4115
|
},
|
|
3711
4116
|
{
|
|
3712
|
-
"name": "priceTriggeredLiquidationDisabled",
|
|
4117
|
+
"name": "priceTriggeredLiquidationDisabled",
|
|
4118
|
+
"docs": [
|
|
4119
|
+
"Whether the liquidation operations that are triggered by price changes should be disabled.",
|
|
4120
|
+
"This includes regular liquidation (i.e. LTV exceeding the unhealthy threshold) and some",
|
|
4121
|
+
"obligation orders' execution.",
|
|
4122
|
+
"",
|
|
4123
|
+
"*Caution:* this flag is *disabling* the liquidations when `1` - contrary to all the other",
|
|
4124
|
+
"liquidation-driving flags (see e.g. [Self::autodeleverage_enabled])."
|
|
4125
|
+
],
|
|
4126
|
+
"type": "u8"
|
|
4127
|
+
},
|
|
4128
|
+
{
|
|
4129
|
+
"name": "matureReserveDebtLiquidationEnabled",
|
|
4130
|
+
"docs": [
|
|
4131
|
+
"Whether the debts that reached their reserve's [ReserveConfig::debt_maturity_timestamp] can",
|
|
4132
|
+
"be liquidated."
|
|
4133
|
+
],
|
|
4134
|
+
"type": "u8"
|
|
4135
|
+
},
|
|
4136
|
+
{
|
|
4137
|
+
"name": "obligationBorrowDebtTermLiquidationEnabled",
|
|
4138
|
+
"docs": [
|
|
4139
|
+
"Whether the [Obligation::borrows] that reached their [ReserveConfig::debt_term_seconds] can",
|
|
4140
|
+
"be liquidated."
|
|
4141
|
+
],
|
|
4142
|
+
"type": "u8"
|
|
4143
|
+
},
|
|
4144
|
+
{
|
|
4145
|
+
"name": "borrowOrderCreationEnabled",
|
|
4146
|
+
"docs": [
|
|
4147
|
+
"Whether new borrow orders can be created.",
|
|
4148
|
+
"Note: updating or cancelling existing orders is *not* affected by this flag."
|
|
4149
|
+
],
|
|
4150
|
+
"type": "u8"
|
|
4151
|
+
},
|
|
4152
|
+
{
|
|
4153
|
+
"name": "borrowOrderExecutionEnabled",
|
|
4154
|
+
"docs": [
|
|
4155
|
+
"Whether the existing borrow orders can be filled."
|
|
4156
|
+
],
|
|
4157
|
+
"type": "u8"
|
|
4158
|
+
},
|
|
4159
|
+
{
|
|
4160
|
+
"name": "proposerAuthority",
|
|
4161
|
+
"docs": [
|
|
4162
|
+
"Authority that can propose creating of new reserves but cannot enable them."
|
|
4163
|
+
],
|
|
4164
|
+
"type": "publicKey"
|
|
4165
|
+
},
|
|
4166
|
+
{
|
|
4167
|
+
"name": "withdrawTicketIssuanceEnabled",
|
|
3713
4168
|
"docs": [
|
|
3714
|
-
"Whether
|
|
3715
|
-
"
|
|
3716
|
-
"obligation orders' execution.",
|
|
3717
|
-
"",
|
|
3718
|
-
"*Caution:* this flag is *disabling* the liquidations when `1` - contrary to all the other",
|
|
3719
|
-
"liquidation-driving flags (see e.g. [Self::autodeleverage_enabled])."
|
|
4169
|
+
"Whether any new withdraw tickets can be issued (i.e. whether new requests can enter the",
|
|
4170
|
+
"withdraw queue)."
|
|
3720
4171
|
],
|
|
3721
4172
|
"type": "u8"
|
|
3722
4173
|
},
|
|
3723
4174
|
{
|
|
3724
|
-
"name": "
|
|
4175
|
+
"name": "withdrawTicketRedemptionEnabled",
|
|
3725
4176
|
"docs": [
|
|
3726
|
-
"Whether the
|
|
3727
|
-
"
|
|
4177
|
+
"Whether the existing withdraw tickets can be redeemed (i.e. whether the tickets can be used",
|
|
4178
|
+
"to transfer accumulated pending liquidity to destination accounts)."
|
|
3728
4179
|
],
|
|
3729
4180
|
"type": "u8"
|
|
3730
4181
|
},
|
|
3731
4182
|
{
|
|
3732
|
-
"name": "
|
|
4183
|
+
"name": "obligationBorrowRolloverConfigurationEnabled",
|
|
3733
4184
|
"docs": [
|
|
3734
|
-
"Whether the
|
|
3735
|
-
"
|
|
4185
|
+
"Whether the owners can enable the \"fixed term borrow rollover\" on their obligations.",
|
|
4186
|
+
"",
|
|
4187
|
+
"*Note 1:* the actual execution of (different kinds of) rollovers can be disabled by zeroing",
|
|
4188
|
+
"[Self::fixed_rollover_window_duration_seconds] and",
|
|
4189
|
+
"[Self::variable_rollover_window_duration_seconds].",
|
|
4190
|
+
"",
|
|
4191
|
+
"*Note 2:* when this configuration is disabled, the obligation owners can still disable their",
|
|
4192
|
+
"rollover (i.e. set the obligation's flags to zeroes)."
|
|
3736
4193
|
],
|
|
3737
4194
|
"type": "u8"
|
|
3738
4195
|
},
|
|
3739
4196
|
{
|
|
3740
|
-
"name": "
|
|
4197
|
+
"name": "padding2",
|
|
4198
|
+
"type": {
|
|
4199
|
+
"array": [
|
|
4200
|
+
"u8",
|
|
4201
|
+
5
|
|
4202
|
+
]
|
|
4203
|
+
}
|
|
4204
|
+
},
|
|
4205
|
+
{
|
|
4206
|
+
"name": "minWithdrawQueuedLiquidityValue",
|
|
3741
4207
|
"docs": [
|
|
3742
|
-
"
|
|
3743
|
-
"
|
|
4208
|
+
"Minimum value that can be withdrawn in a single `withdraw_queued_liquidity()` call, in full",
|
|
4209
|
+
"units of the quote currency (e.g. `2` means \"$2\", not \"2 lamports of USDC\")."
|
|
3744
4210
|
],
|
|
3745
|
-
"type": "
|
|
4211
|
+
"type": "u64"
|
|
3746
4212
|
},
|
|
3747
4213
|
{
|
|
3748
|
-
"name": "
|
|
4214
|
+
"name": "fixedRolloverWindowDurationSeconds",
|
|
3749
4215
|
"docs": [
|
|
3750
|
-
"
|
|
4216
|
+
"A configurable time window (right before the end of a fixed debt term) during which an",
|
|
4217
|
+
"auto-rollover into another *fixed* rate/term can happen.",
|
|
4218
|
+
"",
|
|
4219
|
+
"When zeroed, this rollover mode is effectively disabled.",
|
|
4220
|
+
"",
|
|
4221
|
+
"See [FixedTermBorrowRolloverConfig]."
|
|
3751
4222
|
],
|
|
3752
|
-
"type": "
|
|
4223
|
+
"type": "u64"
|
|
3753
4224
|
},
|
|
3754
4225
|
{
|
|
3755
|
-
"name": "
|
|
4226
|
+
"name": "variableRolloverWindowDurationSeconds",
|
|
3756
4227
|
"docs": [
|
|
3757
|
-
"
|
|
4228
|
+
"A configurable time window (right before the end of a fixed debt term) during which an",
|
|
4229
|
+
"auto-rollover into a *variable* (indefinite) rate/term can happen.",
|
|
4230
|
+
"",
|
|
4231
|
+
"When zeroed, this rollover mode is effectively disabled.",
|
|
4232
|
+
"",
|
|
4233
|
+
"This will typically be shorter than [Self::fixed_rollover_window_duration_seconds], acting",
|
|
4234
|
+
"as a fallback if a fixed reserve liquidity remains unavailable for considerable time."
|
|
3758
4235
|
],
|
|
3759
|
-
"type": "
|
|
4236
|
+
"type": "u64"
|
|
3760
4237
|
},
|
|
3761
4238
|
{
|
|
3762
4239
|
"name": "padding1",
|
|
3763
4240
|
"type": {
|
|
3764
4241
|
"array": [
|
|
3765
4242
|
"u64",
|
|
3766
|
-
|
|
4243
|
+
161
|
|
3767
4244
|
]
|
|
3768
4245
|
}
|
|
3769
4246
|
}
|
|
@@ -4256,12 +4733,148 @@
|
|
|
4256
4733
|
]
|
|
4257
4734
|
}
|
|
4258
4735
|
},
|
|
4736
|
+
{
|
|
4737
|
+
"name": "withdrawQueue",
|
|
4738
|
+
"docs": [
|
|
4739
|
+
"The tracker of ticket-based withdrawals."
|
|
4740
|
+
],
|
|
4741
|
+
"type": {
|
|
4742
|
+
"defined": "WithdrawQueue"
|
|
4743
|
+
}
|
|
4744
|
+
},
|
|
4259
4745
|
{
|
|
4260
4746
|
"name": "padding",
|
|
4261
4747
|
"type": {
|
|
4262
4748
|
"array": [
|
|
4263
4749
|
"u64",
|
|
4264
|
-
|
|
4750
|
+
204
|
|
4751
|
+
]
|
|
4752
|
+
}
|
|
4753
|
+
}
|
|
4754
|
+
]
|
|
4755
|
+
}
|
|
4756
|
+
},
|
|
4757
|
+
{
|
|
4758
|
+
"name": "WithdrawTicket",
|
|
4759
|
+
"docs": [
|
|
4760
|
+
"A finite-lifecycle account representing a specific depositor's place in the withdraw queue of",
|
|
4761
|
+
"a specific reserve.",
|
|
4762
|
+
"",
|
|
4763
|
+
"The lifecycle:",
|
|
4764
|
+
"1. The depositor holding ctokens wants to withdraw funds from the reserve, and finds out that",
|
|
4765
|
+
"the required amount is not available (due to high utilization).",
|
|
4766
|
+
"2. The depositor calls the `enqueue_to_withdraw` handler.",
|
|
4767
|
+
"3. The handler transfers the depositor's ctokens to the reserve's internal \"pending\" vault.",
|
|
4768
|
+
"4. The handler initializes a new [WithdrawTicket] account, with the next available sequence",
|
|
4769
|
+
"number.",
|
|
4770
|
+
"5. The depositor waits until his ticket is the next expected one for actual withdraw, and until",
|
|
4771
|
+
"the reserve has enough liquidity.",
|
|
4772
|
+
"6. Anyone (the depositor or a bot) calls the permissionless `withdraw_queued_liquidity`",
|
|
4773
|
+
"handler. If the ticket became invalid (e.g. destination account no longer exists), then the",
|
|
4774
|
+
"depositor can call the `recover_invalid_ticket_collateral` handler instead.",
|
|
4775
|
+
"7. The handler transfers the liquidity amount according to the current exchange rate.",
|
|
4776
|
+
"8. The handler closes the ticket account."
|
|
4777
|
+
],
|
|
4778
|
+
"type": {
|
|
4779
|
+
"kind": "struct",
|
|
4780
|
+
"fields": [
|
|
4781
|
+
{
|
|
4782
|
+
"name": "sequenceNumber",
|
|
4783
|
+
"docs": [
|
|
4784
|
+
"This ticket's place in the queue; the same as used for PDA derivation."
|
|
4785
|
+
],
|
|
4786
|
+
"type": "u64"
|
|
4787
|
+
},
|
|
4788
|
+
{
|
|
4789
|
+
"name": "owner",
|
|
4790
|
+
"docs": [
|
|
4791
|
+
"The funds' owner (the user who called the `enqueue_to_withdraw` handler)."
|
|
4792
|
+
],
|
|
4793
|
+
"type": "publicKey"
|
|
4794
|
+
},
|
|
4795
|
+
{
|
|
4796
|
+
"name": "reserve",
|
|
4797
|
+
"docs": [
|
|
4798
|
+
"The reserve to withdraw from."
|
|
4799
|
+
],
|
|
4800
|
+
"type": "publicKey"
|
|
4801
|
+
},
|
|
4802
|
+
{
|
|
4803
|
+
"name": "userDestinationLiquidityTa",
|
|
4804
|
+
"docs": [
|
|
4805
|
+
"The token account to which the finally-available liquidity should be transferred (by the",
|
|
4806
|
+
"`withdraw_queued_liquidity` handler)."
|
|
4807
|
+
],
|
|
4808
|
+
"type": "publicKey"
|
|
4809
|
+
},
|
|
4810
|
+
{
|
|
4811
|
+
"name": "queuedCollateralAmount",
|
|
4812
|
+
"docs": [
|
|
4813
|
+
"The amount of collateral still waiting to be withdrawn using this ticket."
|
|
4814
|
+
],
|
|
4815
|
+
"type": "u64"
|
|
4816
|
+
},
|
|
4817
|
+
{
|
|
4818
|
+
"name": "createdAtTimestamp",
|
|
4819
|
+
"docs": [
|
|
4820
|
+
"The timestamp at which the queue was entered.",
|
|
4821
|
+
"",
|
|
4822
|
+
"This is currently only a piece of metadata, not used by the logic."
|
|
4823
|
+
],
|
|
4824
|
+
"type": "u64"
|
|
4825
|
+
},
|
|
4826
|
+
{
|
|
4827
|
+
"name": "invalid",
|
|
4828
|
+
"docs": [
|
|
4829
|
+
"Whether the ticket has been found to be invalid (e.g. the [Self::user_destination_liquidity]",
|
|
4830
|
+
"has been repurposed) by the `withdraw_queued_liquidity` handler.",
|
|
4831
|
+
"To be specific: valid = `0`, invalid = `1`.",
|
|
4832
|
+
"",
|
|
4833
|
+
"An invalid ticket cannot be made valid again, and can only be passed to the",
|
|
4834
|
+
"`recover_invalid_ticket_collateral` handler."
|
|
4835
|
+
],
|
|
4836
|
+
"type": "u8"
|
|
4837
|
+
},
|
|
4838
|
+
{
|
|
4839
|
+
"name": "progressCallbackType",
|
|
4840
|
+
"docs": [
|
|
4841
|
+
"One of the valid [ProgressCallbackType] representations."
|
|
4842
|
+
],
|
|
4843
|
+
"type": "u8"
|
|
4844
|
+
},
|
|
4845
|
+
{
|
|
4846
|
+
"name": "alignmentPadding",
|
|
4847
|
+
"docs": [
|
|
4848
|
+
"Inner padding, for alignment."
|
|
4849
|
+
],
|
|
4850
|
+
"type": {
|
|
4851
|
+
"array": [
|
|
4852
|
+
"u8",
|
|
4853
|
+
6
|
|
4854
|
+
]
|
|
4855
|
+
}
|
|
4856
|
+
},
|
|
4857
|
+
{
|
|
4858
|
+
"name": "progressCallbackCustomAccounts",
|
|
4859
|
+
"docs": [
|
|
4860
|
+
"The (optional) accounts to be used by [Self::progress_callback_type]s."
|
|
4861
|
+
],
|
|
4862
|
+
"type": {
|
|
4863
|
+
"array": [
|
|
4864
|
+
"publicKey",
|
|
4865
|
+
2
|
|
4866
|
+
]
|
|
4867
|
+
}
|
|
4868
|
+
},
|
|
4869
|
+
{
|
|
4870
|
+
"name": "endPadding",
|
|
4871
|
+
"docs": [
|
|
4872
|
+
"Trailing padding, for future developments."
|
|
4873
|
+
],
|
|
4874
|
+
"type": {
|
|
4875
|
+
"array": [
|
|
4876
|
+
"u64",
|
|
4877
|
+
40
|
|
4265
4878
|
]
|
|
4266
4879
|
}
|
|
4267
4880
|
}
|
|
@@ -4375,7 +4988,7 @@
|
|
|
4375
4988
|
"name": "UpdateBorrowRateCurve"
|
|
4376
4989
|
},
|
|
4377
4990
|
{
|
|
4378
|
-
"name": "
|
|
4991
|
+
"name": "DeprecatedUpdateEntireReserveConfig"
|
|
4379
4992
|
},
|
|
4380
4993
|
{
|
|
4381
4994
|
"name": "UpdateDebtWithdrawalCap"
|
|
@@ -4641,6 +5254,24 @@
|
|
|
4641
5254
|
},
|
|
4642
5255
|
{
|
|
4643
5256
|
"name": "UpdateBorrowOrderExecutionEnabled"
|
|
5257
|
+
},
|
|
5258
|
+
{
|
|
5259
|
+
"name": "UpdateWithdrawTicketIssuanceEnabled"
|
|
5260
|
+
},
|
|
5261
|
+
{
|
|
5262
|
+
"name": "UpdateWithdrawTicketRedemptionEnabled"
|
|
5263
|
+
},
|
|
5264
|
+
{
|
|
5265
|
+
"name": "UpdateMinWithdrawQueuedLiquidityValue"
|
|
5266
|
+
},
|
|
5267
|
+
{
|
|
5268
|
+
"name": "UpdateFixedRolloverWindowDurationSeconds"
|
|
5269
|
+
},
|
|
5270
|
+
{
|
|
5271
|
+
"name": "UpdateVariableRolloverWindowDurationSeconds"
|
|
5272
|
+
},
|
|
5273
|
+
{
|
|
5274
|
+
"name": "UpdateObligationBorrowRolloverConfigurationEnabled"
|
|
4644
5275
|
}
|
|
4645
5276
|
]
|
|
4646
5277
|
}
|
|
@@ -4793,7 +5424,7 @@
|
|
|
4793
5424
|
"The minimum allowed debt term that the obligation owner agrees to.",
|
|
4794
5425
|
"The reserves used to fill this order *cannot* define their debt term *lower* than this.",
|
|
4795
5426
|
"",
|
|
4796
|
-
"If zeroed, then only
|
|
5427
|
+
"If zeroed, then only open-term reserves may be used."
|
|
4797
5428
|
],
|
|
4798
5429
|
"type": "u64"
|
|
4799
5430
|
},
|
|
@@ -4866,6 +5497,79 @@
|
|
|
4866
5497
|
]
|
|
4867
5498
|
}
|
|
4868
5499
|
},
|
|
5500
|
+
{
|
|
5501
|
+
"name": "FixedTermBorrowRolloverConfig",
|
|
5502
|
+
"docs": [
|
|
5503
|
+
"Settings driving the auto-rollover of an [ObligationLiquidity] that uses a fixed-term [Reserve]",
|
|
5504
|
+
"and approaches the end of its [ReserveConfig::debt_term_seconds].",
|
|
5505
|
+
"",
|
|
5506
|
+
"By its nature (not a special case), the zeroed struct mean \"no auto-rollover\"."
|
|
5507
|
+
],
|
|
5508
|
+
"type": {
|
|
5509
|
+
"kind": "struct",
|
|
5510
|
+
"fields": [
|
|
5511
|
+
{
|
|
5512
|
+
"name": "autoRolloverEnabled",
|
|
5513
|
+
"docs": [
|
|
5514
|
+
"Whether the borrow can be permissionlessly prolonged under the following *joint* conditions:",
|
|
5515
|
+
"",
|
|
5516
|
+
"The reserve used to re-borrow the liquidity must have:",
|
|
5517
|
+
"A) the exact same maximum borrow rate as the current one,",
|
|
5518
|
+
"B) the exact same debt term as the current one,",
|
|
5519
|
+
"C) sufficient available liquidity (including no withdraw tickets waiting in its queue).",
|
|
5520
|
+
"",
|
|
5521
|
+
"The time left until the current debt term expires must be:",
|
|
5522
|
+
"D) less than [LendingMarket::fixed_rollover_window_duration_seconds].",
|
|
5523
|
+
"",
|
|
5524
|
+
"Note: the other settings are only effective when this one is `1`."
|
|
5525
|
+
],
|
|
5526
|
+
"type": "u8"
|
|
5527
|
+
},
|
|
5528
|
+
{
|
|
5529
|
+
"name": "openTermAllowed",
|
|
5530
|
+
"docs": [
|
|
5531
|
+
"When `1`, partially lifts the condition *B* from [Self::auto_rollover_enabled]: additionally",
|
|
5532
|
+
"allows to use a variable (indefinite) debt term if less than",
|
|
5533
|
+
"[LendingMarket::variable_rollover_window_duration_seconds] is left until expiration.",
|
|
5534
|
+
"",
|
|
5535
|
+
"Note: typically this flag should be used together with [Self::max_borrow_rate_bps] set to",
|
|
5536
|
+
"`u32::MAX` (to denote a variable-rate reserve)."
|
|
5537
|
+
],
|
|
5538
|
+
"type": "u8"
|
|
5539
|
+
},
|
|
5540
|
+
{
|
|
5541
|
+
"name": "alignmentPadding",
|
|
5542
|
+
"docs": [
|
|
5543
|
+
"Internal alignment padding (free to reuse)."
|
|
5544
|
+
],
|
|
5545
|
+
"type": {
|
|
5546
|
+
"array": [
|
|
5547
|
+
"u8",
|
|
5548
|
+
2
|
|
5549
|
+
]
|
|
5550
|
+
}
|
|
5551
|
+
},
|
|
5552
|
+
{
|
|
5553
|
+
"name": "maxBorrowRateBps",
|
|
5554
|
+
"docs": [
|
|
5555
|
+
"A customization setting that can lift the condition *A* from [Self::auto_rollover_enabled]:",
|
|
5556
|
+
"when not zeroed, the rollover may use a reserve with a maximum borrow rate equal or lower",
|
|
5557
|
+
"than the given one."
|
|
5558
|
+
],
|
|
5559
|
+
"type": "u32"
|
|
5560
|
+
},
|
|
5561
|
+
{
|
|
5562
|
+
"name": "minDebtTermSeconds",
|
|
5563
|
+
"docs": [
|
|
5564
|
+
"A customization setting that can lift the condition *B* from [Self::auto_rollover_enabled]:",
|
|
5565
|
+
"when not zeroed, the rollover may use a reserve with a *fixed* debt term equal or longer",
|
|
5566
|
+
"than the given one."
|
|
5567
|
+
],
|
|
5568
|
+
"type": "u64"
|
|
5569
|
+
}
|
|
5570
|
+
]
|
|
5571
|
+
}
|
|
5572
|
+
},
|
|
4869
5573
|
{
|
|
4870
5574
|
"name": "InitObligationArgs",
|
|
4871
5575
|
"type": {
|
|
@@ -4999,12 +5703,22 @@
|
|
|
4999
5703
|
],
|
|
5000
5704
|
"type": "u64"
|
|
5001
5705
|
},
|
|
5706
|
+
{
|
|
5707
|
+
"name": "fixedTermBorrowRolloverConfig",
|
|
5708
|
+
"docs": [
|
|
5709
|
+
"The user's auto-rollover opt-ins - only effective when this borrow is fixed-term (i.e. its",
|
|
5710
|
+
"reserve has a non-zero [ReserveConfig::debt_term_seconds])."
|
|
5711
|
+
],
|
|
5712
|
+
"type": {
|
|
5713
|
+
"defined": "FixedTermBorrowRolloverConfig"
|
|
5714
|
+
}
|
|
5715
|
+
},
|
|
5002
5716
|
{
|
|
5003
5717
|
"name": "padding2",
|
|
5004
5718
|
"type": {
|
|
5005
5719
|
"array": [
|
|
5006
5720
|
"u64",
|
|
5007
|
-
|
|
5721
|
+
5
|
|
5008
5722
|
]
|
|
5009
5723
|
}
|
|
5010
5724
|
}
|
|
@@ -5620,9 +6334,13 @@
|
|
|
5620
6334
|
"type": "publicKey"
|
|
5621
6335
|
},
|
|
5622
6336
|
{
|
|
5623
|
-
"name": "
|
|
6337
|
+
"name": "totalAvailableAmount",
|
|
5624
6338
|
"docs": [
|
|
5625
|
-
"
|
|
6339
|
+
"Total reserve liquidity available.",
|
|
6340
|
+
"",
|
|
6341
|
+
"Note: not all of this liquidity can be freely used for any purpose. Production code should",
|
|
6342
|
+
"use the specialized getters - see e.g. [Reserve::total_available_liquidity_amount()],",
|
|
6343
|
+
"[Reserve::freely_available_liquidity_amount()]."
|
|
5626
6344
|
],
|
|
5627
6345
|
"type": "u64"
|
|
5628
6346
|
},
|
|
@@ -5752,6 +6470,41 @@
|
|
|
5752
6470
|
]
|
|
5753
6471
|
}
|
|
5754
6472
|
},
|
|
6473
|
+
{
|
|
6474
|
+
"name": "WithdrawQueue",
|
|
6475
|
+
"docs": [
|
|
6476
|
+
"A tracker of ticket-based withdrawals."
|
|
6477
|
+
],
|
|
6478
|
+
"type": {
|
|
6479
|
+
"kind": "struct",
|
|
6480
|
+
"fields": [
|
|
6481
|
+
{
|
|
6482
|
+
"name": "queuedCollateralAmount",
|
|
6483
|
+
"docs": [
|
|
6484
|
+
"The part of [ReserveLiquidity::total_available_amount] locked for ticketed withdrawals."
|
|
6485
|
+
],
|
|
6486
|
+
"type": "u64"
|
|
6487
|
+
},
|
|
6488
|
+
{
|
|
6489
|
+
"name": "nextIssuedTicketSequenceNumber",
|
|
6490
|
+
"docs": [
|
|
6491
|
+
"The sequence number of the next ticket to be issued when enqueueing to withdraw.",
|
|
6492
|
+
"Note: it is also a number of tickets issued so far."
|
|
6493
|
+
],
|
|
6494
|
+
"type": "u64"
|
|
6495
|
+
},
|
|
6496
|
+
{
|
|
6497
|
+
"name": "nextWithdrawableTicketSequenceNumber",
|
|
6498
|
+
"docs": [
|
|
6499
|
+
"The sequence number of the next ticket to be used for actually transferring the withdrawn",
|
|
6500
|
+
"liquidity (assuming it is available in the reserve).",
|
|
6501
|
+
"Note: it is also a number of fully-consumed tickets so far."
|
|
6502
|
+
],
|
|
6503
|
+
"type": "u64"
|
|
6504
|
+
}
|
|
6505
|
+
]
|
|
6506
|
+
}
|
|
6507
|
+
},
|
|
5755
6508
|
{
|
|
5756
6509
|
"name": "WithdrawalCaps",
|
|
5757
6510
|
"docs": [
|
|
@@ -5974,6 +6727,31 @@
|
|
|
5974
6727
|
]
|
|
5975
6728
|
}
|
|
5976
6729
|
},
|
|
6730
|
+
{
|
|
6731
|
+
"name": "ProgressCallbackType",
|
|
6732
|
+
"docs": [
|
|
6733
|
+
"A callback to be notified when the ticket is being processed.",
|
|
6734
|
+
"",
|
|
6735
|
+
"## Why an enum?",
|
|
6736
|
+
"",
|
|
6737
|
+
"Only reliable programs may be used for callbacks (since any error or panic returned from a CPI",
|
|
6738
|
+
"aborts an entire transaction, which would stall the queue progress). Hence, we need a whitelist,",
|
|
6739
|
+
"and the simplest initial implementation is a hardcoded enum. If we want to be able to add new",
|
|
6740
|
+
"whitelist items without SC updates, we can implement such support using a special enum value",
|
|
6741
|
+
"(e.g. `SPECIFIED_BY_PDA = 255`)."
|
|
6742
|
+
],
|
|
6743
|
+
"type": {
|
|
6744
|
+
"kind": "enum",
|
|
6745
|
+
"variants": [
|
|
6746
|
+
{
|
|
6747
|
+
"name": "None"
|
|
6748
|
+
},
|
|
6749
|
+
{
|
|
6750
|
+
"name": "KlendQueueAccountingHandlerOnKvault"
|
|
6751
|
+
}
|
|
6752
|
+
]
|
|
6753
|
+
}
|
|
6754
|
+
},
|
|
5977
6755
|
{
|
|
5978
6756
|
"name": "BorrowRateCurve",
|
|
5979
6757
|
"type": {
|
|
@@ -6806,6 +7584,56 @@
|
|
|
6806
7584
|
"code": 6143,
|
|
6807
7585
|
"name": "ExpectationNotMet",
|
|
6808
7586
|
"msg": "The on-chain state does not meet expectation specified by the caller, so the operation must be aborted (to avoid race conditions)"
|
|
7587
|
+
},
|
|
7588
|
+
{
|
|
7589
|
+
"code": 6144,
|
|
7590
|
+
"name": "WithdrawTicketIssuanceDisabled",
|
|
7591
|
+
"msg": "Issuing new withdraw tickets is disabled by the market"
|
|
7592
|
+
},
|
|
7593
|
+
{
|
|
7594
|
+
"code": 6145,
|
|
7595
|
+
"name": "WithdrawTicketRedemptionDisabled",
|
|
7596
|
+
"msg": "Redeeming withdraw tickets is disabled by the market"
|
|
7597
|
+
},
|
|
7598
|
+
{
|
|
7599
|
+
"code": 6146,
|
|
7600
|
+
"name": "WithdrawTicketStillValid",
|
|
7601
|
+
"msg": "Recovering collateral is only available after the withdraw ticket has been marked invalid"
|
|
7602
|
+
},
|
|
7603
|
+
{
|
|
7604
|
+
"code": 6147,
|
|
7605
|
+
"name": "WithdrawTicketRequiresFullRedemption",
|
|
7606
|
+
"msg": "The withdraw ticket's current state requires that it is fully redeemed (e.g. due to owner ATA creation), but there is not enough liquidity"
|
|
7607
|
+
},
|
|
7608
|
+
{
|
|
7609
|
+
"code": 6148,
|
|
7610
|
+
"name": "UserTokenBalanceMismatch",
|
|
7611
|
+
"msg": "The user's token account has changed its balance in an unexpected way"
|
|
7612
|
+
},
|
|
7613
|
+
{
|
|
7614
|
+
"code": 6149,
|
|
7615
|
+
"name": "WithdrawQueuedLiquidityValueTooSmall",
|
|
7616
|
+
"msg": "Available liquidity could not satisfy the minimum required ticketed withdrawal value"
|
|
7617
|
+
},
|
|
7618
|
+
{
|
|
7619
|
+
"code": 6150,
|
|
7620
|
+
"name": "InvalidTokenAccountState",
|
|
7621
|
+
"msg": "Token account is in a state preventing the handler's operation (e.g. frozen or delegate)"
|
|
7622
|
+
},
|
|
7623
|
+
{
|
|
7624
|
+
"code": 6151,
|
|
7625
|
+
"name": "WithdrawTicketInvalid",
|
|
7626
|
+
"msg": "Cannot use ticket that was already marked invalid"
|
|
7627
|
+
},
|
|
7628
|
+
{
|
|
7629
|
+
"code": 6152,
|
|
7630
|
+
"name": "InvalidWithdrawTicketProgressCallbackConfig",
|
|
7631
|
+
"msg": "Invalid configuration or required custom accounts for the requested withdraw ticket callback type"
|
|
7632
|
+
},
|
|
7633
|
+
{
|
|
7634
|
+
"code": 6153,
|
|
7635
|
+
"name": "WithdrawTicketProgressCallbackAccountsMissing",
|
|
7636
|
+
"msg": "One or more accounts required by the ticket's configured progress callback are missing"
|
|
6809
7637
|
}
|
|
6810
7638
|
]
|
|
6811
7639
|
}
|