← Back to index

Program: barter-dex-program

Purpose

This program implements an oracle-based DEX. Unlike a traditional AMM, it does not use an internal formula (like x*y=k) to determine prices. Instead, it relies on a trusted off-chain service (price-keeper-bot) to push AI-generated exchange rates on-chain via the update_oracle_price instruction. Swaps are then executed at this externally-provided oracle price.

State Accounts

1. LiquidityPool

Instructions

1. create_pool

2. add_liquidity

3. update_oracle_price

4. swap

Errors