Now use solana.tokenlist.json for token lookups.

This commit is contained in:
Geoff Taylor 2021-06-01 18:16:02 +01:00
parent cbd42d24ae
commit f73ee9ca19
10 changed files with 8507 additions and 335 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
"cells": [ "cells": [
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "fitting-ticket", "id": "successful-ordinary",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# ⚠ Warning\n", "# ⚠ Warning\n",
@ -16,7 +16,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "historical-grace", "id": "living-league",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# 🥭 Constants\n", "# 🥭 Constants\n",
@ -27,7 +27,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "subtle-idaho", "id": "spatial-korean",
"metadata": { "metadata": {
"jupyter": { "jupyter": {
"source_hidden": true "source_hidden": true
@ -44,7 +44,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "institutional-earthquake", "id": "constitutional-former",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## SYSTEM_PROGRAM_ADDRESS\n", "## SYSTEM_PROGRAM_ADDRESS\n",
@ -55,7 +55,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "everyday-donna", "id": "undefined-majority",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -64,27 +64,27 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "motivated-northwest", "id": "liberal-hamilton",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## SOL_MINT_ADDRESS\n", "## SOL_MINT_ADDRESS\n",
"\n", "\n",
"The mint address of the SOL token." "The fake mint address of the SOL token. **Note:** Wrapped SOL has a different mint address - it is So11111111111111111111111111111111111111112."
] ]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "speaking-homework", "id": "accepting-circumstances",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"SOL_MINT_ADDRESS = PublicKey(\"So11111111111111111111111111111111111111112\")" "SOL_MINT_ADDRESS = PublicKey(\"So11111111111111111111111111111111111111111\")"
] ]
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "dated-appeal", "id": "sacred-valve",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## SOL_DECIMALS\n", "## SOL_DECIMALS\n",
@ -95,7 +95,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "ready-tension", "id": "female-customs",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -104,7 +104,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "artistic-batch", "id": "excess-tyler",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## SOL_DECIMAL_DIVISOR decimal\n", "## SOL_DECIMAL_DIVISOR decimal\n",
@ -115,7 +115,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "powerful-warrior", "id": "divine-concord",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -124,7 +124,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "mathematical-gender", "id": "western-removal",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## NUM_TOKENS\n", "## NUM_TOKENS\n",
@ -135,7 +135,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "isolated-sandwich", "id": "hungry-disco",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -144,7 +144,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "marine-florist", "id": "abroad-woman",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## NUM_MARKETS\n", "## NUM_MARKETS\n",
@ -155,7 +155,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "defensive-jewel", "id": "flush-wages",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -164,7 +164,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "optimum-wagner", "id": "pleasant-convergence",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# WARNING_DISCLAIMER_TEXT\n", "# WARNING_DISCLAIMER_TEXT\n",
@ -175,7 +175,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "arranged-hypothesis", "id": "residential-roots",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -195,7 +195,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "focused-electricity", "id": "surrounded-magnet",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## MangoConstants\n", "## MangoConstants\n",
@ -206,7 +206,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "otherwise-pencil", "id": "radical-submission",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -216,7 +216,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "dependent-pursuit", "id": "dutch-tension",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# 🏃 Running\n", "# 🏃 Running\n",
@ -227,7 +227,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "primary-graphic", "id": "settled-clock",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [

View File

@ -2,7 +2,7 @@
"cells": [ "cells": [
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "proud-accommodation", "id": "artistic-cheese",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# ⚠ Warning\n", "# ⚠ Warning\n",
@ -16,7 +16,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "manufactured-subcommittee", "id": "endless-table",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# 🥭 Context\n", "# 🥭 Context\n",
@ -26,7 +26,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "academic-liberia", "id": "willing-companion",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## Environment Variables\n", "## Environment Variables\n",
@ -41,7 +41,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "equivalent-conspiracy", "id": "infinite-ambassador",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## Provided Configured Objects\n", "## Provided Configured Objects\n",
@ -61,7 +61,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "automotive-diamond", "id": "suffering-soccer",
"metadata": { "metadata": {
"jupyter": { "jupyter": {
"source_hidden": true "source_hidden": true
@ -86,7 +86,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "private-vessel", "id": "unlimited-plymouth",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## Context class" "## Context class"
@ -95,7 +95,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "blessed-azerbaijan", "id": "through-factory",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -172,18 +172,9 @@
" return name\n", " return name\n",
" return \"« Unknown Group »\"\n", " return \"« Unknown Group »\"\n",
"\n", "\n",
" def lookup_market_name(self, market_address: PublicKey) -> str:\n",
" return Context._lookup_name_by_address(market_address, MangoConstants[self.cluster][\"mango_groups\"][self.group_name][\"spot_market_symbols\"]) or \"« Unknown Market »\"\n",
"\n",
" def lookup_oracle_name(self, token_address: PublicKey) -> str:\n", " def lookup_oracle_name(self, token_address: PublicKey) -> str:\n",
" return Context._lookup_name_by_address(token_address, MangoConstants[self.cluster][\"oracles\"]) or \"« Unknown Oracle »\"\n", " return Context._lookup_name_by_address(token_address, MangoConstants[self.cluster][\"oracles\"]) or \"« Unknown Oracle »\"\n",
"\n", "\n",
" def lookup_token_name(self, token_address: PublicKey) -> typing.Optional[str]:\n",
" return Context._lookup_name_by_address(token_address, MangoConstants[self.cluster][\"mango_groups\"][self.group_name][\"symbols\"])\n",
"\n",
" def lookup_token_address(self, token_name: str) -> typing.Optional[PublicKey]:\n",
" return Context._lookup_address_by_name(token_name, MangoConstants[self.cluster][\"mango_groups\"][self.group_name][\"symbols\"])\n",
"\n",
" def wait_for_confirmation(self, transaction_id: str, max_wait_in_seconds: int = 60) -> typing.Optional[typing.Dict]:\n", " def wait_for_confirmation(self, transaction_id: str, max_wait_in_seconds: int = 60) -> typing.Optional[typing.Dict]:\n",
" self.logger.info(f\"Waiting up to {max_wait_in_seconds} seconds for {transaction_id}.\")\n", " self.logger.info(f\"Waiting up to {max_wait_in_seconds} seconds for {transaction_id}.\")\n",
" for wait in range(0, max_wait_in_seconds):\n", " for wait in range(0, max_wait_in_seconds):\n",
@ -253,7 +244,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "guilty-conservation", "id": "brazilian-ethnic",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## default_context object\n", "## default_context object\n",
@ -264,7 +255,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "classified-underground", "id": "scenic-morgan",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -283,7 +274,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "ceramic-nightlife", "id": "educational-equilibrium",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## solana_context object\n", "## solana_context object\n",
@ -294,7 +285,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "animated-louisiana", "id": "published-jordan",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -306,7 +297,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "thick-crash", "id": "beautiful-coffee",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## serum_context object\n", "## serum_context object\n",
@ -317,7 +308,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "behavioral-laser", "id": "velvet-bride",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -329,7 +320,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "neural-malpractice", "id": "fiscal-contribution",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# 🏃 Running\n", "# 🏃 Running\n",
@ -340,7 +331,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "previous-capacity", "id": "recovered-proceeding",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -349,10 +340,6 @@
"\n", "\n",
" print(default_context)\n", " print(default_context)\n",
"\n", "\n",
" print(\"Lookup ETH token name result:\", default_context.lookup_token_name(PublicKey(\"2FPyTwcZLUg1MDrwsyoP4D6s1tM7hAkHYRjkNb5w6Pxk\")))\n",
" print(\"Lookup ETH token address result:\", default_context.lookup_token_address(\"ETH\"))\n",
" print(\"Lookup BTC/USDC market name result:\", default_context.lookup_market_name(PublicKey(\"CVfYa8RGXnuDBeGmniCcdkBwoLqVxh92xB1JqgRQx3F\")))\n",
"\n",
" # Fill out your account address between the quotes below\n", " # Fill out your account address between the quotes below\n",
" MY_ACCOUNT_ADDRESS = \"\"\n", " MY_ACCOUNT_ADDRESS = \"\"\n",
" # Don't edit anything beyond here.\n", " # Don't edit anything beyond here.\n",

View File

@ -2,7 +2,7 @@
"cells": [ "cells": [
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "corresponding-metabolism", "id": "numeric-sheep",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# ⚠ Warning\n", "# ⚠ Warning\n",
@ -16,7 +16,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "hollywood-victory", "id": "lesser-small",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# 🥭 Instructions\n", "# 🥭 Instructions\n",
@ -27,7 +27,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "disturbed-washer", "id": "african-picking",
"metadata": { "metadata": {
"jupyter": { "jupyter": {
"source_hidden": true "source_hidden": true
@ -55,7 +55,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "different-philosophy", "id": "trained-cartridge",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# InstructionBuilder class\n", "# InstructionBuilder class\n",
@ -66,7 +66,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "secret-eugene", "id": "apparent-plane",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -85,7 +85,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "accessory-drunk", "id": "daily-dependence",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# ForceCancelOrdersInstructionBuilder class" "# ForceCancelOrdersInstructionBuilder class"
@ -93,7 +93,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "touched-consideration", "id": "ceramic-football",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## Rust Interface\n", "## Rust Interface\n",
@ -125,7 +125,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "blank-biodiversity", "id": "empirical-ultimate",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## Client API call\n", "## Client API call\n",
@ -169,7 +169,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "physical-gentleman", "id": "eligible-madison",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -200,7 +200,7 @@
" AccountMeta(is_signer=False, is_writable=True, pubkey=self.margin_account.address),\n", " AccountMeta(is_signer=False, is_writable=True, pubkey=self.margin_account.address),\n",
" AccountMeta(is_signer=False, is_writable=True, pubkey=self.market_metadata.base.vault),\n", " AccountMeta(is_signer=False, is_writable=True, pubkey=self.market_metadata.base.vault),\n",
" AccountMeta(is_signer=False, is_writable=True, pubkey=self.market_metadata.quote.vault),\n", " AccountMeta(is_signer=False, is_writable=True, pubkey=self.market_metadata.quote.vault),\n",
" AccountMeta(is_signer=False, is_writable=True, pubkey=self.market_metadata.spot),\n", " AccountMeta(is_signer=False, is_writable=True, pubkey=self.market_metadata.spot.address),\n",
" AccountMeta(is_signer=False, is_writable=True, pubkey=self.market.state.bids()),\n", " AccountMeta(is_signer=False, is_writable=True, pubkey=self.market.state.bids()),\n",
" AccountMeta(is_signer=False, is_writable=True, pubkey=self.market.state.asks()),\n", " AccountMeta(is_signer=False, is_writable=True, pubkey=self.market.state.asks()),\n",
" AccountMeta(is_signer=False, is_writable=False, pubkey=self.group.signer_key),\n", " AccountMeta(is_signer=False, is_writable=False, pubkey=self.group.signer_key),\n",
@ -224,7 +224,7 @@
" def from_margin_account_and_market(context: Context, group: Group, wallet: Wallet, margin_account: MarginAccount, market_metadata: MarketMetadata) -> \"ForceCancelOrdersInstructionBuilder\":\n", " def from_margin_account_and_market(context: Context, group: Group, wallet: Wallet, margin_account: MarginAccount, market_metadata: MarketMetadata) -> \"ForceCancelOrdersInstructionBuilder\":\n",
" market = market_metadata.fetch_market(context)\n", " market = market_metadata.fetch_market(context)\n",
" nonce = struct.pack(\"<Q\", market.state.vault_signer_nonce())\n", " nonce = struct.pack(\"<Q\", market.state.vault_signer_nonce())\n",
" dex_signer = PublicKey.create_program_address([bytes(market_metadata.spot), nonce], context.dex_program_id)\n", " dex_signer = PublicKey.create_program_address([bytes(market_metadata.spot.address), nonce], context.dex_program_id)\n",
" oracles = list([mkt.oracle for mkt in group.markets])\n", " oracles = list([mkt.oracle for mkt in group.markets])\n",
"\n", "\n",
" return ForceCancelOrdersInstructionBuilder(context, group, wallet, margin_account, market_metadata, market, oracles, dex_signer)\n", " return ForceCancelOrdersInstructionBuilder(context, group, wallet, margin_account, market_metadata, market, oracles, dex_signer)\n",
@ -258,7 +258,7 @@
" liqee_margin_account_acc: &Pubkey: {self.margin_account.address},\n", " liqee_margin_account_acc: &Pubkey: {self.margin_account.address},\n",
" base_vault_pk: &Pubkey: {self.market_metadata.base.vault},\n", " base_vault_pk: &Pubkey: {self.market_metadata.base.vault},\n",
" quote_vault_pk: &Pubkey: {self.market_metadata.quote.vault},\n", " quote_vault_pk: &Pubkey: {self.market_metadata.quote.vault},\n",
" spot_market_pk: &Pubkey: {self.market_metadata.spot},\n", " spot_market_pk: &Pubkey: {self.market_metadata.spot.address},\n",
" bids_pk: &Pubkey: {self.market.state.bids()},\n", " bids_pk: &Pubkey: {self.market.state.bids()},\n",
" asks_pk: &Pubkey: {self.market.state.asks()},\n", " asks_pk: &Pubkey: {self.market.state.asks()},\n",
" signer_pk: &Pubkey: {self.group.signer_key},\n", " signer_pk: &Pubkey: {self.group.signer_key},\n",
@ -275,7 +275,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "changing-humanity", "id": "expanded-separate",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# LiquidateInstructionBuilder class\n", "# LiquidateInstructionBuilder class\n",
@ -287,7 +287,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "occupational-steam", "id": "stupid-arrest",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## Rust Interface\n", "## Rust Interface\n",
@ -333,7 +333,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "heard-farming", "id": "identical-november",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## Client API call\n", "## Client API call\n",
@ -370,7 +370,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "changed-literacy", "id": "logical-burning",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## from_margin_account_and_market() function\n", "## from_margin_account_and_market() function\n",
@ -391,7 +391,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "former-cemetery", "id": "pending-services",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -503,7 +503,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "traditional-assembly", "id": "retired-bundle",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# 🏃 Running" "# 🏃 Running"
@ -512,7 +512,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "victorian-character", "id": "wrong-rebel",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [

View File

@ -2,7 +2,7 @@
"cells": [ "cells": [
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "enclosed-algebra", "id": "ordinary-duplicate",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# ⚠ Warning\n", "# ⚠ Warning\n",
@ -16,7 +16,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "aggressive-physiology", "id": "sound-earthquake",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# 🥭 Notification\n", "# 🥭 Notification\n",
@ -27,7 +27,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "patient-blame", "id": "tamil-carpet",
"metadata": { "metadata": {
"jupyter": { "jupyter": {
"source_hidden": true "source_hidden": true
@ -49,7 +49,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "global-feature", "id": "brave-coordinate",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# NotificationTarget class\n", "# NotificationTarget class\n",
@ -64,7 +64,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "noted-marking", "id": "weekly-financing",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -88,7 +88,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "forward-compact", "id": "negative-madagascar",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# TelegramNotificationTarget class\n", "# TelegramNotificationTarget class\n",
@ -113,7 +113,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "quarterly-nothing", "id": "binary-export",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -136,7 +136,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "published-ideal", "id": "whole-design",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# DiscordNotificationTarget class\n", "# DiscordNotificationTarget class\n",
@ -147,7 +147,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "junior-conditions", "id": "naughty-disney",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -170,7 +170,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "actual-bronze", "id": "finite-caribbean",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# MailjetNotificationTarget class\n", "# MailjetNotificationTarget class\n",
@ -224,7 +224,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "reduced-rabbit", "id": "daily-accreditation",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -271,7 +271,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "gross-stereo", "id": "physical-norfolk",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# CsvFileNotificationTarget class\n", "# CsvFileNotificationTarget class\n",
@ -288,7 +288,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "given-african", "id": "awful-airport",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -318,7 +318,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "adult-chicago", "id": "instrumental-adams",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# FilteringNotificationTarget class\n", "# FilteringNotificationTarget class\n",
@ -329,7 +329,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "acceptable-christopher", "id": "iraqi-dryer",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -349,7 +349,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "falling-cattle", "id": "monthly-translator",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# parse_subscription_target() function\n", "# parse_subscription_target() function\n",
@ -362,7 +362,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "speaking-vocabulary", "id": "overall-camera",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -383,7 +383,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "bacterial-coffee", "id": "original-heating",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## NotificationHandler class\n", "## NotificationHandler class\n",
@ -394,7 +394,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "norman-bruce", "id": "different-breach",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -410,7 +410,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "cloudy-czech", "id": "entertaining-mobility",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# ✅ Testing" "# ✅ Testing"
@ -419,7 +419,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "rough-structure", "id": "animal-player",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -466,7 +466,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "solved-switzerland", "id": "after-definition",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# 🏃 Running\n", "# 🏃 Running\n",
@ -477,7 +477,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "signed-guyana", "id": "anticipated-destruction",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -503,18 +503,21 @@
" # from Context import default_context\n", " # from Context import default_context\n",
" # from decimal import Decimal\n", " # from decimal import Decimal\n",
" # from Wallet import default_wallet\n", " # from Wallet import default_wallet\n",
" # token_lookup = TokenLookup.default_lookups()\n",
" # balances_before = [\n", " # balances_before = [\n",
" # TokenValue(TokenLookup.find_by_name(default_context, \"ETH\"), Decimal(1)),\n", " # TokenValue(token_lookup.find_by_symbol(\"ETH\"), Decimal(1)),\n",
" # TokenValue(TokenLookup.find_by_name(default_context, \"BTC\"), Decimal(\"0.1\")),\n", " # TokenValue(token_lookup.find_by_symbol(\"BTC\"), Decimal(\"0.1\")),\n",
" # TokenValue(TokenLookup.find_by_name(default_context, \"USDT\"), Decimal(1000))\n", " # TokenValue(token_lookup.find_by_symbol(\"USDT\"), Decimal(1000))\n",
" # ]\n", " # ]\n",
" # balances_after = [\n", " # balances_after = [\n",
" # TokenValue(TokenLookup.find_by_name(default_context, \"ETH\"), Decimal(1)),\n", " # TokenValue(token_lookup.find_by_symbol(\"ETH\"), Decimal(1)),\n",
" # TokenValue(TokenLookup.find_by_name(default_context, \"BTC\"), Decimal(\"0.05\")),\n", " # TokenValue(token_lookup.find_by_symbol(\"BTC\"), Decimal(\"0.05\")),\n",
" # TokenValue(TokenLookup.find_by_name(default_context, \"USDT\"), Decimal(2000))\n", " # TokenValue(token_lookup.find_by_symbol(\"USDT\"), Decimal(2000))\n",
" # ]\n", " # ]\n",
" #\n",
" # event = LiquidationEvent(datetime.datetime.now(),\n", " # event = LiquidationEvent(datetime.datetime.now(),\n",
" # \"Liquidator Name\",\n",
" # \"GROUP_NAME\",\n",
" # True,\n",
" # \"SIGNATURE\",\n", " # \"SIGNATURE\",\n",
" # default_wallet.address,\n", " # default_wallet.address,\n",
" # default_wallet.address,\n", " # default_wallet.address,\n",

View File

@ -2,7 +2,7 @@
"cells": [ "cells": [
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "juvenile-netherlands", "id": "french-mexico",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# ⚠ Warning\n", "# ⚠ Warning\n",
@ -16,7 +16,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "changed-correspondence", "id": "eastern-relevance",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# 🥭 TradeExecutor\n", "# 🥭 TradeExecutor\n",
@ -31,7 +31,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "pacific-organic", "id": "descending-attendance",
"metadata": { "metadata": {
"jupyter": { "jupyter": {
"source_hidden": true "source_hidden": true
@ -59,7 +59,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "champion-wheel", "id": "impressed-hazard",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# TradeExecutor class\n", "# TradeExecutor class\n",
@ -77,7 +77,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "competent-former", "id": "thirty-habitat",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -104,7 +104,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "latin-electronics", "id": "possible-blank",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## NullTradeExecutor class\n", "## NullTradeExecutor class\n",
@ -115,7 +115,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "accessible-decline", "id": "subjective-violation",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -144,7 +144,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "noted-immunology", "id": "paperback-america",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# SerumImmediateTradeExecutor class\n", "# SerumImmediateTradeExecutor class\n",
@ -174,7 +174,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "enabling-convenience", "id": "greatest-impression",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -327,7 +327,7 @@
" self.reporter(\"All settlement transaction IDs confirmed.\")\n", " self.reporter(\"All settlement transaction IDs confirmed.\")\n",
"\n", "\n",
" def _tokens_and_market(self, symbol: str) -> typing.Tuple[MarketMetadata, Token, Token]:\n", " def _tokens_and_market(self, symbol: str) -> typing.Tuple[MarketMetadata, Token, Token]:\n",
" base_token = BasketToken.find_by_name(self.group.basket_tokens, symbol).token\n", " base_token = BasketToken.find_by_symbol(self.group.basket_tokens, symbol).token\n",
" quote_token = self.group.shared_quote_token.token\n", " quote_token = self.group.shared_quote_token.token\n",
" self.logger.info(f\"Base token: {base_token}\")\n", " self.logger.info(f\"Base token: {base_token}\")\n",
" self.logger.info(f\"Quote token: {quote_token}\")\n", " self.logger.info(f\"Quote token: {quote_token}\")\n",
@ -356,7 +356,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "front-queens", "id": "living-mitchell",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# 🏃 Running\n", "# 🏃 Running\n",
@ -369,7 +369,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "optimum-judgment", "id": "collected-simon",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [

View File

@ -2,7 +2,7 @@
"cells": [ "cells": [
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "corrected-sunrise", "id": "described-pencil",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# ⚠ Warning\n", "# ⚠ Warning\n",
@ -16,7 +16,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "aware-hollywood", "id": "nervous-bikini",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# 🥭 TransactionScount\n", "# 🥭 TransactionScount\n",
@ -29,7 +29,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "coastal-wilson", "id": "fitting-andrews",
"metadata": { "metadata": {
"jupyter": { "jupyter": {
"source_hidden": true "source_hidden": true
@ -54,7 +54,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "indirect-mount", "id": "weighted-annotation",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## Transaction Indices\n", "## Transaction Indices\n",
@ -79,7 +79,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "gothic-grace", "id": "spiritual-buffer",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -149,7 +149,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "oriented-defense", "id": "suspected-broadcasting",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## TransactionInstruction class\n", "## TransactionInstruction class\n",
@ -160,7 +160,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "entire-russian", "id": "compact-extreme",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -273,7 +273,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "auburn-liability", "id": "portuguese-implement",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# TransactionScout class" "# TransactionScout class"
@ -282,7 +282,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "strong-olive", "id": "focused-poultry",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -358,7 +358,7 @@
" decimals = Decimal(balance[\"uiTokenAmount\"][\"decimals\"])\n", " decimals = Decimal(balance[\"uiTokenAmount\"][\"decimals\"])\n",
" divisor = Decimal(10) ** decimals\n", " divisor = Decimal(10) ** decimals\n",
" value = amount / divisor\n", " value = amount / divisor\n",
" token = TokenLookup.find_by_mint(context, mint)\n", " token = TokenLookup.default_lookups().find_by_mint(mint)\n",
" return OwnedTokenValue(account, TokenValue(token, value))\n", " return OwnedTokenValue(account, TokenValue(token, value))\n",
"\n", "\n",
" try:\n", " try:\n",
@ -436,7 +436,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "enormous-boxing", "id": "electronic-cassette",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -462,7 +462,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "lonely-proceeding", "id": "false-merchant",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# 🏃 Running\n", "# 🏃 Running\n",
@ -479,7 +479,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "static-affiliation", "id": "recovered-times",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -489,7 +489,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "quantitative-wellington", "id": "descending-norwegian",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [

View File

@ -2,7 +2,7 @@
"cells": [ "cells": [
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "important-firmware", "id": "intense-illinois",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# ⚠ Warning\n", "# ⚠ Warning\n",
@ -16,7 +16,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "limited-ordering", "id": "ceramic-smoke",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# 🥭 WalletBalancer\n", "# 🥭 WalletBalancer\n",
@ -31,7 +31,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "immediate-berlin", "id": "adequate-costume",
"metadata": { "metadata": {
"jupyter": { "jupyter": {
"source_hidden": true "source_hidden": true
@ -54,7 +54,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "atomic-studio", "id": "special-nomination",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# Target Balances\n", "# Target Balances\n",
@ -75,7 +75,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "muslim-whale", "id": "unknown-relationship",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## TargetBalance class\n", "## TargetBalance class\n",
@ -86,7 +86,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "fallen-plumbing", "id": "mighty-stock",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -105,7 +105,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "acting-december", "id": "earlier-internship",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## FixedTargetBalance class\n", "## FixedTargetBalance class\n",
@ -116,7 +116,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "fuzzy-laptop", "id": "electronic-cycle",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -134,7 +134,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "ready-costume", "id": "muslim-priority",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## PercentageTargetBalance\n", "## PercentageTargetBalance\n",
@ -150,7 +150,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "premium-basin", "id": "potential-mustang",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -170,7 +170,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "behavioral-convertible", "id": "assigned-mississippi",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## TargetBalanceParser class\n", "## TargetBalanceParser class\n",
@ -183,7 +183,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "democratic-crowd", "id": "hired-laundry",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -197,7 +197,7 @@
" except Exception as exception:\n", " except Exception as exception:\n",
" raise Exception(f\"Could not parse target balance '{to_parse}'\") from exception\n", " raise Exception(f\"Could not parse target balance '{to_parse}'\") from exception\n",
"\n", "\n",
" token = Token.find_by_name(self.tokens, token_name)\n", " token = Token.find_by_symbol(self.tokens, token_name)\n",
"\n", "\n",
" # The value we have may be an int (like 27), a fraction (like 0.1) or a percentage\n", " # The value we have may be an int (like 27), a fraction (like 0.1) or a percentage\n",
" # (like 25%). In all cases we want the number as a number, but we also want to know if\n", " # (like 25%). In all cases we want the number as a number, but we also want to know if\n",
@ -221,7 +221,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "supreme-kentucky", "id": "private-colorado",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# sort_changes_for_trades function\n", "# sort_changes_for_trades function\n",
@ -234,7 +234,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "small-period", "id": "signal-reputation",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -244,7 +244,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "significant-bearing", "id": "regular-array",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# calculate_required_balance_changes function\n", "# calculate_required_balance_changes function\n",
@ -255,7 +255,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "regulation-essay", "id": "minimal-kinase",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -271,7 +271,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "taken-salvation", "id": "round-appendix",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# FilterSmallChanges class\n", "# FilterSmallChanges class\n",
@ -286,7 +286,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "clean-horizon", "id": "european-ratio",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -315,7 +315,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "animated-switzerland", "id": "three-shareware",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# WalletBalancers\n", "# WalletBalancers\n",
@ -331,7 +331,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "essential-heating", "id": "destroyed-validation",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## WalletBalancer class\n", "## WalletBalancer class\n",
@ -342,7 +342,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "behind-product", "id": "engaged-thunder",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -354,7 +354,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "mighty-minimum", "id": "democratic-series",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## NullWalletBalancer class\n", "## NullWalletBalancer class\n",
@ -365,7 +365,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "serious-ghost", "id": "wound-flour",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -376,7 +376,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "metric-veteran", "id": "painful-stake",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## LiveWalletBalancer class\n", "## LiveWalletBalancer class\n",
@ -387,7 +387,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "shared-craft", "id": "south-ministry",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -454,7 +454,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "living-fitness", "id": "compatible-mustang",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# ✅ Testing" "# ✅ Testing"
@ -463,7 +463,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "superb-proportion", "id": "little-exposure",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -548,7 +548,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "built-evidence", "id": "emotional-instruction",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# 🏃 Running\n", "# 🏃 Running\n",
@ -559,7 +559,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "welcome-secretariat", "id": "adjusted-myrtle",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -569,9 +569,9 @@
" from Context import default_context\n", " from Context import default_context\n",
"\n", "\n",
" group = Group.load(default_context)\n", " group = Group.load(default_context)\n",
" eth = BasketToken.find_by_name(group.basket_tokens, \"eth\").token\n", " eth = BasketToken.find_by_symbol(group.basket_tokens, \"eth\").token\n",
" btc = BasketToken.find_by_name(group.basket_tokens, \"btc\").token\n", " btc = BasketToken.find_by_symbol(group.basket_tokens, \"btc\").token\n",
" usdt = BasketToken.find_by_name(group.basket_tokens, \"usdt\").token\n", " usdt = BasketToken.find_by_symbol(group.basket_tokens, \"usdt\").token\n",
"\n", "\n",
" parser = TargetBalanceParser([eth, btc])\n", " parser = TargetBalanceParser([eth, btc])\n",
" eth_target = parser.parse(\"ETH:20%\")\n", " eth_target = parser.parse(\"ETH:20%\")\n",

View File

@ -80,7 +80,7 @@ try:
logging.info(f"Wallet address: {wallet.address}") logging.info(f"Wallet address: {wallet.address}")
group = Group.load(context) group = Group.load(context)
group_basket_token = BasketToken.find_by_name(group.basket_tokens, args.token_symbol) group_basket_token = BasketToken.find_by_symbol(group.basket_tokens, args.token_symbol)
group_token = group_basket_token.token group_token = group_basket_token.token
spl_token = Token(context.client, group_token.mint, TOKEN_PROGRAM_ID, wallet.account) spl_token = Token(context.client, group_token.mint, TOKEN_PROGRAM_ID, wallet.account)

7996
solana.tokenlist.json Normal file

File diff suppressed because it is too large Load Diff