Symmetry APIs
Symmetry APIs simplifies integration with on-chain programs without the need of installing or interacting with external libraries.
Getting Started
To interact with Symmetry API, you'll need to make POST requests to https://api.symmetry.fi/baskets/XXXX with specific parameters based on the operation you want to perform. Each operation, such as minting, burning, or creating a new basket, has its own command path and required parameters.
Currently users can use symmetry API endpoints to
Create a new Basket
Description: Creates a new basket.
Endpoint:
POST https://api.symmetry.fi/baskets/createParameters:
symbol: Basket Symbol/Ticker (3-10 characters).name: Basket name (3-60 characters).uri: URI containing desired metadata in JSON format (Max 300 characters).hostPlatform: A project integrating Symmetry may receive hostPlatformFees.hostPlatformFees: Fee in bps (0.1% = 10) for host platform wallet.creator: Wallet PublicKey of a user creating a basket.depositFee: Fee charged on deposits for creator (in bps).type: Basket type: 0 = Immutable, 1 = Mutable, 2 = Permissioned.rebalanceInterval: Frequency of rebalance checks in seconds.rebalanceThreshold: Allowed deviation from target weights before rebalancing,slippage: Maximum allowed slippage for rebalance transactions, in bps.lpOffsetThreshold: EXPERIMENTAL: Defines liquidity pool behavior for rebalancing. 0 disables this feature.disableRebalance: Controls automatic rebalancing: 0 = enabled, 1 = disabled.disableLp: Controls liquidity pool functionality: 0 = enabled, 1 = disabled.composition: Array of desired basket composition
Ts Example:
Edit Basket
Description: Edit a basket.
Endpoint:
POST https://api.symmetry.fi/baskets/editParameters:
basket: PublicKey of basket to be edited (string).creator: Wallet PublicKey of the basket creator.depositFee: Fee charged on deposits for creator (in bps).rebalanceInterval: Frequency of rebalance checks in seconds.rebalanceThreshold: Allowed deviation from target weights before rebalancing,slippage: Maximum allowed slippage for rebalance transactions, in bps.lpOffsetThreshold: EXPERIMENTAL: Defines liquidity pool behavior for rebalancing. 0 disables this feature.disableRebalance: Controls automatic rebalancing: 0 = enabled, 1 = disabled.disableLp: Controls liquidity pool functionality: 0 = enabled, 1 = disabled.composition: Array of desired basket composition
Ts Example:
Deposit into Basket
Description: Deposit USDC to on-chain account. Automation will rebalance USDC to baskets current composition assets and basket tokens will be automatically minted for user within 3 minutes
Endpoint:
POST https://api.symmetry.fi/baskets/depositParameters:
user: PublicKey of the user depositing USDC.basket: PublicKey of the basket on-chain account.amount: amount of USDC to be deposited.
Ts Example:
Withdraw and Claim Tokens
Description: Burn Basket Tokens and Withdraw underlying assets to the new on-chain account. Underlying assets from the new account can be claimed by using Claim API.
Withdraw - Endpoint:
POST https://api.symmetry.fi/baskets/withdrawWithdraw - Parameters:
user: PublicKey of the user depositing USDC.basket: PublicKey of the basket on-chain account.amount: amount of Basket Tokens to be withdrawn.
Claim - Endpoint:
POST https://api.symmetry.fi/baskets/withdrawClaim - Parameters:
user: PublicKey of the user depositing USDC.basket: PublicKey of the on-chain account created during Withdraw.
Ts Example:
Deposit single Asset
Description: Users also have an option to deposit an arbitrary asset to Buy/Mint Basket tokens. Only constraint is - asset should be in the baskets current composition.
Endpoint:
POST https://api.symmetry.fi/baskets/mintParameters:
user: PublicKey of the user depositing asset.basket: PublicKey of the basket on-chain account.tokenMint: Mint address of the Asset to be deposited.amount: amount of Asset to be deposited.
Ts Example:
Redeem Single Asset
Description: Users also have an option to sell/burn Basket tokens and withdraw to an arbitrary asset. Only constraint is - asset should be in the baskets current composition.
Endpoint:
POST https://api.symmetry.fi/baskets/burnParameters:
user: PublicKey of the user selling a basket token.basket: PublicKey of the basket on-chain account.tokenMint: Mint address of the Asset to sell Basket Tokens to.amount: amount of Basket tokens to be withdrawn.
Ts Example:
Set Basket Metadata
Description: Creators can set metadata for their Basket Token. In that case, token will get easily detected by Wallet Extensions and Solana Blockchain Explorers
Endpoint:
POST https://api.symmetry.fi/baskets/set-metadataParameters:
basket: PublicKey of the basket on-chain account.creator: Wallet PublicKey of the basket creator.symbol: new Symbol/Ticker of Basket Tokenname: new Name of Basket Tokenuri: new Symbol/Ticker of Basket Token
Ts Example:
More API Endpoints are Coming...
If you have any questions or issues, please join our Discord, we're happy to help!
Last updated