Giter Club home page Giter Club logo

b-sdk's People

Contributors

agualis avatar brunoguerios avatar danielmkm avatar franzns avatar github-actions[bot] avatar gmbronco avatar johngrantuk avatar lgahdl avatar mattpereira avatar mikemcdonald avatar mkflow27 avatar thal0x avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

b-sdk's Issues

Support Nested Weighted 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.

Map api poolType string to PoolType

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.

Replace remaining Balancer Helpers usage

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.

Weighted Pool - Add Liquidity Init

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.

Decide on raw pool requirements

https://github.com/balancer-labs/b-sdk/blob/b219f2953a089999518a40661ad247947fa13f24/src/data/types.ts#L25-L36

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 constructor
  • poolTypeVersion - can assume latest
  • swapFee - can assume will be queried in enricher
  • swapEnabled - can assume this has already been checked
  • tokens - can assume will be queried in enricher
  • tokensList - i think this can be removed entirely throughout
  • liquidity - same as above
  • totalShares - can assume will be queried in enricher. on enricher type we should only force this for composable stable

Add Liquidity Proportional - Proportional Inputs Helper

It 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.

Price Impact - ABA method

Implement price impact within b-sdk for:

  • design and specs on Notion
  • swap
  • add liquidity single token
  • add liquidity unbalanced (generalized for multiple tokens)
  • remove liquidity single token
  • remove liquidity unbalanced (v2 only)

Price Impact - ABA method - Nested Liquidity

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.

  • add liquidity nested unbalanced
  • remove liquidity nested single token

InitPoolDataProvider v3 scaffold

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.

Add zod schema for env content validation

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:

Remove Liquidity Recovery

95% sure that queryExit does not work for recovery. Couple of options:

  1. Is it queryContracts that don't work or pools themselves? Ask SC team.
  2. Have to add maths 😞 Might be worth considering not doing this?

Remove the need for accountAddress when querying for Add/Remove Liquidity Nested

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.

Avoid barrels

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?)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.