LogoLogo
  • ๐ŸŒŠ๐Ÿ’ธ Welcome to Fluidity Money
  • Docs
    • ๐Ÿ“šLearning and getting started
      • ๐Ÿ”ฎWhy Fluidity?
      • โ“What are Fluid Assets?
      • ๐ŸŒŸHow do you get a Fluid Asset?
      • ๐Ÿ’ฐHow are the rewards earned?
      • ๐Ÿ—ƒ๏ธThe Economics of a Fluid Asset
        • โœ๏ธTransfer Reward Function (TRF) Example
      • ๐Ÿ“‹Tutorials
        • How to use Fluidity
    • ๐ŸกAddresses
      • ๐Ÿ…ฐ๏ธArbitrum
      • โ˜€๏ธSolana
      • ๐Ÿ’งSui
      • ๐Ÿ˜ณSuperposition devnet
    • ๐Ÿ” Fundamentals
      • ๐Ÿ“„FAQ
      • ๐Ÿ”ซFluidity Wars
      • โ›๏ธUtility Mining
      • ๐ŸคFor arbitrage
      • ๐Ÿ›๏ธUnderstanding the $FLY Governance Token
        • ๐Ÿ’ธFluidity $FLY Vaults
        • ๐Ÿช™Understanding $FLY Tokenomics
      • โ›“๏ธLaunch restrictions (mint limits)
      • ๐Ÿ”“Governance structure
      • ๐Ÿš‚Advisory team
      • ๐Ÿ‘ฉโ€๐Ÿซ๐Ÿ‘ฉ๐Ÿซ Laws of Fluidity
      • ๐Ÿ›ฃ๏ธRoadmap
        • ๐Ÿš€Product roadmap
        • ๐ŸŒค๏ธDecentralisation roadmap
      • ๐Ÿ‘ฉโ€๐Ÿš€Why instant rewards?
    • ๐Ÿ’ธUse-cases
      • โŒจ๏ธDevelopers
      • ๐Ÿฆ„DEXs
      • โœจFluid Assets and Utility
      • ๐ŸŽฎMetaverse and Gaming
      • ๐Ÿ–ผ๏ธNFTs
      • ๐Ÿ’ณTransactions and Payments
      • ๐ŸŒŠOther Use-Cases
    • ๐ŸŽชDevelopers
      • ๐ŸขArchitecture
        • ๐Ÿ‘ทWorker architecture
        • ๐Ÿ’ Ethereum contract architecture
        • โ˜€๏ธSolana program architecture
      • ๐ŸŽEVM ABIs
      • โ˜€๏ธSolana account structure
      • ๐Ÿ™‹How can I Fluid Wrap my custom token?
      • ๐Ÿ“ŠGraphQL
      • ๐ŸงพDev Tutorials
        • โ›๏ธCreating a New Utility Mining Client
        • ๐Ÿ‘ฉโ€๐Ÿ’ปSupporting a New Application
        • ๐Ÿ’ธSending and receiving a Fluid Asset
        • ๐Ÿš„Supporting a Fluid Asset on your DEX/AMM/exchange
        • ๐ŸŽWrapping and unwrapping a Fluid Asset in your app
        • ๐ŸŒŠProviding liquidity for a Fluid Asset
      • ๐Ÿ“”Whitepapers
    • ๐Ÿ’ชSecurity
      • ๐ŸคณWebsite/infrastructure security
      • ๐Ÿ“ฅDropboxes
      • ๐Ÿ’ฐBounty program
      • ๐Ÿ“œAudits completed
      • ๐Ÿซ‚Contactable team
    • ๐ŸคPartnerships/collaboration
      • ๐ŸคPartnering with us
      • ๐Ÿ‘Join us!
      • ๐Ÿ’ฌFluidifying your asset
        • ๐Ÿ˜ŽBrand assets
    • Useful links
      • Fluidity website and whitepapers
      • Fluidity Whitepaper v1.0
      • Discord server
      • Medium
      • Telegram
Powered by GitBook
On this page

Was this helpful?

  1. Docs
  2. Developers
  3. Dev Tutorials

