Questions tagged [0x]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
286 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
1 answer
345 views

0x bsc api returning the wrong path for Pancakeswap router v2

I query the api for bsc https://bsc.api.0x.org/swap/v1/quote?buyToken=0x368ce786ea190f32439074e8d22e12ecb718b44c&sellToken=0xe9e7cea3dedca5984780bafc599bd69add087d56&sellAmount=...
0 votes
0 answers
14 views

0x API key in Client-Side dapp

From the docs, getting started section: "Starting in June 2023, all API requests without an API key will return an error. Visit 0x Dashboard to get your API key." "This key is unique ...
0 votes
1 answer
7 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
12 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&...
0 votes
2 answers
268 views

How to resolve insufficient asset liquidity in 0x on polygon mumbai testnet

I am testing the 0x api to get quote on Mumbai testnet. I want to swap BAL -> wETH. https://mumbai.api.0x.org/swap/v1/quote?buyToken=0x2e3A2fb8473316A02b8A297B982498E661E1f6f5&sellToken=...
0 votes
1 answer
275 views

How to do swap using encoded function call

I will try to describe my problem as clearly as possible so that I can get feedback on whether I am going in the right direction for resolution. I'm running tests on mainnet fork trying to implement a ...
0 votes
0 answers
12 views

Matic address for polygon.api.0x.org/swap/v1/quote

Good morning, I use the API of 0x and more precisely this route:https://polygon.api.0x.org/swap/v1/quote I do not understand why we must use the address ...
0 votes
2 answers
340 views

How to bubble up meaningful 0x contract revert data?

I'm fairly new to solidity so thanks in advance for your patience with this question. I'm trying to implement a contract that uses the following line from the 0x sample provided here: https://github....
1 vote
0 answers
24 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 ...
0 votes
1 answer
1k views

BEP20: transfer amount exceeds allowance

I want to swap bep20 tokens like BUSD - BNB and BNB - BUSD, i already approved tokens for the swapping but while i try to swap BNB - BUSD it's throw error like BEP20: transfer amount exceeds allowance ...
0 votes
0 answers
9 views

Trying to use Utils from "@0x/protocol-utils" but it gives undefined

I'm trying to use utils for signing a transaction for sellOrder of ERC721<->ERC20 as instructed here - https://protocol.0x.org/en/latest/basics/orders.html#how-to-sign import utils from '@0x/...
0 votes
0 answers
18 views

Error:"SWAP_CALL_FAILED" while using fillQuote function in 0x

Hi I am trying to swap tokens using 0x. I try to use fillQuote funtion for swapping from fill the input from API of 0x but I am getting Error: VM Exception while processing transaction: reverted with ...
1 vote
3 answers
714 views

How to get a quote and swap on 0x with ethers.js

I'm trying to make a simple swap from 10 USDC to 10 USDT using 0x API quote. I'm doing this: import type { UnsignedTransaction } from '@ethersproject/transactions' import { Web3Provider } from '@...
0 votes
1 answer
298 views

How to add transaction deadline?

I am using web3 to make transactions but I am stuck on how can I add transaction deadlines in web3.eth.sendTransaction function. I am using 0x API for getting the swap quote. My code :- await web3.eth....
0 votes
1 answer
465 views

how to add my custom token to 0x protocol in testnet/mainnet

I am new to the 0x protocol. Is it possible to add custom token using 0x Portal DApp?. Share any example or document. I have deployed my own exchange medium. it is running in http://localhost:3001 I ...
1 vote
1 answer
16 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 ...
0 votes
1 answer
413 views

Swap BEP-20 based tokens with 0x and ethers.js

I am trying to swap BEP-20 based tokens with 0x and Ethers.js. https://bsc.api.0x.org/swap/v1/quote I used this endpoint to get quote of the exchange. https://bsc.api.0x.org/swap/v1/quote?sellToken=...
0 votes
0 answers
28 views

Error with 0x exchange proxy

I'm now trying to swap with 0x exchange proxy on bsc chain. I used the 0x api to generate the calldata and passed it to the exchange proxy ( 0xdef1c0ded9bec7f1a1670819833240f027b25eff) and it results ...
1 vote
1 answer
55 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
53 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....
0 votes
0 answers
22 views

