Architecture
Last updated
Last updated
Magic-Fi's oPMM is Optimus Proactive Market Making (oPMM) contract on the Solana blockchain. This repository contains the Rust smart contract as well as the Typescript SDK (@magicfi/Magic_Fi_Solana
) to interact with a deployed program.
A MagicConfig is a config struct to record:
authority: Owner of the program
paused: Whether the program is paused
Magicpool's admin authority
Magicoracle's admin_authority
Collect fee authority
Guardian set authority
Pause program authority
A MagicPool is a concentrated liquidity pool for a token.
Each MagicPool account hosts the necessary information to deal with the accounting of the pool. It also hosts the PDAs to the vaults. Only the Marble oPMM program has the authority to withdraw from the vault.
A MagicPool account is hashed by the MagicConfig, token mint address and quote token mint address.
A MagicOracle is an on-chain price feed in order to simulate the order book from centralized exchanges without sacrificing capital efficiency.
Fee rate setting stored in MagicPool's fee_rate param, can be updated by set_pool_fee_rate function by admin.
Magic-Fi's oPMM is Synthetic Proactive Market Making (oPMM) contract on the Solana blockchain. This repository contains the Rust smart contract as well as the Typescript SDK (@magicfi/Magic_Fi_Solana
) to interact with a deployed program.
Anchor 0.29.0
Solana 1.17.31
Rust 1.72.0
Set up a valid Solana keypair at the path specified in the wallet
in Anchor.toml
to do local testing with anchor test
flows.
$NODE_PATH
must be set to the node_modules
directory of your global installs. For example, using Node 18.20.4 installed through nvm
, the $NODE_PATH is the following:
Copy
Run "cargo test --lib" to run Rust unit tests
MagicFi in Solana uses to check whether Marble oracle's price is valid.
Detail explanation can check on