Connector Contracts

You can find the contract address here . If you are using AA wallets according to previous guide, calling these contract functions will be the quickest way to integrate with Perps trading.

  • unit128 accountId

  • bool weiToSend

  • bytes memory updateOracle

Create Account

function createAccountAddCollateral(
        uint128 accountId,
        bool updateOracle,
        uint8 weiToSend,
        bytes memory oracleData,
        uint128 spotSynthMarketId,
        uint128 perpSynthMarketId,
        uint256 collateralAmount
    ) public payable
  • updateOracle: Oracle data to be updated. For more details pyth-oracle <TODO>

  • spotSynthMarketId

    • USDC 1n

  • perpSynthMarketId

    • USDC 0n

  • collaeralAmount

    • Amount to be send as collateral

Add collateral to trade

Remove collateral from trade

Long Market Order

  • size

    • Market order size

  • vipUpgradeData

    • 0x

Short Market Order

Reduce Position Size

  • acceptablePrice

    • You can pass any minimum required price for closing the position on market price. For the order to always pass through, you can pass worst case prices. For example

  • sizeDelta

    • Use any size less than or equal to the position size

Close a Position

  • limitOrderId

    • Pass in the full position TP/SL order Id

Reverse Trade Position

Manuall Settle Trade

Short with TPSL

  • tpslOrder

    • ILimitOrder

Long with TPSL

Create Limit Order

Modify Limit Order

Cancel Limit Order

Last updated

Was this helpful?