For the complete documentation index, see llms.txt. This page is also available as Markdown.

Quickstart: First API Trade

This guide walks through the smallest API flow for a partner integration:

  1. Discover a tradable stock.

  2. Confirm mUSD.

  3. Deposit if needed.

  4. Place a market buy.

  5. Record and track the transaction.

  6. Confirm the portfolio changed after settlement.

Use this as the smoke test before adding limit orders, withdrawals, or One Click.

Flow

1. Configure Request Context

Every request must include:

Header
Example

x-api-key

Partner API key

x-api-ts

Current Unix milliseconds

x-api-nonce

UUID

x-api-sign

HMAC-SHA256 authentication value

x-api-chain-id

8453, 143, 1, or target chain

x-api-p

MondayTrade for the MondayTrade API

Use the exact /api/v1/... path in the HMAC payload. Do not include the domain or /rwa/trading.

2. Discover a Tradable Stock

Pick an item where tradable is true. Relevant response fields:

Field
Use

symbol

Symbol and quote lookup

contractAddress

stockAddress for order requests

price

Quote context

Optional quote refresh:

3. Check Portfolio

For a plain market buy, check mUsdBalance, the API field for mUSD. Wallet USDC is not buying power until it is deposited into mUSD. If the cash token is approved and instant deposit is available, /api/v1/orders/with-deposit/calldata can deposit and place the buy in one transaction.

4. Deposit Cash If Needed

First check allowance:

If allowance is too low, have the user approve the spender from cash/deposits.md.

Then build deposit calldata:

Example body:

Submit the returned toAddress, value, and callData on-chain. Then record:

Poll deposit detail until operationStatus is settled or mUsdBalance is updated.

5. Place a Market Buy

Build order calldata:

Example body:

Submit the returned StockRouter transaction with your wallet client.

6. Record and Track the Order

Record the self-submitted tx:

Example:

Then track:

The transaction can be mined before execution and settlement are final. Treat the order as final only after it moves into history and portfolio balances reflect the settlement.

7. Confirm Portfolio

After settlement:

Expected result:

  • mUsdBalance decreases by filled notional plus fees, with unspent mUSD refunded.

  • The bought stock appears as exchangeBalance.

  • Order detail shows settlement fields such as settlePrice, settlePay, and settleReceive.

Next Steps

Need
Doc

viem implementation

Understand statuses

Add One Click

Last updated