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.
Request URL
POST https://ddp.definitive.fi/v2/portfolio/quicktrade
Example
// Execute a trade directly - no quote step needed!
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,
});
console.log("Trade executed!", tradeResponse);
Request Body
{
chain: string, // e.g. "ethereum", "polygon", "arbitrum"
targetAsset: string, // Asset address you want to buy/sell
contraAsset: string, // Asset address you're trading against
qty: string, // Quantity to trade
orderSide: "buy" | "sell",
slippageTolerance: "0.01",
displayAssetPrice: "4454.24" // optional: notional price of target asset
}
Note: please set slippageTolerance and displayAssetPrice for price protection.
Response
{
orderId: string, // e.g. "00000000-0000-0000-0000-000000000001"
status: string, // e.g. "PENDING"
type: string, // e.g. "MARKET"
side: string, // e.g. "BUY"
baseAsset: {
id: string,
name: string,
ticker: string,
address: string,
chain: {
id: string,
name: string,
namespace: string
}
},
quoteAsset: {
id: string,
name: string,
ticker: string,
address: string,
chain: {
id: string,
name: string,
namespace: string
}
},
baseQuantity: number,
quoteQuantity: number,
price: number,
createdAt: string // ISO date string
}
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, you can still use the quote endpoint:
POST https://ddp.definitive.fi/v2/portfolio/quicktrade/quote
This returns the same quote structure as the regular trade quote endpoint.