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

Option Trading

The option trading library helps developers buy call or put options by performing the entire option trading flow when they make an order.

Function List

  • To fetch sign data from RPC

Method
Parameter Type
Error Message
fetchSignData()
-
'Error fetching sign data'
  • To place an order for the option trading

    • Input an object that includes option type (Call or Put), amount, underlying asset address (e.g. ETH address), premium asset (e.g. USDT address), expiration date (e.g. 2 hours, 8 hours, 24 hours)

Method
Parameter Type
Error Message
placeOrder(JVaultOrder: JVaultOrder)
 JVaultOrder:
(
optionType: OptionType;
  amount: BigNumber;
  underlyingAsset: Address;
  premiumAsset: Address;
  expiry: Date
)
'Error Placing order'
  • To settle the option order at expiration time

    • With two main parameter:

      • JVaultOrder refers to above option trading parameter

      • LiquidateType includes 'NotExercising', 'Exercising', 'ProfitTaking'

Method
Parameter Type
Error Message
liquidateOrder(JVaultOrder: JVaultOrder, liquidateType: LiquidateType)
 JVaultOrder:
(
optionType: OptionType;
  amount: BigNumber;
  underlyingAsset: Address;
  premiumAsset: Address;
  expiry: Date
);
LiquidateType:
(
  NotExercising,
  Exercising,
  ProfitTaking,
) // enum
'Error liquidateOrder'

Last updated