How does the buyAmount in response change when setting enableSlippageProtection in a 0x Swap request?

According to the docs (https://docs.0x.org/0x-swap-api/advanced-topics/slippage-protection#response-changes), when enableSlippageProtection is not false, the buyAmount & price returned will factor ...
0 votes
0 answers
38 views

How to get 0x api description in JSON of each network?

Is that possible to get full JSON description of 0x API for each network similar to One Inch openApi https://api.1inch.io/swagger/ethereum-json? Probably you have a URL not for separated requests?
0 votes
0 answers
40 views

Receiving SenderNotAuthorizedError error while making 0x swap

I am trying to recreate swap with 0x API. I am trying to swap WETH, which I have in my wallet Here is my swap code async function getQuote(account){ console.log("Getting Quote"); // if only &...
0 votes
2 answers
82 views

0x Protocol - Can I use for selling an NFT and get back an ERC-20 token example BUSD on BSC?

I'm using 0x Protocol for my project. And I want to use BUSD as asset that taker must pay to maker. In 0x's document describes we can use native token BNB or WBNB, but not clear about if we can use ...
0 votes
1 answer
50 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-...
1 vote
3 answers
327 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
74 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
47 views

ZRX staking was my goal on this website: https://www.0x.org/zrx/vote and from my Metamask wallet

I have question! I just wanted to stake my ZRX tokens on ETH chain from my Metamask and went to this website: https://www.0x.org/zrx/vote sent some little fee and now I can not see anymore my tokens ...
0 votes
1 answer
291 views

0x API returns invalid result

We've noticed that in one edge case the 0x API returns a weird result. We're trying to get a swap transaction for the exact same token, it works with sellAmount 0.1 BNB but fails with sellAmount of 0....
1 vote
2 answers
304 views

Swap problem with big amounts (PancakeSwap liquidity)

I try to swap some tokens and receive BUSD. When I enter the amount 100_000 for my token, API returns the normal price. But it doesnt work when I increase this amount more then 1_000_000. All ...
0 votes
1 answer
172 views

How to swap tokens using 0x using smart contracts only.?

I am building an dApp and want to integrate 0x in the smart contract directly instead of me depending on the http request and passing that. Is there a way to implement 0x directly from the smart ...
0 votes
0 answers
34 views

I am trying to build 0xAPI on my local environment but it occurs following errors

I followed the readme. https://github.com/0xProject/0x-api "yarn build" was succeeded but "yarn db:migrate" occurs following errors.
0 votes
1 answer
445 views

Is 0x Api perform "Dex aggregator" Swaps internally like 1Inch exchange?

Is 0x Api performing "Dex aggregator" Swaps internally like 1Inch exchange?
0 votes
0 answers
73 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
36 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 "...
1 vote
2 answers
46 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
150 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
29 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 ...
0 votes
1 answer
220 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
0 answers
30 views

0x Mumbai api orderbook is not working

I want to build an application on polygon. For testing I want to use Mumbai testnet. But orderbook api for mumbai doesn't seem to be working. But same API is working for polygon. For example https://...
1 vote
1 answer
35 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
0 answers
56 views

My 0x api results are wrong

HI My result of scanning with 0x Api is wrong and the results are not what shown in dexs for arbitrage from urllib.request import urlopen import requests import pandas as pd from json import loads as ...
0 votes
1 answer
310 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-...
0 votes
1 answer
83 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 ...
1 vote
0 answers
89 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, ...
0 votes
1 answer
147 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
2 answers
54 views

Swap bundles in 0x Protocol

Do you know if future updates of the protocol will allow to swap NFT bundles as in version V3 of the protocol? I would be very interested in that functionality but I can't use the v3 version because ...
0 votes
1 answer
50 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
0 answers
29 views

0x gives incorrect quote for swap to XYO token

When trying to swap from fixed amount of ETH to XYO (XY Oracle) on Ethereum chain, 0x gives exaggerated buy amount. For example, as of moment of writing, trying to swap from 0.1 ETH to XYO: 0x: ~...

1
2 3 4 5 6