Account address to pay for the order. Typically, this is the same as ownerAddress if providing SOL, else the SPL token wallet for the relevant token.
market
string
Smart contract address/symbol of the market.
side
string
Order type: βASKβ or βBIDβ
amount
number
Order size
price
number
Order price. Not applicable if the type is "market"
type
string
Supported types: "LIMIT", "IOC", "POSTONLY"
openOrdersAddress
string
Define with open order address to place the order in case of having multiple open order addresses. Specify for a faster response.
clientOrderId
string
OPTIONAL. Client order ID which can useful for unique identifying orders, since there aren't any other ID-like fields immediately available. This field is only as reliable as the user that provides it.
computeLimit
number
OPTIONAL. Specifies total compute limit to be allocated for all instructions within the created tx
computePrice
number
OPTIONAL. Specifies compute price in Lamport (0.000001 SOL = 1,000 Lamport) to be included as a part of instruction, known as priority fee.
tip
uint64
OPTIONAL. Specifies a tip amount that will be used to pay for front-running protection or bundle submission services. The minimum value is What is tip?
//Make sure to set environment variable AUTH_HEADER.newOrderUnsignedTransaction, err := g.PostOrder( ctx, "BraJjCwLLqw8TciQXYruDEF4YhDkGwoEnwnAdwJSjcgC", // owner solana wallet address"4raJjCwLLqw8TciQXYruDEF4YhDkGwoEnwnAdwJSjcgv", // SPL token wallet address "SOL/USDC", // market pb.Side_S_BID, // trade side (Bid/Ask) []pb.OrderType{pb.OrderType_OT_LIMIT}, // OrderType20, // order sizefloat64(0.124), // order price provider.PostOrderOpts{ ClientOrderID: 5000, // Client controlled OrderID })
#Make sure to set environment variable AUTH_HEADER.await api.post_order( owner_address=PUBLIC_KEY, payer_address=PUBLIC_KEY, market="SOLUSDC", side=proto.Side.S_ASK, type=[proto.OrderType.OT_LIMIT], amount=0.1, price=150_000,# optional, but much faster if known open_orders_address="5yyh4mzzycmjfR6arY736d1mB6vNSLiUaFWfepKLf8kZ",# optional, for identification client_order_i_d=0,)
This example places an order exchanging 0.1 SOL for USDC, at the price of 10000000 SOL/USDC. Since the submitter (AFT8VayE7qr8MoQsW3wHsDS83HhEvhGWdbNSHRKeUDfQ ) is providing SOL , they can specify their Solana address as the payerAddress. In the opposite case ("side": "S_BID"), the submitter must provide their USDC wallet address.
In the future, this transaction's resulting order can be uniquely retrieved using the "clientOrderID": "1234" if there are no other transactions from the same user with the same clientOrderID. Note that even cancelled orders cannot reuse the same clientOrderID without causing issues with , though this will not have any effect on the orderbook's ability to fill the transaction itself.