{"id":18300990,"url":"https://github.com/bonfida/bonfida-bot-ui","last_synced_at":"2025-04-05T14:30:49.848Z","repository":{"id":47664223,"uuid":"329557116","full_name":"Bonfida/bonfida-bot-ui","owner":"Bonfida","description":null,"archived":false,"fork":false,"pushed_at":"2022-04-19T10:22:00.000Z","size":8304,"stargazers_count":15,"open_issues_count":1,"forks_count":17,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-21T05:32:55.023Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/Bonfida.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}},"created_at":"2021-01-14T08:47:18.000Z","updated_at":"2024-09-13T04:14:57.000Z","dependencies_parsed_at":"2022-08-21T09:40:16.277Z","dependency_job_id":null,"html_url":"https://github.com/Bonfida/bonfida-bot-ui","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bonfida%2Fbonfida-bot-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bonfida%2Fbonfida-bot-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bonfida%2Fbonfida-bot-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bonfida%2Fbonfida-bot-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bonfida","download_url":"https://codeload.github.com/Bonfida/bonfida-bot-ui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247352265,"owners_count":20925242,"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":[],"created_at":"2024-11-05T15:14:03.685Z","updated_at":"2025-04-05T14:30:47.995Z","avatar_url":"https://github.com/Bonfida.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bonfida Bot UI\n\nAn implementation of a UI for Bonfida Bot.\n\n[Bonfida Bot Tutorial](https://www.youtube.com/watch?v=6BFmyi0qnEI)\n\nBonfida Bot is hosted on IPFS. Current IPFS CID: **QmR6fezFhQbxdPZx41quREbCVTEZEkju6aQT51dsU5FZvN**.\n\nYou can verify the build using the `etag` of the **Response Header**.\n\n## Running the UI\n\nRun `yarn` to install dependencies, then run `yarn start` to start a development server or `yarn build` to create a production build that can be served by a static file server.\n\n## Bonfida Bot Design and documentation\n\nBonfida-bot is a an on-chain and off-chain tool suite that enables the creation of trading pools. Each trading pool has a cryptographically identified signal provider who is able to create Serum orders with the pool's assets. Anyone can invest in a trading pool in exchange for specific pool tokens which are redeemable at any time.\n\n### Structure:\n\n- Program account data:\n\n  - Vec of pool tokens accounts addresses (Vec of Pubkeys, owned by program)\n  - Pool FIDA account address (Pubkey, owned by program)\n  - Signal Provider address (Pubkey)\n\n- Instructions:\n  - Initialize Pool:\n    - Max number of Markets (u32)\n    - Signed by Payer\n  - Deposit(initializes the pool if its nonexistent):\n    - Pool Seeds (256 bits)\n    - Token Mint address (Pubkey)\n    - Amount (u64)\n    - Signed by Source and Payer\n  - Redeem:\n    - Pool Seeds (256 bits)\n    - Amount of Pooltoken (u64)\n    - Payout Token Mint address (Pubkey)\n    - Payout Destination token address (Pubkey)\n    - Signed by Pool-token owner and Payer\n  - Trade (from signal):\n    - Pool Seeds (256 bits)\n    - Array of order amounts (array of u64)\n    - Serum Market address (Pubkey?)\n    - Buy/Sell (bool, buy = true)\n    - Signed by Signal Provider and Payer\n\n### Diagram:\n\n![structure-diagram](src/assets/readme/bonfida-bot-architecture.png)\n\n### JS Bindings\n\n- [JS library repo link](https://github.com/Bonfida/bonfida-bot/tree/main/js)\n- [Documentation](https://bonfida.github.io/bonfida-bot-docs/)\n\n## Signal Provider fees\n\nEach pool has a signal provider (i.e a SOL address) that can send trading instructions to the pool. When a signal provider creates a pool he can set up the `feePeriod` and the `feeRate`. The `feeRate` is the amount of pool tokens that will deducted from the pool and paid to the signal provider at every `feePeriod`.\n\n- The signal provider is never directly in control of the pool's asset. They can only issue Serum market orders on behalf of the pool.\n\n- A signal provider is contractually obligated to perform market operations on a specific set of markets which is immutably defined at pool creation. This means that it is impossible for the signal provider to directly extract assets from the pool by creating temporary mock markets which would enable the signal provider from buying the pool's asset under the market price.\n\n- Whereas the pool can itself be in a locked state which locally prevents pool token redeeming as well as investments, it is always possible for anyone to unlock the pool in order to gain access to their funds or just buy in.\n\n## Serum Referral fees\n\nSimilar to Serum DEX UI, people who host a Bonfida Bot UI can generate revenues from orders executed from their UI. You can do so by passing your public key as the referral public key for the orders passed on Serum.\n\nTo do so, set the `REACT_APP_USDT_REFERRAL_FEES_ADDRESS` and `REACT_APP_USDC_REFERRAL_FEES_ADDRESS` environment variables to the addresses of your USDT and USDC SPL token accounts.\n\nYou may want to put these in local environment files (e.g. .env.development.local, .env.production.local). See the [documentation](https://create-react-app.dev/docs/adding-custom-environment-variables) on environment variables for more information.\n\nNOTE: remember to re-build your app before deploying for your referral addresses to be reflected.\n\n## Depolyment\n\nChange `homepage` in `package.json` to make in match with your domain name.\n\n### IPFS\n\nYou can host the UI using IPFS `ipfs-deploy`:\n\n- Install `ipfs-deploy`: `yarn global add ipfs-deploy`\n- Add the following to `package.json`: `\"deploy\": \"ipfs-deploy build\"`\n- Deploy: `yarn deploy`\n\nLearn more about `ipfs-deploy` [here](https://github.com/ipfs-shipyard/ipfs-deploy)\n\n### GitHub Pages\n\nYou can host the UI using GitHub Pages:\n\n- Install `gh-pages`: `yarn add -D gh-pages`\n- Add the following to `package.json`: `\"deploy\": \"gh-pages -d build\"`\n- Deploy: `yarn deploy`\n\nLearn more about `gh-pages` [here](https://github.com/tschaub/gh-pages)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbonfida%2Fbonfida-bot-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbonfida%2Fbonfida-bot-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbonfida%2Fbonfida-bot-ui/lists"}