Charm Finance
  • Charm Overview
    • The mission
  • Products Overview
    • Alpha Vaults
      • Whitepaper
      • FAQ
    • Charm Simulator
  • Provide Liquidity
    • Overview
    • The Benefits
    • Risks and Mitigants
    • Charm Vaults
    • Community Vaults
    • Conclusion
    • Fees
    • FAQ
    • User Guides
      • Home Page
      • Depositing and Withdrawing
      • Vault Information Page
      • Performance Page
      • Portfolio Page
  • Manage Liquidity
    • Overview
    • The Benefits
    • Challenges and Solution
    • Uses Cases
    • How it works
    • Risks and mitigants
    • Conclusion
    • Fees
    • FAQ
    • User Guides
      • Create Vault
        • Default Values
        • Next Steps
      • Vault Parameters
      • Rebalancing
      • Verifying Vaults
      • Capital Efficiency
      • Other Features
      • Best Practices
      • Walkthroughs
        • Create Vault
        • Edit Vault
        • Automating Rebalance
        • Verify Manager
  • Technical References
    • Overview
    • Core
      • AlphaProVault
      • AlphaProVaultFactory
      • CloneFactory
      • Interfaces
    • Periphery
    • Error Codes
    • Contract Addresses
    • Subgraph
  • Links
    • Alpha Vaults v2
    • Contracts
    • Blog
  • Appendix
    • Glossary
    • Audit Reports
    • Team
    • Charm's Investors
    • 中文版
  • Research
    • Medallion
      • Whitepaper
      • FAQ
      • Decentralised competition
  • Previous Products
    • Alpha Vaults v1
    • Charm Options
      • Key Features
        • Capital Efficiency
      • Use Cases
      • How trading works
      • How liquidity provision works
      • Trading Tutorials
        • Open a position
          • Notes
        • Close a position
        • Settlement
      • Liquidity Provision Tutorials
        • Provide liquidity
        • Withdraw Liquidity
    • Cube Tokens
      • How it works
Powered by GitBook
On this page
  • Numerical example
  • Model
  1. Previous Products
  2. Cube Tokens

How it works

PreviousCube Tokens

Last updated 1 year ago

To buy cubeBTC (a long leveraged token), you deposit ETH into the pool. If the price of BTC goes up 1%, your pool share goes up 3%. If the price of BTC goes down 1%, your pool share goes down 3%. So as BTC moves, the value of your cubeBTC moves roughly 3x as much.

Inverse cube tokens like invBTC work the other way round, and move the opposite direction of cubeBTC. If the price of BTC goes up 1%, your pool share goes down 3%. If the price of BTC goes down 1%, your pool share goes up 3%. So as BTC moves, the value of your invBTC moves roughly 3x as much in the opposite direction.

After a deposit/withdrawal, the pool shares are all normalized so that they sum to 100%. This means the pool always contains exactly enough to pay everyone out.

The smart contract code can be found here:

Numerical example

Alice thinks BTC will go up so spends 10 ETH on cubeBTC. Bob thinks ETH will go down so spends 20 ETH on invETH. So in total, there’s 30 ETH in the pool and the values of Alice and Bob’s cube tokens has to always sum to 30 ETH.

Let’s say BTC goes up by 5% and ETH goes up by 10%. Theoretically Alice’s cubeBTC increases in value from 10 → 11.58 ETH (= 10 x 1.05³) and Bob’s invETH loses value from 20 → 15.02 ETH (= 20 / 1.1³).

The problem is the pool would now be worth 11.58 + 15.02 = 26.6 ETH, which is different from the actual balance of the pool of 30 ETH. The values are therefore normalized so that they sum up to the balance. So the value of Alice’s cube token becomes 11.58 x 30 / 26.6 = 13.06 ETH and Bob’s cube token becomes 15.02 x 30 / 26.6 = 16.94 ETH

Model

A spreadsheet showing cube price calculations can be found below. It demonstrates how underlying price moves and total supply of cubes tokens affect cube token prices.

https://github.com/charmfinance/cube-protocol/
https://docs.google.com/spreadsheets/d/139nxdCUWXvWZqkrFlWmpAUCoC6zApvyN4IZYa8aMN38/