Creating a New Utility Mining Client

  1. Deploy a contract implementing the interface IFluidClient. Essentially the client must implement batchReward() and getUtilityVars(), with the former emitting the event Reward for each reward paid out and the latter returning your desired utility variables.

  2. Update the registry by calling updateUtilityClients in Registry.sol. This requires the above client, an address for the relevant token, and a name for the client. This call must be made by the operator, which is currently a centralised entity, with plans in the works to decentralise this responsibility to the DAO.

  3. Update the automation used by the offchain worker. Namely, update ENV_FLU_ETHEREUM_UTILITY_CONTRACTS in the application server for the given network (automation/<network>/application-server/mainnet.yml) to include the client name and address as set in the previous step. In the worker server and spooler automation (automation/<network>/worker-server/mainnet.yml and automation/<network>/worker-spooler/mainnet.yml respectively), update ENV_FLU_ETHEREUM_UTILITY_TOKEN_DETAILS to include the client name, token name, and token decimals. For example, adding Wombat:


diff --git a/automation/arbitrum/application-server/mainnet.yml b/automation/arbitrum/application-server/mainnet.yml
--- a/automation/arbitrum/application-server/mainnet.yml
+++ b/automation/arbitrum/application-server/mainnet.yml
@@ -1,8 +1,8 @@
 DOCKER_IMAGE: microservice-arbitrum-application-server
 DOCKERFILE_PATH: ./cmd/microservice-ethereum-application-server
-ENV_FLU_ETHEREUM_UTILITY_CONTRACTS: 'chronos initial boost:0x0176416bdc885b1bb751b0a014d495760a972a73:0x62030690385A481Ab0c6039fEA75AC6658B7b961'
+ENV_FLU_ETHEREUM_UTILITY_CONTRACTS: 'chronos initial boost:0x0176416bdc885b1bb751b0a014d495760a972a73:0x62030690385A481Ab0c6039fEA75AC6658B7b961,wombat initial boost:0x956454c7be9318863297309183c79b793d370401'

diff --git a/automation/arbitrum/worker-server/mainnet.yml b/automation/arbitrum/worker-server/mainnet.yml
--- a/automation/arbitrum/worker-server/mainnet.yml
+++ b/automation/arbitrum/worker-server/mainnet.yml
@@ -10,7 +10,7 @@ SERVICES:
       SERVICE_NAME: microservice-arbitrum-worker-server-usdt
       ENV_FLU_WORKER_ID: arbitrum-microservice-arbitrum-worker-server-usdt
       ENV_FLU_ETHEREUM_CONTRACT_ADDR: "0xc9fa90d24b7103ad2215de52afec5e1e4c7a6e62"
-      ENV_FLU_ETHERUEM_UTILITY_TOKEN_DETAILS: "FLUID:USDT:6,chronos initial boost:USDC:6"
+      ENV_FLU_ETHERUEM_UTILITY_TOKEN_DETAILS: "FLUID:USDT:6,wombat initial boost:WOM:18,chronos initial boost:USDC:6"
       ENV_FLU_ETHEREUM_AMQP_QUEUE_NAME: arbitrum.worker.usdt
       ENV_FLU_ETHEREUM_WORK_QUEUE: worker.arbitrum.server.work.usdt

@@ -18,7 +18,7 @@ SERVICES:
       SERVICE_NAME: microservice-arbitrum-worker-server-usdc
       ENV_FLU_WORKER_ID: arbitrum-microservice-arbitrum-worker-server-usdc
       ENV_FLU_ETHEREUM_CONTRACT_ADDR: "0x4cfa50b7ce747e2d61724fcac57f24b748ff2b2a"
-      ENV_FLU_ETHERUEM_UTILITY_TOKEN_DETAILS: "FLUID:USDC:6,chronos initial boost:USDC:6"
+      ENV_FLU_ETHERUEM_UTILITY_TOKEN_DETAILS: "FLUID:USDC:6,wombat initial boost:WOM:18,chronos initial boost:USDC:6"
       ENV_FLU_ETHEREUM_AMQP_QUEUE_NAME: arbitrum.worker.usdc
       ENV_FLU_ETHEREUM_WORK_QUEUE: worker.arbitrum.server.work.usdc

@@ -26,6 +26,6 @@ SERVICES:
       SERVICE_NAME: microservice-arbitrum-worker-server-dai
       ENV_FLU_WORKER_ID: arbitrum-microservice-arbitrum-worker-server-dai
       ENV_FLU_ETHEREUM_CONTRACT_ADDR: "0x1b40e7812e75d02eef97e4399c33865d2ff5952b"
