Orderbook Endpoints
placeOrder
Places an order on an event.
Method: update isSigned: true
Parameters
Name | Type | Description | Optional |
---|---|---|---|
marketId | Nat | The id of the market you wish to get the order book for | No |
orderData | PlaceOrder: public type PlaceOrder = { side : OrderSide; odds : Nat; // in E8S so 200_000_000 = 2.0 decimal odds contracts : Nat; // in E8S so 100_000_000 = 1 contract }; public type OrderSide = { #buy; #sell; }; | The object containing order data you wish to validate | No |
blockHeight | Nat | The blockHeight response from the transfer of funds to the canister completed prior to placing the order | No |
Response
Returns: ?T.ImmutableOrder
where ImmutableOrder is defined as:
public type ImmutableOrder = {
id : OrderID;
eventId : EventID;
user : Principal;
createdAt : Time.Time;
marketId : MarketID;
side : OrderSide;
premium : Premium;
initialContracts : Nat; // in E8S so 100_000_000 = 1 contract
currentContracts : Nat; // in E8S so 100_000_000 = 1 contract
status : OrderStatus;
};
public type OrderID = Text;
public type EventID = Nat;
public type MarketID = Nat;
public type OrderSide = {
#buy;
#sell;
};
public type Premium = Nat;
public type OrderStatus = {
#open;
#cancelled;
#filled;
};