Skip to content

Commit

Permalink
feat: uxrp
Browse files Browse the repository at this point in the history
  • Loading branch information
rhlsthrm committed Dec 10, 2024
1 parent 4c3b0de commit 0d2046e
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 21 deletions.
15 changes: 15 additions & 0 deletions packages/chains/src/base/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const uSUI = "0xb0505e5a99abd03d94a1169e638B78EDfEd26ea4";
export const sUSDz = "0xe31eE12bDFDD0573D634124611e85338e2cBF0cF";
export const fBOMB = "0x74ccbe53F77b08632ce0CB91D3A545bF6B8E0979";
export const KLIMA = "0xDCEFd8C8fCc492630B943ABcaB3429F12Ea9Fea2";
export const uXRP = "0x2615a94df961278DcbC41Fb0a54fEc5f10a693aE";

export const assets: SupportedAsset[] = [
{
Expand Down Expand Up @@ -398,6 +399,20 @@ export const assets: SupportedAsset[] = [
initialSupplyCap: parseUnits(String(1_500_000), 9).toString(),
initialBorrowCap: parseUnits(String(1_200_000), 9).toString(),
initialCf: "0.55"
},
{
symbol: assetSymbols.uXRP,
underlying: uXRP,
name: "Wrapped XRP",
decimals: 18,
oracle: OracleTypes.PythPriceOracle,
oracleSpecificParams: {
feed: "0xec5d399846a9209f3fe5881d70aae9268c94339ff9817e8d18ff19fa05eea1c8"
} as PythSpecificParams,
extraDocs: defaultDocs("https://basescan.org", uXRP),
initialBorrowCap: parseEther(String(245_000)).toString(),
initialSupplyCap: parseEther(String(200_000)).toString(),
initialCf: "0.65"
}
// DO NOT ADD TO MARKET UNLESS PROPER ORACLE IS DEPLOYED
// {
Expand Down
42 changes: 21 additions & 21 deletions packages/contracts/tasks/chain-specific/base/markets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Address, zeroAddress } from "viem";
import { prepareAndLogTransaction } from "../../../chainDeploy/helpers/logging";

task("markets:deploy:base:new", "deploy base market").setAction(async (_, { viem, run }) => {
const assetsToDeploy: string[] = [assetSymbols.KLIMA];
const assetsToDeploy: string[] = [assetSymbols.uXRP];
for (const asset of base.assets.filter((asset) => assetsToDeploy.includes(asset.symbol))) {
console.log("Deploying market for ", asset.symbol, asset.name);
await new Promise((resolve) => setTimeout(resolve, 10000)); // Wait 10 seconds
Expand Down Expand Up @@ -42,30 +42,30 @@ task("markets:deploy:base:new", "deploy base market").setAction(async (_, { viem

task("base:set-caps:new", "one time setup").setAction(async (_, { viem, run, getNamedAccounts, deployments }) => {
const { deployer } = await getNamedAccounts();
const assetsToDeploy: string[] = [assetSymbols.KLIMA];
const assetsToDeploy: string[] = [assetSymbols.uXRP];
for (const asset of base.assets.filter((asset) => assetsToDeploy.includes(asset.symbol))) {
const pool = await viem.getContractAt("IonicComptroller", COMPTROLLER);
const cToken = await pool.read.cTokensByUnderlying([asset.underlying]);
const asExt = await viem.getContractAt("CTokenFirstExtension", cToken);
const admin = await pool.read.admin();
// const ap = await deployments.get("AddressesProvider");
// if (admin.toLowerCase() !== deployer.toLowerCase()) {
// await prepareAndLogTransaction({
// contractInstance: asExt,
// functionName: "_setAddressesProvider",
// args: [ap.address as Address],
// description: "Set Addresses Provider",
// inputs: [
// {
// internalType: "address",
// name: "_ap",
// type: "address"
// }
// ]
// });
// } else {
// await asExt.write._setAddressesProvider([ap.address as Address]);
// }
const ap = await deployments.get("AddressesProvider");
if (admin.toLowerCase() !== deployer.toLowerCase()) {
await prepareAndLogTransaction({
contractInstance: asExt,
functionName: "_setAddressesProvider",
args: [ap.address as Address],
description: "Set Addresses Provider",
inputs: [
{
internalType: "address",
name: "_ap",
type: "address"
}
]
});
} else {
await asExt.write._setAddressesProvider([ap.address as Address]);
}

await run("market:set-borrow-cap", {
market: cToken,
Expand All @@ -80,7 +80,7 @@ task("base:set-caps:new", "one time setup").setAction(async (_, { viem, run, get
});

task("market:set-cf:base:new", "Sets CF on a market").setAction(async (_, { viem, run }) => {
for (const asset of base.assets.filter((asset) => asset.symbol === assetSymbols.fBOMB)) {
for (const asset of base.assets.filter((asset) => asset.symbol === assetSymbols.uXRP)) {
const pool = await viem.getContractAt("IonicComptroller", COMPTROLLER);
const cToken = await pool.read.cTokensByUnderlying([asset.underlying]);
console.log("cToken: ", cToken, asset.symbol);
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ export enum assetSymbols {
sUSDz = "sUSDz",
fBOMB = "fBOMB",
KLIMA = "KLIMA",
uXRP = "uXRP",

// optimism
OP = "OP",
Expand Down
1 change: 1 addition & 0 deletions packages/ui/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ export const pools: Record<number, PoolParams> = {
'wUSDM',
'uSOL',
'uSUI',
'uXRP',
'EURC',
'cbBTC',
'eUSD',
Expand Down
Binary file added packages/ui/public/img/symbols/32/color/uxrp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0d2046e

Please sign in to comment.