Last updated
Last updated
Symmetry SDK is utilized in Symmetry UI (app.symmetry.fi), which is open-source. You can fork the repository and deploy it as your own asset management platform, or modify & add new features.
Check out Symmetry UI on Github:
Software Development Kit for interacting with Symmetry Baskets Program
To install the sdk, run:
npm install @symmetry-hq/baskets-sdk
Create Basket with specific settings and rules
Edit Basket (Only for Mutable & Permissioned baskets)
Close Basket (Basket TVL == 0 & no active BuyStates is required)
Load specific basket from public key
Load list of baskets based on filters (manager/host platform public key)
You can also load baskets' current compositions & parsed data such as basket name, symbol, current TVL - basketWorth
, current price - rawPrice
, etc...
There are three ways to buy a basket token.
Buy basket with a single token (token should be in the basket composition)
Works for baskets with no more than 5 tokens Amounts for tokens should be provided in the same order tokens are present in baskets composition. Baskets composition can be found in Basket object of a basket, or using getCurrentCompositions()
Users also have option to contribute USDC to the basket. Symmetry Engine will use that USDC to buy underlying tokens (rebalance usdc to baskets current composition based on their target weights) After rebalancing, basket tokens will be minted for user.
Step 1: Contribute USDC to Basket and create BuyState (Temporary on-chain account) Initially BuyState will have the information about users contribution.
Step 2: Rebalance BuyState: Buy underlying assets in the basket using contributed USDC. During rebalancing process, BuyState will store the information about already purchased assets, as well as remaining amount of USDC.
Users can always force-rebalance their BuyState, but it is also done by Symmetry engine (BuyState will automatically rebalance within 3 minutes)
Step 3: Mint Basket Tokens & Close Buy State.
During this stage, all the assets acquired during rebalancing process will be added to the basket. Corresponding basket tokens will be minted for user, and circulating supply of the basket tokens will increase by same amount. After, it will safely close BuyState. Users can call force-mint function after 3 minutes, but Symmetry engine will also automatically handle this step. Rent for creating temporary account goes back to user.
There are two ways to sell basket tokens.
Users can directly claim their portion of the tokens from Baskets composition. They also have an option to rebalance those tokens to USDC before claiming.
Step 1: Burn Basket Tokens and create SellState (Temporary on-chain account) SellState is an on-chain account which has exactly same structure as Basket. Initially SellState will store baskets composition with amounts corresponding to users holdings. Circulating supply will decrease by burn amount and users Basket tokens will be burned. From here, this SellState is already independent from the original Basket. User can specify if they want to rebalance their to-be-claimed tokens to USDC
Step 2: Rebalance SellState(Basket): Rebalance underlying assets to USDC This step is optional, user can skip this step and directly claim underlying tokens. SellState-s have exact structure as Baskets so rebalance function is same for them. (Optional, only when rebalance == true)
Step 3: Claim underlying tokens (or USDC) from SellState. After this step, SellState is closed and rent is collected by user.
Automation on all baskets (Refilter/Reweight/Rebalance), as well as monitoring active Buy/Sell states and rebalancing them is done by Symmetry Engine, based on RefilterInterval, ReweightInterval, RebalanceInterval settings provided in basket rules. Platforms and Developers can run their own automation for their baskets using examples below. Managers can Force-(Refilter/Reweight/Rebalance) anytime.
Automatically selects assets based on provided rules in basket settings.
Automatically updates target weights for assets based on provided rules.
Swap basket tokens using DEX aggregators to bring all tokens back to target weights.
Users can swap and check available swap liquidity for a specific basket
Example shows how to create/buy/sell/rebalance/refilter/reweight a basket
Creating basket with following settings:
Manager fee : 0.1% - Users pay 0.1% to basket manager when buying
Is Mutable - Manager can edit basket settings and rules
Asset Pool consists of 4 tokens - [USDC, SOL, BTC, ETH]
Basket refilters underlying assets every week
Basket reweights underlying assets every day
Basket rebalances every 2 hours
Basket rebalances when target and current weights differ by at least 5%
Maximum allowed slippage on rebalance is 3% (compared to oracle price)
Basket provides swap liquidity for a token if current weight is within 5% (rebalance) 50%(lpOffset) = 2.5% of target weight
Basket has 1 rule:
Select TOP 3 assets by 1 week average MarketCap,
Weight chosen assets by square root of 1 day performance
Automation is on (Symmetry Engine will Refilter/Reweight/Rebalance based on rules)
Liquidity Provision is enabled.
Having trouble integrating? Please reach out in our Discord, we're happy to help!
Checkout and for more information on how settings should be provided.
Find out more at