QuickTrade
Execute trades instantly with just one API call. QuickTrade automatically generates a quote and executes your order immediately, eliminating the need for separate quote and submit steps.
Endpoint
Portfolio API: POST https://ddp.definitive.fi/v2/portfolio/quicktrade
Organization API: Replace
/v2/portfolio/with/v2/organization/portfolios/{portfolioId}/. See Portfolio vs. Organization API.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| chain | string | Yes | Chain identifier (e.g. "ethereum", "polygon", "arbitrum") |
| targetAsset | string | Yes | Asset address you want to buy/sell |
| contraAsset | string | Yes | Asset address you're trading against |
| qty | string | Yes | Quantity to trade |
| orderSide | string | Yes | "buy" or "sell" |
| slippageTolerance | string | No | Max allowed slippage (e.g. "0.01" = 1%). Default: "0.01". Recommended for price protection. |
| displayAssetPrice | string | No | Notional price of target asset (e.g. "4454.24"). Recommended for price protection — validates execution price. |
| secondsToExpire | number | No | Time until order expiration in seconds (minimum: 1). Default: ~5 seconds. Increase for slower-processing orders. |
Request Body Examples
const tradeResponse = await AuthHelpers.signAndSend({
path: "/v2/portfolio/quicktrade",
method: "POST",
body: {
chain: "ethereum",
targetAsset: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // WETH
contraAsset: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // USDC
qty: "1000",
orderSide: "buy",
},
apiKey: process.env.API_KEY,
apiSecret: process.env.API_SECRET,
});Response
{
"orderId": "00000000-0000-0000-0000-000000000005"
}Benefits
- Faster execution: Single API call instead of quote -> submit flow
- Reduced latency: No network round-trip between quote and execution
- Simpler integration: Less code and fewer edge cases to handle
- Atomic operation: Quote and execution happen together, reducing slippage risk
Rate Limiting
QuickTrade endpoints have custom rate limiting to balance speed with system stability. The limits are higher than standard endpoints to support legitimate high-frequency trading.
Optional Quote Preview
If you want to preview pricing before executing, use the QuickTrade Quote endpoint.