{"id":13630000,"url":"https://github.com/madfish-solutions/yupana-protocol-core","last_synced_at":"2026-01-20T19:12:45.277Z","repository":{"id":39232983,"uuid":"314231054","full_name":"madfish-solutions/yupana-protocol-core","owner":"madfish-solutions","description":"Open-source lending protocol built on top of Tezos blockchain","archived":false,"fork":false,"pushed_at":"2023-12-20T11:18:53.000Z","size":1380,"stargazers_count":8,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-01T22:44:59.169Z","etag":null,"topics":["blockchain","defi","tezos"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/madfish-solutions.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2020-11-19T11:45:05.000Z","updated_at":"2023-10-25T12:22:08.000Z","dependencies_parsed_at":"2024-08-01T22:52:22.706Z","dependency_job_id":null,"html_url":"https://github.com/madfish-solutions/yupana-protocol-core","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madfish-solutions%2Fyupana-protocol-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madfish-solutions%2Fyupana-protocol-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madfish-solutions%2Fyupana-protocol-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madfish-solutions%2Fyupana-protocol-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/madfish-solutions","download_url":"https://codeload.github.com/madfish-solutions/yupana-protocol-core/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223757105,"owners_count":17197496,"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","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":["blockchain","defi","tezos"],"created_at":"2024-08-01T22:01:26.905Z","updated_at":"2026-01-20T19:12:45.260Z","avatar_url":"https://github.com/madfish-solutions.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Yupana protocol\n\n# Description\n\n**Yupana Protocol** is a decentralized lending protocol for individuals and protocols to access financial services. The protocol is permissionless, transparent, and non-custodial.\n\n*Yupana Protocol contracts are under development. In this repository, you can follow the development and changes.*\n\n# Architecture\n\n![Architecture](Yupana_architecture.png)\n\n1. `YToken` - Core contract than manages all markets and implements FA2 interface for yToken for each collateral provided;\n2. `PriceFeedProxy` - Proxy that allows to request the price from real oracle;\n3. `InterestRate` - Providers methods to calculate supply, borrow, utilization rate.\n\n# Project structure\n\n```\n.\n.\n├──  contracts/ # contracts\n├──────────  main/ # the contracts to be compiled\n├───────────────────  yToken\n├───────────────────  interestRate\n├───────────────────  priceFeed\n├──────────  partial/ # the code parts imported by main contracts\n├───────────────────  interestRate/\n├───────────────────────── interestRateMethods\n├───────────────────────── interestRateTypes\n├───────────────────  proxy/\n├───────────────────────── priceFeedMethods\n├───────────────────────── priceFeedTypes\n├───────────────────  yToken/\n├───────────────────────── adminMethods\n├───────────────────────── fa2Methods\n├───────────────────────── fa2Types\n├───────────────────────── lendingMethods\n├─────────────────────────lendingTypes\n├───────────────────────── wrapTransfer\n├───────────────────   mainTypes\n├──  migrations/\n├──  scripts/ # cli for account actions\n├──  storage/ # initial storage for contract originations\n├──  test/ # test cases\n├──  README.md # current file\n└──  .gitignore\n```\n\n# Glossary\n\n**Underlying asset** is the real asset that is provided to the lending protocol.\n\n**yToken token is** the single token with the specific token id inside of the core Yupana FA2; represents specific underlying asset locked in the protocol.\n\n**Collateral** is the yToken token that can be used as the collateral to take the loan.\n\n**Borrow** is the amount of the underlying asset  borrowed by the user(loan).\n\n**Cash** is the amount of the underlying asset present on the contract(not borrowed).\n\n**Reserves** is the amount of the underlying asset stored in the protocol.\n\n**Collateral Factor** is the rate represents by which the borrow limit increases if the yToken is minted.\n\n**Close Factor** is the max portion of the loan that can be liquidated per single transaction.\n\n**Reserve Factor** is the rate that represents what part of the interest goes to the protocol reserves.\n\n**Liquidation discount** is the rate that the liquidator will earn if liquidate the asset.\n\n# Contracts\n\n## PriceFeedProxy\n\n- The `getPrice(asset_name)` :\n    - can only be called by the **yToken** and otherwise, the transaction fails\n    - requests the price from the **Price Feed** and expects the response on the `receivePrice` entrypoint.\n- The `receivePrice`:\n    - can only be called by the **Price Feed**.\n    - the response is processed and the price is sent to the **yToken** contract.\n- The `receivePrice` can only be called if the `getPrice` has been called just before in the same operation(prevent unexpected entrance and reentrancy); the `entered` flag can be used.\n\n### Entrypoints\n\n- getPrice - asks for a price from Oracle.\n- receivePrice - sends the price from Oracle to the `yToken` contract.\n\n## InterestRate\n\n- The contract has the followed 3 entrypoints that can be called by anyone with the result send to arbitrary contract: `getBorrowRate(borrows, cash, reserves)`, `getSupplyRate(borrows, cash, reserves)`, `getUtilizationRate(borrows, cash, reserves)`.\n\n### Entrypoints\n\n- getBorrowRate - sends a callback with the counted BorrowRate.\n- getSupplyRate - sends a callback with the counted SupplyRate.\n- getUtilizationRate - sends a callback with the counted UtilizationRate.\n\n## YToken\n\n### Entrypoints\n\n- mint - is a function to add a token as a collateral. It allows you to add a token to our system.\n- redeem - the function is designed to withdraw tokens from the platform.\n- borrow - a function for borrowing a token. Implemented the logic of freezing collateral tokens when borrowing a token.\n- repay - a function designed to repay debt.\n- liquidate - the function allows another user to liquidate someone's debt.\n- enterMarket - allows you to designate that this token will be used as collateral.\n- exitMarket - allows you to indicate that this token is no longer used as collateral.\n\n# Quick Start\n\nTo compile and deploy contracts to network:\n0. run `yarn`\n1. compile contract `yarn compile`\n2. deploy contract to chain\n    - mainnet: `yarn migrate`\n    - hangzhounet: `yarn migrate-hang`\n    - granadanet: `yarn migrate-gra`\n\n# Testing\n\nRun: `yarn test`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadfish-solutions%2Fyupana-protocol-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadfish-solutions%2Fyupana-protocol-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadfish-solutions%2Fyupana-protocol-core/lists"}