Inverter Documentation
GithubDiscordTwitterLinks
  • Getting Started
  • Concepts
    • What is Inverter Network
    • The Inverter Protocol
    • Protocol Concepts
      • Workflow Model
        • Factories
        • Orchestrator
        • Authorizer
        • Funding Manager
        • Payment Processor
        • Logic Module
      • Module Library
        • Authorizers
          • Role Authorizer
          • Single Vote Governance Module
          • Token Gated Role Authorizer
        • Funding Managers
          • PIMs
            • Bancor Based PIM: Virtual Supply
            • Bancor Based PIM: Virtual Supply Buy Restriction
          • Deposit Vault Funding Manager
        • Payment Processors
          • Streaming Payment Processor
          • Simple Payment Processor
        • Logic Modules
          • Bounty Manager
          • Recurring Payment Manager
          • KPI Rewarder
          • Staking Manager
      • Primary Issuance Markets (PIMs)
      • Governance
      • Security
        • Upgradeability
        • Emergency Protocol
        • Audits
        • Bug Bounties
      • Fees
  • SDK's
    • TypeScript SDK
      • Deploy a Workflow
      • Operate a Workflow
      • Deploy a Contract
    • React SDK
      • Deploy a Workflow
      • Operate a Workflow
      • Deploy a Contract
      • Query the Indexer
      • Subscribe to the Indexer
    • Graphql SDK
    • Workflow Guides
      • Grant/Revoke Roles
      • Bounty Manager
      • Bonding Curve
      • Deposit Vault
    • API
      • Inverter
      • getDeployWorkflowOptions
      • deployWorkflow
      • getModule
      • getWorkflow
      • deploy
  • Contracts
    • Technical Specification
    • Security Guidelines
    • Deployment Addresses
    • Technical Reference
      • Factories
        • Interfaces
          • IModuleFactory_v1.sol
          • IOrchestratorFactory_v1.sol
        • ModuleFactory_v1.sol
        • OrchestratorFactory_v1.sol
      • Orchestrator
        • Abstracts
          • ModuleManagerBase_v1.sol
        • Interfaces
          • IModuleManagerBase_v1.sol
          • IOrchestrator_v1.sol
        • Orchestrator_v1.sol
      • Modules
        • Authorizer
          • Role
            • Interfaces
              • IAUT_EXT_VotingRoles_v1.sol
              • IAUT_TokenGated_Roles_v1.sol
            • AUT_EXT_VotingRoles_v1.sol
            • AUT_Roles_v1.sol
            • AUT_TokenGated_Roles_v1.sol
          • IAuthorizer_v1.sol
        • Base
          • IModule_v1.sol
          • Module_v1.sol
        • Funding Manager
          • Deposit Vault
            • FM_DepositVault_v1
            • Interfaces
              • IFM_DepositVault_v1
          • Bonding Curve
            • Abstracts
              • BondingCurveBase_v1.sol
              • RedeemingBondingCurveBase_v1.sol
              • VirtualCollateralSupplyBase_v1.sol
              • VirtualIssuanceSupplyBase_v1.sol
            • Formulas
              • BancorFormula.sol
              • Utils.sol
            • Interfaces
              • IBancorFormula.sol
              • IBondingCurveBase_v1.sol
              • IFM_BC_Bancor_Redeeming_VirtualSupply_v1.sol
              • IRedeemingBondingCurveBase_v1.sol
              • IVirtualCollateralSupplyBase_v1.sol
              • IVirtualIssuanceSupplyBase_v1.sol
            • FM_BC_Bancor_Redeeming_VirtualSupply_v1.sol
            • FM_BC_Restricted_Bancor_Redeeming_VirtualSupply_v1.sol
            • FM_BC_Tools
          • IFundingManager_v1.sol
        • Logic Module
          • Abstracts
            • ERC20PaymentClientBase_v1.sol
            • Oracle Integrations
              • UMA Optimistic Oracle V3
                • Optimistic Oracle V3
                  • Interfaces
                    • OptimisticOracleV3CallbackRecipientInterface.sol
                    • OptimisticOracleV3Interface.sol
                  • AncillaryData.sol
                  • ClaimData.sol
                • IOptimisticOracleIntegrator.sol
                • OptimisticOracleIntegrator.sol
          • Interfaces
            • IERC20PaymentClientBase_v1.sol
            • ILM_PC_Bounties_v1.sol
            • ILM_PC_KPIRewarder_v1.sol
            • ILM_PC_PaymentRouter_v1.sol
            • ILM_PC_RecurringPayments_v1.sol
            • ILM_PC_Staking_v1.sol
          • LM_PC_Bounties_v1.sol
          • LM_PC_KPIRewarder_v1.sol
          • LM_PC_PaymentRouter_v1.sol
          • LM_PC_RecurringPayments_v1.sol
          • LM_PC_Staking_v1.sol
        • Payment Processor
          • Interfaces
            • IPP_Streaming_v1.sol
          • IPaymentProcessor_v1.sol
          • PP_Simple_v1.sol
          • PP_Streaming_v1.sol
        • Lib
          • LibMetadata.sol
          • LinkedIdList.sol
          • SafeMath.sol
      • External
        • Fees
          • Interfaces
            • IFeeManager_v1.sol
          • FeeManager_v1.sol
        • Forwarder
          • Interfaces
            • ITransactionForwarder_v1.sol
          • TransactionForwarder_v1
        • Governance
          • Interfaces
            • IGovernor_v1.sol
          • Governor_v1.sol
        • Reverter
          • InverterReverter_v1.sol
        • ERC20Issuance
          • Interfaces
            • IERC20Issuance_v1.sol
          • ERC20Issuance_v1.sol
        • Interfaces
          • IERC2771Context.sol
      • Proxies
        • Interfaces
          • IInverterBeacon_v1.sol
          • IInverterProxyAdmin_v1.sol
          • IInverterTransparentUpgradeableProxy_v1.sol
        • InverterBeacon_v1.sol
        • InverterBeaconProxy_v1.sol
        • InverterProxyAdmin_v1.sol
        • InverterTransparentUpgradeableProxy_v1.sol
  • Apps
  • Support
