# Contracts & Functions

- [Contracts](/developer-guides/contracts.md)
- [Write Functions](/developer-guides/write-functions.md)
- [Transaction Prerequisites](/developer-guides/write-functions/transaction-prerequisites.md): Before interacting with a blockchain smart contract, you need approval
- [approve() / allowance()](/developer-guides/write-functions/transaction-prerequisites/approve-allowance.md): Give permission for a contract to access your wallet
- [Trading](/developer-guides/write-functions/trading.md): 2 function that enable trade flexibility
- [tradeBySourceAmount()](/developer-guides/write-functions/trading/trading-with-bancor.md): Trade an exact amount of source tokens for as many target tokens as possible
- [tradeByTargetAmount()](/developer-guides/write-functions/trading/tradebytargetamount.md): Trade target tokens for the least amount of source tokens possible
- [Trading Troubleshooting](/developer-guides/write-functions/trading/trading-troubleshooting.md): Common errors for trading on Bancor v3
- [Adding Liquidity](/developer-guides/write-functions/adding-liquidity.md): Provide liquidity with only one asset
- [deposit()](/developer-guides/write-functions/adding-liquidity/deposit.md): Deposit tokens for ownership in a liquidity pool
- [depositFor()](/developer-guides/write-functions/adding-liquidity/depositfor.md): Deposit tokens on behalf of a different address
- [Deposit Troubleshooting](/developer-guides/write-functions/adding-liquidity/deposit-troubleshooting.md): Common errors for adding liquidity in Bancor v3
- [depositAndJoin()](/developer-guides/write-functions/adding-liquidity/depositandjoin.md): This function is in the StandardRewards.sol contract.
- [Removing Liquidity](/developer-guides/write-functions/removing-liquidity.md): Initiating withdrawal and the withdrawal process
- [Initiating Cooldown](/developer-guides/write-functions/removing-liquidity/initiating-cooldown.md): Stake pool tokens in withdrawal contracts with Bancor
- [initWithdrawal()](/developer-guides/write-functions/removing-liquidity/initiating-cooldown/initwithdrawal.md): Functions on the PendingWithdrawals contract
- [withdraw()](/developer-guides/write-functions/removing-liquidity/withdraw.md): Withdrawing funds
- [cancelWithdrawal()](/developer-guides/write-functions/removing-liquidity/cancelwithdrawal.md): This function is in the BancorNetwork.sol contract
- [Withdraw Troubleshooting](/developer-guides/write-functions/removing-liquidity/withdraw-troubleshooting.md): Common errors for removing liquidity in Bancor v3
- [Flashloan](/developer-guides/write-functions/flashloan.md): In a single block, borrow capital and return it with an additional fee
- [flashLoan()](/developer-guides/write-functions/flashloan/flashloan.md): Borrow an indicated amount from the liquidity pool
- [Flashloan Troubleshooting](/developer-guides/write-functions/flashloan/flashloan-troubleshooting.md): Common errors for flash loans in Bancor v3
- [Migrating Liquidity to v3](/developer-guides/write-functions/migrating-liquidity-to-v3.md)
- [Migrating Bancor positions to v3](/developer-guides/write-functions/migrating-liquidity-to-v3/migrating-bancor-positions-to-v3.md): Enable the migration of user liquidity
- [migratePositions()](/developer-guides/write-functions/migrating-liquidity-to-v3/migrating-bancor-positions-to-v3/migratepositions.md): Migrate Bancor v2.1 pool tokens to Bancor v3
- [migratePoolTokens()](/developer-guides/write-functions/migrating-liquidity-to-v3/migrating-bancor-positions-to-v3/migratepooltokens.md): Migrate Bancor v1 pool tokens to Bancor v3
- [Errors and Troubleshooting](/developer-guides/write-functions/migrating-liquidity-to-v3/migrating-bancor-positions-to-v3/errors-and-troubleshooting.md): Common errors for migrating Bancor positions from previous versions
- [Migrating from Uniswap v2](/developer-guides/write-functions/migrating-liquidity-to-v3/migrating-from-uniswap-v2.md)
- [migrateUniswapV2Position()](/developer-guides/write-functions/migrating-liquidity-to-v3/migrating-from-uniswap-v2/migrateuniswapv2position.md): Common errors for migrating Uniswap v2 positions to Bancor v3
- [Migrating from Sushiswap](/developer-guides/write-functions/migrating-liquidity-to-v3/migrating-from-sushiswap.md)
- [migrateSushiSwapV1Position()](/developer-guides/write-functions/migrating-liquidity-to-v3/migrating-from-sushiswap/migratesushiswapv1position.md): Common errors for migrating SushiSwap positions to Bancor v3
- [Rewards](/developer-guides/write-functions/rewards.md)
- [join()](/developer-guides/write-functions/rewards/join.md): This function is in the StandardRewards.sol contract.
- [stakeRewards()](/developer-guides/write-functions/rewards/stakerewards.md): This function is in the StandardRewards.sol contract.
- [autoProcessRewards()](/developer-guides/write-functions/rewards/autoprocessrewards.md): This function is in the AutoCompoundingRewards.sol contract.
- [claimRewards()](/developer-guides/write-functions/rewards/claimrewards.md): This function is in the StandardRewards.sol contract.
- [leave()](/developer-guides/write-functions/rewards/leave.md): This function is in the StandardRewards.sol contract.
- [Surplus migration](/developer-guides/write-functions/surplus-migration.md)
- [withdrawPOL()](/developer-guides/write-functions/surplus-migration/withdrawpol.md)
- [Network Fees](/developer-guides/write-functions/network-fees.md)
- [burnNetworkFees()](/developer-guides/write-functions/network-fees/burnnetworkfees.md)
- [Read Functions](/developer-guides/read-functions.md): Use read functions to simulate an on-chain response
- [Rewards](/developer-guides/read-functions/rewards.md): Reward programs supported by Bancor v3
- [Standard rewards](/developer-guides/read-functions/rewards/standard-rewards.md)
- [Identify if a program exists](/developer-guides/read-functions/rewards/standard-rewards/identify-if-a-program-exists.md)
- [Auto Compounding](/developer-guides/read-functions/rewards/standard-rewards/identify-if-a-program-exists/auto-compounding.md): Check if a pool has a rewards program
- [Standard Rewards](/developer-guides/read-functions/rewards/standard-rewards/identify-if-a-program-exists/standard-rewards.md): List reward programs for token pools
- [programIds()](/developer-guides/read-functions/rewards/standard-rewards/programids.md): This function is in the StandardRewards.sol contract.
- [programs()](/developer-guides/read-functions/rewards/standard-rewards/programs.md): This function is in the StandardRewards.sol contract.
- [providerProgramIds()](/developer-guides/read-functions/rewards/standard-rewards/providerprogramids.md): This function is in the StandardRewards.sol contract.
- [pendingRewards()](/developer-guides/read-functions/rewards/standard-rewards/pendingrewards.md): This function is in the StandardRewards.sol contract.
- [latestProgramId()](/developer-guides/read-functions/rewards/standard-rewards/latestprogramid.md): This function is in the StandardRewards.sol contract.
- [isProgramActive()](/developer-guides/read-functions/rewards/standard-rewards/isprogramactive.md): This function is in the StandardRewards.sol contract.
- [isProgramEnabled()](/developer-guides/read-functions/rewards/standard-rewards/isprogramenabled.md): This function is in the StandardRewards.sol contract.
- [providerStake()](/developer-guides/read-functions/rewards/standard-rewards/providerstake.md): This function is in the StandardRewards.sol contract.
- [programStake()](/developer-guides/read-functions/rewards/standard-rewards/programstake.md): This function is in the StandardRewards.sol contract.
- [providerRewards()](/developer-guides/read-functions/rewards/standard-rewards/providerrewards.md): This function is in the StandardRewards.sol contract.
- [Auto compounding rewards](/developer-guides/read-functions/rewards/auto-compounding-rewards.md)
- [bnToken balance](/developer-guides/read-functions/rewards/auto-compounding-rewards/bntoken-balance.md)
- [isProgramActive()](/developer-guides/read-functions/rewards/auto-compounding-rewards/isprogramactive.md)
- [isProgramPaused()](/developer-guides/read-functions/rewards/auto-compounding-rewards/isprogrampaused.md)
- [pools()](/developer-guides/read-functions/rewards/auto-compounding-rewards/pools.md)
- [program()](/developer-guides/read-functions/rewards/auto-compounding-rewards/program.md)
- [programs()](/developer-guides/read-functions/rewards/auto-compounding-rewards/programs.md)
- [Liquidity Pool Details](/developer-guides/read-functions/liquidity-pool-details.md): This section includes read functions that provide details about liquidity pools.
- [liquidityPools()](/developer-guides/read-functions/liquidity-pool-details/liquiditypools.md): This function is in the BancorNetwork.sol contract.
- [isPoolValid()](/developer-guides/read-functions/liquidity-pool-details/ispoolvalid.md): This function is in the BancorNetwork.sol contract.
- [isPoolStable()](/developer-guides/read-functions/liquidity-pool-details/ispoolstable.md): This function is in the BancorNetworkInfo.sol contract.
- [tradingLiquidity()](/developer-guides/read-functions/liquidity-pool-details/tradingliquidity.md): This function is in the BancorNetworkInfo.sol contract.
- [depositingEnabled()](/developer-guides/read-functions/liquidity-pool-details/depositingenabled.md): This function is in the BancorNetworkInfo.sol contract.
- [poolFundingLimit()](/developer-guides/read-functions/liquidity-pool-details/poolfundinglimit.md): Bancor v3 supports infinity pools and deposits
- [Trades](/developer-guides/read-functions/trades.md): These functions return the expected results of a trade.
- [tradeOutputBySourceAmount()](/developer-guides/read-functions/trades/tradeoutputbysourceamount.md)
- [tradeInputByTargetAmount()](/developer-guides/read-functions/trades/tradeinputbytargetamount.md)
- [tradingEnabled()](/developer-guides/read-functions/trades/tradingenabled.md): This function is in the BancorNetworkInfo.sol contract.
- [tradingFeePMM()](/developer-guides/read-functions/trades/tradingfeepmm.md): This function is in the BancorNetworkInfo.sol contract.
- [Withdrawals](/developer-guides/read-functions/withdrawals.md): This section includes withdrawal-related read functions.
- [isReadyForWithdrawal()](/developer-guides/read-functions/withdrawals/isreadyforwithdrawal.md): This function is in both PendingWithdrawals.sol and BancorNetworkInfo.sol.
- [withdrawalRequest()](/developer-guides/read-functions/withdrawals/withdrawalrequest.md): This function is in the PendingWithdrawals.sol contract.
- [withdrawalAmounts()](/developer-guides/read-functions/withdrawals/withdrawalamounts.md): This function is in the BancorNetworkInfo.sol contract.
- [withdrawalRequestIds()](/developer-guides/read-functions/withdrawals/withdrawalrequestids.md): This function is in the PendingWithdrawals.sol contract.
- [withdrawalRequestCount()](/developer-guides/read-functions/withdrawals/withdrawalrequestcount.md): This function is in the PendingWithdrawals.sol contract.
- [lockDuration()](/developer-guides/read-functions/withdrawals/lockduration.md): This function is in the PendingWithdrawals.sol contract.
- [Pool Token Information](/developer-guides/read-functions/pool-token-information.md): This section includes read functions that return information about pool tokens.
- [poolToken()](/developer-guides/read-functions/pool-token-information/pooltoken.md): This function is found in the BancorNetworkInfo.sol contract.
- [collectionByPool()](/developer-guides/read-functions/pool-token-information/collectionbypool.md): This function is found in the BancorNetworkInfo.sol contract.
- [poolTokenToUnderlying()](/developer-guides/read-functions/pool-token-information/pooltokentounderlying.md)
- [underlyingToPoolToken()](/developer-guides/read-functions/pool-token-information/underlyingtopooltoken.md): This function is found in the BancorNetworkInfo.sol contract.
- [Vortex](/developer-guides/read-functions/vortex.md): This section includes read functions related to the Bancor Vortex.
- [pendingNetworkFeeAmount()](/developer-guides/read-functions/vortex/pendingnetworkfeeamount.md): This function is in the BancorNetwork.sol contract.
- [minNetworkFeeBurn()](/developer-guides/read-functions/vortex/minnetworkfeeburn.md)
- [Surplus whitelist](/developer-guides/read-functions/surplus-whitelist.md)
- [protectedTokenWhitelist()](/developer-guides/read-functions/surplus-whitelist/protectedtokenwhitelist.md)
- [Data & Events](/developer-guides/data-and-events.md)
- [General Data](/developer-guides/data-and-events/general-data.md): Using data to trigger events from a smart contract
- [contextId](/developer-guides/data-and-events/general-data/contextid.md): The unique value contexid logs data events
- [Trading Data](/developer-guides/data-and-events/trading-data.md): The event to track trades on the Bancor Network
- [event TokensTraded()](/developer-guides/data-and-events/trading-data/event-tokenstraded.md): This function fires an event after a token is successfully swapped
- [Liquidity Data](/developer-guides/data-and-events/liquidity-data.md): The events to track liquidity data
- [TotalLiquidityUpdated()](/developer-guides/data-and-events/liquidity-data/totalliquidityupdated.md)
- [TradingLiquidityUpdated()](/developer-guides/data-and-events/liquidity-data/tradingliquidityupdated.md)
- [TokensDeposited()](/developer-guides/data-and-events/liquidity-data/tokensdeposited.md)
- [TokensWithdrawn()](/developer-guides/data-and-events/liquidity-data/tokenswithdrawn.md)
- [WithdrawalInitiated()](/developer-guides/data-and-events/liquidity-data/withdrawalinitiated.md)
- [WithdrawalCancelled()](/developer-guides/data-and-events/liquidity-data/withdrawalcancelled.md)
- [WithdrawalCompleted()](/developer-guides/data-and-events/liquidity-data/withdrawalcompleted.md)
- [LockDurationUpdated()](/developer-guides/data-and-events/liquidity-data/lockdurationupdated.md)
- [Cross AMM Migration Data](/developer-guides/data-and-events/liquidity-data/cross-amm-migration-data.md)
- [UniswapV2PositionMigrated()](/developer-guides/data-and-events/liquidity-data/cross-amm-migration-data/uniswapv2positionmigrated.md)
- [SushiswapV1PositionMigrated()](/developer-guides/data-and-events/liquidity-data/cross-amm-migration-data/sushiswapv1positionmigrated.md)
- [Flashloan Data](/developer-guides/data-and-events/flashloan-data.md)
- [FlashLoanCompleted()](/developer-guides/data-and-events/flashloan-data/flashloancompleted.md)
- [FlashLoanFeePPMUpdated()](/developer-guides/data-and-events/flashloan-data/flashloanfeeppmupdated.md)
- [Rewards](/developer-guides/data-and-events/rewards.md): Events & data points related to rewards
- [Staking and Unstaking](/developer-guides/data-and-events/rewards/staking-and-unstaking.md)
- [Event ProviderJoined()](/developer-guides/data-and-events/rewards/staking-and-unstaking/event-providerjoined.md)
- [Event ProviderLeft()](/developer-guides/data-and-events/rewards/staking-and-unstaking/event-providerleft.md)
- [Claiming and Restaking Rewards](/developer-guides/data-and-events/rewards/claiming-and-restaking-rewards.md)
- [Event RewardsClaimed()](/developer-guides/data-and-events/rewards/claiming-and-restaking-rewards/event-rewardsclaimed.md)
- [Event RewardsStaked()](/developer-guides/data-and-events/rewards/claiming-and-restaking-rewards/event-rewardsstaked.md)
