Skip to content
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
5 changes: 4 additions & 1 deletion src/ao/messaging/getData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ interface MessageTags {

type GetDataRes = DryRunResult;

export async function getData(messageTags: MessageTags, config?: Services): Promise<GetDataRes> {
export async function getData(
messageTags: MessageTags,
config?: Services,
): Promise<GetDataRes> {
const convertedMessageTags = Object.entries(messageTags)
.map(([name, value]) => ({
name,
Expand Down
266 changes: 195 additions & 71 deletions src/ao/utils/tokenAddressData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,139 +25,263 @@ export const lqdTokenAddress = "n2MhPK0O3yEvY2zW73sqcmWqDktJxAifJDrri4qireI";
export const tokenData: Record<string, TokenData> = {
QAR: {
name: "Quantum Arweave",
icon: "8VLMb0c9NATl4iczfwpMDe1Eh8kFWIUpSlIkcGfDFzM",
ticker: "QAR",
address: "NG-0lVX882MG5nhARrSzyprEK6ejonHpdUmaaMPsHE8",
oTicker: "oQAR",
oAddress: "fODpFVOb5weX9Yc-26AA82m2MhmT7N9L0TkynOsruK0",
controllerAddress,
cleanTicker: "qAR",
denomination: BigInt(12),
collateralEnabled: true,
baseDenomination: BigInt(12),
deprecated: true,
address: "NG-0lVX882MG5nhARrSzyprEK6ejonHpdUmaaMPsHE8",
icon: "8VLMb0c9NATl4iczfwpMDe1Eh8kFWIUpSlIkcGfDFzM",
denomination: BigInt(12),
//
oAddress: "fODpFVOb5weX9Yc-26AA82m2MhmT7N9L0TkynOsruK0",
oIcon: "i_U-jhdMMaib2hK51qPrKXbLo6cx2Nt58_gNz5FA4sw",
//
deprecated: true,
borrowingDisabled: true,
borrowingDisabledReason: "Deprecated token.",
//
get oTicker() {
return `o${this.cleanTicker.toUpperCase()}`;
},
get ticker() {
return this.cleanTicker.toUpperCase();
},
get baseDenomination() {
return this.denomination;
},
controllerAddress,
},
WAR: {
name: "Wrapped Arweave",
icon: "ICMLzIKdVMedibwgOy014I4yan_F8h2ZhORhRG5dgzs",
ticker: "WAR",
address: "xU9zFkq3X2ZQ6olwNVvr1vUWIjc3kXTWr7xKQD6dh10",
oTicker: "oWAR",
oAddress: "rAc0aP0g9NXYUXAbvlLjPH_XxyQy6eYmwSuIcf6ukuw",
controllerAddress,
cleanTicker: "wAR",
denomination: BigInt(12),
collateralEnabled: true,
baseDenomination: BigInt(12),
deprecated: false,
address: "xU9zFkq3X2ZQ6olwNVvr1vUWIjc3kXTWr7xKQD6dh10",
icon: "ICMLzIKdVMedibwgOy014I4yan_F8h2ZhORhRG5dgzs",
denomination: BigInt(12),
//
oAddress: "rAc0aP0g9NXYUXAbvlLjPH_XxyQy6eYmwSuIcf6ukuw",
oIcon: "lTWBOBtEZ2JvTAHfvoPq5aXRWTVouv7jZ-6B9HTwosU",
//
deprecated: false,
borrowingDisabled: true,
borrowingDisabledReason: "AO airdrop.",
//
get oTicker() {
return `o${this.cleanTicker.toUpperCase()}`;
},
get ticker() {
return this.cleanTicker.toUpperCase();
},
get baseDenomination() {
return this.denomination;
},
controllerAddress,
},
WUSDC: {
name: "Wrapped USD Circle",
icon: "iNYk0bDqUiH0eLT2rbYjYAI5i126R4ye8iAZb55IaIM",
ticker: "WUSDC",
address: "7zH9dlMNoxprab9loshv3Y7WG45DOny_Vrq9KrXObdQ",
oTicker: "oWUSDC",
oAddress: "4MW7uLFtttSLWM-yWEqV9TGD6fSIDrqa4lbTgYL2qHg",
controllerAddress,
cleanTicker: "wUSDC",
denomination: BigInt(6),
collateralEnabled: true,
baseDenomination: BigInt(6),
deprecated: false,
address: "7zH9dlMNoxprab9loshv3Y7WG45DOny_Vrq9KrXObdQ",
icon: "iNYk0bDqUiH0eLT2rbYjYAI5i126R4ye8iAZb55IaIM",
denomination: BigInt(6),
//
oAddress: "4MW7uLFtttSLWM-yWEqV9TGD6fSIDrqa4lbTgYL2qHg",
oIcon: "7EEISJIzxC-3RPhgvRc-lAZnP7st1b79_ER4Sc5P_MU",
//
deprecated: false,
borrowingDisabled: false,
borrowingDisabledReason: "",
//
get oTicker() {
return `o${this.cleanTicker.toUpperCase()}`;
},
get ticker() {
return this.cleanTicker.toUpperCase();
},
get baseDenomination() {
return this.denomination;
},
controllerAddress,
},
WUSDT: {
name: "Wrapped USD Tether",
icon: "JaxupVYerLRZWLd32llz_3CG8sCQaNhn2hAWm51U_7s",
ticker: "WUSDT",
address: "7j3jUyFpTuepg_uu_sJnwLE6KiTVuA9cLrkfOp2MFlo",
oTicker: "oWUSDT",
oAddress: "9B9J1O5FDoMsFZGJUSOa6TwivsH7LYIfiaizPn7fUHs",
controllerAddress,
cleanTicker: "wUSDT",
denomination: BigInt(18),
collateralEnabled: true,
baseDenomination: BigInt(18),
deprecated: false,
address: "7j3jUyFpTuepg_uu_sJnwLE6KiTVuA9cLrkfOp2MFlo",
icon: "JaxupVYerLRZWLd32llz_3CG8sCQaNhn2hAWm51U_7s",
denomination: BigInt(18),
//
oAddress: "9B9J1O5FDoMsFZGJUSOa6TwivsH7LYIfiaizPn7fUHs",
oIcon: "bkAnKOF4NhqPHnccDhPyOzBws42zNE-u9WtxCPdaABU",
//
deprecated: false,
borrowingDisabled: false,
borrowingDisabledReason: "",
//
get oTicker() {
return `o${this.cleanTicker.toUpperCase()}`;
},
get ticker() {
return this.cleanTicker.toUpperCase();
},
get baseDenomination() {
return this.denomination;
},
controllerAddress,
},
WETH: {
name: "Wrapped Ethereum",
icon: "Bi7iqzLQXN-wVD3nM8TYGfTI9g7HgGtiD0XuruoQTJk",
ticker: "WETH",
address: "cBgS-V_yGhOe9P1wCIuNSgDA_JS8l4sE5iFcPTr0TD0",
oTicker: "oWETH",
oAddress: "rNa0hdxEZjz_TAUoI85OcPRul_BzoS6Py_3vamJKpr4",
controllerAddress,
cleanTicker: "wETH",
denomination: BigInt(18),
collateralEnabled: true,
baseDenomination: BigInt(18),
deprecated: false,
address: "cBgS-V_yGhOe9P1wCIuNSgDA_JS8l4sE5iFcPTr0TD0",
icon: "Bi7iqzLQXN-wVD3nM8TYGfTI9g7HgGtiD0XuruoQTJk",
denomination: BigInt(18),
//
oAddress: "rNa0hdxEZjz_TAUoI85OcPRul_BzoS6Py_3vamJKpr4",
oIcon: "z1nnBgzGpt-eXHrjD5A9KrQX6dK8E1ONDuBIqB94VTA",
//
deprecated: false,
borrowingDisabled: false,
borrowingDisabledReason: "",
//
get oTicker() {
return `o${this.cleanTicker.toUpperCase()}`;
},
get ticker() {
return this.cleanTicker.toUpperCase();
},
get baseDenomination() {
return this.denomination;
},
controllerAddress,
},
USDA: {
name: "Astro USD",
icon: "seXozJrsP0OgI0gvAnr8zmfxiHHb5iSlI9wMI8SdamE",
ticker: "USDA",
address: "FBt9A5GA_KXMMSxA2DJ0xZbAq8sLLU2ak-YJe9zDvg8",
oTicker: "oUSDA",
oAddress: "qX9KiT3p_KnV5RE7Dddghwc0uC5t-kvsVgjq2iLAi8s",
controllerAddress,
cleanTicker: "USDA",
denomination: BigInt(12),
collateralEnabled: false,
baseDenomination: BigInt(12),
deprecated: false,
address: "FBt9A5GA_KXMMSxA2DJ0xZbAq8sLLU2ak-YJe9zDvg8",
icon: "seXozJrsP0OgI0gvAnr8zmfxiHHb5iSlI9wMI8SdamE",
denomination: BigInt(12),
//
oAddress: "qX9KiT3p_KnV5RE7Dddghwc0uC5t-kvsVgjq2iLAi8s",
oIcon: "p7iMD3X6iGYQ5Qw7dPU4ER7w678wEt2epwSA8t6-hu8",
//
deprecated: false,
borrowingDisabled: false,
borrowingDisabledReason: "",
//
get oTicker() {
return `o${this.cleanTicker.toUpperCase()}`;
},
get ticker() {
return this.cleanTicker.toUpperCase();
},
get baseDenomination() {
return this.denomination;
},
controllerAddress,
},
VAR: {
name: "Vento Arweave",
icon: "XQKXtuxDGDn13z0JBqYvbkNXPu3Y3aE1WaK2XftQ3cA",
ticker: "VAR",
address: "y-p7CPhs6JMUStAuE4KeTnMXN7qYBvEi2hiBFk8ZhjM",
oTicker: "oVAR",
oAddress: "TYaFOOJUwUjSCTi_CFNZXYAEt4SYTx-HNjrV-cCmwNQ",
controllerAddress,
cleanTicker: "vAR",
collateralEnabled: true,
address: "y-p7CPhs6JMUStAuE4KeTnMXN7qYBvEi2hiBFk8ZhjM",
icon: "XQKXtuxDGDn13z0JBqYvbkNXPu3Y3aE1WaK2XftQ3cA",
denomination: BigInt(12),
collateralEnabled: false,
baseDenomination: BigInt(12),
deprecated: false,
//
oAddress: "TYaFOOJUwUjSCTi_CFNZXYAEt4SYTx-HNjrV-cCmwNQ",
oIcon: "kjybk2--iRY9vxo2eQtVu52vbT8iWJzwBslhGPtTMeM",
//
deprecated: false,
borrowingDisabled: false,
borrowingDisabledReason: "",
//
get oTicker() {
return `o${this.cleanTicker.toUpperCase()}`;
},
get ticker() {
return this.cleanTicker.toUpperCase();
},
get baseDenomination() {
return this.denomination;
},
controllerAddress,
},
VUSDC: {
name: "Vento USD Circle",
icon: "DbT_EMed2vx4MR7N03YJYLSNeNBvuSgIzjybw8TOqMg",
ticker: "VUSDC",
cleanTicker: "vUSDC",
collateralEnabled: true,
address: "cxkFiGP89fEKOvbvl9SLs1lEaw0L-DWJiqQOuDPeDG8",
oTicker: "oVUSDC",
icon: "DbT_EMed2vx4MR7N03YJYLSNeNBvuSgIzjybw8TOqMg",
denomination: BigInt(6),
//
oAddress: "aKt8ZDDT43-3vwgqSEKx6aWd_3GA1paePP9EAOf3zcc",
oIcon: "7EEISJIzxC-3RPhgvRc-lAZnP7st1b79_ER4Sc5P_MU",
//
deprecated: false,
borrowingDisabled: false,
borrowingDisabledReason: "",
//
get oTicker() {
return `o${this.cleanTicker.toUpperCase()}`;
},
get ticker() {
return this.cleanTicker.toUpperCase();
},
get baseDenomination() {
return this.denomination;
},
controllerAddress,
cleanTicker: "vUSDC",
denomination: BigInt(6),
collateralEnabled: false,
baseDenomination: BigInt(6),
},
VDAI: {
name: "Vento DAI",
cleanTicker: "vDAI",
collateralEnabled: true,
address: "Q5Qk5W_AOUou2nRu1RlEpfr8yzKmWJ98tQb8QEyYqx4",
icon: "0hn3-PiE45LzIr9fYxSEXrQu8qk9arXt-FsVoN98grw",
denomination: BigInt(18),
//
oAddress: "UNj2195zpcrRcHdxWXq0zfsUMybbpfyFpyFpyaaLm03dW0",
oIcon: "rCEwGR-OYAft5mAYqMOur7icDpxNCttyAuRqwJUjKSM",
//
deprecated: false,
oIcon: "7EEISJIzxC-3RPhgvRc-lAZnP7st1b79_ER4Sc5P_MU",
borrowingDisabled: false,
borrowingDisabledReason: "",
//
get oTicker() {
return `o${this.cleanTicker.toUpperCase()}`;
},
get ticker() {
return this.cleanTicker.toUpperCase();
},
get baseDenomination() {
return this.denomination;
},
controllerAddress,
},
VETH: {
name: "Vento Ethereum",
cleanTicker: "vETH",
collateralEnabled: true,
address: "SGUZMZ1toA4k5wlDNyDtHQThf1SEAOLNwiE8TzsnSgw",
icon: "zAQeInmLoCwtHfWzAebYWyrdb8Yh-s5H8_b4Ad2egSc",
denomination: BigInt(18),
//
oAddress: "Sipm0KlrxYR7Pr_sKgedjIt1yzEQ0R6Yfkkuhd7Q0Og",
oIcon: "z1nnBgzGpt-eXHrjD5A9KrQX6dK8E1ONDuBIqB94VTA",
//
deprecated: false,
borrowingDisabled: false,
borrowingDisabledReason: "",
//
get oTicker() {
return `o${this.cleanTicker.toUpperCase()}`;
},
get ticker() {
return this.cleanTicker.toUpperCase();
},
get baseDenomination() {
return this.denomination;
},
controllerAddress,
},
};

Expand Down
26 changes: 16 additions & 10 deletions src/functions/liquidations/getLiquidations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,15 @@ export async function getLiquidations(
const tokensList = Object.keys(tokens);

// Make a request to RedStone oracle process for prices (same used onchain)
const redstonePriceFeedRes = await getData({
Owner: controllerAddress,
Target: redstoneOracleAddress,
Action: "v2.Request-Latest-Data",
Tickers: JSON.stringify(collateralEnabledTickers.map(convertTicker)),
}, config);
const redstonePriceFeedRes = await getData(
{
Owner: controllerAddress,
Target: redstoneOracleAddress,
Action: "v2.Request-Latest-Data",
Tickers: JSON.stringify(collateralEnabledTickers.map(convertTicker)),
},
config,
);

// add dry run await to not get rate limited
await dryRunAwait(1);
Expand Down Expand Up @@ -114,10 +117,13 @@ export async function getLiquidations(
}

// get discovered liquidations
const auctionsRes = await getData({
Target: controllerAddress,
Action: "Get-Auctions",
}, config);
const auctionsRes = await getData(
{
Target: controllerAddress,
Action: "Get-Auctions",
},
config,
);
// add dry run await to not get rate limited
await dryRunAwait(1);

Expand Down
Loading