{"id":13729398,"url":"https://github.com/gauss314/defi","last_synced_at":"2025-12-27T07:14:43.704Z","repository":{"id":38748102,"uuid":"356973232","full_name":"gauss314/defi","owner":"gauss314","description":"Tools for use in DeFi. Impermanent Loss calculations, staking and farming strategies, coingecko and pancakeswap API queries, liquidity pools and more","archived":false,"fork":false,"pushed_at":"2024-03-02T14:31:12.000Z","size":2617,"stargazers_count":591,"open_issues_count":15,"forks_count":151,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-09-20T16:00:08.068Z","etag":null,"topics":["api","blockchain","cex","coingecko","crypto","cryptocurrency","dapp","defi","dex","exchanges","farming","impermanent-loss","pancakeswap","stake"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gauss314.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-04-11T20:32:54.000Z","updated_at":"2025-09-17T09:31:43.000Z","dependencies_parsed_at":"2025-05-08T01:33:24.267Z","dependency_job_id":"95a1a2e1-be9b-4705-9bbe-d37d30d9a7fa","html_url":"https://github.com/gauss314/defi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gauss314/defi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauss314%2Fdefi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauss314%2Fdefi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauss314%2Fdefi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauss314%2Fdefi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gauss314","download_url":"https://codeload.github.com/gauss314/defi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauss314%2Fdefi/sbom","scorecard":{"id":419825,"data":{"date":"2025-08-11","repo":{"name":"github.com/gauss314/defi","commit":"a53e3f4d31cdb417b951c158cb81feb432131088"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: defi/__pycache__/defi_tools.cpython-38.pyc:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}}]},"last_synced_at":"2025-08-19T00:55:17.049Z","repository_id":38748102,"created_at":"2025-08-19T00:55:17.049Z","updated_at":"2025-08-19T00:55:17.049Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28075319,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-27T02:00:05.897Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","blockchain","cex","coingecko","crypto","cryptocurrency","dapp","defi","dex","exchanges","farming","impermanent-loss","pancakeswap","stake"],"created_at":"2024-08-03T02:00:59.660Z","updated_at":"2025-12-27T07:14:43.657Z","avatar_url":"https://github.com/gauss314.png","language":"Python","readme":"\u003cbr\u003e\n\n# DeFi open source tools\n\n[![Downloads](https://pepy.tech/badge/defi)](https://pepy.tech/project/defi)\n[![License](http://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/gauss314/defi/blob/main/LICENSE.txt)\n[![Twitter](https://img.shields.io/twitter/follow/JohnGalt_is_www?color=blue\u0026style=flat-square)](https://twitter.com/JohnGalt_is_www)\n[![Update](https://img.shields.io/github/last-commit/gauss314/defi)](https://github.com/gauss314/defi)\n[![Update](https://img.shields.io/pypi/pyversions/defi?color=green\u0026label=python)](https://pypi.org/project/defi/)\n\n\u003cbr\u003e\n\n## Get Started\n* [Instalation](#instalation)\n\n## General Tools\n* [Impermanent Loss, simple calculation](#impermanent-loss)\n* [Compare Buy \u0026 Hold with Staking and Farming](#buyhold-vs-stake--farming-strategy)\n* [Complete list for DeFi protocols TVL, volume and more](#defi-protocols)\n* [Example listing top20 DeFi dapps by TVL](#top-20-dapps-tvl-by-chain)\n* [Example show historical TVL for one or more protocols ](#historical-tvl)\n\n## CoinGecko API\n* [API endpoints](#coingecko-api)\n* [Get IDs list](#coingecko---ids-list)\n* [Live prices](#coingecko---get-price-for-coins-at-diferent-currencies)\n* [All exchanges and prices for each coin](#coingecko---get-main-exchanges-for-a-coin-or-token)\n* [Historial prices por each coin](#coingecko---historical-prices-for-a-coin)\n* [Simulate Farming Strategy](#coingecko---farming-simulate)\n\n## PancakeSwap API\n* [All token prices real time](#pancakeswap---get-tokens-prices-in-real-time)\n* [All pairs liquidity, volume and more](#pancakeswap---get-pairs-liquidity-and-more)\n* [Get data in real time for one token](#pancakeswap---get-token-info)\n* [Get data in real time for one pair](#pancakeswap---get-pair-info)\n* [Simulate invest in LP considering impermanent loss, 3D graph](#pancakeswap---simulate-lp-invest)\n\n\n\n\u003cbr\u003e\u003cbr\u003e\n\n## Get started\n\n\u003cbr\u003e\n\n### Instalation\n\n\n```sh\npip install defi\n```\n\n\u003cbr\u003e\n\n### Impermanent Loss\n\n```python\nimport defi.defi_tools as dft\n\n# Impermanent loss for stableCoin \u0026 -20% return token \ndft.iloss(0.8)\n```\n\u003e -0.62%\n\n\n\n```python\nimport defi.defi_tools as dft\n\n# Impermanent loss for stableCoin \u0026 +60% return token \ndft.iloss(1.6, numerical=True)\n\n```\n\u003e 0.027   # Same as 2.7%\n\n\n\u003cbr\u003e\n\n### Buy\u0026Hold vs Stake \u0026 Farming strategy\n\n\n```python\nimport defi.defi_tools as dft\n\n# Exercise: Get returns after 20 days, assuming token A is a stablecoin, token B perform + 150%\n# individual staking pools for both = 0.01% \u0026 0.05% daily\n# liquidity-pool farming rewards =0.2% daily \u0026 Earn by fees/day = 0.01%\ndft.compare(days=20, var_A=0, var_B=150, rw_pool_A=0.01, rw_pool_B=0.05, rw_pool_AB=0.2, fees_AB=0.01)\n```\n\n```json\n{\n \"buy_hold\": \"75.00%\",\n \"stake\": \"75.60%\",\n \"farm\": \"71.96%\",\n \"Best\": \"Stake\"\n}\n```\n\n\u003cbr\u003e\n\n### DeFi protocols\n\n\n```python\nimport defi.defi_tools as dft\n\nmetadata, df = dft.getProtocol('Uniswap')\nmetadata\n```\n\n```json\n{\n \"id\": \"1\",\n \"name\": \"Uniswap\",\n \"address\": \"0x1f9840a85d5af5bf1d1762f925bdaddc4201f984\",\n \"symbol\": \"UNI\",\n \"url\": \"https://info.uniswap.org/\",\n \"description\": \"A fully decentralized protocol for automated liquidity provision on Ethereum.\\r\\n\",\n \"chain\": \"Ethereum\",\n \"logo\": \"None\",\n \"audits\": \"2\",\n \"audit_note\": \"None\",\n \"gecko_id\": \"uniswap\",\n \"cmcId\": \"7083\",\n \"category\": \"Dexes\",\n \"chains\": [\"Ethereum\"],\n \"module\": \"uniswap.js\"\n}\n```\n\n\u003cbr\u003e\n\n### Top 20 dapps TVL by chain\n\n```python\nimport defi.defi_tools as dft\nimport matplotlib.pyplot as plt\n\ndf = dft.getProtocols()\nfig, ax = plt.subplots(figsize=(12,6))\n\nn = 50 # quantity to show\ntop = df.sort_values('tvl', ascending=False).head(n)\n\nchains = top.groupby('chain').size().index.values.tolist()\nfor chain in chains:\n    filtro = top.loc[top.chain==chain]\n    ax.bar(filtro.index, filtro.tvl, label=chain)\n\nax.set_title(f'Top {n} dApp TVL, groupBy dApp main Chain', fontsize=14)\nax.grid(alpha=0.5)\nplt.legend()\nplt.xticks(rotation=90)\nplt.show()\n```\n\u003cimg src=\"images/top20_dapps.png\" width=600\u003e\n\n\n\u003cbr\u003e\n### Historical TVL\n\n\n```python\nimport defi.defi_tools as dft\nimport pandas as pd\n\nexchanges = ['pancakeswap', 'curve', 'makerdao', 'uniswap','Compound', 'AAVE','sushiswap','anchor']\n\nhist = [dft.getProtocol(exchange)[1] for exchange in exchanges]\ndf = pd.concat(hist, axis=1)\ndf.columns = exchanges\n\ndf.plot(figsize=(12,6))\n```\n\u003cimg src=\"images/main_dapps.png\" width=600\u003e\n\n\n\u003cbr\u003e\n\n### CoinGecko API\n\nEndpoints available, some examples:\n\n    * dft.getGeckoIDs()\n        # coinGecko first 5000 ids\n\n\t* dft.geckoPrice(\"bitcoin,ethereum\", \"usd,eur,brl\")\n\t\t# coinGecko quotes\n\n\t* dft.geckoList(page=1, per_page=250)\n\t\t# full coinGecko cyptocurrency list\n\n\t* dft.geckoMarkets(\"ethereum\")\n\t\t# top 100 liquidity markets, prices, and more, for eth or other coin\n\n\t* dft.geckoHistorical('cardano')\n\t\t# full history containing price, market cap and volume \n\n    * dft.farmSimulate(['huobi-token','tether'], apr=45)\n        # Simulate farming strategy with apr=45% \n\n\n### CoinGecko - ids list\n```python\nimport defi.defi_tools as dft\n\nids = dft.getGeckoIDs()\nids[:10]\n```\n\u003cpre\u003e\n['bitcoin',\n 'ethereum',\n 'binancecoin',\n 'tether',\n 'solana',\n 'cardano',\n 'ripple',\n 'polkadot',\n 'shiba-inu',\n 'dogecoin']\n\u003c/pre\u003e\n\n\n### CoinGecko - Get price for coins at diferent currencies\n```python\nimport defi.defi_tools as dft\n\ndft.geckoPrice(\"bitcoin,ethereum\", \"usd,eur,brl\")\n```\n\n```json\n{\"ethereum\": {\"usd\": 2149.85, \"eur\": 1807.58, \"brl\": 12208.77},\n \"bitcoin\": {\"usd\": 60188, \"eur\": 50606, \"brl\": 341802}}\n```\n\n\u003cbr\u003e\n\n### CoinGecko - Get main exchanges for a coin or token \n```python\nimport defi.defi_tools as dft\n\ndf = dft.geckoMarkets(\"ethereum\")\nprint(df.info())\n# returns top 100 ethereum quotes by volume\n```\n```text\nIndex: 100 entries, IDCM to FTX.US\nData columns (total 9 columns):\n #   Column       Non-Null Count  Dtype              \n---  ------       --------------  -----              \n 0   base         100 non-null    object             \n 1   target       100 non-null    object             \n 2   last         100 non-null    float64            \n 3   volume       100 non-null    float64            \n 4   spread       100 non-null    float64            \n 5   timestamp    100 non-null    datetime64[ns, UTC]\n 6   volume_usd   100 non-null    float64            \n 7   price_usd    100 non-null    float64            \n 8   trust_score  100 non-null    object             \ndtypes: datetime64[ns, UTC](1), float64(5), object(3)\nmemory usage: 7.8+ KB\n```\n\n\u003cbr\u003e\n\n### CoinGecko - historical prices for a coin\n```python\nimport defi.defi_tools as dft\n\ndf = dft.geckoHistorical('cardano')\nprint(df)\n```\n\u003cpre\u003e\n                        price   market_caps  total_volumes\ndate                                                      \n2017-10-18 00:00:00  0.026845  6.960214e+08   2.351678e+06\n2017-10-19 00:00:00  0.026830  6.956220e+08   2.815156e+06\n2017-10-20 00:00:00  0.030300  7.855800e+08   8.883473e+06\n2017-10-21 00:00:00  0.028588  7.412021e+08   5.308857e+06\n2017-10-22 00:00:00  0.027796  7.206698e+08   2.901876e+06\n...                       ...           ...            ...\n2021-04-13 00:00:00  1.319790  4.223483e+10   5.005258e+09\n2021-04-14 00:00:00  1.422447  4.565529e+10   5.693373e+09\n2021-04-15 00:00:00  1.456105  4.676570e+10   8.920293e+09\n2021-04-16 00:00:00  1.478071  4.730118e+10   5.151595e+09\n2021-04-17 03:47:55  1.433489  4.595961e+10   5.152747e+09\n\n[1278 rows x 3 columns]\n\u003c/pre\u003e\n\n\n### CoinGecko - Farming Simulate\n```python\nimport defi.defi_tools as dft\n\npair = ['huobi-token','tether']\napr = 45\n\ndft.farmSimulate(pair, apr, start='2021-01-01')\n```\n\u003cpre\u003e\nDownloading huobi-token\nDownloading tether\n{'Token 1': 'huobi-token',\n 'Token 2': 'tether',\n 'start': '2021-01-01',\n 'fixed APR': '45%',\n 'Buy \u0026 Hold': '68.90%',\n 'Impermanent Loss': '-8.66%',\n 'Farming Rewards': '75.45%',\n 'Farming + Rewards - IL': '153.02%'}\n\n\u003c/pre\u003e\n\u003cimg src=\"images/simulate.png\" width=800\u003e\n\n\n\u003cbr\u003e\n\n### PancakeSwap - Get tokens prices in real time\n```python\nimport defi.defi_tools as dft\n\ndf = dft.pcsTokens()\nprint(df)\n```\n```text\n                                                         name     symbol       price  price_BNB                 updated\n0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82  PancakeSwap Token       Cake     24.0636     0.0450 2021-04-17 04:29:08.332\n0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c        Wrapped BNB       WBNB    534.2575     1.0000 2021-04-17 04:29:08.332\n0x0F9E4D49f25de22c2202aF916B681FBB3790497B             Perlin        PRL      0.2091     0.0004 2021-04-17 04:29:08.332\n0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56         BUSD Token       BUSD      1.0000     0.0019 2021-04-17 04:29:08.332\n0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c         BTCB Token       BTCB  62166.5517   116.3604 2021-04-17 04:29:08.332\n...                                                       ...        ...         ...        ...                     ...\n0xB6802C06A441BA63624751C53C7c0708b75F06EC          FinalMoon  FINALMOON      0.0651     0.0001 2021-04-17 04:29:08.332\n0x2cF0DA1EB4165d73156CE1E32450e4A0E1c1791b        FairUnicorn       FUni      0.0000     0.0000 2021-04-17 04:29:08.332\n0x5CeD26185f82B07E1516d0B013c54CcBD252A4Ad            Peaches      PEACH      0.1130     0.0002 2021-04-17 04:29:08.332\n0x2bA64EFB7A4Ec8983E22A49c81fa216AC33f383A        Wrapped BGL       WBGL      0.1000     0.0002 2021-04-17 04:29:08.332\n0x019bE1796178516e060072004F267B59a49A0801     Pepper Finance       PEPR      0.1819     0.0003 2021-04-17 04:29:08.332\n\n[854 rows x 5 columns]\n```\n\n\u003cbr\u003e\n\n### PancakeSwap - Get pairs, liquidity, and more\n```python\nimport defi.defi_tools as dft\n\npairs = dft.pcsPairs(as_df=False)\nprint(pairs)\n```\n\n```json\n{\"updated_at\": 1618645355351,\n \"data\": {\"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82_0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\": \n \t{\"pair_address\": \"0xA527a61703D82139F8a06Bc30097cC9CAA2df5A6\",\n\t   \"base_name\": \"PancakeSwap Token\",\n\t   \"base_symbol\": \"Cake\",\n\t   \"base_address\": \"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82\",\n\t   \"quote_name\": \"Wrapped BNB\",\n\t   \"quote_symbol\": \"WBNB\",\n\t   \"quote_address\": \"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\",\n\t   \"price\": \"0.04503969270521829587\",\n\t   \"base_volume\": \"5473068.824002232134035221\",\n\t   \"quote_volume\": \"239997.1228321299572591638\",\n\t   \"liquidity\": \"1076144814.0632013827775993748053\",\n\t   \"liquidity_BNB\": \"2007551.221740467021401314\"\n\t},\n}\n```\n\n\u003cbr\u003e\n\n### PancakeSwap - Get token info\n```python\nimport defi.defi_tools as dft\ndft.pcsTokenInfo('cake')\n```\n```json\n{\"name\": \"PancakeSwap Token\",\n \"symbol\": \"Cake\",\n \"price\": \"24.03353223898417117634582253598019\",\n \"price_BNB\": \"0.04503467915973850237292527741402623\"\n}\n```\n\n\u003cbr\u003e\n\n### PancakeSwap - Get pair info\n```python\nimport defi.defi_tools as dft\ndft.pcsPairInfo('cake','bnb')\n```\n\n```json\n{\"pair_address\": \"0xA527a61703D82139F8a06Bc30097cC9CAA2df5A6\",\n \"base_name\": \"PancakeSwap Token\",\n \"base_symbol\": \"Cake\",\n \"base_address\": \"0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82\",\n \"quote_name\": \"Wrapped BNB\",\n \"quote_symbol\": \"WBNB\",\n \"quote_address\": \"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\",\n \"price\": \"0.04503969270521829587\",\n \"base_volume\": \"5473068.824002232134035221\",\n \"quote_volume\": \"239997.1228321299572591638\",\n \"liquidity\": \"1076144814.0632013827775993748053\",\n \"liquidity_BNB\": \"2007551.221740467021401314\"\n}\n```\n\n\u003cbr\u003e\n\n### PancakeSwap - Simulate LP invest\n```python\nimport defi.defi_tools as dft\ndft.value_f, iloss = dft.iloss_simulate('cake','bnb', value=1000, base_pct_chg=50, quote_pct_chg=-25)\n```\n\u003cimg src=\"images/imp_loss_3d.png\" width=600\u003e\n\n\n\n\n\u003cbr\u003e\n\n### About\n\n- twitter user  [@JohnGalt_is_www](https://twitter.com/JohnGalt_is_www)","funding_links":[],"categories":["DeFi","dApps directory","Python"],"sub_categories":["Cairo","Gas Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgauss314%2Fdefi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgauss314%2Fdefi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgauss314%2Fdefi/lists"}