Skip to main content

ixWrapperManagerUpdatePosition

Updates the vault’s strategy position tracking. Managers use this to register or deregister positions such as orderbook offer indices, token account balances, and Kamino obligation entries. This uses the wrapper instruction which executes via self-CPI. Requires the manager role.

Usage

import { positionUpdate, priceId } from "@exponent-labs/exponent-sdk/client/vaults";

// Add a Kamino obligation entry
const ix = vault.ixWrapperManagerUpdatePosition({
  manager: wallet.publicKey,
  update: positionUpdate("AddKaminoObligationEntry", [{
    obligationAddress: kaminoObligation,
    lendingMarket: kaminoLendingMarket,
    priceIdDeposit: priceId("Simple", { priceId: 0n }),
    priceIdBorrow: priceId("Simple", { priceId: 1n }),
  }]),
});

const tx = new Transaction().add(ix);
await sendAndConfirmTransaction(connection, tx, [wallet]);

Parameters

NameTypeRequiredDescription
managerPublicKeyYesManager wallet (must be signer)
updatePositionUpdateYesThe position change to apply
remainingAccountsAccountMeta[]NoAdditional accounts for specific updates
exponentPricesPublicKeyNoExponentPrices PDA. Auto-derived
systemProgramPublicKeyNoSystem program. Defaults to SystemProgram.programId
See Manager Update Position (raw) for the full PositionUpdate variant list.

Returns

TransactionInstruction — a single instruction that updates the vault’s position tracking.