Powered by GitBook
On this page
  • Introduction
  • Deployment Setup
  • Post Deployment: Set the Curve as a minter
  • Admin Actions
  • Curve Actions
  1. SDK's
  2. Workflow Guides

Bonding Curve

PreviousBounty ManagerNextDeposit Vault

Last updated 2 months ago

Introduction

This guide focusses on the most common patterns of interactions with the Bonding Curve Modules. Please refer to the section to see all public getters and setters.

Bancor formula and supported chains can be found here:

Deployment Setup

  • Deploy the Issuance Token

  • Deploy the Workflow

  • Retrieve the Workflow

Post Deployment: Set the Curve as a minter

In order to perform this action you should be the deployer of the token

await workflow.issuanceToken.module.write.setMinter([
    workflow.fundingManager.address, true
], { confirmations: 1 })

Admin Actions

These actions can be preformed by the workflow admin role

// Close/Open Buy/Sell
await workflow.fundingManager.write.closeBuy.run()
await workflow.fundingManager.write.openBuy.run()
await workflow.fundingManager.write.closeSell.run()
await workflow.fundingManager.write.openSell.run()

// Grant/Revoke Workflow Admin Role
const adminRole = await workflow.authorizer.read.DEFAULT_ADMIN_ROLE.run()
await workflow.authorizer.write.grantRole.run([adminRole, deployer])
await workflow.authorizer.write.revokeRole.run([adminRole, deployer])

// Fee Withdrawal
await workflow.fundingManager.write.withdrawProjectCollateralFee.run([
  '<address>' as `0x${string}`,
  '1000', // amount
])

// Update Parameters
await workflow.fundingManager.write.setBuyFee.run(
  '1000' // Fee in ( BPS ) Basis Points
)
await workflow.fundingManager.write.setSellFee.run(
  '1000' // Fee in ( BPS ) Basis Points
)
await workflow.fundingManager.write.setReserveRatioForBuying.run(
  333_333 // Reserve Ratio in ( PPM ) Parts Per Million
)
await workflow.fundingManager.write.setReserveRatioForSelling.run(
  333_333 // Reserve Ratio in ( PPM ) Parts Per Million
)
 await workflow.fundingManager.write.setVirtualCollateralSupply.run(
  '1000' // New Virtual Collateral Supply
)
await workflow.fundingManager.write.setVirtualIssuanceSupply.run(
  '1000' // New Virtual Issuance Supply
)

Curve Actions

These actions can be performed by the users of the product | app. The bonding curve funding managers have a calculate function which uses the formula contract to define the minimum amount out from either buy or sell method.

// Buy/Sell

// Amount to buy
const purchaseAmount = '1000'
// Min amount received from the buy
const purchaseReturn =
  await workflow.fundingManager.read.calculatePurchaseReturn.run(
    purchaseAmount
  )

// Buy using the connected account
await workflow.fundingManager.write.buy.run([
  purchaseAmount,
  purchaseReturn,
])
// Buy for another account
await workflow.fundingManager.write.buyFor.run([
  '<address>' as `0x${string}`,
  purchaseAmount,
  purchaseReturn,
])

// Amount to sell
const saleAmount = '1000'
// Min amount out of the sell
const saleReturn =
  await workflow.fundingManager.read.calculateSaleReturn.run(saleAmount)

// Sell using the connected account
await workflow.fundingManager.write.sell.run([saleAmount, saleReturn])
// Sell to another account
await workflow.fundingManager.write.sellTo.run([
  '<address>' as `0x${string}`,
  saleAmount,
  saleReturn,
])

Technical Reference
https://github.com/InverterNetwork/deployments/tree/main/deployments

Setup Requirements

The guide includes code snippets for Inverter Network's TypeScript SDK. Please refer to the relevant code snippets based on the SDK you are using.

  1. Set up Inverter Network SDK: Refer to the Quick Start guides for detailed instructions. See the or for more information.

  2. Deploy a Workflow: Refer to the Deploy a Workflow guide for detailed instructions. See the or for more information.

  3. Retrieve a deployed Workflow: Refer to the Operate a Workflow guide for detailed instructions. See the or for more information.

  • Optionally if your setup needs a specific contract: Refer to the Deploy a Contract Guide for detailed instructions. See the Guide or Guide for more information.

React SDK Guide
TypeScript SDK Guide
React SDK Guide
TypeScript SDK Guide
React SDK Guide
TypeScript SDK Guide
React SDK
TypeScript SDK