Portail dév.

Firm order#

OKX DEX will request relevant data using the parameters below.

Request Parameters#

ParameterTypeRequiredDescription
chainIndexStringYesUnique identifier for the chain.
e.g., 1: Ethereum.
See more here.
takerAssetStringYesAddress of takerToken
makerAssetStringYesAddress of makerToken
takerAmountStringYesTrade quantity of takerToken
toAmountString—The expected makerToken output amount calculated using the Levels returned during the Pricing stage and the takerAmount for this request. Expressed in the token's smallest unit, consistent with makerAmount in the Firm Order response.
takerAddressStringYesAddress of Taker
rfqIdLongYesA unique identifier assigned to each quote request.
expiryDurationIntegerYesThis parameter sets the validity duration of a quote or request, indicating the time interval from when the quote/request is generated until it expires.
callDataStringNoThe transaction needs to be signed, this requirement applies to Solana only.
beneficiaryAddressStringNoAddress of taker
orderIdStringNo
confidenceTLongNoSlippage start time (in seconds)
confidenceRateLongNoSlippage per second, 1e6
confidenceCapLongNoMaximum slippage cap ,1e6
requestTypeStringNo0: C-end users or whitelisted API keys
1: Other OpenAPI requests
slippageRejectThresholdStringNoMaximum permitted slippage fluctuation for this request. The project may reject the order if this threshold is exceeded. `` indicates that the parameter was not provided and is handled by the compatibility policy.

Response Parameters#

ParameterTypeDescription
chainIndexStringUnique chain identifier. For example, 1 represents Ethereum. See supported chains for more information.
pmmProtocolStringSettlement contract address.
makerAmountStringAmount of makerToken to trade.
makerAddressStringAddress of the order signer.
takerAssetStringAddress of takerToken.
makerAssetStringAddress of makerToken.
takerAmountStringAmount of takerToken to trade.
takerAddressStringAddress of the taker.
toAmountStringThe expected makerToken output amount calculated using the Levels returned during the Pricing stage and the takerAmount for this request. Expressed in the token's smallest unit, consistent with makerAmount in the Firm Order response.
rfqIdLongUnique identifier assigned to each quote request.
expiryTimestampExpiration timestamp.
signatureStringMarket maker's signature.
callDataStringSigned transaction and modified call data (required for Solana).
signatureSchemeStringEIP-712 or EIP-1271 (required for EVM).
usePermit2BooleanWhether to use Permit2 for approval. Defaults to false (required for EVM).
permit2SignatureStringOptional embedded Permit2 signature (65 bytes if provided).
permit2WitnessStringPacked witness hash when using a Permit2 witness.
permit2WitnessTypeStringCanonical witness type string for Permit2.
confidenceTLongRequest time plus the specified timestamp.
confidenceRateLongSlippage per second, with a precision of 1e6.
confidenceCapLongMaximum slippage, with a precision of 1e6.

Request Example#

json
{
    "chainIndex" : "1",
    "takerAsset": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",  // Address of takerToken
    "makerAsset": "0xdac17f958d2ee523a2206206994597c13d831ec7",  // Address of makerToken
    "takerAmount": "6000000000000000", // Quantity of takerToken
    "takerAddress": "taker address", // Address of order taker
    "rfqId": 12345678, // uniqueId for the rfq
    "expiryDuration": 60
    "beneficiaryAddress":"0xf921fb05ed9db87889f413d7fefb2cd4af03beb6" // Address of taker
    "orderId": 1002142110, // 
    "confidenceT": 30, // Slippage start time (in seconds)
    "confidenceRate": 75, // Slippage per second, 1e6
    "confidenceCap": 1200, // Maximum slippage cap ,1e6
    "slippageRejectThreshold": null
}

Response Example#

json
{
    "chainIndex" : "1",
    "rfqId" : 12345678,
    "expiry": 172120120102,
    "pmmProtocol": "0x0Bdf246b4AEF9Cfe4DD6eEf153A1b645aC4BcBb6", //settlement contract address
    "makerAsset": "0xdac17f958d2ee523a2206206994597c13d831ec7", //Address of makerToken
    "takerAsset": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", //Address of takerToken
    "makerAddress": "0xcfdfea67395c531249a9e1dc8d916c9158810509", //Address of order signer
    "takerAddress": "0xF36bC73f9783539E1DAC8Cf6d2bfd74e0663699C", //Address of trading user
    "makerAmount": "100000000",     //Trade quantity of makerToken. TakerAmount * takerTokenRate
    "takerAmount": "6000000000000000",    //Trade quantity of takerToken
    "signature": "0xc64bf62b7619edda019fe491da256b9fbe892fbfeac91f9d1fce168478ad53053dde038584f063fe21e267fcb4e758bcf420036cd2838fe5cbd993ec6d3dde561b",
    "sign_scheme": "EIP-712" //EIP-712 or 1271,
    "usePermit2": false
    "confidenceT": 1769767048, // Request timestamp plus offset
    "confidenceRate": 75, // Slippage per second, 1e6
    "confidenceCap": 1200, // Maximum slippage cap ,1e6
}