From f8b42d2f9466827a911445c0d4ae1fa5979c8cb6 Mon Sep 17 00:00:00 2001 From: Chepelau Date: Mon, 14 Oct 2024 10:16:47 +0200 Subject: [PATCH] WIP: Ekubo options --- src/amm_core/constants.cairo | 3 +++ src/amm_core/oracles/pragma.cairo | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/amm_core/constants.cairo b/src/amm_core/constants.cairo index 37acb6e..8841145 100644 --- a/src/amm_core/constants.cairo +++ b/src/amm_core/constants.cairo @@ -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)] diff --git a/src/amm_core/oracles/pragma.cairo b/src/amm_core/oracles/pragma.cairo index 8283ad7..2dc1a73 100644 --- a/src/amm_core/oracles/pragma.cairo +++ b/src/amm_core/oracles/pragma.cairo @@ -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 @@ -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 } @@ -284,6 +291,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;