> For the complete documentation index, see [llms.txt](https://learn.charm.fi/charm-finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.charm.fi/charm-finance/previous-products-1/overview-1/how-it-works.md).

# How it works

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: <https://github.com/charmfinance/cube-protocol/>

### 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://docs.google.com/spreadsheets/d/139nxdCUWXvWZqkrFlWmpAUCoC6zApvyN4IZYa8aMN38/>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://learn.charm.fi/charm-finance/previous-products-1/overview-1/how-it-works.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
