API

API for Ethereum Wallets

This section explains how to interact with the bigshortbets P2P Futures Market using Ethereum wallets.

Contract Address: 0x0000000000000000000000000000000000000859 Solidity Version: >=0.8.3


Function Reference

  • create_order

    • Creates a new order.

    • Parameters:

      • market (uint64): Market ID.

      • price (uint256): Price of the order.

      • quantity (uint32): Quantity of the order.

      • order_side (OrderSide): Indicates whether the order is Long or Short.

      • (Optional) margin (uint8): Margin percentage.

  • cancel_order

    • Cancels an existing order and unlocks the reserved funds.

    • Parameters:

      • market (uint64): Market ID.

      • order_id (uint64): ID of the order to cancel.

  • close_position

    • Places a closing order for the position with the specified ID.

    • Parameters:

      • market (uint64): Market ID.

      • position_id (uint64): ID of the position for which a closing order will be created.

      • price (uint256): Price of the closing order.

      • quantity (uint32): Quantity to close.

  • deposit

    • Adds funds to the selected market margin.

    • Parameters:

      • market (uint64): Market ID.

      • amount (uint256): Amount of funds to add.

  • withdraw

    • Withdraws a specified amount of excess funds from the margin of the selected market.

    • Parameters:

      • market (uint64): Market ID.

      • amount (uint256): Amount to withdraw.

  • withdraw_all

    • Withdraws all excess funds from the margin of the selected market.

    • Parameters:

      • market (uint64): Market ID.


Last updated