What it offers
- addLiquidity: Place an order adding liquidity to the MUX pool (receive MLP tokens)
- removeLiquidity: Place an order removing liquidity (burn MLP tokens)
- placePositionOrder3: Place a leveraged position order
- cancelOrder: Cancel a pending order
Notes
- Aggregates perpetual DEXs (GMX, Gains, etc.)
- subAccountId (bytes32) encodes: account address + collateral token ID + asset ID + isLong flag
- tokenId is a uint8 index identifying the collateral asset (0=ETH, 1=BTC, etc.)
- MLP is the liquidity provider token
- Position orders require ETH execution fee sent as msg.value
Its names in a program
On Arbitrum One,MuxProtocol is a namespace: its contracts need no import.
Deployments
ABI
LiquidityPoolABI
import LiquidityPoolABI from "./protocols/mux-protocol/LiquidityPoolABI.json"; Speaks for: liquidityPool.
depositCollateral(bytes32 subAccountId, uint256 rawAmount)getAssetAddress(uint8 assetId) view returns (address)getSubAccount(bytes32 subAccountId) view returns (uint96 collateral, uint96 size, uint32 lastIncreasedTime, uint96 entryPrice, uint128 entryFunding)
OrderBookABI
import OrderBookABI from "./protocols/mux-protocol/OrderBookABI.json"; Speaks for: orderBook.
cancelOrder(uint64 orderId)placeLiquidityOrder(uint8 assetId, uint96 rawAmount, bool isAdding) payableplacePositionOrder3(bytes32 subAccountId, uint96 collateralAmount, uint96 size, uint96 price, uint8 profitTokenId, uint8 flags, uint32 deadline, bytes32 referralCode, (uint96 tpPrice, uint96 slPrice, uint8 tpslProfitTokenId, uint32 tpslDeadline) extra) payable
Next steps
- Protocols: the other protocols, by what they do.
- Protocols and tokens: calling a contract by its namespace, or through its ABI.
- Glossary: the words these pages use, in plain terms.
