@rabbitholegg/questdk-plugin-vela
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-alpha.35 • Public • Published

Vela Options (Derivitives) Plugin

This plugin is designed to filter valid trades using Vela Exchange. Vela Exchange is a decentralized trading platform with its foundations in the Arbitrum ecosystem.

Overview

This plugin uses the OptionsActionParams

Other Notes

  • Trades that are either short or long will pass.
  • There is a one-click trading mode that uses an abstracted wallet. We do not have support for this at present.

Vela Docs

Sample Transaction

Other Notes

function newPositionOrderPacked(uint256 a, uint256 b, uint256 c) external payable {
  uint256 tokenId = a / 2 ** 240; //16 bits for tokenId
  uint256 tmp = (a % 2 ** 240) / 2 ** 232;
  bool isLong = tmp / 2 ** 7 == 1; // 1 bit for isLong
  OrderType orderType = OrderType(tmp % 2 ** 7); // 7 bits for orderType
  address refer = address(uint160(a)); //last 160 bit for refer
  uint256[] memory params = new uint256[](4);
  params[0] = b / 2 ** 128; //price
  params[1] = b % 2 ** 128; //price
  params[2] = c / 2 ** 128; //collateral
  params[3] = c % 2 ** 128; //size
  newPositionOrder(tokenId, isLong, orderType, params, refer);
}```

Readme

Keywords

none

Package Sidebar

Install

npm i @rabbitholegg/questdk-plugin-vela

Weekly Downloads

921

Version

1.0.0-alpha.35

License

ISC

Unpacked Size

3.99 MB

Total Files

89

Last publish

Collaborators

  • quazia
  • jamierabbithole
  • rhjim