IEngine
Last updated
Last updated
This interface defines the functions that can be called on the Engine contract. These functions provide various operations related to market orders, limit orders, market prices, and adding new trading pairs.
mktPrice
Retrieves the market price of the specified trading pair.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
getOrderbook
Retrieves the address of the order book corresponding to the specified bookId
.
Name | Type | Description |
---|---|---|
marketBuy
Executes a market buy order for the specified trading pair and amount.
marketSell
Executes a market sell order for the specified trading pair and amount.
limitBuy
Places a limit buy order for the specified trading pair, amount, and price.
limitSell
Places a limit sell order for the specified trading pair, amount, and price.
addPair
Adds a new trading pair to the engine and returns the address of the corresponding order book.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
base
address
The address of the base asset in the trading pair.
quote
address
The address of the quote asset in the trading pair.
mktPrice
uint256
The market price of the trading pair.
bookId
uint256
The ID of the order book.
orderbook
address
The address of the order book.
base
address
The address of the base asset in the pair.
quote
address
The address of the quote asset in the pair.
amount
uint256
The amount of the base asset to buy.
base
address
The address of the base asset in the trading pair.
quote
address
The address of the quote asset in the trading pair.
amount
uint256
The amount of the base asset to sell.
base
address
The address of the base asset in the trading pair.
quote
address
The address of the quote asset in the trading pair.
amount
uint256
The amount of the base asset to buy.
price
uint256
The price at which to buy the base asset.
base
address
The address of the base asset in the trading pair.
quote
address
The address of the quote asset in the trading pair.
amount
uint256
The amount of the base asset to buy.
price
uint256
The price at which to buy the base asset.
base
address
The address of the base asset in the trading pair.
quote
address
The address of the quote asset in the trading pair.
book
address
The address of the created order book.