Sample t1-dApp Flow
Yild is a non-custodial, automated cross-chain strategy protocol built on t1’s real-time proving infrastructure. It enables developers to act as fund managers by deploying verifiable, on-chain–enforced investment strategies that execute across multiple chains without additional trust assumptions. By making strategies readable, provable, and enforced by code, Yild dramatically lowers the barrier to starting a hedge fund and empowers independent developers to raise capital without legal agreements, intermediaries, or existing relationships.
Let's consider the example of a cross-chain Yild arbitrage strategy, which reallocates funds across yield sources and chains, to explain the application flow in t1's Docker architecture:
- A developer submits the Docker image with her Yild strategy logic as a
t1-dapp. - t1 pull and runs the docker image as a
t1-dappTEE-co-located witht1-core. - The newly started Yild container proceeds to call
initIdentity(callbackOnDeposit)ont1-core, wherecallbackOnDepositis Yild's handler that will determine how to treat deposits (e.g. credit a user, supply to a new yield source, withdraw to a user). - Furthermore, Yild will call
registerCallbackOnTransaction(chainId, address, callback)for each chain where Yild users should be able to withdraw to, with the respective Yild ERC-20 share token contract address and a handler. - Now, upon a new user deposit,
t1-corewill invoke the previously registeredcallbackOnDeposithandler and pass metadata such as chain ID, sender address, or deposited amount to the Yildt1-dappcontainer. - Yild will then run its logic to determine the deposit type ("credit a user"), update its cross-chain global ledger, mint new Yild share tokens to the user, and determine which yield source to direct the new funds to.
- For example, Yild might proceed to call
sendTx(chainId, payload, callback)with a payload constructed to mean opening a bridge intent from the deposit chain to the chain with the highest yield source. - Upon
t1-core's subsequent invocation of the Yild-providedcallbackwill the Yildt1-dappdecode the callback parameters to determine whether the transaction was sent correctly, and may decide to retry etc. - Once a solver fills the intent on the target chain to Yild's initialized identity, will
t1-coreinvokecallbackOnDeposit, as always—but this time, Yild will decode the callback parameters to interpret this deposit as a bridge (cross-chain optimization) transaction. It will therefore NOT credit these funds to a user, but instead callsendTxagain, with a payload instructingt1-coreto supply the newly arrived funds to a yield source on the new chain. - If a user wishes to withdraw, they will burn their Yild share tokens. This will result in
t1-coreinvoking the callback ont1-dappfrom the previously registered watcher (viaregisterCallbackOnTransaction) on said share token address. Therefore,t1-dappwill be able to process the withdrawal request, update its ledger, and usesendTxcalls to withdraw the calculated amount of funds from a yield source, bridge them if needed, and finally send them to the requesting user.