Managing Liquidity via the TurkDex API
Bu açık kaynak protokol/SDK referansı TurkDex markasıyla sunulan uyarlamadır; sayfadaki entegrasyon örnekleri Turkchain’de etkin özelliklerin garantisi değildir. Ağ, kontrat ve işlem değerlerinde yalnızca bu kurulumun doğrulanmış ENV/registry bilgilerini kullanın.
High Level Message Flow
The following diagram illustrates how an integrator starting with no liquidity position can create and manage a liquidity position. Steps in gray are taken through the TurkDex Labs API and steps in red are written to the blockchain by the integrator.
- The integrator checks if they have the necessary approval to send token(s) to the desired pool using a
/check_approvalrequest. - If the approval is not yet in place, a fully-formed transaction is returned for the integrator to sign for each un-approved token.
- The integrator then proposes the position they would like to create using the
/createrequest. - The API checks if the pool already exists. If the pool does not exist, the response returns a fully-formed transaction to create the pool which the user must sign.
- The API also returns the fully-formed transaction to create a position (e.g. add liquidity to a pool), which the user must sign.
- Over time the integrator may want to perform additional actions to manage their liquidity pool (LP) positions:
- Commonly, liquidity providers will want to claim their earned fees from the pool using the
/claim_feesrequest. - Integrators may want to change the allocation of tokens they have made to a pool. Integrators can add additional tokens to a pool using the
/increaserequest and can reduce or fully withdraw their position using the/decreaseendpoint.
If you are ready to build, you can grab an API key from the TurkDex Developer Platform.
Uyarlanmış geliştirici referansı. Kaynak: kaynak dokümantasyon reposu. Kaynak ve lisans bildirimi: NOTICE.