Questions tagged [0x]
The 0x tag has no usage guidance.
303
questions
6
votes
1
answer
1k
views
Decentralized Exchanges with Market Orders
My goal is to make a market order (sell/buy) from a smart contract without a centralized app feeding in the order data. E.g. buy token X for 1 ETH at current market.
0x Project
So far I stumbled ...
4
votes
2
answers
203
views
0x Handling of tokens with less than 18 decimals
I am trying to create a sell limit order with an 18 decimal ERC20 token as makerToken (makerAmount = 1.5) and a 6 decimal ERC20 token as takerToken (takerAmount 1.1). The order is created but ...
2
votes
1
answer
1k
views
Member "concat" not found or not visible after argument-dependent lookup
I'm trying to concatenate a series of strings but I'm getting the following error:
TypeError: Member "concat" not found or not visible after argument-dependent lookup in bytes storage ...
2
votes
1
answer
703
views
0x: Is it possible to fill an order from a smartcontract?
When I try to fill an order with funds from a contract I get the following generic error:
Error: Transaction:
0x1d3161cd7f318c3b0b28fc34b2c6bca0cbf4efdb3b11fcf7ec3af7c9adfd821b
exited with an ...
2
votes
1
answer
90
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
1
answer
84
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.
...
2
votes
1
answer
295
views
How to check and Increase API rate limit on 0x?
I am using 0x API for my dex and I am expecting at least 4k users on my app. But I don't see any subscription plan or anything on 0x documentation to increase or at least know my API rate limits. Is ...
2
votes
0
answers
90
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=...
2
votes
1
answer
184
views
Tracking orders on 0x network
How are the various 0x network order trackers sourcing on-chain settlement data?
My first assumption was that they were utilising the Etherscan API, however Etherscan have their own tracker, found at ...
1
vote
2
answers
168
views
Trade resulting in incorrect ratio for value traded out-of and into
I am helping a friend try to recover approximately $36K of value traded through an 0X router.
We have been given the run-around on multiple customer supports each one pointing to a different entity ...
1
vote
3
answers
452
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 ...
1
vote
1
answer
91
views
0x protocol - Using the qoute endpoint without takerAddress parameter
I want to use the 0x quote api endpoint (https://docs.0x.org/0x-api-swap/api-references/get-swap-v1-quote). When requesting a swap, i do not know the takerAddress since at request time i do not know ...
1
vote
1
answer
343
views
Approving tokens after flash loan
I'm creating a smart contract that can both make flash loans and swap tokens via 0x. I can call the flash loan and token swap functions just fine, but when I try to call the token swap within the ...
1
vote
1
answer
267
views
How to submit a swap using EIP-1559 style?
I'd like to submit a swap to 0x using an eip1559 style transaction, but am unable to figure out how this should be done.
Can someone provide some guidance on how to achive this using web3, in a ...
1
vote
1
answer
101
views
0x API swap destination address
Looks like there is no way to specify destination address for the swap function, is it so?
Is there a way such that the swapped to tokens will be sent to another address, but not the original sender's?...
1
vote
1
answer
182
views
0x API Help: Order Routing
Our project is working to integrate order routing for the trading feature on our application, and we are exploring using the 0x API for this purpose.
The design of our system is such that we intend to ...
1
vote
1
answer
58
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
1
answer
477
views
How to swap using 0x from a smart contract without using the API?
Is it possible for a smart contract to swap using 0x without receiving the calldata from outside?
I know how to make my deployed contract to swap with 0x by creating a fillQuote function and passing ...
1
vote
1
answer
68
views
How buyTokenPercentageFee is calculated in 0x
I am using a 0x Quote API to convert BUSD to USDC by exploring the feeRecipient and buyTokenPercentageFee but have confusion in the calculation.
Initial Quote without buyTokenPercentageFee
Request
...
1
vote
2
answers
755
views
Invalid transaction key: price - Swap Transaction fails using ethers.js on Ropsten
I am trying sell ETH and buy DAI. Trying to test it on Ropsten but the transaction fails saying - invalid transaction key - price.
Here is the my code
let wallet = new ethers.Wallet(wallet_privateKey);...
1
vote
2
answers
231
views
Sent to contract address
Hi I made a mistake by sending my WETH to the WETH contract address is there a way to recover my funds? I'll send proof of the transaction.
...
1
vote
2
answers
45
views
0x API Help: Is this bandwith consumption normal for 0x api?
thanks for stopping by my question.
I'm implementing a bot that uses the /quote endpoint of 0x API to check some trading prices. The 0x application is dockerized, together with postgreSQL and redis, ...
1
vote
2
answers
164
views
Swapping tokens when value of sellToken is unknown
I want to swap from 0xdb25f211ab05b1c97d595516f45794528a807ad8(EURS) to 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 (USDC) but the sellAmount is not known upfront and is only known during contract ...
1
vote
1
answer
204
views
Use 0x api to swap tokens with PHP
I'd like to use the 0x api to swap tokens given on certains conditions included in a PHP file.
However, it seems 0x api/ecosystem revolves around JS since it has lots of utilities and needs npm to run....
1
vote
1
answer
575
views
Is 0x Api perform "Dex aggregator" Swaps internally like 1Inch exchange?
Is 0x Api performing "Dex aggregator" Swaps internally like 1Inch exchange?
1
vote
1
answer
140
views
TRANSFORM ERC 20 vs Sell to pancake swap
I am able to do the Sell to pancake swap tranx
But failed with the API when i do TRANSFORM E R C20 Tranx
example of failed: https://bscscan.com/tx/...
1
vote
2
answers
226
views
Failed to swap BEP20 > BNB, WalletExecuteDelegateError
I try to use 0x Swap rest API to swap a token.
buyToken=0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82
sellToken=0x07515f6d56879040b02c4d355df62ec5aede4c7e
But i got WalletExecuteDelegateCallFailedError, ...
1
vote
1
answer
512
views
List of tokens available to trade via Ox API (Avalanche)
I'm trying to trade TEDDY on Avalanche via 0x, when I call the tokens API curl -X 'GET' 'https://avalanche.api.0x.org/swap/v1/tokens' -H 'accept: application/json' I only get AVAX, WAVAX, and WETH, ...
1
vote
1
answer
404
views
0x exchange v3 debugging (execution reverted, more details inside)
I am trying to swap the erc721 token for erc20 using the 0x protocol which I deployed on the testnet.
Using the following script to perform the swap:
/**
* Local, Data & Env imports
* Exchange....
1
vote
1
answer
74
views
is it possible to remapping directly from etherscan
I have one contract from etherscan and I'm the settings remapping one dependency on the root path that I don't own, is it possible to override it ?
"remappings": [
"@0x/contracts-...
1
vote
1
answer
589
views
what is the role of relayer in 0x protocol?
I understand that 0x protocol allows orders to be transmitted across off chain channel to reach large audience and potential buyers/sellers. However, I don't get what a Relayer is exactly.
1
vote
0
answers
16
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,{&...
1
vote
0
answers
44
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
39
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 ...
1
vote
0
answers
28
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
0
answers
46
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
30
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 ...
1
vote
1
answer
225
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
87
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....
1
vote
2
answers
66
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 ...
1
vote
0
answers
124
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
42
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 ...
1
vote
1
answer
128
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 ...
1
vote
0
answers
97
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 ...
1
vote
1
answer
48
views
Problem using 0x polygon API - 500 - reason: 'relation "valid_signed_orders_v4" does not exist'
I am attempting to use the 0x Orderbook API for Polygon. I think there might be an issue with the API though, as whilst I remember it previously working, it doesn't seem to be anymore.
I'm getting the ...
1
vote
1
answer
511
views
Selling tokens with fees on Uniswap
I'm attempting to sell a token (0xC5a9BC46A7dbe1c6dE493E84A18f02E70E2c5A32) with fees (5% buy and sell) using the 0x: Exchange Proxy but the transaction fails with Uniswap K. This is the url I'm using ...
1
vote
0
answers
41
views
Receiving affiliateFee in sellToken instead of buyToken
I'm currently implementing 0xRouter into my app and encountered a hurdle.
How can I deduct the fee of a trade from sellToken and not receive it in the form of buyToken? The main use for this is, if a ...
1
vote
0
answers
69
views
setup the local 0x-api. internal server error in Order Watcher
I'm tring to deploy 0x-api locally, when I use the api /orderbook/v1/order to create an order, I got the 500 Internal Server Error, the error log is :
req: {
"id": "bbce499b-61f8-...
1
vote
0
answers
65
views
Build and Sign a 0x Erc1155 order with python
I would like to use the 0x protocol to post orders through the backend of a protocol that uses 0x.
The biggest challenge here for me is to correctly sign an order with python web3 library.
order = { &...
1
vote
1
answer
192
views
Looking for a Python way to query ETH chain LAST prices
I have no need for a smart contract or dApp. Using a local Python script, I just want to query different asset prices on ETH/EVM chains. No trading.
Querying the ETH chain seems very complicated, ...