@perena/vault-sdk 1.0.28 → 1.0.30
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 +20 -3
- package/dist/index.d.ts +433 -31
- package/dist/index.js +759 -53
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -406,8 +406,25 @@ const plan = await client.tx.executeWithdraw.getTx({
|
|
|
406
406
|
await client.sendTransaction(payer, plan);
|
|
407
407
|
```
|
|
408
408
|
|
|
409
|
-
|
|
410
|
-
|
|
409
|
+
Prefer the external-liquidity route when transaction size is not a constraint.
|
|
410
|
+
The builder auto-detects external liquidity slot 0 and, when it finds an active
|
|
411
|
+
Marginfi position for the asset, emits `execute_withdraw_from_external` instead
|
|
412
|
+
of `execute_withdraw`. That route can pull from the vault's external position in
|
|
413
|
+
the same transaction, so it draws on far more liquidity than the plain
|
|
414
|
+
`execute_withdraw`: the external-liquidity integrity service keeps only ~0.5% of
|
|
415
|
+
each holding in the vault's own token account (see
|
|
416
|
+
`DEFAULT_TARGET_LOCAL_BPS`) and deploys the rest into Marginfi, so a plain
|
|
417
|
+
withdrawal is capped at that small local buffer and will fail for anything
|
|
418
|
+
larger.
|
|
419
|
+
|
|
420
|
+
The cost is transaction size — the Marginfi withdraw CPI adds its bank, oracle,
|
|
421
|
+
and liquidity-vault accounts on top of the withdrawal's own accounts. Pass
|
|
422
|
+
`lookupTables` to keep the transaction within the packet limit; only fall back
|
|
423
|
+
to the local-only path (`skipExternalLiquidity: true`) when you are size-bound
|
|
424
|
+
or the vault has no funded external position.
|
|
425
|
+
|
|
426
|
+
To supply the external route explicitly instead of relying on auto-detection,
|
|
427
|
+
pass `externalWithdrawIxRefs`, `externalWithdrawAccounts`, and optionally
|
|
411
428
|
`lookupTables` — see `ExecuteWithdrawTxArgs` in `args.ts`.
|
|
412
429
|
|
|
413
430
|
### Example: vault setup (multi-step)
|
|
@@ -605,7 +622,7 @@ All builders are on `client.tx`:
|
|
|
605
622
|
| `requestJuniorTrancheWithdraw` | `request_junior_tranche_withdraw` | Owner |
|
|
606
623
|
| `cancelJuniorTrancheWithdraw` | `cancel_junior_tranche_withdraw` | Owner |
|
|
607
624
|
| `fulfillJuniorTrancheWithdraw` | `fulfill_junior_tranche_withdraw` | Fulfiller |
|
|
608
|
-
| `executeWithdraw` | `execute_withdraw`
|
|
625
|
+
| `executeWithdraw` | `execute_withdraw` / `execute_withdraw_from_external` | User |
|
|
609
626
|
| `managerWithdrawAsset` | `manager_withdraw_asset` | HW manager |
|
|
610
627
|
| `managerRedepositAsset` | `manager_redeposit_asset` | HW manager |
|
|
611
628
|
| `protocolInteraction` | `protocol_interaction` | HW manager |
|