balancer / b-sdk Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Add Init Pool functionality to Gyro Pools
If no swapOptions.block
is set the subgraph query fails. Think it's on fetchDataFromSubgraph()
.
Instead of setting a default latest
, if no block is set we should remove the block query filter. Have a feeling this will slightly improve query speed on the graph's side even though it shouldn't matter.
Add Create Pool functionality for Gyro Pools
Currently beets API does not support Nested Weighted Pools.
As soon as the API is updated, b-sdk API client should be updated as well.
Note: add/remove liquidity nested logic already supports it. It's just the API client that needs to be updated.
Before implementing, we should evaluate the experience of adding custom types (not only pool types, but add liquidity types, remove liquidity types, etc.).
One key feature of the SDK is that it's extensible, so we have to make sure that changing poolType
from string
to PoolType
won't affect the ability to add custom types.
Circular imports caused build issues before.
This lint was suggested by Alberto in the API:
https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-cycle.md
Will likely need a bunch of refactoring if implemented.
Prepare b-sdk to support both v2 and v3 implementation
Addresses for BASE chain are missing in the constants.ts file
Use beets api implementation as reference (here)
This setup looks pretty fragile, it will only work for those two explicit pool types.
It should work with all supported pool types + any custom pool type added to b-sdk
A few months ago we replaced Balancer Queries contract with MulticallV3 for querying onChain data, but there are still some places using it.
It should be replaced by equivalent contracts, such as Balancer Helpers, so we reduce the amount of contracts we depend on.
It should follow what's defined by the SC for each pool.
Create Add Liquidity Init Functionality for Weighted Pools
Comment from Daniel: Could be worthwhile pulling init into its own function as it is really a special case and not something needed by most integrators.
Thinking about supporting other data providers, we should make only the minimum fields required for functionality a hard requirement. It may also make sense to separate a RawPool
type between a PoolDataProvider
and a PoolDataEnricher
to be less opinionated. Ex: a GetPoolsResponse
shouldn't require these fields:
address
- pool classes regenerate this using the id
in the constructorpoolTypeVersion
- can assume latestswapFee
- can assume will be queried in enricherswapEnabled
- can assume this has already been checkedtokens
- can assume will be queried in enrichertokensList
- i think this can be removed entirely throughoutliquidity
- same as abovetotalShares
- can assume will be queried in enricher. on enricher type we should only force this for composable stableIt would be nice to have a helper method to calculate proportional amounts in, that can later be used as input to add liquidity methods.
Please use the old SDK implementation as reference (here)
Note: we'll likely need a new api client to fetch pool balances. I'd say it's ok to use that instead of on chain balances.
Make sure both static.ts and sor.ts reflect the same change
Implement price impact within b-sdk for:
Comment from Daniel: Could be worthwhile pulling init into its own function as it is really a special case and not something needed by most integrators.
Implement price impact for nested liquidity within b-sdk.
Note: releasing this depends on relayerV6 being audited and approved by governance. Development can still be done with a locally deployed relayer. It should be ok to build on top of the existing nested liquidity working branch.
Pool types:
Add Liquidity Init Functionality for Composable Stable Pools;
Considering Daniel's comment about v3 not having a getPoolId
method, we should break InitPoolDataProvider into v2 and v3 implementation.
Since we don't yet have everything ready for v3, v3 implementation can be blank for now.
Following the Ledger issue its worth reviewing. Couple of useful threads:
https://twitter.com/ricmoo/status/1735414433956999177
https://twitter.com/LefterisJP/status/1735389403357319253
https://twitter.com/evan_van_ness/status/1740491595152318623
From @agualis:
Regarding undefined env vars
, I don’t think we need it (yet) as we don’t have so many of them. But if the project env var handling becomes more complex we could probably add a zod schema for env content validation:
95% sure that queryExit does not work for recovery. Couple of options:
Request from @agualis:
Ideally, it would be good to allow the users to check the “quote” before connecting
If you are a new user and you are simply exploring balancer is good to have this ability
To achieve that we could to remove accountAddress
from AddLiquidityNestedInput
and fill in with ZERO_ADDRESS
.
Then we'd need to replace that with sender/recipient provided on buildCall.
This is probably not a high priority task at this development stage but I would consider avoiding barrels for different reasons.
There are some good examples of libraries consumed by thousands of users that could inspire our bundle setup (i.e. viem?)
Note: solution should be generalized for multiple tokens
This task depends on the development of a helper contract that should prevent the need for several query swaps as the current implementation needs.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.