The effect of adding liquidity to the pool.
Current stableswap amplifier. Zero for constant product pools.
Only for stableswaps. Zero for constant product pools.
A positive bonus means that after removing all the liquidity the user will end up with more tokens than he provided. This can happen when providing liquidity in a way that improves the pool balance.
If adding the liquidity increases the pool imbalance, the bonus will be negative (a penalty).
Also, a fee is subtracted from each liquidity addition. This negatively impacts the bonus.
Amount of minimum liquidity tokens received. The transaction will fail if the real value will be lower than this.
Amount of new liquidity tokens minted when adding the liquidity. All the minted tokens will be received by the liquidity provider except of first 1000 minted tokens which are permanently locked in the contract.
App call transaction fee.
The arguments to add liquidity to the pool.
The amount of primary asset to deposit.
The amount of secondary asset to deposit.
The maximum allowed slippage in percents e.g. 10
is 10%. Adding liquidity will fail if slippage will be higher.
Account address that will deposit the primary and secondary assets and receive the LP token.
Details about the liquidity pool assets returned from the asset pool.
Response from listPools function containing pagination information and results.
The individual pool information returned from listPools, this contains the basic pool information.
Global data for contracts.
The one to one representation of pool's global state. The optional properties are used only by stableswaps and should not be relevant to the users.
Params for calling the compileContract function.
An integer between 1 and 10_000.
Compiled funding transaction. Used to provide first funds into the newly created pool.
Response from compileContract function containing information about pool that is going to be created.
Compiled Noop transaction. Used to optin to assets in the newly created pool.
Basic fields in compiled transaction.
Params for calling the prepareContractTxns function.
Contains appid of the newly created & deployed pool.
The address of the farm's admin account. The admin can deposit new rewards and destroy the farm after it is deprecated.
Amounts of assets claimed by users so far.
Amounts of assets distributed so far. This includes tokens that are already claimed and tokens which are accrued and are awaiting claim.
Time in seconds until current cycle ends. This is the time at which the rewards are depleted. Next cycle is automatically picked up if next_rewards are deposited.
The duration of the next cycle.
Amounts of rewards deposited for the next cycle.
The number of active stakers. Active staker stakes at least 1 token.
Amounts of not yet distributed rewards in the farm.
Assets that are distributed as rewards in the farm.
Current rate per token for each asset.
The asset the users are going to stake in the farm.
The sum of all stakers deposits.
The time the farm was last updated.
The address of farm's updater. The updater can update the farm's contract to a new version.
Contract version.
Amounts of rewards the user has accrued and can claim.
Amounts of rewards the user has already claimed.
The app id of the user's escrow contract.
Current rate per token for each asset.
The amount of staked asset the user has deposited in the escrow.
The Pact pool between two fAssets tokens.
The Folks Finance pool for the primary fAsset.
The Folks Finance pool for the secondary fAsset.
A wrapper around Swap object that adds some lending specific information.
Amount of original asset deposited by the user.
Amount of original asset received by the user.
Information about the actual swap on the Pact pool.
Minimal amount of original asset received by the user after the slippage.
Options for calling the listPools function.
The basic three operation types in a PACT liquidity pool, namely Add Liquidity (ADDLIQ), Remove Liquidity (REMLIQ) and making a swap (SWAP).
A user friendly representation of pool's global state.
The arguments for removing liquidity from the pool.
Account address that will return the LP token and receive the primary and secondary assets.
The amount of the LP token to return to the pool.
Swap Effect are the basic details of the effect on the pool of performing the swap.
Stableswap only. Zero otherwise.
Options for creating a Swap.
Amount to swap or to receive. Look at swapForExact
flag for details.
The asset to swap.
The maximum allowed slippage in percents e.g. 10
is 10%. The swap will fail if slippage will be higher.
If false or not provided, the amount
is the amount to swap (deposit in the contract).
If true, the amount
is the amount to receive from the swap.
The arguments used to generate the swap.
A blob from a signed transaction.
Possible transaction types.
The arguments to add liquidity to the pool using zap.
Amount used for the zap.
Asset provided for the zap.
The maximum allowed slippage in percents e.g. 10
is 10%. The swap will fail if slippage will be higher.
All amounts that should be used in swap and add liquidity transactions.
The options for building zap transactions.
Compiles contract data.
The API URL.
Information about sender, assets ids and desired fee bps.
Compiled contract data, to be used in transaction creation.
Deploys contract to the blockchain.
The API URL.
Signed transaction blob.
The id of the newly deployed contract.
Fetches the global state of the of an application.
The algo client to query the app in.
The application id to fetch the state of.
The global state of the application.
Fetches an Asset class with the details about the asset for a given id number.
The function uses an internal cache so as to minimize the number of times the actual Algorand client is used to look up the asset. This function is used through out the pact sdk to query asset information.
An Algorand client to query about the asset.
An Algorand Asset number to look up.
An Asset instance for the asset number passed in.
Fetches Folks lending pool application info from the algod, parses the global state and builds FolksLendingPool object.
Fetches the pool from the blockchain using the provided algod client.
The algo client to use.
The application id to fetch.
The pool object for the application id passed in.
Returns the list of Pool for the assets passed in. There can be zero pools if there are no pools matching the assets, or multiple if there are multiple at different fees. The order of assets that you provide is irrelevant.
The algo client to use.
One of the assets in the pool (asset id or Asset).
The other asset in the pool (asset id or Asset).
The API url to use.
A list of pools matching the provided assets.
Returns the application ids for any pools that match the primary and secondary asset.
This function finds any pools using the pactApiUrl
passed in that match the asset ids passed in.
The API url to use.
The algorand asset id for the primary asset of the pool.
The algorand asset id for the secondary asset of the pool.
Array of asset ids.
Uses a Newton-Raphson method to calculate the pool invariant.
A tuple of invariant and number of iterations required to calculate the invariant.
Returns a tuple of minted tokens and total Newton-Raphson iterations (needed for tx fee calculations).
To calculate the pool invariant, a Newton-Raphson method is used in both - the SDK and the smart contract. Algorand has a limit of the number of operations available in a single app call. To increase the limit, an additional empty inner transaction have to be created. Each extra tx increases tx fee. This functions calculates the fee needed for a swap transaction.
Number of iterations of Newton-Raphson interpolation.
Number of extra inner transactions needed in case of slippage.
The required fee.
Finds all the pools that match the pool options passed in.
The API URL to query the list of pools.
List of options for querying the pools.
Pool data for all pools in the Pact that meets the pool options.
The contract's global state retrieved from algosdk.
Prepares data to create transactions for funding the contract, creating liquidity tokens and opting-in assets.
The API URL.
Required contract data.
An array of 3 data objects, to be used in transaction creation.
Sends all initial contract transactions prepared in prepareContractTxns function.
The API URL.
An array of three transaction blobs.
Pool data of successfully created, deployed and prepared contract.
Generated using TypeDoc
Account address that will deposit the primary and secondary assets and receive the LP token.