{"id":18263805,"url":"https://github.com/yearn/yearn-partner-tracker","last_synced_at":"2025-07-26T05:16:20.264Z","repository":{"id":41116444,"uuid":"446452967","full_name":"yearn/yearn-partner-tracker","owner":"yearn","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-06T10:25:39.000Z","size":29,"stargazers_count":2,"open_issues_count":1,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-20T19:07:33.191Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yearn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-10T14:20:00.000Z","updated_at":"2023-02-16T07:03:40.000Z","dependencies_parsed_at":"2023-01-24T01:30:11.520Z","dependency_job_id":null,"html_url":"https://github.com/yearn/yearn-partner-tracker","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/yearn%2Fyearn-partner-tracker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yearn%2Fyearn-partner-tracker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yearn%2Fyearn-partner-tracker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yearn%2Fyearn-partner-tracker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yearn","download_url":"https://codeload.github.com/yearn/yearn-partner-tracker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247246382,"owners_count":20907785,"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-05T11:12:45.707Z","updated_at":"2025-04-04T20:31:20.708Z","avatar_url":"https://github.com/yearn.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yearn V2 Partner Tracker\n\nThis contract is a non-custodial accounting contract for tracking yearn deposits from partners.\n\nTo work out how much traffic an partner has generated we compare the balance stored in the accounting contract with the yvault tokens in their wallet.\n\nTotal partner referrals per vyToken = Min(Sum(reffered balance over all partners), user vyToken)\n\nIndividual partner referrals are then ordered by most recent.\n\nExample:\nA user deposits 10,000 DAI to the yvDAI vault through this contract specifying partner A. They get 9,000 yvdai tokens back. At this point partner A's balance from the user is 9,000 yvDAI. The minimum of the 9,000 in the accounting and the 9,000 in their balance.\n\nIf the user now withdraws 5,000 yvDAI the balance they have left is 4,000 yvDAI. \nAt this point partner A's balance from the user is 4,000 yvDAI. The minimum of the 9,000 in the accounting and the 4,000 in their balance.\n\nA second user deposits 10,000 DAI to the yvDAI vault through this contract specifying partner A. They get 9,000 yvdai tokens back but have already got 10,000 yvDAI from a previous, non-partnered deposit.  At this point partner A's balance from the user is 9,000 yvDAI. The minimum of the 9,000 in the accounting and the 19,000 in their balance.\n\nA third user deposits 10,000 DAI to the yvDAI vault through this contract specifying partner A and receive 9,000 yvdai tokens back. Then one day later they deposit 10,000 DAI to the yvDAI vault through this contract specifying partner B and and receive 8,900 yvDAI tokens back. At this point partner A's balance from the user is 9,000 yvDAI and partner B is 8,900 yvDAI. \n\nIf the user now withdraws 5,000 yvDAI they will be left with 12,900 yvDAI. At this point partner A's balance from the user is 4,000 yvDAI and partner B is 8,900 yvDAI. This is because the total across all partners is 12,900 yvDAI and partners are filled last in first. \n\n\n## Deployment addresses:\nEthereum mainnet (1): `0x8ee392a4787397126C163Cb9844d7c447da419D8`  \nOptimism (10): `0x7E08735690028cdF3D81e7165493F1C34065AbA2`  \nFantom Opera (250): `0x086865B2983320b36C42E48086DaDc786c9Ac73B`  \nArbitrum One (42161): `0x0e5b46E4b2a05fd53F5a4cD974eb98a9a613bcb7`  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyearn%2Fyearn-partner-tracker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyearn%2Fyearn-partner-tracker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyearn%2Fyearn-partner-tracker/lists"}