Market are define as a pair of assets such as ETH-GBP
. ETH
is the base asset, while GBP
is the quote asset.
Prices are expressed in quote asset values.
enum Markets {
ETH_GBP
}
type PriceQuote {
price: String!
quoteId: String!
fee: Float
expiration: Int!
}
type Query {
priceQuote(market: Markets!): PriceQuote!
}
Where $market
equal to ETH-GBP
enum OrderStatus {
OK
}
enum OrderSide {
BUY
SELL
}
Exchange GBP for ETH:
type Mutation {
createOrder(order: CreateOrderInput!): OrderStatus!
}
Where OrderInput
equals to:
input CreateOrderInput {
market: Markets!
price: Float!
priceQuoteId: String
side: OrderSide!
quoteAmount: String # Amount in GBP
}
Exchange ETH for GBP:
type Mutation {
createOrder(order: CreateOrderInput!): OrderStatus!
}
Where OrderInput
equal:
input CreateOrderInput {
market: Markets!
price: String
priceQuoteId: String
side: OrderSide!
baseAmount: String # Amount in ETH
}