> For the complete documentation index, see [llms.txt](https://docs.shellprotocol.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.shellprotocol.io/deep-dive/important-concepts/ocean-primitives.md).

# Ocean Primitives

Ocean Primitives are a type of primitive designed to interact with the Ocean contract. At a minimum, they must implement the `computeOutputAmount` and `computeInputAmount` functions from the `IOceanPrimitive` interface.

Their main role is to compute exchange rates between an input and output token. This can take many forms, depending on the primitive. For instance, in the context of an AMM primitive, the primitive is tasked with determining the swap rate.

Conversely, the Ocean's responsibility lies in updating the relevant balances: of the users, the AMM, and any other associated primitives.
