Trading Futures on Etherscan
On-chain perpetual futures have the benefit of allowing users to execute trades directly through the futures contracts if they are unable to access the Bit Bank frontend, safeguarding them from not being able to interact with the market.
In the event Bit Bank becomes unavailable, you can still manage positions directly on etherscan. Each futures market has a corresponding smart contract that can be accessed regardless of the state of Bit Bank, with an up-to-date list of contracts available at docs.bit-bank.io.
The most likely need for this is the ability to close a position, which we will cover first. These steps must be completed on every assets contract with an open position you wish to interact with.
Closing your position
Head over to an assets writeContract tool on etherscan (We are using the ETH futures market contract found here.)
Connect your wallet, and call the
#2 close position
function.Withdraw available xUSD by using the
#13 WithdrawAllMargin
function.
Steps:
Connect the wallet that holds the open perps position on the assets contract page on etherscan.
When connected, the
connect to Web3
button will display connected as well as the connect eth address. (Make sure you are connected to the correct wallet)Users will see a number of functions available to them for our purposes, we will focus on the
#2 close position function

 WithdrawAllMargin function
.To close a position, call function
2. closePositions
, selectwrite
and submit the transactions through metamask. After clicking theWrite
button and confirming your transaction on Metamask, the position will be closed.Next, you’ll be able to withdraw all of your margin within the specified contract by calling function
13. withdrawAllMargin
selectingwrite
and submitting the transaction. After clicking theWrite
button and confirming your transaction on Metamask, the xUSD will be sent back to your wallet. Repeat these steps for every asset with an open position you wish exit. Available futures contracts can be found at .
Querying Position Information
Head over to your assets readContract tool on etherscan (We are using ETH).
Have your ETH address ready to paste
Steps:
Select a read function that corresponds to the position information you wish to retrieve. We will cover a few like the current oracle price, position liquidation price, and a few others.
You can query the current asset oracle price by calling the function
#3 AssetPrice
and selectingquery
. This will query the assets contract for the current oracle price and return a uint256 value. Since Ethereum works on 18 decimal places, we will need to count back 18 places to get a usable number. Turning 1341680000000000000000 into a current Ethereum price of $1341.68.You can query your open positions liquidation price by calling function
#13 LiquidationPrice
, entering your ETH address, and selectingquery.
This will return a uint256 value. Counting back 18 decimal places (Ethereum works with 18 decimal places), we see the position will be liquidated when the price of Ethereum reaches $132,235.08.
All position stats can be queried in a similar fashion in case the Bit Bank frontend becomes inaccessible.
Last updated