Create a p2p limit order

You can notice the difference between p2p and normal limit orders by looking at the path.

POST /ft/p2p/:chainId/

Examples

The process of composing the order and the payload to POST to API endpoint is pretty much the same as with usual non-p2p orders.

The only differences are:

curl -X POST \
  'https://api.paraswap.io/ft/p2p/1' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "nonceAndMeta": "1490585846052014974250870934243084527261268076495",
  "expiry": 1665493373,
  "makerAsset": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
  "takerAsset": "0x2b591e99afe9f32eaa6214f7b7629768c40eeb39",
  "maker": "0xB4E6f1c1f9Ba3aD97e09603966b4ac773303a8d1",
  "taker": "0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57",
  "makerAmount": "1000000000000000000",
  "takerAmount": "8000000000000000000",
  "signature": "0x1647ae642db6e02c39ac80f40b73df032ca43648c2d11c44d5c7437e0c3a151739e54b7d3ea22067226b723ac84ac577a487579b04e7197bc3b13abee5d3952a1c"
}'

Query parameters:

  • chainId:network id (Ethereum Mainnet = 1)

Body parameters

{ 
    "maker": "0x05182E579FDfCf69E4390c3411D8FeA1fb6467cf",
    "taker": "0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57",
    "nonceAndMeta": "7433034152904838547212883274543254857465784035140417181410394112",
    "expiry": 0,
    "makerAsset": "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",
    "takerAsset": "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",
    "makerAmount": "10000000000000000",
    "takerAmount": "7775870000000000",
    "signature": "0x43de8dbc8228594171d0ed3e623ca0ab5c24f46bf0575800624ae56723712f807ecaf7dc8edfcf0d4517f80f11bf016bde0a9a20e243eea2bb32e55eadbb6b0d1b"
}

Important notice:

  • nonceAndMeta: needs to be encoded as described in (here we are in the p2p case so we should add the address of the person you want to execute a trade in nonceAndMeta):

pageData structure in our centralized system

Response

Understand the response by checking our dedicated page:

pageData structure in our centralized system
{
	"order": {
		"expiry": 0,
		"createdAt": 1661165141,
		"updatedAt": 1661165141,
		"transactionHash": null,
		"chainId": 137,
		"nonceAndMeta": "7433034152904838547212883274543254857465784035140417181410394112",
		"maker": "0x05182e579fdfcf69e4390c3411d8fea1fb6467cf",
		"taker": "0xdef171fe48cf0115b1d80b88dc8eab59176fee57",
		"takerFromMeta": "0x0000000000000000000000000000000000000000",
		"makerAsset": "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270",
		"takerAsset": "0x8f3cf7ad23cd3cadbd9735aff958023239c6a063",
		"makerAmount": "10000000000000000",
		"fillableBalance": "10000000000000000",
		"swappableBalance": "10000000000000000",
		"makerBalance": "10000000000000000",
		"takerAmount": "7775870000000000",
		"signature": "0x43dd8dbc8228594171d0ed3e633ca0eb5c24f46bf0575100623ae56723712f807ecaf7dc8edfcf0d4517f80f11bf016bde0a9a20e243eea2bb32e55eadbb6b0d1b",
		"orderHash": "0xdef400fd95d028d8caaba2c4887d2694563e0bc7f73c17d747feac2e24ed411d",
		"permitMakerAsset": null,
		"type": "LIMIT",
		"state": "PENDING"
	}
}

Last updated