LogoLogo
  • About Bancor Network
    • Bancor V3
    • Bancor Basics
      • About Bancor
      • What Can I Do With Bancor?
      • Liquidity Pools
      • Single-Side Liquidity
      • Why Use Bancor?
      • Resources
    • Resources for DAOs
      • Token Whitelisting Requirements
      • Liquidity Mining
        • Auto Compounding Rewards
          • How Auto Compounding Rewards work
          • How to Create an Auto Compounding Rewards Program
          • Custom Rewards Programs
        • Dual Liquidity Mining
        • Standard (External) Rewards
    • Security & Audits
      • Multisig Rights
      • Oracles
      • DAO MSIG Intervention Policy
  • Contracts & Functions
    • Contracts
    • Write Functions
      • Transaction Prerequisites
        • approve() / allowance()
      • Trading
        • tradeBySourceAmount()
        • tradeByTargetAmount()
        • Trading Troubleshooting
      • Adding Liquidity
        • deposit()
        • depositFor()
        • Deposit Troubleshooting
        • depositAndJoin()
      • Removing Liquidity
        • Initiating Cooldown
          • initWithdrawal()
        • withdraw()
        • cancelWithdrawal()
        • Withdraw Troubleshooting
      • Flashloan
        • flashLoan()
        • Flashloan Troubleshooting
      • Migrating Liquidity to v3
        • Migrating Bancor positions to v3
          • migratePositions()
          • migratePoolTokens()
          • Errors and Troubleshooting
        • Migrating from Uniswap v2
          • migrateUniswapV2Position()
        • Migrating from Sushiswap
          • migrateSushiSwapV1Position()
      • Rewards
        • join()
        • stakeRewards()
        • autoProcessRewards()
        • claimRewards()
        • leave()
      • Surplus migration
        • withdrawPOL()
      • Network Fees
        • burnNetworkFees()
    • Read Functions
      • Rewards
        • Standard rewards
          • Identify if a program exists
            • Auto Compounding
            • Standard Rewards
          • programIds()
          • programs()
          • providerProgramIds()
          • pendingRewards()
          • latestProgramId()
          • isProgramActive()
          • isProgramEnabled()
          • providerStake()
          • programStake()
          • providerRewards()
        • Auto compounding rewards
          • bnToken balance
          • isProgramActive()
          • isProgramPaused()
          • pools()
          • program()
          • programs()
      • Liquidity Pool Details
        • liquidityPools()
        • isPoolValid()
        • isPoolStable()
        • tradingLiquidity()
        • depositingEnabled()
        • poolFundingLimit()
      • Trades
        • tradeOutputBySourceAmount()
        • tradeInputByTargetAmount()
        • tradingEnabled()
        • tradingFeePMM()
      • Withdrawals
        • isReadyForWithdrawal()
        • withdrawalRequest()
        • withdrawalAmounts()
        • withdrawalRequestIds()
        • withdrawalRequestCount()
        • lockDuration()
      • Pool Token Information
        • poolToken()
        • collectionByPool()
        • poolTokenToUnderlying()
        • underlyingToPoolToken()
      • Vortex
        • pendingNetworkFeeAmount()
        • minNetworkFeeBurn()
      • Surplus whitelist
        • protectedTokenWhitelist()
    • Data & Events
      • General Data
        • contextId
      • Trading Data
        • event TokensTraded()
      • Liquidity Data
        • TotalLiquidityUpdated()
        • TradingLiquidityUpdated()
        • TokensDeposited()
        • TokensWithdrawn()
        • WithdrawalInitiated()
        • WithdrawalCancelled()
        • WithdrawalCompleted()
        • LockDurationUpdated()
        • Cross AMM Migration Data
          • UniswapV2PositionMigrated()
          • SushiswapV1PositionMigrated()
      • Flashloan Data
        • FlashLoanCompleted()
        • FlashLoanFeePPMUpdated()
      • Rewards
        • Staking and Unstaking
          • Event ProviderJoined()
          • Event ProviderLeft()
        • Claiming and Restaking Rewards
          • Event RewardsClaimed()
          • Event RewardsStaked()
  • Developer Guides
    • Bancor Vortex Burner
    • Bancor Etherscan Guide
      • Etherscan Basics
      • Deposit
      • Deposit and Join
      • Rewards: Joining Standard Rewards
      • Rewards: Stake & Claim
      • Rewards: Leaving the Rewards Contract
      • Withdrawing Tokens
        • Initiating the Withdrawal
        • Completing the Withdrawal
      • Migrating V2.1 Positions
      • Rewards: Auto Compounding Rewards Distribution
    • REST API
      • API Reference
      • DLT Identifier
Powered by GitBook
On this page
  • 1. Identify your position(s)
  • 2. Identify position data
  • 3. Migrate your protected positions
  1. Developer Guides
  2. Bancor Etherscan Guide

Migrating V2.1 Positions

PreviousCompleting the WithdrawalNextRewards: Auto Compounding Rewards Distribution

Last updated 2 years ago

This section outlines the process to migrate Bancor V2.1 positions to Bancor V3.

This process calculates all your available rewards and might be expensive

1. Identify your position(s)

This step explains how to identify your position IDs.

  • Visit the LiquidityProtectionStore contract on etherscan

  • Execute the protectedLiquidityIds function (this is a Read function)

Input variable

Name
Type
Description

_provider

address

Your wallet address

Output response

Name
Type
Description

id(s)

uint256

1 or more unique IDs that indicate the protected positions for the specified address

2. Identify position data

This section explains how to identify the relevant data based on the unique position ID.

  • Visit the LiquidityProtectionStore contract on etherscan

  • Execute the protectedLiquidity function (this is a Read function)

Input variable

Name
Type
Description

_id

uint256

A unique position ID

Output response

Name
Type
Description

provider

address

The wallet address of the position owner

poolToken

token

The pool token address * (i.e. LINK/BNT pool token address)

reserveToken

token

The reserve token address * (i.e. LINK token address)

poolAmount

uint256

Pool token amount *

reserveAmount

uint256

Reserve token amount

reserveRateN

uint256

Rate of 1 protected reserve token in units of the other reserve token (numerator)

reserveRateD

unit256

Rate of 1 protected reserve token in units of the other reserve token (denominator)

timestamp

unit256

Timestamp of the original deposit

* These values are needed for the migratePositions function

3. Migrate your protected positions

Now that you have your V2.1 protected position(s) data available, you can proceed in calling the migration function and move the funds to Bancor V3.

This process will migrate the full position and update the protection to 100% as a bonus

Visit the LiquidityProtection contract on etherscan

  • Execute the migratePositions function (this is a Write function)

Input variable

Name
Type
Description

positionLists

PositionList

Array of data to define the pool, token and positions.

Format example:
[["poolTokenAddress", "reserveTokenAddress", [ID1, ID2, ..]]]
[["0x5B38Da6a701c568545dCfcB03FcB875f56beddC4","0x5B38Da6a701c568545dCfcB03FcB875f56beddC4",[1,2,3]]]

You can group multiple IDs with the same poolToken and reserveToken combination i.e. all IDs for LINK from the LINK/BNT pool

Once executed successfully, the following will happen:

  1. The v2.1 protected position(s) will no longer exist

  2. The value of the protected tokens will be staked into Bancor V3

  3. You would receive bnTokens that represent your migration

If you wish to participate in Standard Rewards, proceed to Joining Standard Rewards guide