Returns the solana instructions to collect the fees from the pool. See the readme for the payout destinations. (Permissionless)
The connection object to the rpc node
The seed of the pool
Returns the solana instructions to create a new serum order for the pool. (Signed by the SignalProvider account of the pool and the OpenOrder Account returned by this function)
The connection object to the rpc node
The seed of the pool that should be traded on
The address of the serum market to trade on
The side of the order (ask or bid)
The limit price for the order
The percentage (a number from 0 to 100) of the pool assets that should be invested
For now, all orders are to be set as type ImmediateOrCancel
The serum clientId for the order, can be set as 0
The serum self trade behaviour for the order
The address of the srm discount key for the order (optional)
The address of the account that should pay for the allocation fees
If this optional argument is given, it will overwrite the maxQuantityPercentage and fix the size of the order in base quantity. If you want to trade one and a half FIDA on FIDA/USDC for example, give 1.5 as an input here.
Returns the solana instructions to create a new pool by performing the first deposit of any number of different tokens and setting the pubkey of the signal provider. The first deposit will fix the initial value of 1 pooltoken (credited to the target) with respect to the deposited tokens. (Signed by the sourceOwner account)
The connection object to the rpc node
The address of the wallet that owns the tokens to be invested in the pool
The adresses of the token accounts that hold the tokens to be invested in the pool
The key of the account that will have the right to trade with the funds of the pool
An array of the amounts that should be invested for each token, in the same order as the sourceAssetKeys
The maximum number of different tokens the pool will ever be able to hold (solana memory allocation is fixed)
An array of the addresses of the serum markets that the signalProvider will be able to trade on
The address of the account that should pay for the allocation fees
The smallest period in seconds after which the trading fees can be payed out again (minimum is 604800 s or 1 week)
The percentage (a number from 0 to 100) of the pool assets that should be collected as fees
Returns the solana instructions to buy into the pool. The source deposits tokens into the pool and the target receives a corresponding amount of pool-token in exchange. The program will try to maximize the deposit sum with regards to the amounts given by the source and the ratio of tokens present in the pool at that moment. Tokens can only be deposited in the exact ratio of tokens that are present in the pool. (Signed by the sourceOwnerKey)
The connection object to the rpc node
The address of the wallet that owns the tokens to be invested in the pool
The adresses of the token accounts that hold the tokens to be invested in the pool
The amount of pooltokens that should be bought (ie the amount of tokens that should be invested)
The seed of the pool that should be invested into
The address of the account that should pay for the allocation fees
Fetch the balances of the poolToken and the assets (returned in the same order as in the poolData)
Returns a structure containing most informations that one can parse from a pools state.
Returns the seeds of the pools managed by the given signal provider. Returns all poolseeds for the current BonfidaBot program if no signal provider was given.
Returns the solana instructions to buy out of the pool by redeeming (burning) pooltokens. This instruction needs to be executed after (and within the same transaction) having settled on all possible open orders for the pool. This is because as long as an order is open for the pool, redeeming is impossible. (Signed by the owner of the pooltokens)
The connection object to the rpc node
The address of the account that owns the pooltokens to be redeemed
The address that holds the pooltokens
An array of addresses to which the pool asset tokens are payed out to
The seed of the pool that should be redeemed from
The amount of pooltokens that should be used (ie the amount of tokens that should be bought back)
Returns the solana instructions to a crank to settle funds out of one of the pool's active OpenOrders accounts. (Permissionless)
The connection object to the rpc node
The seed of the pool that should be settled
The address of the serum market on which the order is
The address of the serum openOrder account to settle
The address of the referer that should receive the serum trading fees
Returns the solana instructions to settle all open orders for a given pool. If the returned transaction array is too large for it to be sent on Solana, you may need to process it batch-wise.
This method lets the user deposit an arbitrary token into the pool by intermediately trading with serum in order to reach the pool asset ratio. (WIP)
Generated using TypeDoc
This method is obsolete for now as all orders can only be passed as ImmediateOrCancel