{"$id":"https://cowswap.exchange/schemas/app-data/v1.13.0.json","$schema":"http://json-schema.org/draft-07/schema","description":"Metadata JSON document for adding information to orders.","required":["version","metadata"],"title":"AppData Root Schema","type":"object","additionalProperties":false,"properties":{"version":{"readOnly":true,"default":"1.13.0","$id":"#/definitions/version","description":"Semantic versioning of document.","examples":["1.0.0","1.2.3"],"title":"Version","type":"string"},"appCode":{"$id":"#/properties/appCode","description":"The code identifying the CLI, UI, service generating the order.","examples":["CoW Swap"],"title":"App Code","type":"string"},"environment":{"$id":"#/properties/environment","description":"Environment from which the order came from.","title":"Environment","type":"string","examples":["production","development","staging","ens"]},"metadata":{"$id":"#/properties/metadata","default":{},"description":"Each metadata will specify one aspect of the order.","required":[],"title":"Metadata","type":"object","additionalProperties":false,"properties":{"signer":{"$id":"#signer/v0.1.0.json","$schema":"http://json-schema.org/draft-07/schema","title":"Signer","description":"The address of the trader who signs the CoW Swap order. This field should normally be omitted; it is recommended to use it if the signer is a smart-contract wallet using EIP-1271 signatures.","pattern":"^0x[a-fA-F0-9]{40}$","examples":["0xb6BAd41ae76A11D10f7b0E664C5007b908bC77C9"],"type":"string"},"referrer":{"$id":"#referrer/v0.2.0.json","$schema":"http://json-schema.org/draft-07/schema","required":["address"],"title":"Referrer","type":"object","additionalProperties":false,"properties":{"address":{"$ref":"#/properties/metadata/properties/partnerFee/definitions/recipient","title":"Referrer address"}}},"utm":{"$id":"#utm/v0.3.0.json","$schema":"http://json-schema.org/draft-07/schema","required":[],"title":"UTM Codes","type":"object","additionalProperties":false,"properties":{"utmSource":{"$id":"#/properties/utmSource","title":"UTM Source","type":"string","examples":["twitter"],"description":"Tracks in which medium the traffic originated from (twitter, facebook, etc.)"},"utmMedium":{"$id":"#/properties/utmMedium","title":"UTM Medium","type":"string","examples":["email"],"description":"Tracks in which medium the traffic originated from (mail, CPC, social, etc.)"},"utmCampaign":{"$id":"#/properties/utmCampaign","title":"UTM Campaign","type":"string","examples":["everyone-loves-cows-2023"],"description":"Track the performance of a specific campaign"},"utmContent":{"$id":"#/properties/utmContent","title":"UTM Content","type":"string","examples":["big-fat-button"],"description":"Track which link was clicked"},"utmTerm":{"$id":"#/properties/utmTerm","title":"UTM Keyword Term","type":"string","examples":["coincidence+of+wants"],"description":"Track which keyword term a website visitor came from"}}},"quote":{"$id":"#quote/v1.1.0.json","$schema":"http://json-schema.org/draft-07/schema","required":["slippageBips"],"title":"Quote","type":"object","additionalProperties":false,"properties":{"slippageBips":{"title":"Slippage Bips","description":"Slippage tolerance that was applied to the order to get the limit price. Expressed in Basis Points (BPS). One basis point is equivalent to 0.01% (1/100th of a percent)","$id":"#/definitions/bps","examples":[0,10,50],"type":"integer","maximum":10000,"minimum":0},"smartSlippage":{"title":"Smart Slippage","description":"Whether the given slippageBips used is originated from a Smart slippage suggestion","type":"boolean","default":false}}},"orderClass":{"$id":"#orderClass/v0.3.0.json","$schema":"http://json-schema.org/draft-07/schema","required":["orderClass"],"title":"Order class","type":"object","additionalProperties":false,"properties":{"orderClass":{"$id":"#/definitions/orderClass","description":"Indicator of the order class.","examples":["market","limit","liquidity","twap"],"title":"Order class","type":"string","enum":["market","limit","liquidity","twap"]}}},"hooks":{"$id":"#hooks/v0.2.0.json","$schema":"http://json-schema.org/draft-07/schema","default":{},"required":[],"title":"Order interaction hooks","description":"Optional Pre and Post order interaction hooks attached to a single order","type":"object","additionalProperties":false,"properties":{"version":{"$ref":"#/properties/version","readOnly":true,"default":"0.2.0"},"pre":{"$id":"#/properties/hooks/pre","title":"Pre-Hooks","description":"CoW Hooks to call before an order executes","type":"array","items":{"$id":"#hook/v0.2.0.json","$schema":"http://json-schema.org/draft-07/schema","required":["target","callData","gasLimit"],"title":"CoW Hook","type":"object","additionalProperties":false,"properties":{"target":{"$ref":"#/properties/metadata/properties/partnerFee/definitions/recipient","title":"Hook Target","description":"The contract to call for the hook"},"callData":{"$id":"#/properties/callData","title":"Hook CallData","description":"The calldata to use when calling the hook","type":"string","pattern":"^0x[a-fA-F0-9]*$","examples":["0x","0x01020304"]},"gasLimit":{"title":"Hook Gas Limit","description":"The gas limit (in gas units) for the hook","$id":"#/definitions/bigNumber","pattern":"^\\d+$","examples":["90741097240912730913","0","75891372"],"type":"string"},"dappId":{"$ref":"#/properties/metadata/properties/bridging/properties/providerId","title":"Id of the dApp which has built the hook","description":"CoW Swap has an interface that allows dApps to build hooks for orders. This field is used to identify the dApp that has built the hook."}}}},"post":{"$id":"#/properties/hooks/post","title":"Post-Hooks","description":"CoW Hooks to call after an order executes","type":"array","items":{"$ref":"#/properties/metadata/properties/hooks/properties/pre/items"}}}},"widget":{"$id":"#widget/v0.1.0.json","$schema":"http://json-schema.org/draft-07/schema","required":["appCode"],"title":"Widget","type":"object","additionalProperties":false,"properties":{"appCode":{"$id":"#/properties/appCodeWidget","description":"The code identifying the UI powering the widget","examples":["CoW Swap"],"title":"App Code","type":"string"},"environment":{"$id":"#/properties/environmentWidget","description":"Environment from which the order came from.","title":"Environment","type":"string","examples":["production","development","staging","ens"]}}},"partnerFee":{"$id":"#partnerFee/v1.0.0.json","$schema":"http://json-schema.org/draft-07/schema","title":"Partner fee","oneOf":[{"type":"array","items":{"$ref":"#/properties/metadata/properties/partnerFee/definitions/partnerFeeObject"}},{"$ref":"#/properties/metadata/properties/partnerFee/definitions/partnerFeeObject"}],"definitions":{"partnerFeeObject":{"type":"object","oneOf":[{"required":["volumeBps","recipient"],"properties":{"volumeBps":{"title":"Volume Basis Point (BPS)","description":"The fee in basis points (BPS) to be paid to the partner based on volume. Capped at protocol level to 100 BPS (1%)","$ref":"#/properties/metadata/properties/partnerFee/definitions/maxVolumeBps"},"recipient":{"$ref":"#/properties/metadata/properties/partnerFee/definitions/recipient"}},"additionalProperties":false},{"required":["surplusBps","maxVolumeBps","recipient"],"properties":{"surplusBps":{"title":"Surplus Basis Point (BPS)","description":"The fee in basis points (BPS) to be paid to the partner based on surplus","type":"integer","maximum":9999,"minimum":1},"maxVolumeBps":{"$ref":"#/properties/metadata/properties/partnerFee/definitions/maxVolumeBps"},"recipient":{"$ref":"#/properties/metadata/properties/partnerFee/definitions/recipient"}},"additionalProperties":false},{"required":["priceImprovementBps","maxVolumeBps","recipient"],"properties":{"priceImprovementBps":{"title":"Price Improvement Basis Point (BPS)","description":"The fee in basis points (BPS) to be paid to the partner based on price improvement","type":"integer","maximum":9999,"minimum":1},"maxVolumeBps":{"$ref":"#/properties/metadata/properties/partnerFee/definitions/maxVolumeBps"},"recipient":{"$ref":"#/properties/metadata/properties/partnerFee/definitions/recipient"}},"additionalProperties":false}]},"maxVolumeBps":{"title":"Max Volume Basis Point (BPS)","description":"The maximum volume in basis points (BPS) to be paid to the partner. Capped at protocol level to 100 BPS (1%). You can chose to go lower but not higher","type":"integer","maximum":100,"minimum":1,"default":100,"examples":[10,50,100]},"recipient":{"title":"Partner account","description":"The Ethereum address of the partner to receive the fee.","$id":"#/definitions/ethereumAddress","pattern":"^0x[a-fA-F0-9]{40}$","examples":["0xb6BAd41ae76A11D10f7b0E664C5007b908bC77C9"],"type":"string"}}},"replacedOrder":{"$id":"#replacedOrder/v0.1.0.json","$schema":"http://json-schema.org/draft-07/schema","required":["uid"],"title":"Replaced order","type":"object","additionalProperties":false,"properties":{"uid":{"title":"Replaced order UID","description":"The replaced order UID.","$id":"#/definitions/orderUid","pattern":"^0x[a-fA-F0-9]{112}$","examples":["0xff2e2e54d178997f173266817c1e9ed6fee1a1aae4b43971c53b543cffcc2969845c6f5599fbb25dbdd1b9b013daf85c03f3c63763e4bc4a"],"type":"string"}}},"bridging":{"$id":"#bridging/v0.4.0.json","$schema":"http://json-schema.org/draft-07/schema","required":["providerId","destinationChainId","destinationTokenAddress"],"title":"Bridging","type":"object","additionalProperties":false,"properties":{"providerId":{"title":"Id of bridging provider","description":"The id links order with a bridging provider which processes it","$id":"#/definitions/dappId","examples":["75716a3cb48fdbb43ebdff58ce6c541f6a2c269be690513131355800367f2da2"],"type":"string","minLength":1},"destinationChainId":{"title":"Bridging destination chainId","description":"Id of a blockchain where funds will be received","$id":"#/definitions/chainId","pattern":"^[a-zA-Z0-9\\-_]{1,32}$","examples":["1","100","hedera-hashgraph"],"type":"string"},"destinationTokenAddress":{"title":"Bridging destination token address","description":"Address of a token that will be received at destination chain. The chain might be EVM or non-EVM. Some chains might even not have a token address. E.g.: Bitcoin","type":"string","pattern":"^[a-zA-Z0-9\\-.]{1,64}$","examples":["0x00E989b87700514118Fa55326CD1cCE82faebEF6","A.b19436aae4d94622.FiatToken","0.0.456858","1337"]},"quoteId":{"title":"Bridge provider quote id","description":"An ID of a quote which is used for bridging","type":"string","examples":["60012"]},"quoteSignature":{"title":"Bridge provider quote signature","description":"Provider who implement ReceiverAccountBridgeProvider must return a signature of a quote than will be used to verify the quote deposit address validity","type":"string","examples":["ed25519:Y54QM45ockDtJf3uAVhV8xndF79GPeQW5fJaZZLKfnaj8mW9NaBDsGg3uVXY1Fge73fYDAsdn9qokhjm2rsJATz"]},"attestationSignature":{"title":"Bridge provider attestation signature","description":"For ReceiverAccountBridgeProvider, this is the attestation signature from the bridge provider that validates the deposit address. Empty for other provider types.","type":"string","examples":["0x1234567890abcdef..."]},"quoteBody":{"title":"Bridge provider quote body","description":"A stringified JSON of quote which is associated with the order.","type":"string","examples":["{\"dry\":false,\"swapType\":\"EXACT_INPUT\",\"slippageTolerance\":100,...}"]}}},"flashloan":{"$id":"#flashloan/v0.2.0.json","$schema":"http://json-schema.org/draft-07/schema","title":"Flashloan","description":"Information about flashloan parameters for the order","type":"object","required":["amount","liquidityProvider","protocolAdapter","receiver","token"],"properties":{"amount":{"title":"Loan amount","description":"The amount of tokens to be flash loaned (in token units, as uint256)","$id":"#/definitions/bigPositiveNumber","pattern":"^[1-9]\\d*$","examples":["90741097240912730913","75891372","1"],"type":"string"},"liquidityProvider":{"title":"Liquidity provider address","description":"The Ethereum address of the flashloan liquidity provider","$ref":"#/properties/metadata/properties/partnerFee/definitions/recipient"},"protocolAdapter":{"title":"Protocol adapter address","description":"The Ethereum address of the protocol adapter","$ref":"#/properties/metadata/properties/partnerFee/definitions/recipient"},"receiver":{"title":"Receiver address","description":"The Ethereum address of the flashloan receiver","$ref":"#/properties/metadata/properties/partnerFee/definitions/recipient"},"token":{"title":"Token address","description":"The Ethereum address of the token being borrowed","$ref":"#/properties/metadata/properties/partnerFee/definitions/recipient"}},"additionalProperties":false},"wrappers":{"$id":"#wrappers/v0.2.0.json","$schema":"http://json-schema.org/draft-07/schema","title":"Wrappers","description":"Information about wrappers to execute for the order","type":"array","items":{"title":"Wrapper Entry","description":"Information about an individual wrapper to execute for the order","type":"object","required":["address"],"properties":{"address":{"title":"Wrapper address","description":"The Ethereum address of the wrapper to execute","$ref":"#/properties/metadata/properties/partnerFee/definitions/recipient"},"data":{"title":"Wrapper data","description":"Any additional data. The format of this data will vary depending on the wrapper you are calling. If left unspecified, this field defaults to 0x (empty wrapper data)","$id":"#/definitions/hexData","pattern":"^0x[a-f0-9]*$","examples":["0x","0x1","0xfac282674bbdb"],"type":"string"},"isOmittable":{"title":"Is Omittable","description":"Whether or not this wrapper must be executed exactly as given with the order. If left unspecified, this field defaults to `false` (wrapper data must be executed with the order exactly as given)","type":"boolean"}},"additionalProperties":false}},"userConsents":{"$id":"#userConsents/v0.1.0.json","$schema":"http://json-schema.org/draft-07/schema","title":"User Consents","description":"Array of user consents for terms acceptance","type":"array","items":{"type":"object","required":["terms","acceptedDate"],"additionalProperties":false,"properties":{"terms":{"$id":"#/properties/terms","type":"string","description":"IPFS hash of the accepted terms","examples":["QmYwAPJzv5CZsnAzt8auVZRn5DfvPYg8X7yGvkb5sNqBmV"]},"acceptedDate":{"$id":"#/properties/acceptedDate","type":"string","description":"ISO 8601 date-time when user accepted the terms in the UI","examples":["2025-11-11T23:00:00Z"]}}}}}}}}