Comments (2)
#65 seems to be a duplicate of this. This issue has more details so I closed the other, but it is there if we want to reference another issue.
from smart-order-router.
I believe this bug is fixed in the current version 3.2.6.
In Fraction.constructor, numerator
and denominator
are always initialized.
public constructor(numerator: BigintIsh, denominator: BigintIsh = JSBI.BigInt(1)) {
this.numerator = JSBI.BigInt(numerator)
this.denominator = JSBI.BigInt(denominator)
}
In Fraction.tryParseFraction, new Fraction(fractionish)
is created when type of fractionish
is BigintIsh (or instance of JSBI, number or string).
private static tryParseFraction(fractionish: BigintIsh | Fraction): Fraction {
if (fractionish instanceof JSBI || typeof fractionish === 'number' || typeof fractionish === 'string')
return new Fraction(fractionish)
if ('numerator' in fractionish && 'denominator' in fractionish) return fractionish
throw new Error('Could not parse fraction')
}
Finally, when fractionish is CurrencyAmount
, CurrencyAmount.constructor always calls Fraction.constructor
with super(numerator, denominator)
, which means numerator
and denominator
are always initialized.
protected constructor(currency: T, numerator: BigintIsh, denominator?: BigintIsh) {
super(numerator, denominator)
invariant(JSBI.lessThanOrEqual(this.quotient, MaxUint256), 'AMOUNT')
this.currency = currency
this.decimalScale = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(currency.decimals))
}
from smart-order-router.
Related Issues (20)
- Requesting V2 trades always throw an error "Unexpected pool type in route when constructing trade object"
- Failed to get subgraph pools from any providers after upgrade HOT 5
- Browser is not defined HOT 12
- Bug: AlphaRouter.route returning Error: invalid address on Polygon Mumbai HOT 3
- "Failed to get gas constants data from the optimism gas oracle" when quoting swaps on Base and Optimism HOT 11
- Can not find latest pool from the default _v3SubgraphProvider
- Routing Break when swaping a large amount
- Cannot read properties of undefined (reading 'DAI_OPTIMISM_SEPOLIA') HOT 3
- Module not found: Can't resolve 'fs' HOT 15
- Smart Order Router unable to find routes for a token on V3
- Vite build breaks smart-order-router app
- Smart Order Router is not working with some tokens..
- do you have the problem? HOT 2
- Alpha Router for sepolia not working HOT 1
- IPFS pool list access fails HOT 2
- wrong result HOT 2
- percents start loop index
- Base Sepolia
- alpha router uniswap CORS error HOT 4
- Can I get more precision in the quote?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smart-order-router.