Questions tagged [0x]
The 0x tag has no usage guidance.
284 questions
0
votes
1
answer
47
views
calling 0x price api endpoint and getting error 400 Bad request
I have a simple front end, and when the user inputs an amount , on blur i want to show the amount of token B they will be buying with the input amount.
for that I'm trying to use 0x price api
const ...
1
vote
0
answers
46
views
Any example of a transaction where `feeRecipient` is used in 0x
I need to see what these transactions look like on Etherscan, but can't find any examples. Seems to be very rare. Some transaction hash of such transaction where feeRecipient is receiving some small ...
2
votes
0
answers
92
views
How to really encode dynamicall length array of structs in Solidity ? Or how to use the Muliplex Feature of 0x?
I need to use the Multiplex Feature of 0x in order to perform a specific trade that perform a UniswapV3 call followed by a _FillOTCorder using the SelfBalance feature of the the Multiplex Feature.
As ...
0
votes
0
answers
2k
views
0x API: Am I able to Swap absolutely NEW coins?
I have a trading bot that operates on newly created tokens in BSC and ETH networks. It works only for new tokens, that were created with WBNB (BSC chain with PancakeSwap) or with WETH (ETH chain with ...
0
votes
1
answer
795
views
0X Swap failing when swapping Token X for Native Currency Smart Contract Integration
i have a contract that i would like to utilize the zeroEx protocol with
i am calling the qoute endpoint like this
https://bsc.api.0x.org/swap/v1/quote?sellToken=...
1
vote
1
answer
180
views
Why did 0x swap API get deprecated and what is its substitute?
0x swap API was a great project that was under active development for several years. But recently it got deprecated and no longer kept up to date. I could not find any other substitute for it on the ...
0
votes
1
answer
239
views
How to sign the hash of a message using EIP712?
There are many guides and online services on how to sign a message using eip712. But they all apply to messages.
Now, if I already have the hash of my message, how to use MetaMask without other third ...
0
votes
0
answers
450
views
Execution Reverted: GS013 Error in Safe Wallet During 0x OTC Transaction
I am encountering a 'execution reverted: GS013' error when trying to execute a script that aims to fill an Over-the-Counter (OTC) transaction through Safe Wallet using the 0x protocol. This issue ...
0
votes
1
answer
60
views
Verify signature result return 0x
The return signature result from signMessage method obtained is 0x. How do we handle 0x signer result from frontend?
const signer = new ethers.providers.Web3Provider(provider).getSigner();
try {
...
1
vote
0
answers
34
views
What are those trx periodically being sent to the zero address
An example of such trx is the following (0x1c22498f94934e18b32f2fdb00d8bf091af7cd77e8aeea0191f21efc211aeebc) in particular they have a calldata which UTF-8 decoding looks like 'data:application/json,{&...
0
votes
2
answers
227
views
Batch Token Swap using 0x
I'm trying to make a telegram bot that sells all the tokens available on a wallet using Ox API. In order to automate the process with only command, I'm okay with adding the private key to the script.
...
0
votes
1
answer
43
views
How to subscribe to swap events for 0x protocol?
I'm building an nft marketplace and I'm getting the data from reservoir. I have built swap/trade functionality using 0x on my marketplace. I want to now subscribe to swap events on my marketplace. Is ...
1
vote
1
answer
88
views
Quote from 0x API endpoint feeRecipientTradeSurplus parameter not doing anything?
The documentation for the 0x API "quote" endpoint indicates that adding a feeRecipientTradeSurplus parameter to the query should generate a transaction where any "trade surplus fees&...
1
vote
0
answers
142
views
0x protocol swap api not fetching liquidity from pancakeswap
I created a liquidity pool on pancakeswap for an asset pair for goerli network. I get this error when i try and fetch the price.
here is the api request
https://goerli.api.0x.org/swap/v1/price?...
1
vote
0
answers
70
views
Decode FillQuoteTransformer data in 0x Protocol
I'm trying to decode FillQuoteTransformer input data for 0x protocol. I'm able to decode other transformer very well but am stuck with this one. It does technically decode the data but I'm not sure ...
2
votes
1
answer
93
views
`ZIPPO_CONTEXT_INVALID` error when querying 0x goerli swap api quote endpoint
When querying the following endpoint and parameters: https://goerli.api.0x.org/swap/v1/quote?buyToken=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee&sellAmount=1000000000000&sellToken=...
2
votes
0
answers
92
views
ZIPPO_CONTEXT_INVALID error when querying 0x mumbai api quote endpoint
When querying the following endpoint and parameters: https://mumbai.api.0x.org/swap/v1/quote?sellToken=0xA6FA4fB5f76172d178d61B04b0ecd319C5d1C0aa&buyToken=...
0
votes
1
answer
36
views
Too few ERC721 Orders on 0x v4 Exchange
I'm trying to grab information about NFT-to-ERC20 swaps conducted over 0x V4 (on Ethereum). My initial intention was to read ERC321OrderFilled events from https://etherscan.io/address/...
2
votes
2
answers
191
views
CORS Policy Blocking Axios Request with 0x-api-key Header to 0x API on Goerli Network
I'm currently working on a project where I use the 0x API on the Goerli network to swap tokens. I'm making an HTTP GET request using axios from a web application served from http://localhost:3000.
...
0
votes
1
answer
86
views
execution reverted 0x contract on goerli for swap but every transaction fails while giving me the error? although tx object is fine
i am getting the same error on every transaction and its on goelri network, furthermore not supoorting much of pairs. Attaching the image for reference
1
vote
0
answers
35
views
0x ExchangeProxy addresses point to different implementations on Ethereum and Polygon
Why is it that on ethereum the 0xDef1C0ded9bec7F1a1670819833240f027b25EfF contract is a ERC1155OrdersFeature and on Polygon it is a ERC721OrdersFeature? Does is mean that there is no ERC1155 support ...
1
vote
1
answer
36
views
Does 0x still have the condensed RFQ order type, and if so where is its structure defined?
I am looking into the 0x docs at the moment, and get a 404 error when attempting to view the RFQ order type structure in the cheat sheet section. Where can I find this order type's struct?
Thanks!
0
votes
1
answer
51
views
I reported an error during contract interaction
This is my method of obtaining the signer
async function getSigner() {
if (window.ethereum) {
await window.ethereum.enable()
provider = new ethers.providers.Web3Provider(window.ethereum)
// console....
0
votes
0
answers
31
views
Function Visibility specifiers during inheritance
when am overriding a function in solidity must my child function have the same visibility as the parent function? can the parent function be public and the child function be internal
0
votes
1
answer
56
views
"Uni::transferFrom: transfer amount exceeds spender allowance" code: 105
I get this error when i'm trying to get a quote for uni to weth swap.
https://goerli.api.0x.org/swap/v1/quote?sellToken=0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984&buyToken=...
0
votes
2
answers
286
views
0xapi swap Asking for a quote for code: 111, reason: 'Gas estimation failed'
const response= await fetch(https://api.0x.org/swap/v1/quote?sellToken=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2&buyToken=0x6b175474e89094c44da98b954eedeac495271d0f&sellAmount=100&...
1
vote
0
answers
67
views
CORS Issue with the /quote 0x API endpoint
I'm a new web2 fullstack web dev trying to get his feet in web3 and i've tried to create my first web3 dApp.
For the profile section and displaying a users' NFT and tokens balances I easily managed my ...
1
vote
1
answer
33
views
0x swap Expected quote.orders to conform to schema /signedOrdersSchema
Hi i should like to know if the fonction "swapQuoteConsumer.executeSwapQuoteOrThrowAsync(quote,{opt})" is depreciated in 0x protocol V4 or not ? i have a perdsistent "error Expected ...
2
votes
1
answer
321
views
Call Requests Limit
I made a bot swap on bsc network using 1inch 0x and para swap.. everything is great except one thing which is Call requests I can’t make call every 1 sec for more than 1 token when make 2 tokens my ip ...
1
vote
1
answer
114
views
0x swap api gas is doubled when adding feeRecipient and buyTokenPercentageFee
I would like to collect fees on trade using 0x API. But the gas in the quote response is doubled or more when adding feeRecipient and buyTokenPercentageFee which doubles the gas price users are paying....
2
votes
3
answers
594
views
Get the token id from 0x number
How can I use ethers.js to get the token id (34797) from this 0x number?
0x0000000000000000000000000000000000000000000000000000000000034797
I'm not sure which util to use from ethers.js I've looked ...
0
votes
1
answer
76
views
[0x End Point API https://bsc.api.0x.org/swap/v1/quote?
where find the list of token available on API EndPoint https://bsc.api.0x.org/swap/v1/quote?
When i'm trying to quote with https://bsc.api.0x.org/swap/v1/quote? all is ok for pair 'BUSD-WBNB', 'BUSD-...
0
votes
1
answer
186
views
How to identify valid token pairs on 0x
I am trying to use 0x for a project and I am getting a lot of Invalid token combination errors when trying to get price quotes.
So this works (USDC / ETH):
https://api.0x.org/swap/v1/quote?buyToken=...
0
votes
0
answers
83
views
Slight MEV ETH transaction
Thorswap integrates 0x as a liquidity provider on Ethereum. A user reports getting much less than anticipated on this transaction:
https://etherscan.io/tx/...
0
votes
1
answer
55
views
Could not find corresponding event log from 0x aggregator contract
Looking at the event log from the 0x Protocol aggregator contract ("0xdef1c0ded9bec7f1a1670819833240f027b25eff"), I could not find corresponding event to the following log topics0 "...
0
votes
1
answer
234
views
Problem with 0x Protocol Goerli API
I'm trying to test the 0x quote API, ran into an issue with the Goerli endpoint.
I sent a quote request to mainnet, to sell WETH and buy USDC:
https://api.0x.org/swap/v1/quote?buyToken=USDC&...
0
votes
1
answer
36
views
Does Taker on 0x generate only 1 tx ? (not 2, one for maker and one for taker)
I am writing a book about cryptocurrency history. I have questions about 0x, Etherdelta, and IDEX.
Question 1. This is the last trading process from 0x whitepaper page 5.
Taker submits the makers ...
1
vote
2
answers
76
views
Wallet Integration with 0x
We are building a decentralized wallet. There are some questions about the integration with 0x.
Is there any direct way to add fee
If there is any API parameters to add fee.
Please share your ...
0
votes
1
answer
723
views
Multicall Smart Contract: BEP20: transfer amount exceeds balance
I'm created a Smart Contract with the abilities to execute a multi call to the 0x DeFi aggregator. I already have the logic on my centralised server who checks for an arbitrage opportunity. When an ...
0
votes
1
answer
1k
views
Set Max Approval use big number
i am want create max approval fot approve token transaction on polygon exchange like this
const maxApproval = new BigNumber(2).pow(256).minus(1);
i see the documention in https://docs.0x.org/0x-api-...
1
vote
0
answers
141
views
0x API buy USDC with ETH works, buy ETH with USDC fails
have been building a little front end app to execute trades back and forth between ETH and USDC, partly to learn and partly to build a tool I want to exist.
I have all the quotes and stuff working OK, ...
1
vote
1
answer
46
views
Customize 0x API to get more details
we are testing the 0x API our goal is to get more details, like the top 5 rates along with the best rate also routing information
can anyone point me in the right direction, please
by default, it only ...
0
votes
1
answer
359
views
How to test 0x swap api on testnet?
Hello I m making a swap dapp with the help of 0x api I want to test it if it's working properly or not is there anyway I can test it on test net?
0
votes
1
answer
142
views
Retrieve amount of tokens received from 0x swap
I was wondering if there is any way to get the amount of tokens received from an on-chain swap inside of a smart contract (solidity)? Or is that data inside of the swap calldata? If so, how can that ...
0
votes
0
answers
128
views
0x-API response not working as expected for WETH-USDT and UNI-WETH
I am using the below official contract given in documentation of Ox, for swapping ERC20 coins.
0x-Smart-Contract
So,The transactions like LINK-WETH, WETH-DAI, DAI-WETH, WETH-LINK, etc are working ...
2
votes
1
answer
191
views
Reducing CallData Size
I have an implementation where I'm needing to send 0x parameters (from the API) to a swap function that's being used in another function's logic.
To pass the data over a struct is being used, which is ...
0
votes
2
answers
47
views
Does using the preSign function in 0x v4 require gas?
I am reading about on-chain orders in the docs for 0x v4 here:
https://docs.0x.org/nft-support/docs/introduction#on-chain-listings
Is using the preSign function when generating an order on 0x v4 an on-...
0
votes
1
answer
90
views
Can i send a signed raw txn to a smart contract without using buildTransaction()?
I'm trying to use 0x protocol on goerli and gathering the transaction data from their json response, which contains all the necessary information needed for the swap. Is it possible to successfully ...
0
votes
1
answer
245
views
How does 0x V4 proxy handle the ERC20 trade in smart contract level?
I am trying to review a integration code. The protocol integrate with ZeroEx, and use the code like
address(ZeroExSwapTarget).call(tradeCallData)
the zeroExSwapTarget is https://etherscan.io/...
1
vote
0
answers
104
views
Is there an API to create/remove Liquidity Pools on different DEXes?
I'm looking for a way to automate liquidity allocation into the most profitable pools,
for this, I need the ability to create/remove liquidity pools on the most popular DEXes.
At a low level to do ...