{"id":23679021,"url":"https://github.com/uxdprotocol/anchor-comp","last_synced_at":"2025-09-02T07:33:27.240Z","repository":{"id":38256236,"uuid":"462554965","full_name":"UXDProtocol/anchor-comp","owner":"UXDProtocol","description":"Anchor wrapper for interacting with the raw Solana program","archived":false,"fork":false,"pushed_at":"2022-12-15T11:54:58.000Z","size":141,"stargazers_count":20,"open_issues_count":1,"forks_count":3,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-03T11:51:15.262Z","etag":null,"topics":["anchor","mangomarkets","solana"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/UXDProtocol.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-02-23T02:40:33.000Z","updated_at":"2024-09-30T06:08:45.000Z","dependencies_parsed_at":"2023-01-29T03:00:59.926Z","dependency_job_id":null,"html_url":"https://github.com/UXDProtocol/anchor-comp","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/UXDProtocol/anchor-comp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UXDProtocol%2Fanchor-comp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UXDProtocol%2Fanchor-comp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UXDProtocol%2Fanchor-comp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UXDProtocol%2Fanchor-comp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UXDProtocol","download_url":"https://codeload.github.com/UXDProtocol/anchor-comp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UXDProtocol%2Fanchor-comp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273250231,"owners_count":25072167,"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-09-02T02:00:09.530Z","response_time":77,"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":["anchor","mangomarkets","solana"],"created_at":"2024-12-29T16:59:56.023Z","updated_at":"2025-09-02T07:33:26.951Z","avatar_url":"https://github.com/UXDProtocol.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# anchor-comp\n\nAnchor wrapper for non anchor program. In v3, contains:\n\n- SplGovernanceV3 Solana program.\n\nFollows structure of \u003chttps://github.com/project-serum/anchor/blob/master/spl/src/dex.rs\u003e and \u003chttps://github.com/project-serum/anchor/blob/master/spl/src/token.rs\u003e\n\n## Usage\n\n```toml\n[dependencies]\nanchor-comp = { version = \"0.1.0\", git = \"https://github.com/UXDProtocol/anchor-comp\", features = [\"no-entrypoint\", \"development\"] }\n# anchor-comp = { version = \"0.1.0\", git = \"https://github.com/UXDProtocol/anchor-comp\", features = [\"no-entrypoint\", \"production\"] }\n```\n\n## Example CPI from Rust Solana program\n\n```rust\n    use anchor_comp::mango_markets_v3;\n    use anchor_comp::mango_markets_v3::MangoMarketV3;\n\n    #[derive(Accounts)]\n    pub struct MyInstruction\u003c'info\u003e {\n\n        // ...\n\n        pub mango_program: Program\u003c'info, MangoMarketV3\u003e,\n    }\n\n    pub fn my_instruction(\n        ctx: Context\u003cMyInstruction\u003e,\n    ) -\u003e Result\u003c()\u003e {\n\n        // ...\n\n        // - [MangoMarkets CPI - Place perp order]\n        mango_markets_v3::place_perp_order2(\n            ctx.accounts\n                .into_open_mango_short_perp_context()\n                .with_signer(depository_pda_signer),\n            taker_side,\n            limit_price_lot.to_num(),\n            max_base_quantity.to_num(),\n            i64::MAX,\n            0,\n            OrderType::ImmediateOrCancel,\n            false,\n            None,\n            10,\n        )?;\n\n        // ...\n    }\n\n\n    impl\u003c'info\u003e MyInstruction\u003c'info\u003e {\n\n        // ...\n\n        pub fn into_open_mango_short_perp_context(\n            \u0026self,\n        ) -\u003e CpiContext\u003c'_, '_, '_, 'info, mango_markets_v3::PlacePerpOrder2\u003c'info\u003e\u003e {\n            let cpi_accounts = mango_markets_v3::PlacePerpOrder2 {\n                mango_group: self.mango_group.to_account_info(),\n                mango_account: self.depository_mango_account.to_account_info(),\n                owner: self.depository.to_account_info(),\n                mango_cache: self.mango_cache.to_account_info(),\n                perp_market: self.mango_perp_market.to_account_info(),\n                bids: self.mango_bids.to_account_info(),\n                asks: self.mango_asks.to_account_info(),\n                event_queue: self.mango_event_queue.to_account_info(),\n            };\n            let cpi_program = self.mango_program.to_account_info();\n            CpiContext::new(cpi_program, cpi_accounts)\n        }\n\n        // ...\n    }\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuxdprotocol%2Fanchor-comp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuxdprotocol%2Fanchor-comp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuxdprotocol%2Fanchor-comp/lists"}