Skip to main content

The VyFi API

The VyFi Factory

The interaction with the VyFi platforms happens via the blockchain, using a "factory". You basically send your request in the form of a transaction, to the following factory address (this one is on preprod, NOT production):

addr_test1qpjavykfl5n4t47xklzyuccevgple0e4c7mke2m6cd0z0fwy0pq8p292lgrquq7hx75c4wpvz0h8cjp69mp7men3nw8s46zete

The VyFi platform will ingest the transaction along with the accompanying LP json payload, and it will create the liquidity pool and token pair.

Here's what that factory looks like on CardanoScan:

https://preprod.cardanoscan.io/address/0065d612c9fd2755d7c6b7c44e63196203fcbf35c7b76cab7ac35e27a5c4784070a8aafa060e03d737a98ab82c13ee7c483a2ec3ede6719b8f

Creating a liquidity pool / token pair

In order to create a token pair and a liquidity pool, we have to create a transaction that carries the definition of our liquidity pool with it. We can inspect how other liquidity pools were created:

curl -o lp.json 'https://api.vyfi.io/lp?networkId=1&v2=true&tokenAUnit=lovelace&tokenBUnit=804f5544c1962a40546827cab750a88404dc7108c0f588b72964754f56594649'

Note: this is version v1 of the VyFi platform. They are working on launching VyFi v3 and all of this might change.

Transaction Payload

[
    {
        "highVolume":false,
        "processHold":false,
        "unitsPair":"lovelace/804f5544c1962a40546827cab750a88404dc7108c0f588b72964754f56594649",
        "poolValidatorUtxoAddress":"addr1z9es6px68rlmwatqwg6qxwqf3szyz0n4lm0m2e5j38nu0062a6yhtrq8a4cxg2trrtzddev7v974nafzmx4xaegv2ngqky7khv",
        "isPabPool":true,
        "lpPolicyId-assetId":"36babde255ba721444a5c2bf7ea85b0ccbe5452088573d355681e1d9-567946695f4144412f565946495f4c50",
        "json":
            "{\"bAsset\":{\"tokenName\":\"VYFI\",\"currencySymbol\":\"804f5544c1962a40546827cab750a88404dc7108c0f588b72964754f\"},\"mainNFT\":{\"tokenName\":\"\",\"currencySymbol\":\"c285d6d7e61163b7f7a918f28e450e37d55dc684450d87b96750d8db\"},\"operatorToken\":{\"tokenName\":\"VyFi_Credential\",\"currencySymbol\":\"4d07e0ceae00e6c53598cea00a53c54a94c6b6aa071482244cc0adb5\"},\"lpTokenName\":{\"unTokenName\":\"VyFi_ADA/VYFI_LP\"},\"aAsset\":{\"tokenName\":\"\",\"currencySymbol\":\"\"},\"feesSettings\":{\"barFee\":10,\"processFee\":1900000,\"liqFee\":20},\"stakeKey\":\"4aee89758c07ed706429631ac4d6e59e617d59f522d9aa6ee50c54d0\"}",
        "pair":"ADA/VYFI","isLive":true,
        "orderValidatorUtxoAddress":"addr1wy6z9sfat2t7drl8yhfaws9hl9ktx90rk3xs8g479zrrh6cqv5m2x",
        "tokenAQuantity":532369659562,
        "tokenAQuantityBarFee":172563835,
        "tokenBQuantity":6565639472852,
        "tokenBQuantityBarFee":0,
        "lpQuantity":1805072170870
    }
]

Liquidity Pool Payload Format

Here's the actual liquidity pool definition that you see encoded above, but expanded for readability:

{
    "bAsset": {
        "tokenName":"VYFI",
        "currencySymbol":"804f5544c1962a40546827cab750a88404dc7108c0f588b72964754f"
    },
    "mainNFT": {
        "tokenName":"","currencySymbol":"c285d6d7e61163b7f7a918f28e450e37d55dc684450d87b96750d8db"
    },
    "operatorToken": {
        "tokenName":"VyFi_Credential",
        "currencySymbol":"4d07e0ceae00e6c53598cea00a53c54a94c6b6aa071482244cc0adb5"
    },
    "lpTokenName": {
        "unTokenName":"VyFi_ADA/VYFI_LP"
    },
    "aAsset": {
        "tokenName":"",
        "currencySymbol":""
    },
    "feesSettings": {
        "barFee":10,
        "processFee":1900000,
        "liqFee":20
    },
    "stakeKey":"4aee89758c07ed706429631ac4d6e59e617d59f522d9aa6ee50c54d0"
}