Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ekubo options #23

Merged
merged 6 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/amm_core/constants.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ const TOKEN_WBTC_ADDRESS: felt252 =
const TOKEN_STRK_ADDRESS: felt252 =
0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d; // mainnet

const TOKEN_EKUBO_ADDRESS: felt252 =
0x075afe6402ad5a5c20dd25e10ec3b3986acaa647b77e4ae24b0cbc9a54a27a87; // mainnet

// Tests --------------------------------------------------------------------------------------------------------------

#[cfg(test)]
Expand Down
11 changes: 10 additions & 1 deletion src/amm_core/oracles/pragma.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ mod Pragma {


use carmine_protocol::amm_core::constants::{
TOKEN_USDC_ADDRESS, TOKEN_ETH_ADDRESS, TOKEN_WBTC_ADDRESS, TOKEN_STRK_ADDRESS
TOKEN_USDC_ADDRESS, TOKEN_ETH_ADDRESS, TOKEN_WBTC_ADDRESS, TOKEN_STRK_ADDRESS,
TOKEN_EKUBO_ADDRESS
};

// Mainnet
Expand Down Expand Up @@ -66,6 +67,12 @@ mod Pragma {
} else {
0
}
} else if base_token_addr.into() == TOKEN_EKUBO_ADDRESS {
if quote_token_addr.into() == TOKEN_USDC_ADDRESS {
PragmaUtils::PRAGMA_EKUBO_USD_KEY
} else {
0
}
} else {
0
}
Expand Down Expand Up @@ -215,6 +222,7 @@ mod Pragma {
set_pragma_checkpoint(PragmaUtils::PRAGMA_USDC_USD_KEY);
set_pragma_checkpoint(PragmaUtils::PRAGMA_WBTC_USD_KEY);
set_pragma_checkpoint(PragmaUtils::PRAGMA_STRK_USD_KEY);
set_pragma_checkpoint(PragmaUtils::PRAGMA_EKUBO_USD_KEY);
}
}

Expand Down Expand Up @@ -284,6 +292,7 @@ mod PragmaUtils {
const PRAGMA_XRP_USD_KEY: felt252 = 24860302295520068;
const PRAGMA_MATIC_USD_KEY: felt252 = 1425106761739050242884;
const PRAGMA_STRK_USD_KEY: felt252 = 6004514686061859652;
const PRAGMA_EKUBO_USD_KEY: felt252 = 1278253658919688033092;

// Stablecoins
const PRAGMA_USDT_USD_KEY: felt252 = 6148333044652921668;
Expand Down
Loading
Loading