1
Set Up
Imports, env config, and the wallet and RPC client used across every step.
Imports, env, and wallet
Imports, env, and wallet
2
Find the Equity Mint
Find Equities adds retries and lookup by mint.
Find the equity mint
Find the equity mint
3
Call the Order Endpoint
Set
inputMint to USDC and outputMint to the equity mint. Pass userPublicKey so the /order response includes a transaction for that wallet to sign. Equity Order Execution describes the equity fields in the response.Request an order
Request an order
4
Sign and Choose the Submission Path
Sign the transaction. Where to submit it depends on the order response: Submit a Sync Response when
submitEndpointRequired is true, Submit an Async Response when executionMode is async, and through your own RPC otherwise.Sign and submit
Sign and submit
Submit a Sync Response
Send the signed transaction to the submit transaction endpoint and confirm the signature onchain through your own RPC. Submit Transaction Errors lists the endpoint’s errors.Submit a sync response
Submit a sync response
Submit an Async Response
Anasync response’s transaction is complete once the user signs it. Send it through your own RPC, then track the order with the returned signature and the response’s lastValidBlockHeight, as in Track an Async Equity Order.
Submit an async response
Submit an async response
Sell an Equity
To sell, setinputMint to the equity mint. Set amount to the raw token amount, in the mint’s decimals and before the ScaledUiAmount multiplier. Read the decimals from the mint with getTokenSupply.
Sell an equity
Sell an equity
sell.transaction, then branch as above.