-      ENV_FLU_ETHERUEM_UTILITY_TOKEN_DETAILS: "FLUID:DAI:18,chronos initial boost:USDC:6"
+      ENV_FLU_ETHERUEM_UTILITY_TOKEN_DETAILS: "FLUID:DAI:18,wombat initial boost:WOM:18,chronos initial boost:USDC:6"
       ENV_FLU_ETHEREUM_AMQP_QUEUE_NAME: arbitrum.worker.dai
       ENV_FLU_ETHEREUM_WORK_QUEUE: worker.arbitrum.server.work.dai
diff --git a/automation/arbitrum/worker-spooler/mainnet.yml b/automation/arbitrum/worker-spooler/mainnet.yml
--- a/automation/arbitrum/worker-spooler/mainnet.yml
+++ b/automation/arbitrum/worker-spooler/mainnet.yml
@@ -11,18 +11,18 @@ SERVICES:
     ENV_FLU_WORKER_ID: arbitrum-microservice-arbitrum-worker-spooler-usdc
     ENV_FLU_ETHEREUM_WINNERS_AMQP_QUEUE_NAME: arbitrum.winners.usdc
     ENV_FLU_ETHEREUM_BATCHED_WINNERS_AMQP_QUEUE_NAME: arbitrum.winners.batched.usdc
-    ENV_FLU_ETHERUEM_UTILITY_TOKEN_DETAILS: "FLUID:USDC:6,chronos initial boost:USDC:6"
+    ENV_FLU_ETHERUEM_UTILITY_TOKEN_DETAILS: "FLUID:USDC:6,wombat initial boost:WOM:18,chronos initial boost:USDC:6"

  - SPOOLER_USDT:
     SERVICE_NAME: microservice-arbitrum-worker-spooler-usdt
     ENV_FLU_WORKER_ID: arbitrum-microservice-arbitrum-worker-spooler-usdt
     ENV_FLU_ETHEREUM_WINNERS_AMQP_QUEUE_NAME: arbitrum.winners.usdt
     ENV_FLU_ETHEREUM_BATCHED_WINNERS_AMQP_QUEUE_NAME: arbitrum.winners.batched.usdt
-    ENV_FLU_ETHERUEM_UTILITY_TOKEN_DETAILS: "FLUID:USDT:6,chronos initial boost:USDC:6"
+    ENV_FLU_ETHERUEM_UTILITY_TOKEN_DETAILS: "FLUID:USDT:6,wombat initial boost:WOM:18,chronos initial boost:USDC:6"

  - SPOOLER_DAI:
     SERVICE_NAME: microservice-arbitrum-worker-spooler-dai
     ENV_FLU_WORKER_ID: arbitrum-microservice-arbitrum-worker-spooler-dai
     ENV_FLU_ETHEREUM_WINNERS_AMQP_QUEUE_NAME: arbitrum.winners.dai
     ENV_FLU_ETHEREUM_BATCHED_WINNERS_AMQP_QUEUE_NAME: arbitrum.winners.batched.dai
-    ENV_FLU_ETHERUEM_UTILITY_TOKEN_DETAILS: "FLUID:DAI:18,chronos initial boost:USDC:6"
+    ENV_FLU_ETHERUEM_UTILITY_TOKEN_DETAILS: "FLUID:DAI:18,wombat initial boost:WOM:18,chronos initial boost:USDC:6"
  1. Set up an instance of microservice-ethereum-track-winners in automation/<network>/track-winners/mainnet.yml, using the following template:

  - TRACK_WINNERS_<TOKEN>:
      SERVICE_NAME: microservice-<network>-track-winners-<token>
      ENV_FLU_WORKER_ID: <network>-microservice-<network>-track-winners-<token>
      ENV_FLU_ETHEREUM_CONTRACT_ADDR: "contract address of the underlying token"
      ENV_FLU_ETHEREUM_UNDERLYING_TOKEN_NAME: TOKEN_NAME
      ENV_FLU_ETHEREUM_UNDERLYING_TOKEN_DECIMALS: 6
PreviousDev TutorialsNextSupporting a New Application

Last updated 1 year ago

Was this helpful?

๐ŸŽช
๐Ÿงพ
โ›๏ธ