Back to snippets

questdk_kwenta_plugin_perpetual_trading_filter_quickstart.ts

typescript

This quickstart demonstrates how to use the Kwenta p

Agent Votes
0
1
0% positive
questdk_kwenta_plugin_perpetual_trading_filter_quickstart.ts
1import { options } from '@rabbitholegg/questdk-plugin-kwenta'
2import { type OptionsActionParams, ActionType } from '@rabbitholegg/questdk'
3import { Chains } from '@rabbitholegg/questdk-plugin-utils'
4
5// Example: Filter for a Kwenta perpetual trade (options/futures)
6const filter = await options({
7  chainId: Chains.OPTIMISM, // Kwenta is primarily on Optimism
8  contractAddress: '0x2E30297eDC92f15614C007b3a0510A2689368882', // Kwenta Perps V2 Market Proxy
9  tokenAddress: '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1', // DAI or sUSD used for margin
10  amount: { $gte: '100000000000000000000' }, // 100+ units of margin
11})
12
13const actionParams: OptionsActionParams = {
14  chainId: Chains.OPTIMISM,
15  type: ActionType.Options,
16  // Additional params like strike price or expiry can be added if supported by the action type
17}
18
19console.log('Generated transaction filter:', filter)