Created
January 28, 2023 01:29
-
-
Save jlin27/3e80df42d9ffd50a7431123e4b64bba7 to your computer and use it in GitHub Desktop.
Example quote from the 0x Swap API to buy DAI with 1 WETH
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"chainId":1, | |
"price":"1596.8685376172358", | |
"guaranteedPrice":"1580.899852241063442", | |
"estimatedPriceImpact":"0.3366", | |
"to":"0xdef1c0ded9bec7f1a1670819833240f027b25eff", | |
"data":"0xd9627aa40000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000000000000000000000000000db64d8657ef60cb400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000006b175474e89094c44da98b954eedeac495271d0f869584cd000000000000000000000000100000000000000000000000000000000000001100000000000000000000000000000000000000000000007495a7a91163d473a5", | |
"value":"0", | |
"gas":"111000", | |
"estimatedGas":"111000", | |
"gasPrice":"15000000000", | |
"protocolFee":"0", | |
"minimumProtocolFee":"0", | |
"buyTokenAddress":"0x6b175474e89094c44da98b954eedeac495271d0f", | |
"sellTokenAddress":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", | |
"buyAmount":"15968685376172358000", | |
"sellAmount":"10000000000000000", | |
"sources":[ | |
{ | |
"name":"0x", | |
"proportion":"0" | |
}, | |
{ | |
"name":"Uniswap", | |
"proportion":"0" | |
}, | |
{ | |
"name":"Uniswap_V2", | |
"proportion":"0" | |
}, | |
{ | |
"name":"Curve", | |
"proportion":"0" | |
}, | |
{ | |
"name":"Balancer", | |
"proportion":"0" | |
}, | |
{ | |
"name":"Balancer_V2", | |
"proportion":"0" | |
}, | |
{ | |
"name":"Bancor", | |
"proportion":"0" | |
}, | |
{ | |
"name":"BancorV3", | |
"proportion":"0" | |
}, | |
{ | |
"name":"mStable", | |
"proportion":"0" | |
}, | |
{ | |
"name":"SushiSwap", | |
"proportion":"1" | |
}, | |
{ | |
"name":"Shell", | |
"proportion":"0" | |
}, | |
{ | |
"name":"DODO", | |
"proportion":"0" | |
}, | |
{ | |
"name":"DODO_V2", | |
"proportion":"0" | |
}, | |
{ | |
"name":"CryptoCom", | |
"proportion":"0" | |
}, | |
{ | |
"name":"Lido", | |
"proportion":"0" | |
}, | |
{ | |
"name":"MakerPsm", | |
"proportion":"0" | |
}, | |
{ | |
"name":"KyberDMM", | |
"proportion":"0" | |
}, | |
{ | |
"name":"Component", | |
"proportion":"0" | |
}, | |
{ | |
"name":"Saddle", | |
"proportion":"0" | |
}, | |
{ | |
"name":"Uniswap_V3", | |
"proportion":"0" | |
}, | |
{ | |
"name":"Curve_V2", | |
"proportion":"0" | |
}, | |
{ | |
"name":"ShibaSwap", | |
"proportion":"0" | |
}, | |
{ | |
"name":"Synapse", | |
"proportion":"0" | |
}, | |
{ | |
"name":"Synthetix", | |
"proportion":"0" | |
}, | |
{ | |
"name":"Aave_V2", | |
"proportion":"0" | |
}, | |
{ | |
"name":"Compound", | |
"proportion":"0" | |
} | |
], | |
"orders":[ | |
{ | |
"type":0, | |
"source":"SushiSwap", | |
"makerToken":"0x6b175474e89094c44da98b954eedeac495271d0f", | |
"takerToken":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", | |
"makerAmount":"15968685376172358000", | |
"takerAmount":"10000000000000000", | |
"fillData":{ | |
"tokenAddressPath":[ | |
"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", | |
"0x6b175474e89094c44da98b954eedeac495271d0f" | |
], | |
"router":"0xd9e1ce17f2641f24ae83637ab66a2cca9c378b9f" | |
}, | |
"fill":{ | |
"input":"10000000000000000", | |
"output":"15968685376172358000", | |
"adjustedOutput":"13805632724188712885", | |
"gas":90000 | |
} | |
} | |
], | |
"allowanceTarget":"0xdef1c0ded9bec7f1a1670819833240f027b25eff", | |
"decodedUniqueId":"7495a7a911-1674867621", | |
"sellTokenToEthRate":"1", | |
"buyTokenToEthRate":"1602.26122369158897394", | |
"expectedSlippage":"0" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment