LogoLogo
WebsiteAppWiki
  • 🤙Start here
    • Overview
    • Shell Protocol Basics
    • Quickstart: Deploy a liquidity pool
    • Tutorial: Executing swap with Shell Protocol
    • Reference Library
      • Contract addresses
  • 🤿Deep dive
    • Important concepts
      • Separating accounting logic & business logic
      • Ocean Primitives
    • The Ocean
    • Primitives
      • Adapters
      • Proteus AMM Engine
      • NFT Fractionalizer
  • 📜Smart Contracts Specification
    • Ocean
      • Ocean.sol
      • IOceanPrimitive.sol
      • IOceanToken.sol
      • OceanAdapter.sol
    • Proteus
      • Proteus.sol
      • EvolvingProteus.sol
      • LiquidityPoolProxy.sol
    • Fractionalizer
      • FractionalizerFactory.sol
  • 🧠Tutorials
    • Build an AMM with Proteus
    • Build an NFT Fractionalizer
    • Build an NFT AMM
Powered by GitBook
On this page
  1. Deep dive
  2. Important concepts

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.

PreviousSeparating accounting logic & business logicNextThe Ocean

Last updated 9 months ago

🤿