Skip to content

Instantly share code, notes, and snippets.

View RiccardoBiosas's full-sized avatar
🎯
Focusing

RiccardoBiosas

🎯
Focusing
View GitHub Profile
from __future__ import annotations
from jira import JIRA
import os
from dotenv import load_dotenv
class JiraClient:
def __init__(self):
load_dotenv()
self.jira_server_url = os.environ.get('JIRA_SERVER_URL')
self.jira_username = os.environ.get('JIRA_USERNAME')
@RiccardoBiosas
RiccardoBiosas / bondEventMonitoring.js
Created March 14, 2022 21:32
BondEvent monitoring
const axios = require("axios");
const livepeerSubgraphEndpoint =
"https://api.thegraph.com/subgraphs/name/livepeer/arbitrum-one";
const bondEventQuery = `
query BondEvents {
bondEvents(first: 1000) {
id
transaction {
const derivative = derivativeFactory({
margin: toBN("40"), //required collateral denominated in DAI token
endTime: ~~(Date.now() / 1000) + SECONDS_40_MINS, // Now + 40 mins
params: [
toBN("3430"), // Strike Price 3430DAI
],
oracleId: adminOracleController.address,
token: dai.address,
syntheticId: optionCallMock.address,
});
it("should execute the full margin option with the underlying's market price less than the strike price", async () => {
const { buyer, oracle } = namedSigners;
/**
* @dev time-travel after the maturity of the derivative
*/
await timeTravel(SECONDS_40_MINS + 100);
/**
* @dev manually pushes the current underlying's market price to the oracle contract
*/
@RiccardoBiosas
RiccardoBiosas / OptionController.sol
Last active September 24, 2021 13:25
basic option call workflow on top of the Opium Protocol
pragma solidity 0.5.16;
pragma experimental ABIEncoderV2;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "opium-contracts/contracts/Lib/LibDerivative.sol";
import "erc721o/contracts/Libs/LibPosition.sol";
const { Api, Utils } = require('@opiumteam/oex-js')
const { signMessage } = Utils
class Example {
constructor (publicKey, privateKey) {
this.api = new Api()
this.publicKey = publicKey
this.privateKey = privateKey
}