3 votes

How can I get all tokens listed on `Sushiswap`

The SushiSwap subgraph provides a GraphQL API that you can query to get information about tokens, pairs, and other relevant data. You can find the SushiSwap subgraph URL on their official ...
Canard Coca's user avatar
3 votes
Accepted

How is uniswap/sushiswap distributing their fees?

Well, after some research I can answer my question. I was indeed right, treasury fee is 1/6 (16.6%) of the total fee. Precisely, the code for this formula is in the core repository: code unction ...
Kaneda's user avatar
  • 365
2 votes

Can I avoid impermanent loss if I only as a LP of BETH/ETH pair in binance?

Binance documentation describes the BETH/ETH pair. In short, this pool is less exposed to impermanent loss because the relative volatility between BETH and ETH is much lower than for something like ...
eth's user avatar
  • 85.8k
2 votes

Is there a grid trading option for Ethereum DEX'es like uniswap and sushiswap?

I would be very interested too. If you find any information, don't hesitate to post. I just found this, doing a quick search: https://medium.com/degate/degate-dex-launches-testnet-with-spot-limit-...
Jerome's user avatar
  • 21
2 votes

How to make the basic DEX operations in SushiSwap in Solidity? (internals of SushiSwap)

You'd need to do the following steps. You could also check out defi-minimal for more minimal examples of working with smart contracts. We are going to use uniswap, but sushiswap has essentially the ...
Patrick Collins's user avatar
2 votes
Accepted

Prices from Uniswap and SushiSwap inconstistent

I think what's going is that you are confused about the number of decimals. One ETH is 10^18 wei. But the USDC and USDT tokens only have 6 decimals: one USDC or USDT is only 10^6 of the basic unit. ...
kfx's user avatar
  • 1,516
2 votes
Accepted

How to know base token from the pool

Price in Uniswap pools is tracked in terms of token1/token0, so token1 is the numeraire token if that's what you're asking.
kfx's user avatar
  • 1,516
2 votes

What are the things MEV bots can MEV?

MEV can be the difference in the balance of reserves across two pools, it can be the opportunity created by bad swap setting, (100% slippage or ignoring price impact). It can be the bid a searcher ...
Maka's user avatar
  • 955
2 votes
Accepted

Is it possible to check the gas fees for a contract before executing the contract itself?

You can use a library like ethers.js or web3.js to estimate the gas usage and cost of the transaction. A sample code to achieve that using ethers.js: const { ethers } = require('ethers'); const ...
SYED ASAD KAZMI's user avatar
1 vote

How to know base token from the pool

There is no on-chain way to determine which token is a base token or which is a quote token if token0 and token1 are mapped to normal trading pairs. The trading pair base-quote token order is a human-...
Mikko Ohtamaa's user avatar
1 vote

SushiSwap contract RouteProcessor: Unknown command code

Route Processor: route breakdown (with working example) To build a route you'll want to know what you want to do, then look for those stages in the contract. There are command bytes and pool bytes ...
Maka's user avatar
  • 955
1 vote

processRoute SushiSwap

You say your error is cannot import name 'encode' from 'eth_abi', but in your code you use eth_abi.encode_single which was deprecated so as to not use different code for decoding single vs multiple. ...
pacrob's user avatar
  • 181
1 vote

Generate route for Sushi Swap Route Processor processRoute contract method

Sushiswap cross-chain swap is plugging into Layer0’s Stargate bridge infrastructure. in this project input of the router's value is based on chainID. I recommend reading this doc for a better ...
Payam Safaei's user avatar
1 vote

Testing uniswapV2 swap function with hardhat

swapExactTokensForTokensSushi function is private. You should make local unit tests for your contract before deploying to live nets.
ColonelBihi's user avatar
1 vote

0x API showing a different price than what is shown on matcha.xyz

It looks like in this case Matcha might be using RFQ to provide that quote, and RFQ liquidity is only surfaced to integrators with a key.
0x_jess's user avatar
  • 181
1 vote

How's Liquidity Pool ID obtained from?

Usually, Pool ID (or also commonly called pid) are incremented every time a pool is added by the Masterchef contract owner. Here, the pid is created by the .push method in the poolInfo array. So ...
Franfran's user avatar
  • 583
1 vote
Accepted

uniswap solidity contract: swapExactTokensForTokens Failed in my own smart contract

IERC20(token1).approve(address(sushiRouter), amountIn); IERC20(token2).approve(address(sushiRouter), amountOut); basically when you call approve from inside your contract then inside the approve ...
viraj's user avatar
  • 71
1 vote

How to make the basic DEX operations in SushiSwap in Solidity? (internals of SushiSwap)

You can interface with Smart Contracts by sending your request as JSON-RPC while connected to the Ethereum Network through any implementation of EVM. Things can be further simplified by using ...
0xCCY's user avatar
  • 161
1 vote
Accepted

When upgrading the smart contract to v0.7.6 of masterchef v2 getting this error TypeError: The "using for" directive is not allowed inside interfaces

That's because interfaces can't use libraries like that (it was allowed but completely useless before, now it's forbidden) just delete this line.
Foxxxey's user avatar
  • 4,307
1 vote

getReserves() function does not provide the information of the swap price

You have to sort the tokens first, otherwise you will get 2 different pair addresses for each pair. function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address ...
codingexplorer's user avatar
1 vote
Accepted

How does flash loan lender know you are not able to pay it back?

Usually the lender contract executes a callback after lending the requested assets. It is the callback responsibility to pay the loan and fees. If the callback hasn't returned the loan nor paid the ...
Ismael's user avatar
  • 30.6k

Only top scored, non community-wiki answers of a minimum length are eligible