For the complete documentation index, see llms.txt. This page is also available as Markdown.

Pledge In Position

The pledgeInPosition function allows users to add more collateral to an existing position.

Function Signature

pledgeInPosition(
  pcpId: string,
  collateralToken: string,
  indexToken: string,
  amount: number,
  coinObjects: string[],
  long: boolean
): Promise<TransactionBlock>

Parameters

  • pcpId: The ID of the position to pledge into

  • collateralToken: The token used as collateral (e.g., "USDC")

  • indexToken: The token used as the market index (e.g., "BTC")

  • amount: The amount of collateral to add

  • coinObjects: Array of coin object IDs to use for the transaction

  • long: Boolean indicating if this is a long (true) or short (false) position

Return Value

Returns a Promise that resolves to a TransactionBlock object.

Usage Example

Last updated