Place Order

Submit a signed order on behalf of a user.

Usage (Convenience Method)

The easiest way to place an order is using the build result directly:

result = builder.place_order_for_user_from_build_result(
    build_result=build_result,     # From build_order_for_signing()
    signature=signature,           # User's signature on struct_hash
    user_wallet_address="0xSafeAddress...",
)

Parameters

Parameter
Type
Required
Description

build_result

dict

Yes

Result from build_order_for_signing()

signature

str

Yes

User's signature (hex string starting with 0x)

user_wallet_address

str

Yes

User's Safe wallet address (must match order maker)

Usage (Full Control)

For more control, pass the order fields explicitly:

result = builder.place_order_for_user(
    order=build_result["order"],
    signature=signature,
    user_wallet_address="0xSafeAddress...",
    market_id=build_result["market_id"],
    order_type=build_result["order_type"],
    price=build_result["price"],
    currency_address=build_result["currency_address"],
)

Parameters

Parameter
Type
Required
Description

order

dict

Yes

Order struct from build_order_for_signing()

signature

str

Yes

User's signature (hex string starting with 0x)

user_wallet_address

str

Yes

User's Safe wallet address (must match order["maker"])

market_id

int

No

Market ID

order_type

int

No

LIMIT_ORDER (2) or MARKET_ORDER (1)

price

str

No

Price for display

currency_address

str

No

Quote token address

Response

API response dict with order details (structure depends on backend).

Notes

  • The order["maker"] must match user_wallet_address (lowercased). An InvalidParamError is raised if they differ.

  • The signature must start with 0x.

  • Order signing uses user.sign_hash(struct_hash) -- see Build Order for details.